HOMEWORK

Mtht 420

Homework is due at the beginning of class one week after it is assigned. Working on homework during class time will reduce your class participation grade. These assignments are being written as the course progresses and are subject to change up until the end of the class period for which they are assigned. The assignments should be posted here in their final form by the Friday preceeding the due date; in case of "emergency", changes to the homework will be sent to the mailing list burgiel-mtht420@math.uic.edu.


Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Week 13
Week 14

Week 1:

Read: Introduction, pp. 1-17, especially items 2, 3, 7-9 and 11-14 on pp. 2-6.
  1. Send email from your favorite computer account to burgiel-mtht420-subscribe@math.uic.edu and follow the forthcoming instructions to subscribe to the Mtht 420 mailing list. The address of this list will be burgiel-mtht420@math.uic.edu; feel free to send questions, comments, and programming-related information to it.
  2. Write down a short sequence of LOGO commands that draws an interesting "squiggle" or pattern on the screen. (E.g. a lightning bolt, a zigzag, or a series of loops.) In class, you will write a procedure to repeat this squiggle multiple times.
  3. Write down a sequence of LOGO commands that draws one of your initials and then returns the turtle to the position it was in when it started drawing.

Week 2:

Read: Section 2.1, pp 35-38; Appendix II, pp. 320-324.
  1. Read Appendix II and write instructions to teach Zeep to erase the blackboard, or to do one of the other activities suggested at the end of the appendix. Be prepared to share your work in class.
  2. What value of :N would you use to ensure that the turtle returns to its initial state after executing the command:
    REPEAT :N [FD 60 RT :ANGLE]
    
    (Hint: Your answer should be a function of the variable :ANGLE. You may assume that :ANGLE is an integer.) Is this the smallest value of :N which has this property for all values of :ANGLE?
  3. Write a procedure POLY :ANGLE :SIDE which draws a regular polygon with exterior angles of size :ANGLE and side length :SIDE.
  4. The book The Logo Language: Learning Mathematics Through Programming by Feurzeig, Lukaas and Lukas states that:

    "LOGO, as an interpretive language, can execute single commends directly. Thus,

    PRINT SUM OF 2 AND 2
    
    [outputs]
    4
    
    But, the most important feature of LOGO is that such commands can be incorporated in user-written procedures. The definition of any procedure results in an object which is treated just like any primitive. Thus, in a very real sense, as the user writes his own procedures, he is gradually extending the basic language to more exactly fill his needs."

    Explain in your own words why it is desirable for a programmer to "extend the basic language" in which she or he is programming. Feel free to discuss the quotation above with your classmates!

Week 3:

Read: Sections 6.4 and 6.5, pp. 164-179
  1. Write a recursive procedure that draws a series of squares, each completely contained inside the last. Make sure the procedure stops after drawing an appropriate number of squares.
  2. Write down a series of if/else statements that describe the decision making process you use to decide what to have for dinner as you leave work. You will probably want to consider variables such as the time of day, the contents of your refrigerator, whether or not your spouse and children will be eating with you, etc. Use parenthesis and indentation to make your answer easier to interpret. For example:
    ; Contributed by William Stenzel, 1/28/99
    
    if I take something out of the freezer in the morning
       eat that for dinner
    else
       if Julie has class
          if I go running after work
             eat pasta
          else
             eat leftovers
       else
          if we go to the health club
             eat pasta
          else
             order pizza
    
  3. Write a procedure that takes two numbers as arguments and outputs the maximum of those two numbers.

Week 4:

Read: Chapter 4
  1. Write a procedure that does the following:
    1. accepts two arguments,
    2. checks that the arguments are both numbers,
    3. uses the procedure you wrote last week to determine the maximum of those two numbers and
    4. prints a message saying which number is the maximum.
  2. In the example given for last week's homework, there are two separate cases in which Mr. Stenzel eats pasta for dinner. Use an AND or OR operator (which one?) so that eat pasta only appears once in the decision tree. You may need to reorganize the decision tree to do this. The conclusions reached by your answer should be identical to those reached in Mr. Stenzel's example.
  3. Write up a question you think might be appropriate for the first midterm exam. Examples include instructions to write a program, vocabulary questions, questions about LOGO commands or a program to trace or debug. In addition, write up a solution to the problem.

Week 5:

Read: Chapter 1 and pp. 235-242.
    If you lost points on one of the first four homework assignments, you may redo the problems you lost points on. Correct answers will add half the credit lost to your homework grade (rounded up for each week.) Turn in a copy of the old, graded assignment along with your corrected answers.

Week 6:

Extra Credit: Turn in a printout of a LOGO procedure DRAWTRI that uses arithmetic operators to draw a triangle given the lengths of two of its sides and the angle between those sides. This project may add up to five points to your final grade; credit will be assigned based on whether the program works, how readable the code is, what error checking it does, and how informative its error messages are. Students wishing to work in groups on this project may submit their work jointly to receive substantial partial credit for each contributor.
  1. Create a state transparent logo procedure RTTRI that uses the SQRT and ARCTAN operators to draw a right triangle given the lengths of two legs of the triangle.
  2. Write a paragraph discussing one or more things you like about the LOGO language and how you would use these in your teaching.
  3. Write a paragraph discussing the most difficult thing we have done so far in this class and how you would present it (or how and why you could avoid presenting it) in your teaching.

Week 7:

