Skip to main content

GATE CSE 2022Combinatory › Recurrence Relations & Generating FunctionsVerified

GATE CSE 2022 PYQ: Consider the following recurrence: f ( 1 ) = 1 ; f ( 2 n ) = 2 f ( n ) – 1 , for n ≥ 1 ; f ( 2 n + 1 ) = 2 f…

Consider the following recurrence:

f(1)=1;f(2n)=2f(n)–1,  for  n≥1;f(2n+1)=2f(n)+1,  for  n≥1.\begin{array}{} f(1) & = & 1; \\ f(2n) & = & 2f(n) – 1, & \; \text{for}\; n \geq 1; \\ f(2n+1) & = & 2f(n) + 1, & \; \text{for}\; n \geq 1. \end{array}

Then, which of the following statements is/are TRUE?\text{TRUE}?

  1. A
    f(2n–1)=2n–1f(2^{n} – 1) = 2^{n} – 1
    Correct answer
  2. B
    f(2n)=1f(2^{n}) = 1
    Correct answer
  3. C
    f(5⋅2n)=2n+1+1f(5 \cdot 2^{n}) = 2^{n+1} + 1
    Correct answer
  4. D
    f(2n+1)=2n+1f(2^{n} + 1) = 2^{n} + 1

Answer

(A, B, C) f ( 2 n – 1 ) = 2 n – 1 f(2^{n} – 1) = 2^{n} – 1 f ( 2 n –1 ) = 2 n –1; f ( 2 n ) = 1 f(2^{n}) = 1 f ( 2 n ) = 1; f ( 5 ⋅ 2 n ) = 2 n + 1 + 1 f(5 \cdot 2^{n}) = 2^{n+1} + 1 f ( 5 ⋅ 2 n ) = 2 n + 1 + 1

Approach

The recurrence is the standard Josephus recurrence. For any integer $n$ with $2^m \le n \< 2^{m+1}$, the closed form is $f(n)=2(n-2^m)+1$. Evaluate each option using this closed form.

The closed form $f(n)=2(n-2^m)+1$ where $2^m \le n \< 2^{m+1}$ confirms options A, B, and C. Option D gives the constant 3, not $2^n+1$, so it is not universally true.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.