Problem Set 1, CS 257

Due before 5pm Tues Sep 2, 1997.
  1. Get Emacs and STk working for you. Demonstrate it by calculating the sin of 1E100 (ten to the power one hundred).

    (Extra credit: do you think your answer is numerically correct? Conduct an experiment to check.)

  2. Use Scheme to calculate the average of: 1, 1, 2, 3, 5, 8, 13, 21, 33.

  3. format and indent the following properly:
    (+ (* (+ 1 (* (+ 1 (* (+ 1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1
    1))))) (+ 1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1 1))))))) (+ 1 (* (+
    1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1 1))))) (+ 1 (* (+ 1 (+ 1 1))
    (* (+ 1 1) (+ 1 (+ 1 1))))))))) (+ 1 (* (+ 1 (* (+ 1 (* (+ 1 (+ 1 1))
    (* (+ 1 1) (+ 1 (+ 1 1))))) (+ 1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1
    1))))))) (+ 1 (* (+ 1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1 1))))) (+
    1 (* (+ 1 (+ 1 1)) (* (+ 1 1) (+ 1 (+ 1 1)))))))))) 1)
    

  4. Make a very complicated expression that expresses a calculation of interest to you and indent it properly.

  5. Draw a big drawing using the turtle. Just edit a file to have all the commands in it, and draw the thing by loading the file into stk. E-mail the contents of this file as part of your homework. (You can compose the e-mail within emacs using C-x m.)

    Make the drawing really complicated and cute. This is a good way to learn the cut-and-paste features of emacs, and maybe query-replace too. By using these, you should be able to eg easily spell your name in big letters.

Turn in this problem set via e-mail to cs257-done@sweat.cs.unm.edu.
Barak Pearlmutter <bap@cs.unm.edu>