There is a staircase with 10 steps. You can move one or two steps at a time. How many ways can you reach the top?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
S ( n ) means how many ways can you reach the top if there are n steps.
There are two cases for each n > 1 :
Case 1: At the last step we moved one step. This is n − 1 ways.
Case 2: At the last step we moved two steps. This is n − 2 ways.
From that: S ( n ) = S ( n − 1 ) + S ( n − 2 ) .
S ( 1 ) = 1
S ( 2 ) = 2
…
S ( 1 0 ) = 8 9
Note: S ( k ) is the k + 1 . item of the Fibonacci series .