The GATE Grind

GATE 2023 XL — all source sections – Question 7

General Aptitude · Quantitative Aptitude: Algebra, Geometry and Mensuration · 2 marks · Multiple choice

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 ______.

  1. 8
  2. 7
  3. 6
  4. 5

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

All Quantitative Aptitude: Algebra, Geometry and Mensuration questions →