GATE 2023 XE — all source sections – Question 7
Ankita climbs five stairs from the ground. Each move is one or two stairs upward, and she cannot move down. Let $F(N)$ count the ways to reach stair $N$; $F(1)=1,F(2)=2,F(3)=3$. The value of $F(5)$ is ______.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) 8
Explanation
Separate paths by their final move. A path to stair N ends either with a one-stair move from N−1 or a two-stair move from N−2. These cases are disjoint and cover every possible path:
$$F(N)=F(N-1)+F(N-2).$$
Using F(2)=2 and F(3)=3 gives F(4)=5 and F(5)=8.
As a second count, five ones give one path; one two and three ones give four orders; two twos and one one give three orders. Total 1+4+3=**8, A**.
More Quantitative Aptitude: Algebra, Geometry and Mensuration questions
- GATE 2023 XE — all source sections Q9
- GATE 2023 XL — all source sections Q7
- GATE 2023 XL — all source sections Q9
- GATE 2019 AG Q3
- GATE 2019 AR Q3
- GATE 2019 ST Q3
All Quantitative Aptitude: Algebra, Geometry and Mensuration questions →