0% found this document useful (0 votes)
7 views3 pages

DAA Asng 1

The document presents a series of recurrence relations and their classifications using the Master Theorem. It identifies cases where the theorem applies and provides the corresponding solutions for each relation. Several cases are noted where the Master Theorem does not apply due to the form of the function f(n).

Uploaded by

mlik.hashir.awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

DAA Asng 1

The document presents a series of recurrence relations and their classifications using the Master Theorem. It identifies cases where the theorem applies and provides the corresponding solutions for each relation. Several cases are noted where the Master Theorem does not apply due to the form of the function f(n).

Uploaded by

mlik.hashir.awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

✅ Solvable using Master Theorem

1. T(n) = 3T(n/2) + n²

• a = 3, b = 2, f(n) = n²
• log_b(a) = log₂(3) ≈ 1.58
• f(n) = n² = Ω(n^log₂3), and polynomially larger ⇒ Case 3
✅ T(n) = Θ(n²)

2. T(n) = 4T(n/2) + n²

• a = 4, b = 2 ⇒ log₂(4) = 2
• f(n) = n² = Θ(n²) ⇒ Case 2
✅ T(n) = Θ(n² log n)

3. T(n) = T(n/2) + 2ⁿ

• Not of the form required for Master Theorem since f(n) = exponential
❌ Master Theorem does not apply

4. T(n) = 2nT(n/2) + n^a

• The 'a' is a variable and 2n is not a constant coefficient


❌ Master Theorem does not apply

5. T(n) = 16T(n/4) + n

• a = 16, b = 4 ⇒ log₄(16) = 2
• f(n) = n = O(n²), i.e. smaller ⇒ Case 1
✅ T(n) = Θ(n²)

6. T(n) = 2T(n/2) + n log n

• a = 2, b = 2 ⇒ log₂(2) = 1
• f(n) = n log n = Θ(n log n) ⇒ Case 2
✅ T(n) = Θ(n log² n)
7. T(n) = 2T(n/2) + n / log n

• a = 2, b = 2 ⇒ log₂(2) = 1
• f(n) = n / log n = o(n) ⇒ Case 1
✅ T(n) = Θ(n)

8. T(n) = 2T(n/4) + n⁰․⁵¹

• a = 2, b = 4 ⇒ log₄(2) = 0.5
• f(n) = n^0.51 = Ω(n^0.5), and polynomially larger ⇒ Case 3
✅ T(n) = Θ(n^0.51)

9. T(n) = 0.5T(n/2) + 1/n

• a = 0.5 (fractional a), not standard form


❌ Master Theorem does not apply

10. T(n) = 16T(n/4) + n!

• f(n) = n! is super-polynomial
❌ Master Theorem does not apply

11. T(n) = √2 T(n/2) + log n

• a = √2 ≈ 1.41, b = 2 ⇒ log₂(√2) = 0.5


• f(n) = log n = o(n^0.5) ⇒ Case 1
✅ T(n) = Θ(n^0.5)

12. T(n) = 3T(n/2) + n

• a = 3, b = 2 ⇒ log₂(3) ≈ 1.58
• f(n) = n = O(n^1.58−ε) ⇒ Case 1
✅ T(n) = Θ(n^log₂3)

13. T(n) = 3T(n/3) + √n

• a = 3, b = 3 ⇒ log₃(3) = 1
• f(n) = √n = n^0.5 ⇒ Case 1
✅ T(n) = Θ(n)

14. T(n) = 4T(n/2) + cn

• a = 4, b = 2 ⇒ log₂(4) = 2
• f(n) = n = O(n^2−ε) ⇒ Case 1
✅ T(n) = Θ(n²)

15. T(n) = 3T(n/4) + n log n

• a = 3, b = 4 ⇒ log₄(3) ≈ 0.792
• f(n) = n log n = Ω(n^0.792+ε) ⇒ Case 3
✅ T(n) = Θ(n log n)

You might also like