Stairy Situation

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?

45 55 89 77

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.

1 solution

S ( n ) S(n) means how many ways can you reach the top if there are n n steps.

There are two cases for each n > 1 n>1 :

Case 1: At the last step we moved one step. This is n 1 n-1 ways.

Case 2: At the last step we moved two steps. This is n 2 n-2 ways.

From that: S ( n ) = S ( n 1 ) + S ( n 2 ) S(n)=S(n-1)+S(n-2) .

S ( 1 ) = 1 S(1)=1

S ( 2 ) = 2 S(2)=2

\dots

S ( 10 ) = 89 S(10)=89

Note: S ( k ) S(k) is the k + 1 k+1 . item of the Fibonacci series .

Please check your work. The answer should be 89, not 55.

Calvin Lin Staff - 3 years, 11 months ago

Log in to reply

Thanks! I missed calculating...I corrected it!

Áron Bán-Szabó - 3 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...