CS212 Exams
Spring 1998 - Final

Solution to Streaming Pies

WARNING: You should seriously try to answer this question before looking at the solution -- it's just a good study skill. Also, some answers on this page may be more brief than you would want to put down in an actual exam. If you want any type of partial credit, you should write more than just the solution.


  1. (define fours (cons-stream 4 fours))
  2. (define odd-naturals (f (nats-from 1)))
  3. (define denoms (g (f odd-naturals) 
                      (k - (f (tails odd-naturals)))))
  4. (define pi (h / fours denoms))

Question

Return to CS 212 Final - Spring 1998