MTH U170 ANNOUNCEMENTS (as of Tuesday, Nov. 23)

(YOU SHOULD BE WORKING ON PROJECTS NOW!)

 

1.    I have posted my program (m-file) to draw mapping diagrams. You can download it from the course homepage or from HERE. The beginning of the m-file contains detailed instructions for using it. Remember: MatLab needs to know where to find it, so, if it is on a floppy in drive A, don’t forget to set MatLab’s directory to this drive (with >> cd  A:, or use the “Current Directory” window at the top of MatLab). Once you have done this, you can view the directions for using it by typing at the prompt: >>  help mapdiag.

 

ASSIGNMENT (due when we meet next):

 

a)    Draw the mapping diagrams for some linear functions f(x) = a*x + b: 2*x+1, -2*x+1, (1/2)*x-1, -(1/2)*-1, -3*x+2 etc. Note carefully what happens when the coefficient of x is negative. (When the coefficient is positive, you may want to extend the mapping lines to the left or right a bit to see what happens a bit “off screen.”). You can draw these by hand (I suggest graph paper) or use my program.

b)   Try drawing the mapping diagrams for some non-linear functions; for example: f(x) = x2 or f(x) = x3-x (which you’d have to enter as the string s = ‘x^3 – x’, see the instructions).

 

2.    Here are the color versions of the visible “polygons” I distributed in class recently:

Level 5  ,  Level 10

 

3.    Here is the command to draw a line from (x1,y1) to (x2,y2) using color c, without using the “linePQ” m-file:

plot([x1,x2],[y1,y2], c)

(Note that the x-coordinates and y-coordinates are grouped together in brackets.)

 

See the MatLab book for available colors; some possibilities are: ‘r’ (=red), ‘k’ (=black) and ‘b’ (=blue). You must use the quotes.

 

Example: To draw a line from (1,3) to (-2,8) in red use: plot([1,-2],[3,8],’r’)

 

(If all you want is a simple asterisk at point (x,y), say in blue, use plot(x,y,’*b’); to make it black, use plot(x,y,’*k’).)

 

4.     I have decided to make the project Greatest Common Divisors required. (This is the same as sheet I handed out.) Please hand in at least a draft in one week. I have done this to get everyone started on at least one project. See me for advice on others. If you have something that you’d like to try, we can, perhaps, make it into a project. Remember that I expect 5 of them by the end of the term.

 

5.     New MatLab assignment: Use MatLab to create a multiplication table mod N. The user will input N. Use a matrix to store the table. First, be very straightforward and just let the entry in row R column C be mod(R*C,N); you can certainly do this with a double “for” loop. Next, create an extra row and column for the “headers” (i.e. the numbers 0 through N-1): this will make the table easier to use. Finally, if you feel ambitious, use the “meshgrid” construction to create the table without using any “for” loop at all! (See me about meshgrid, or look it up; maybe we’ll get to it in class). This assignment is due on Thursday, October 28.

 

6.     New MatLab assignment: Write a MatLab program to display and count lattice point solutions to the (Diophantine) equation ax + by = c.

a.     Have user input a rectangle, say x between MinX and MaxX, y between MinY and MaxY

b.    Input the coefficients a, b and c (make sure a is not 0): they should be integers. Draw the line ax + by = c in blue.

c.     Check all the lattice points in the rectangle; draw solutions as red dots and count them. Are they equally spaced along the line? (In class we looked at lines y = (A/B)x+(C/D). You can use your program to find lattice points on them by considering the equation

(BD)y = (AD)x + (CB)  or

–(AD)x + (BD)y = CB.

(This assignment was due on Monday, Nov. 1.)

 

7.    If you have problems, e-mail me with your m-file. Also, I will have extended office hours on Wednesdays from 11 until 2 or 3 (depending on other factors). I’m often at the Math Club meeting from noon to about 1, in room 509 LA, but I can leave to help you). I can run MatLab in my office (527NI).