Maple Homework
Math 356
Due February 12, 2007

       In order to reduce the number of errors, be sure to open the "Classic Maple" program instead of "Maple 10" in the Maple folder in the program menu. Whenever you wish to enter Maple text, make sure that there is a caret ([>) in front of what you are typing. If there is no caret, make sure to click the button on the toolbar that looks like the caret. When you type at a caret, what you type will be red.
       Remember the difference between ; and :. You'll need to use either to end a Maple statement, but the first tells Maple to display the output and the second tells Maple to suppress the output. Also remember there is a difference between = and :=. Only the second one declares a variable (stores it in Maple's memory bank).

Part (a). (Practice using seq)

  • Create a list X containing the numbers 1 through 30. [Don't forget the brackets!]
  • Create a list Y with 30 entries, where entry Y[i] is i squared minus 100.
  • Get Maple to output the 5th entry of Y.
  • Use seq to output a list of the 5th, 8th, 13th, 21st, and 29th entries of Y
  • Remember that the first difference of a list is a list itself, where each entry is the difference between two elements in the list. Create a list Z of the first differences of Y. [Careful: How many entries does Z have?]
  • [It may be useful to look up ? seq.]

Part (b). (Plotting data points.)

  • We make use of the lists X, Y, and Z from part (a).
  • Create a list Points where each entry Points[i] is the two-element list [X[i],Y[i]].
  • Now plot Points, making sure that the points are not connected.
  • Create a list Points2 where each entry Points2[i] is the two-element list [X[i],Z[i]].
  • Now plot Points2, this time connecting the dots.
  • Lastly, plot both Points and Points2 on the same graph.
  • [It may be useful to look up ? plot.]
  • [If you get an error when you're plotting, a common problem is that your list of points may not be a list. (Starting and ending with an extra set of brackets.)
  • [You can resize the figures before printing your output to use less paper.]

Part (c). (Using a for loop.)

  • Remember the structure of a for loop:
    for < variable > from < start > to < finish > do < instructions > end do;
  • Use a for loop to generate the first 30 multiples of 3 starting at 0. (What should be the last entry?) Try to see the difference if you end your instruction with a ; or a :, and also if you end your do loop with a ; or a :.
  • We are going to define a list A recursively. Define entry 0 of A to be -100. Now use a for loop to define entries 1 through 200 of A using the recurrence An+1=0.9*An+10.(In order to not take up too much space on the screen, try supressing the output).
  • What is A[50]?
  • Plot the data from A.

Back to the Maple Page.
Back to the Math 356 Home Page.