Machine-translated by Google. Questions are authored in English.
Top

Discussion

Ankita has to climb 5 stairs starting at the ground, while respecting the following rules:

1. At any stage, Ankita can move either one or two stairs up.
2. At any stage, Ankita cannot move to a lower step.

Let F(N) denote the number of possible ways in which Ankita can reach the Nth stair. For example, F(1) = 1, F(2) = 2, F(3) = 3.

The value of F(5) is ___.

  • A.8
  • B.7
  • C.6
  • D.5

Answer: A

F(5) is 8.

The last move onto stair N is either a single step from stair N - 1 or a double step from stair N - 2, so:

\[ F(N) = F(N-1) + F(N-2) \]

With F(1) = 1, F(2) = 2 and F(3) = 3, this gives F(4) = 3 + 2 = 5 and F(5) = 5 + 3 = 8, the Fibonacci numbers.

Listing by the number of double steps confirms it: no double step (1 way), one double step among four moves (4 ways), two double steps among three moves (3 ways), total 8. 5 is F(4), one stair short.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.