Skip to content
GATEiit

GATE CSE 2022 Q51: Values of a recurrence on 2n and 2n + 1

Question

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{aligned} f(1) &= 1; \\ f(2n) &= 2f(n) - 1, \quad \text{for } n \ge 1; \\ f(2n+1) &= 2f(n) + 1, \quad \text{for } n \ge 1. \end{aligned}

Then, which of the following statements is/are TRUE?

Try it: multiple select: one or more correct options

Select one or more options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation

Answer: A, B, C (official GATE 2022 final answer key)

Concept used: Compute small values and prove the patterns by induction on nn.

First step: Tabulate f(1),…,f(10)f(1), \ldots, f(10): e.g. f(2)=1f(2) = 1, f(3)=3f(3) = 3, f(4)=1f(4) = 1, f(5)=3f(5) = 3, and compare with each formula.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2022 CS question paper and final answer key, organised by IIT Kharagpur. Question paper · Answer key