Question:

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 $N^{th}$ stair. For example, $F(1) = 1$, $F(2) = 2$, $F(3) = 3$. The value of $F(5)$ is .................

Show Hint

This is a classical example of the Fibonacci-like sequence, where each number is the sum of the two preceding ones.
Updated On: Sep 1, 2025
  • 8
  • 7
  • 6
  • 5
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

We are given the recurrence relation that $F(1) = 1$, $F(2) = 2$, and $F(3) = 3$. The number of ways to reach any stair $N$ depends on whether Ankita took one or two steps from the previous stair: \[ F(N) = F(N-1) + F(N-2) \] Now, let us calculate $F(4)$ and $F(5)$: \[ F(4) = F(3) + F(2) = 3 + 2 = 5 \] \[ F(5) = F(4) + F(3) = 5 + 3 = 8 \] Therefore, the value of $F(5) = 8$.
Was this answer helpful?
0
0

Top Questions on Logical and Analytical Reasoning Skills

View More Questions

Questions Asked in GATE XL exam

View More Questions