Consider the following recurrence: f(1) = 1; f(2n) = 2 f(n) - 1, for n ≥ 1; f(2n+1) = 2 f(n) + 1, for n ≥ 1. Then, which of the following statements is/are TRUE?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2022 · Q51
Time
Select all that applyOne or more correct
Solution
Official answer: A) f(2n - 1) = 2n - 1; B) f(2n) = 1; C) f(5 · 2n) = 2n+1 + 1
Recurrence RelationsLet us compute values of for small values of and test each statement:
Base case: $f(1) = 1$
For :
For :
For :
For :
For :
Now, evaluate each option:
Option (A):
For $n=1$: $f(1) = 1 = 2^1 - 1$.
For $n=2$: $f(3) = 3 = 2^2 - 1$.
By induction: $f(2^n - 1) = f(2(2^{n-1}-1) + 1) = 2f(2^{n-1}-1) + 1 = 2(2^{n-1}-1) + 1 = 2^n - 1$.
Option (A) is TRUE.
Option (B):
For $n=1$: $f(2) = 1$.
By induction: $f(2^n) = 2f(2^{n-1}) - 1 = 2(1) - 1 = 1$.
Option (B) is TRUE.
Option (C):
For $n=0$: $f(5) = 3 = 2^{0+1} + 1$.
For $n=1$: $f(10) = 2f(5) - 1 = 2(3) - 1 = 5 = 2^{1+1} + 1$.
By induction: .
Option (C) is TRUE.
Option (D):
For : .
Option (D) is FALSE.
Thus, statements A, B, and C are TRUE.
Try the question first, then check your work.
Examiner trap
Analyze the recurrence by calculating small values of or by writing in its binary representation and checking the relation via mathematical induction.
This Recurrence Relations previous year question is Q51 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Recurrence Relations in Engineering Mathematics, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 4 related Recurrence Relations PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Recurrence Relations has 4 GATE CSE PYQs across 4 papers from 2016 to 2024. This is the only 2-mark MSQ among them, and it is the only one in GATE CSE 2022.
How GATE tests Recurrence RelationsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.