Combinations to Reach Nth Stair by moving up one step or two step at a time.
The answer to this can be found out by induction.
To reach the Nth Stair, we can reach by jumping one step from the (N - 1)th stair or jumping 2 steps from the (N-2)th chair.
If we denote Number of Ways of reach N as F(N)
F(N) = F(N-1) + F(N-2).
Does that ring any bells ?
It is the general form of the Nth term of the Fibonacci sequence.
So to reach the Nth stair, the (N+1)th number in the Fibonacci sequence is the total Number of combination, if the sequence starts from 0 as shown below.
F(0) = 0
F(1) = 1
F(2) = 1
F(3) = 2
etc...
25 Jan, 2010
Comments (0)
You may also like
Recent Comments
- Siri and Uber also uses Location Services
9 years, 3 months ago
- i connected my dell laptop to videocon lcd …
9 years, 4 months ago
- 05/03/2014_22:09:18,97 C:\Users\kampar>touch .htaccess 'touch' is not recognized as …
9 years, 6 months ago
- IRCTC Tatkal ticket booking script required...
9 years, 8 months ago
- I have a similar solution. I was told …
10 years, 3 months ago
- Can you try checking with a different cable …
10 years, 6 months ago
- wow that's hilarious
10 years, 6 months ago
- Perfect! Thanks! :D
10 years, 6 months ago
- Having the same issue. Were you able to …
10 years, 6 months ago
- hi im having problem with the hdmi port.. …
10 years, 6 months ago
- Hi, As of today the way2sms website has …
10 years, 7 months ago
- HI! I have a problem with my lg …
10 years, 11 months ago
- You know what would be a GREAT idea …
10 years, 11 months ago
- Hi, For changing MAC address in win7 just …
10 years, 11 months ago
- anybody who might read this now should be …
10 years, 11 months ago