GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 2

GATE CSE 2020 Q2

Algorithms · Asymptotic Analysis & Recurrences · Full GATE CSE 2020 paper

GATE 2020, Q2 1 mark · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 2, GATE 2020: For parameters a,b, both printed as ω(1), T(n)=T(n^(1/a))+1 and T(b)=1. Choose the printed asymptotic expression. Options: A Θ(log_a(log_b n)); B Θ(log_(ab) n); C Θ(log_b(log_a n)); D Θ(log_2(log_2 n)). No cutoff for inputs below b is specified; retain this qualification.
Question 2, GATE 2020: For parameters a,b, both printed as ω(1), T(n)=T(n^(1/a))+1 and T(b)=1. Choose the printed asymptotic expression. Options: A Θ(log_a(log_b n)); B Θ(log_(ab) n); C Θ(log_b(log_a n)); D Θ(log_2(log_2 n)). No cutoff for inputs below b is specified; retain this qualification.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A under the intended recurrence-depth convention

Worked explanation

Unroll without changing the logarithm bases: T(n)=T(n1/a²)+2=…=T(n1/a^j)+j. Exact termination at b requires n1/a^j=b, or (ln n)/aj=ln b. Thus aj=ln n/ln b=logb n. Taking log base a yields the expression in A, with total value j+1. This derivation assumes a,b are held fixed during a recursion chain, even if their initial values depend on the original input size. It does not justify swapping a and b as in C. The rigorous cutoff-based estimate is Θ(1+max(0,loga(logb n))) in the regime n>1,a>1,b>1, with ceiling for integral depth.

Derivation and answer

After j recursive calls the argument is n1/a^j. Equating it to b gives aj=logb n, hence j=loga(logb n) and T(n)=j+1 on exact-depth inputs. With a base cutoff at n≤b, the corresponding depth is max(0, ceil(loga(logb n))) for fixed call parameters a, b>1. This gives intended A when the depth is bounded below away from 0, in particular when it grows. Qualification: the source says a, b are ω(1), not fixed constants, and gives only T(b)=1. Arbitrary inputs need a cutoff/rounding convention, and the additive 1 cannot always be dropped when parameters vary. For example a=n, b=log n gives depth 1 under the cutoff, but loga(logb n) tends to 0. Thus the printed unconditional Theta claim requires a parameter regime/termination convention.

Original paper, page 4 · Answer key