Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 19:29 Nov 20, 2015 |
In the Tuesday lecture, when I expanded Fibonacci on the board, the initial numbers came out as 0 1 2 3 5 ... . The second "1" was missing. I don't know what I did wrong. The code on the wiki page comes out right. To run it you need both stream-map-n and stream-take, which are also defined on the page.
|
rabbott
Posts: 1649
|
Posted 15:55 Nov 21, 2015 |
Here's what I did wrong. I showed that
the sum of the fibonacci sequence with it's tail is: '(1 2 3 5 8 13). (In class I made a mistake and put a 0 in front.)
--------------------- '(1 2 3 5 8 13 ...) The fibonacci function returns that sum with '(0 1) put in front, making the whole thing the correct fibonacci sequence: ( |