[cse491] Question about fib8

C. Titus Brown ctb at msu.edu
Tue Sep 2 13:45:40 PDT 2008


Return n + 1, to satisfy the tests -- sorry 'bout that.

On Tue, Sep 02, 2008 at 04:44:05PM -0400, Evan Dontje wrote:
-> Hi Professor,
-> I had a question about how you are counting the Fibonacci numbers in a
-> sequence.
-> 
-> The make_fib function you ask for in the homework is "a function that
-> returns the first n elements in the Fibonacci series." So for make_fib(8) I
-> thought it would return [0, 1, 1, 2, 3, 5, 8, 13].
-> 
-> However, that fails the assert x = fib8 because your fib8 in the hw1 tests
-> has 9 numbers in it, i.e. fib8 = [0, 1, 1, 2, 3, 5, 8, 13, 21].
-> 
-> So my question is, when the function is asked for the first n elements of
-> the Fibonacci series should it return n+1 elements? Or is that a typo in
-> your homework test file.
-> 
-> Thanks,
-> Evan Dontje

-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2008 mailing list