This is a small assignment to give you some experience with Miranda.
Submission directions: Please turn in both printed and electronic copies of your code. The print submission is due in class on the due date above. You may e-mail the electronic copies to Keunwoo (klee@cs) anytime the same day. For full credit, you must follow the submission guidelines.
For example, here is an expression to compute the the amount of money in a savings account, starting with $1 in the year 2000, at 5% interest:
compound 2000 1 0.05This evaluates to:
take 4 (compound 2000 1 0.05)evaluates to:
[(2000,1), (2001,1.05), (2002,1.1025), (2003,1.157625)]Now define a variable population that is the infinite list of yearly total populations of the earth, assuming 6 billion people starting in 1999 and an annual growth rate of 1.3%. (This actually should provide reasonable estimates in the short term, but not in the long term ... however, this is just a Miranda exercise, rather than an exercise in realistic modelling.)
Using population, find the year in which the population will have doubled (to 12 billion).