For all n > 1,
T1(n) = 4T1(n/2) + T2(n)
T2(n) = 5T2(n/4) + Θ(log2n)
Assume that for all n ≤ 1, T1(n) = 1 and T2(n) = 1.
Which one of the following options is correct?
Correct : a
The correct answer is Option A — T₁(n) = Θ(n²).
This problem involves solving a coupled recurrence relation where T₁ depends on T₂. We solve T₂ first, then substitute its solution into the recurrence for T₁.
Solve T₂(n): T₂(n) = 5T₂(n/4) + Θ(log₂n). Using the Master Theorem with a = 5, b = 4, f(n) = Θ(log n): n^(log_b a) = n^(log₄ 5) ≈ n^1.16. Since log n grows asymptotically slower than any positive power of n, we are in Case 1 of the Master Theorem. Therefore, T₂(n) = Θ(n^(log₄ 5)).
Substitute into T₁(n): T₁(n) = 4T₁(n/2) + T₂(n) = 4T₁(n/2) + Θ(n^(log₄ 5)). Applying the Master Theorem with a = 4, b = 2, f(n) = Θ(n^(log₄ 5)): n^(log_b a) = n^(log₂ 4) = n². Since log₄ 5 ≈ 1.16 < 2, we have n^(log₄ 5) = O(n^(2−ε)) for some ε > 0. This is Case 1 of the Master Theorem, so the dominant term is n². Therefore, T₁(n) = Θ(n²).
Why not the other options? Option B (Θ(n² log n)) would require f(n) = Θ(n²) in the recurrence for T₁ (Case 2 of Master Theorem). Option C (Θ(n^(log₄ 5))) would be the complexity of T₂, not T₁. Option D (Θ(n^(log₄ 5) log n)) doesn''t match any standard Master Theorem case for this recurrence structure.
The key insight: when solving coupled recurrences, always solve the independent recurrence first (T₂), then substitute its closed form into the dependent one (T₁).
Similar Questions
Total Unique Visitors