Understanding the Master Theorem for Recursion Equations

Slide Note
Embed
Share

The Master Theorem is a powerful tool for analyzing recursion equations commonly found in divide and conquer algorithms. It provides a framework for solving recurrence relations of the form T(n) = aT(n/b) + f(n). By examining different cases and comparing functions with powers of n, we can determine the time complexity of algorithms efficiently.


Uploaded on Sep 26, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. The Master Theorem

  2. A family of Recursion Equations Divide and conquer frequently lead to recursions of the form ?(?) = ??(?/?) + ?(?)

  3. A family of Recursion Equations Solve Recurrence:

  4. A family of Recursion Equations

  5. A family of Recursion Equations

  6. A family of Recursion Equations Total is log?? 1 ???(?/??)) + ??log?? ( ?=0 Need to compare f with power of n in order to see what dominates

  7. A family of Recursion Equations ?(?) = ?(?log?? ?) ?(?) = (?log??) ?(?) = (?log??) ?(?) = (?log??log?) ?(?) = (?log??+?)and??(?/?) ??(?)eventually ?(?) = (?(?))

  8. A family of Recursion Equations There are gaps between the three cases, where the master theorem does not apply

  9. Examples ?(?) = 2?(?/2) + ? ?log22= ? = ?(?)Case 2 ?(?) = (?log?)

  10. Examples ?(?) = 3?(?/2) + ? log23 = 1.58496 ? = ?(?log23 0.1) ?(?) = (?log23)

  11. Examples ?(?) = ?(?/2) + ? ? = 1,? = 2 log21 = 0 ? = (?0+1/2) ?(?) = (?)

  12. Examples ?(?) = 3?(?/3) + ?log? ? = 3? = 3so compare with? ?log? (?1+?) ?log? (?) Falls into the gap between Case 2 and Case 3

More Related Content