Read Chapter 9 and pp. 302-306
Extra Credit: Write your own Madlib game. You do not need to be able to print the final story, but your program should do everything else Jenny's does. This project may add up to seven points to your final grade.
  1. Write a recursive procedure with one argument, N, that computes the sum of the integers from 1 to N. Hint: If the sum of the numbers from 1 to N is written as sum(N), then sum(N) = N + sum(N-1).
  2. Write down a description of a simple problem that can be solved using LOGO (e.g. determine if three numbers can represent lengths of the sides of a triangle, draw a picture of a cat, draw an N sided regular polygon), then write a program to solve it.
  3. Write one or two pages describing a way in which you might use the XCOR and YCOR commands in your teaching. What mathematical lessons can students learn by examining the position of the turtle?

Week 8:

Read Chapter 7
  1. Use MAKE and FOR to write a procedure that adds the numbers from 1 to :N, where :N is an argument given to your procedure.
  2. Imagine you are teaching LOGO to a group of students who know the commands REPEAT, FORWARD, BACK, LEFT and RIGHT but not much more. Choose a half hour lesson or project they can do using LOGO and create the materials you would use to teach it. If you would give the students a lecture, write down what you think you would say. If you would give the students a handout, write down a first draft of the handout. If you would give the students a question then help them answer it, write down the question and a list of examples of ways in which the students might need help.

    A typical lecture plan might look like:

    The Shapes of Letters

    This project uses LOGO to enforce students' ability to measure angles and distances.
    Materials needed: pencil, graph paper, protractors, computer, LOGO

    • Give students graph paper and ask them to draw their first initial on it.
    • Have students measure and record the lengths of the lines in their initial and the angles the turtle must turn through to draw the letter.
    • Make sure students understand how the turtle's starting position and angle will affect their drawing. Take questions and give suggestions on problems like crossing the top of a T.
    • Move to the computers and type in LOGO commands to draw the initial.
    • Discuss any lessons learned while programming; for example the importance of knowing which direction the turtle is headed so you know whether to turn right or left, the difference between exterior angles, interior angles, and turning angles, or methods of drawing curves in LOGO.

  3. On a separate sheet of paper, carefully describe a problem that can be solved using LOGO. One of your classmates will be asked to solve the problem.
  4. Write a procedure that uses MAKE, FOR, COUNT and ITEM to average the numbers in an array.

Week 9:

Read pp. 38-52, Chapter 2, and
http://max.cs.kzoo.edu/~abrady/java/sorting/.
  1. You got a problem description from one of your classmates. Write a LOGO program to solve that problem if you can. If you cannot, solve a similar problem and explain why you could not solve the original problem.
  2. If you had any trouble determining exactly what your classmate wanted your LOGO program to do, write down the questions you had. If the problem description was perfect, write down ways in which you might extend the capabilities of the program.
  3. Use the WHILE command to write a procedure CFORWARD :DISTANCE that restricts the turtle's movement to a circular portion of the screen. In other words, create a circular version of the square NFD5 command defined on page 210 of the text.

    This problem is not stated precisely; you will have to interpret the question and make some decisions before you can answer it completely. What decisions did you make about how the turtle would wrap around? What decisions did you make about the circle? What decisions did you make about initial turtle positions outside of the circle?

Week 10:

Study for the Midterm
    If you lost points on one of the homework assignments turned in since the last midterm, you may redo the problems you lost points on. Correct answers will add half the credit lost to your homework grade (rounded up for each week.) Turn in a copy of the old, graded assignment along with your corrected answers.

Week 11:

Extra Credit: Research and program the quick sort algorithm.
  1. Write a LOGO program that uses the bubble sort algorithm to sort an array.
  2. Write a proposal for a final project for this class.

Week 12:

Extra Credit: Modify your bubble sort program to skip parts of the array that you know are already sorted by changing the limits of the inner FOR loop.
  1. Write a question that would be appropriate for the final exam for this course and send it via email to burgiel-mtht420@math.uic.edu. (Please indicate in the message that this is an exam question and not one you want me to answer!)
  2. Use LOGO to write a game. You could base your game on the tic-tac-toe or madlibs examples in the book or write an "adventure" type game like the one in this week's handout. Extra credit may be given for more elaborate games. Save your game (or a text file containing the LOGO commands defining the game) on a floppy disk so that you can share your game with your classmates!

Week 13:

  1. Write a LOGO procedure STAR22INFTY :SIZE that draws the frieze pattern denoted by *22 \infty in the activity sheet from week 4.
  2. Use the Euclidean Algorithm program you wrote in class to write a procedure FASTPQGON that takes three arguments :P, :Q and :SIDE and repeats the command FORWARD :SIDE RIGHT (360 * (:P/:Q)) exactly enough times to return the turtle to its starting state.

Week 14:

Prepare for the final exam review session. Review all material in the text.
Extra Credit: Write a question that requires using Dijkstra's Algorithm to find the shortest path through a graph. (It shouldn't be possible to quickly guess the answer withouth applying the algorithm.) Turn in your question and its answer.
  1. Examine your experience as a student in this class and consider how LOGO programming might affect your own students. What skills are taught by LOGO programming lessons? What skills are needed to start programming in LOGO? What things have we done in this class that your students might not have the necessary skills for?

Week 15:

Prepare for the final exam.
    If you lost points on one of the homework assignments turned in since the second midterm, you may redo the problems you lost points on. Correct answers will add half the credit lost to your homework grade (rounded up for each week.) Turn in a copy of the old, graded assignment along with your corrected answers.

Mtht 420