GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 42

Normalize a square-root recurrence and flag its base case

Algorithms · Asymptotic Analysis & Recurrences · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q42 2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 42, GATE 2024: The printed recurrence gives T(n)=√n·T(√n)+n for n≥1 and T(1)=1. Which asymptotic answer is intended? A Θ(n log log n); B Θ(n log n); C Θ(n² log n); D Θ(n² log log n). The recursive branch overlaps the base case, so the literal definition needs qualification.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Approach: First disclose the definition's defect, then solve the intended version with a constant-size stopping threshold.
1. Literally, the n≥1 branch applies at n=1 and says T(1)=T(1)+1, contradicting T(1)=1. Merely changing ≥ to > is still insufficient over exact real arguments: repeated square roots of n>1 approach 1 but never reach it in finitely many steps. A constant threshold greater than 1, or a specified integer-rounding convention with a valid base, is needed.
2. For the intended recurrence, divide by n and set F(n)=T(n)/n. Then √n·T(√n)/n=T(√n)/√n=F(√n), so F(n)=F(√n)+1.
3. After k expansions, F(n)=F(n1/2^k)+k. Reaching a fixed threshold c>1 requires log n/2k≤log c, so k=Θ(log log n).
4. A bounded base value gives F(n)=Θ(log log n), hence T(n)=Θ(n log log n).
Official intended answer: A. This derivation is conditional on the corrected stopping model; it does not solve the inconsistent recurrence exactly as printed. Existing discrepancy CS-2024-S1-Q42-BASE-CASE is preserved.

Original paper, page 27 · Answer key