11 Comments
author

Edited: Val silverCoins = {0, 1, 1, 2, 3, 5} the Fibonacci at p5, is 6 (2+3)

Correction: Val silverCoins = {0, 1, 1, 2, 3, 5} the Fibonacci at p7, is 8 (5+3)

Expand full comment
Apr 27, 2023Liked by Tobi Akinpelu

I am super excited to be honest, thanks for considering my comment, I truly appreciate sir

God bless you!

Expand full comment
Apr 25, 2023Liked by Tobi Akinpelu

Wow

I am super excited because, being so lucky is not really something i am used to enjoying

Thanks for choosing my comment from the last newsletter

I truly appreciate!

As for this weeks newsletter, I canโ€™t really relate, seeing that I have always sucked in science class,

Maybe I am still no good at it!

To many numbers just makes me feel lost๐Ÿ˜‚

Expand full comment
Apr 22, 2023Liked by Tobi Akinpelu

Answer to question 1.

Recursive, once you're discovered that value, you would start over again. While in Iterative, only loop once because it memorises the last two digits number or value each time.

Answer to question 2.

Fibonacci number at position 13.

At position 13 is (55+89) =114

Expand full comment
Apr 22, 2023Liked by Tobi Akinpelu

In using the recursive method to get a fibonacci number, we reduce the problem to calculating the sum of the last two fibonacci numbers until we hit the base case. In the example above, the base case is p <= 1. Then the fibonacci numbers add up (like a stack).

In the iterative method we are leveraging a loop (for or while) to compute the fibonacci of a number by adding the last two numbers given the first two numbers. In the iterative method, we consistently keep track of the last two numbers using two variables.

The fibonacci number at position 13, p13 is 144 i.e (55 + 89)

Expand full comment

I just understood what tha fibonnaci sequence actually is ๐Ÿ˜…๐Ÿ˜…. Thank you

Expand full comment