Kernel: Python 3 (system-wide)
Suppose that you can walk up a set of stairs using steps of size 1, 2 and 4. In how many ways can you walk up a set of 20 stairs? Let = number of ways to n stairs using steps of size 1, 2 and 4
We know that = 1 and = 2 because we can climb in many different ways: [1] and [1,1],[2] respectively
We will compute the sum of our ways to climb using the Fibonacci Sequence formula. We will get since we can climb up using steps of size 1,2, and 4.
In [38]:
In [39]:
Out[39]:
46754
This way, we found in how many ways we can walk up a set of 20 stairs. We can climb a set of 20 stairs in 46754 ways.