This action might not be possible to undo. Are you sure you want to continue?

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

Outline • Motivation • The Master Theorem – Pitfalls – 3 examples • 4th Condition – 1 example CSCE 235. Fall 2008 Master Theorem 2 .

it is sufficient to give an asymptotic characterization • The main tool for doing this is the master theorem CSCE 235.Motivation: Asymptotic Behavior of Recursive Algorithms • When analyzing algorithms. Fall 2008 Master Theorem 3 . recall that we only care about the asymptotic behavior • Recursive algorithms are no different • Rather than solving exactly the recurrence relation associated with the cost of an algorithm.

Outline • Motivation • The Master Theorem – Pitfalls – 3 examples • 4th Condition – 1 example CSCE 235. Fall 2008 Master Theorem 4 .

c>0. If f(n) is (nd) where d 0 then if a < bd T(n) = If a = bd if a > bd Master Theorem 5 CSCE 235. b 2.Master Theorem • Let T(n) be a monotonically increasing function that satisfies T(n) = a T(n/b) + f(n) T(1) = c where a 1. Fall 2008 .

Fall 2008 Master Theorem 6 .Master Theorem: Pitfalls • You cannot use the Master Theorem if – T(n) is not monotone.g.g. T(n) = sin(x) – f(n) is not a polynomial. e. T(n)=2T(n/2)+2n – b cannot be expressed as a constant. e. • Note that the Master Theorem does not solve the recurrence equation • Does the base case remain a concern? CSCE 235.g. e..

which condition applies? 1 < 22.Master Theorem: Example 1 • Let T(n) = T(n/2) + ½ n2 + n. Fall 2008 Master Theorem 7 . What are the parameters? a= 1 b= 2 d= 2 Therefore. case 1 applies • We conclude that T(n) (nd) = (n2) CSCE 235.

case 2 applies • We conclude that CSCE 235. What are the parameters? a= 2 b= 4 d = 1/2 Therefore. which condition applies? 2 = 41/2. Fall 2008 Master Theorem 8 .Master Theorem: Example 2 • Let T(n)= 2 T(n/4) + n + 42.

Fall 2008 Master Theorem 9 .5849) CSCE 235. case 3 applies • We conclude that • Note that log231. which condition applies? 3 > 21. because log231. can we say that T(n) (n1.5849… and n1. What are the parameters? a= 3 b= 2 d= 1 Therefore.584….584 (n1.584) No.Master Theorem: Example 3 • Let T(n)= 3 T(n/2) + 3/4n + 1.

Fall 2008 Master Theorem 10 .Outline • Motivation • The Master Theorem – Pitfalls – 3 examples • 4th Condition – 1 example CSCE 235.

‘Fourth’ Condition • Recall that we cannot use the Master Theorem if f(n). Relax CSCE 235. Fall 2008 Master Theorem 11 .. the non-recursive cost. is not a polynomial • There is a limited 4th condition of the Master Theorem that allows us to consider polylogarithmic functions • Corollary: If for some k0 then • This final condition is fairly limited and we present it merely for sake of completeness.

‘Fourth’ Condition: Example • Say we have the following recurrence relation T(n)= 2 T(n/2) + n log n • Clearly. we have f(n)(n log n). but f(n) is not a polynomial. However. b=2. k=1 • Therefore by the 4th condition of the Master Theorem we can say that CSCE 235. Fall 2008 Master Theorem 12 . a=2.

Summary • Motivation • The Master Theorem – Pitfalls – 3 examples • 4th Condition – 1 example CSCE 235. Fall 2008 Master Theorem 13 .

master theorem in analysis and design of algorithm

master theorem in analysis and design of algorithm

- Ce3 Solutions
- 2012 HCI MA H2 P1 Prelim Soln
- hw
- Gram Schmitd Orthogonalisational Process
- LDEofOrder1
- Week 1
- Tutorial Methods)
- Mellin Transform Example
- Lcs
- 4
- A Cheat Sheet of Maths
- mathecon(2011)4
- PROOF OF THE DEPASCALISATION THEOREM
- A 2
- Dot and Cross Pro
- State Space Models312
- CS61A study sheet
- Section3_4
- Additional Mathematics CXC 2014 Solved
- Z-tranform
- stu2 sayfa3 te sayfa119 3cnin cevabı
- British Mathematical Olympiad 14
- Final 02
- Solution 2
- Pure Mathematics Syllabus
- Whole Numbers and Integers
- AJC H2 Math 2013 Prelim P1 Solutions
- Solutions 1
- Mat Papa
- MATH 2930 - Worksheet 2 Solutions

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd