SlideShare ist ein Scribd-Unternehmen logo
1 von 13
1
Proof of Master Theorem
• The proof for the exact powers, n=bk
for k≥1.
• Lemma 4.2
– for T(n) = Θ(1) if n=1
– aT(n/b)+f(n) if n=bk
for k≥1
– where a ≥ 1, b>1, f(n) be a nonnegative function,
– Then
– T(n) = Θ(nlogba
)+ aj
f(n/bj
)
• Proof:
– By iterating the recurrence
– By recursion tree (See figure 4.3)
∑
j=0
logb
n-1
2
Recursion tree for T(n)=aT(n/b)+f(n)
3
Proof of Master Theorem (cont.)
• Lemma 4.3:
– Let a ≥ 1, b>1, f(n) be a nonnegative function defined on
exact power of b, then
– g(n)= aj
f(n/bj
) can be bounded for exact power of b as:
1. If f(n)=O(nlogb
a-ε) for some ε>0, then g(n)= O(nlogb
a
).
2. If f(n)= Θ(nlogb
a
), then g(n)= Θ(nlogb
a
lg n).
3. If f(n)= Ω(nlogb
a+ε) for some ε>0 and if af(n/b) ≤cf(n) for some
c<1 and all sufficiently large n ≥b, then g(n)= Θ(f(n)).
∑
j=0
logb
n-1
4
Proof of Lemma 4.3
• For case 1: f(n)=O(nlogb
a-ε) implies f(n/bj
)=O((n /bj
)logb
a-ε), so
• g(n)= aj
f(n/bj
) =O( aj
(n /bj
)logb
a-ε)
• = O(nlogb
a-ε aj
/(blogb
a-ε)j
) = O(nlogb
a-ε aj
/(aj
(b-ε)j
))
• = O(nlogb
a-ε (bε)j
) = O(nlogb
a-ε(((bε)logbn
-1)/(bε
-1) )
• = O(nlogb
a-ε(((blogbn
)ε
-1)/(bε
-1)))=O(nlogb
a
n-ε
(nε
-1)/(bε
-1))
• = O(nlogb
a
)
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
logb
n-1
5
Proof of Lemma 4.3(cont.)
• For case 2: f(n)= Θ(nlogb
a
) implies f(n/bj
)= Θ((n /bj
)logb
a
), so
• g(n)= aj
f(n/bj
) = Θ( aj
(n /bj
)logb
a
)
• = Θ(nlogb
a
aj
/(blogb
a
)j
) = Θ(nlogb
a
1)
• = Θ(nlogb
a
logb
n) = Θ(nlogb
a
lg n)
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
logb
n-1
6
Proof of Lemma 4.3(cont.)
• For case 3:
– Since g(n) contains f(n), g(n) = Ω(f(n))
– Since af(n/b) ≤cf(n), aj
f(n/bj
) ≤cj
f(n) , why???
– g(n)= aj
f(n/bj
) ≤ cj
f(n) ≤ f(n) cj
– =f(n)(1/(1-c)) =O(f(n))
– Thus, g(n)=Θ(f(n))
∑
j=0
logb
n-1
∑
j=0
logb
n-1
∑
j=0
∞
7
Proof of Master Theorem (cont.)
• Lemma 4.4:
– for T(n) = Θ(1) if n=1
– aT(n/b)+f(n) if n=bk
for k≥1
– where a ≥ 1, b>1, f(n) be a nonnegative function,
1. If f(n)=O(nlogb
a-ε) for some ε>0, then T(n)= Θ(nlogb
a
).
2. If f(n)= Θ(nlogb
a
), then T(n)= Θ(nlogb
a
lg n).
3. If f(n)=Ω(nlogb
a+ε) for some ε>0, and if af(n/b) ≤cf(n) for
some c<1 and all sufficiently large n, then T(n)=
Θ(f(n)).
8
Proof of Lemma 4.4 (cont.)
• Combine Lemma 4.2 and 4.3,
– For case 1:
• T(n)= Θ(nlogb
a
)+O(nlogb
a
)=Θ(nlogb
a
).
– For case 2:
• T(n)= Θ(nlogb
a
)+Θ(nlogb
a
lg n)=Θ(nlogb
a
lg n).
– For case 3:
• T(n)= Θ(nlogb
a
)+Θ(f(n))=Θ(f(n)) because f(n)= Ω(nlogb
a+ε).
9
Floors and Ceilings
• T(n)=aT(n/b)+f(n) and T(n)=aT(n/b)+f(n)
• Want to prove both equal to T(n)=aT(n/b)+f(n)
• Two results:
– Master theorem applied to all integers n.
– Floors and ceilings do not change the result.
• (Note: we proved this by domain transformation too).
• Since n/b≤n/b, and n/b≥ n/b, upper bound for
floors and lower bound for ceiling is held.
• So prove upper bound for ceilings (similar for lower
bound for floors).
10
Upper bound of proof for T(n)=aT(n/b)+f(n)
• consider sequence n, n/b,  n/b/b,   n/b /b/b,
…
• Let us define nj as follows:
• nj= n if j=0
• = nj-1/b if j>0
• The sequence will be n0, n1, …, nlogb
n
• Draw recursion tree:
11
Recursion tree of T(n)=aT(n/b)+f(n)
12
The proof of upper bound for ceiling
– T(n) = Θ(nlogba
)+ aj
f(nj)
– Thus similar to Lemma 4.3 and 4.4, the upper
bound is proven.
∑
j=0
logb
n -1
13
The simple format of master theorem
• T(n)=aT(n/b)+cnk
, with a, b, c, k are positive
constants, and a≥1 and b≥2,
O(nlogba
), if a>bk
.
• T(n) = O(nk
logn), if a=bk
.
O(nk
), if a<bk
.

Weitere ähnliche Inhalte

Was ist angesagt?

Recurrence and master theorem
Recurrence and master theoremRecurrence and master theorem
Recurrence and master theoremAmit Kumar Rathi
 
03 mathematical anaylsis
03 mathematical anaylsis03 mathematical anaylsis
03 mathematical anaylsisHira Gul
 
strassen matrix multiplication algorithm
strassen matrix multiplication algorithmstrassen matrix multiplication algorithm
strassen matrix multiplication algorithmevil eye
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithmsGanesh Solanke
 
Metaheuristic Optimization: Algorithm Analysis and Open Problems
Metaheuristic Optimization: Algorithm Analysis and Open ProblemsMetaheuristic Optimization: Algorithm Analysis and Open Problems
Metaheuristic Optimization: Algorithm Analysis and Open ProblemsXin-She Yang
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Traian Rebedea
 
Stressen's matrix multiplication
Stressen's matrix multiplicationStressen's matrix multiplication
Stressen's matrix multiplicationKumar
 
Algorithm chapter 2
Algorithm chapter 2Algorithm chapter 2
Algorithm chapter 2chidabdu
 
Deep sarsa, Deep Q-learning, DQN
Deep sarsa, Deep Q-learning, DQNDeep sarsa, Deep Q-learning, DQN
Deep sarsa, Deep Q-learning, DQNEuijin Jeong
 
Lecture 9 Markov decision process
Lecture 9 Markov decision processLecture 9 Markov decision process
Lecture 9 Markov decision processVARUN KUMAR
 
Coin Change : Greedy vs Dynamic Programming
Coin Change : Greedy vs Dynamic ProgrammingCoin Change : Greedy vs Dynamic Programming
Coin Change : Greedy vs Dynamic ProgrammingSyeda Khadizatul maria
 
Algorithm For optimization.pptx
Algorithm For optimization.pptxAlgorithm For optimization.pptx
Algorithm For optimization.pptxKARISHMA JAIN
 
Master method
Master method Master method
Master method Rajendran
 
Intro to Deep Reinforcement Learning
Intro to Deep Reinforcement LearningIntro to Deep Reinforcement Learning
Intro to Deep Reinforcement LearningKhaled Saleh
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programmingGopi Saiteja
 
Np completeness
Np completenessNp completeness
Np completenessRajendran
 

Was ist angesagt? (20)

Recurrence and master theorem
Recurrence and master theoremRecurrence and master theorem
Recurrence and master theorem
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
03 mathematical anaylsis
03 mathematical anaylsis03 mathematical anaylsis
03 mathematical anaylsis
 
Chap4
Chap4Chap4
Chap4
 
strassen matrix multiplication algorithm
strassen matrix multiplication algorithmstrassen matrix multiplication algorithm
strassen matrix multiplication algorithm
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
 
Metaheuristic Optimization: Algorithm Analysis and Open Problems
Metaheuristic Optimization: Algorithm Analysis and Open ProblemsMetaheuristic Optimization: Algorithm Analysis and Open Problems
Metaheuristic Optimization: Algorithm Analysis and Open Problems
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3
 
Stressen's matrix multiplication
Stressen's matrix multiplicationStressen's matrix multiplication
Stressen's matrix multiplication
 
Recurrences
RecurrencesRecurrences
Recurrences
 
Algorithm chapter 2
Algorithm chapter 2Algorithm chapter 2
Algorithm chapter 2
 
Deep sarsa, Deep Q-learning, DQN
Deep sarsa, Deep Q-learning, DQNDeep sarsa, Deep Q-learning, DQN
Deep sarsa, Deep Q-learning, DQN
 
Lecture 9 Markov decision process
Lecture 9 Markov decision processLecture 9 Markov decision process
Lecture 9 Markov decision process
 
Coin Change : Greedy vs Dynamic Programming
Coin Change : Greedy vs Dynamic ProgrammingCoin Change : Greedy vs Dynamic Programming
Coin Change : Greedy vs Dynamic Programming
 
Algorithm For optimization.pptx
Algorithm For optimization.pptxAlgorithm For optimization.pptx
Algorithm For optimization.pptx
 
Master method
Master method Master method
Master method
 
Intro to Deep Reinforcement Learning
Intro to Deep Reinforcement LearningIntro to Deep Reinforcement Learning
Intro to Deep Reinforcement Learning
 
Gamma function
Gamma functionGamma function
Gamma function
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Np completeness
Np completenessNp completeness
Np completeness
 

Ähnlich wie Proof master theorem

RecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.pptRecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.pptISHAN194169
 
Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrencesMegha V
 
lecture 3
lecture 3lecture 3
lecture 3sajinsc
 
Recurrences
RecurrencesRecurrences
RecurrencesDEVTYPE
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquerVikas Sharma
 
Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms IiSri Prasanna
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptZohairMughal1
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptZohairMughal1
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theoremRajendran
 
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerCopy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerJoepang2015
 
lecture 4
lecture 4lecture 4
lecture 4sajinsc
 
Recurrence relation solutions
Recurrence relation solutionsRecurrence relation solutions
Recurrence relation solutionssubhashchandra197
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysisPremjeet Roy
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5Kumar
 

Ähnlich wie Proof master theorem (20)

RecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.pptRecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.ppt
 
L2
L2L2
L2
 
Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrences
 
lecture 3
lecture 3lecture 3
lecture 3
 
3.pdf
3.pdf3.pdf
3.pdf
 
Time complexity
Time complexityTime complexity
Time complexity
 
Recurrences
RecurrencesRecurrences
Recurrences
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms Ii
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master
MasterMaster
Master
 
Master method
Master methodMaster method
Master method
 
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerCopy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquer
 
L2
L2L2
L2
 
lecture 4
lecture 4lecture 4
lecture 4
 
Recurrence relation solutions
Recurrence relation solutionsRecurrence relation solutions
Recurrence relation solutions
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5
 

Mehr von Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower boundsRajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsRajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower boundsRajendran
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statisticsRajendran
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree methodRajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmsRajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisRajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisRajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of QuicksortRajendran
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computabilityRajendran
 
the halting_problem
the halting_problemthe halting_problem
the halting_problemRajendran
 
mechanizing reasoning
mechanizing reasoningmechanizing reasoning
mechanizing reasoningRajendran
 
lazy evaluation
lazy evaluationlazy evaluation
lazy evaluationRajendran
 

Mehr von Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
computer languages
computer languagescomputer languages
computer languages
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computability
 
the halting_problem
the halting_problemthe halting_problem
the halting_problem
 
universality
universalityuniversality
universality
 
mechanizing reasoning
mechanizing reasoningmechanizing reasoning
mechanizing reasoning
 
lazy evaluation
lazy evaluationlazy evaluation
lazy evaluation
 
parser
parserparser
parser
 

Kürzlich hochgeladen

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Kürzlich hochgeladen (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Proof master theorem

  • 1. 1 Proof of Master Theorem • The proof for the exact powers, n=bk for k≥1. • Lemma 4.2 – for T(n) = Θ(1) if n=1 – aT(n/b)+f(n) if n=bk for k≥1 – where a ≥ 1, b>1, f(n) be a nonnegative function, – Then – T(n) = Θ(nlogba )+ aj f(n/bj ) • Proof: – By iterating the recurrence – By recursion tree (See figure 4.3) ∑ j=0 logb n-1
  • 2. 2 Recursion tree for T(n)=aT(n/b)+f(n)
  • 3. 3 Proof of Master Theorem (cont.) • Lemma 4.3: – Let a ≥ 1, b>1, f(n) be a nonnegative function defined on exact power of b, then – g(n)= aj f(n/bj ) can be bounded for exact power of b as: 1. If f(n)=O(nlogb a-ε) for some ε>0, then g(n)= O(nlogb a ). 2. If f(n)= Θ(nlogb a ), then g(n)= Θ(nlogb a lg n). 3. If f(n)= Ω(nlogb a+ε) for some ε>0 and if af(n/b) ≤cf(n) for some c<1 and all sufficiently large n ≥b, then g(n)= Θ(f(n)). ∑ j=0 logb n-1
  • 4. 4 Proof of Lemma 4.3 • For case 1: f(n)=O(nlogb a-ε) implies f(n/bj )=O((n /bj )logb a-ε), so • g(n)= aj f(n/bj ) =O( aj (n /bj )logb a-ε) • = O(nlogb a-ε aj /(blogb a-ε)j ) = O(nlogb a-ε aj /(aj (b-ε)j )) • = O(nlogb a-ε (bε)j ) = O(nlogb a-ε(((bε)logbn -1)/(bε -1) ) • = O(nlogb a-ε(((blogbn )ε -1)/(bε -1)))=O(nlogb a n-ε (nε -1)/(bε -1)) • = O(nlogb a ) ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 logb n-1
  • 5. 5 Proof of Lemma 4.3(cont.) • For case 2: f(n)= Θ(nlogb a ) implies f(n/bj )= Θ((n /bj )logb a ), so • g(n)= aj f(n/bj ) = Θ( aj (n /bj )logb a ) • = Θ(nlogb a aj /(blogb a )j ) = Θ(nlogb a 1) • = Θ(nlogb a logb n) = Θ(nlogb a lg n) ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 logb n-1
  • 6. 6 Proof of Lemma 4.3(cont.) • For case 3: – Since g(n) contains f(n), g(n) = Ω(f(n)) – Since af(n/b) ≤cf(n), aj f(n/bj ) ≤cj f(n) , why??? – g(n)= aj f(n/bj ) ≤ cj f(n) ≤ f(n) cj – =f(n)(1/(1-c)) =O(f(n)) – Thus, g(n)=Θ(f(n)) ∑ j=0 logb n-1 ∑ j=0 logb n-1 ∑ j=0 ∞
  • 7. 7 Proof of Master Theorem (cont.) • Lemma 4.4: – for T(n) = Θ(1) if n=1 – aT(n/b)+f(n) if n=bk for k≥1 – where a ≥ 1, b>1, f(n) be a nonnegative function, 1. If f(n)=O(nlogb a-ε) for some ε>0, then T(n)= Θ(nlogb a ). 2. If f(n)= Θ(nlogb a ), then T(n)= Θ(nlogb a lg n). 3. If f(n)=Ω(nlogb a+ε) for some ε>0, and if af(n/b) ≤cf(n) for some c<1 and all sufficiently large n, then T(n)= Θ(f(n)).
  • 8. 8 Proof of Lemma 4.4 (cont.) • Combine Lemma 4.2 and 4.3, – For case 1: • T(n)= Θ(nlogb a )+O(nlogb a )=Θ(nlogb a ). – For case 2: • T(n)= Θ(nlogb a )+Θ(nlogb a lg n)=Θ(nlogb a lg n). – For case 3: • T(n)= Θ(nlogb a )+Θ(f(n))=Θ(f(n)) because f(n)= Ω(nlogb a+ε).
  • 9. 9 Floors and Ceilings • T(n)=aT(n/b)+f(n) and T(n)=aT(n/b)+f(n) • Want to prove both equal to T(n)=aT(n/b)+f(n) • Two results: – Master theorem applied to all integers n. – Floors and ceilings do not change the result. • (Note: we proved this by domain transformation too). • Since n/b≤n/b, and n/b≥ n/b, upper bound for floors and lower bound for ceiling is held. • So prove upper bound for ceilings (similar for lower bound for floors).
  • 10. 10 Upper bound of proof for T(n)=aT(n/b)+f(n) • consider sequence n, n/b,  n/b/b,   n/b /b/b, … • Let us define nj as follows: • nj= n if j=0 • = nj-1/b if j>0 • The sequence will be n0, n1, …, nlogb n • Draw recursion tree:
  • 11. 11 Recursion tree of T(n)=aT(n/b)+f(n)
  • 12. 12 The proof of upper bound for ceiling – T(n) = Θ(nlogba )+ aj f(nj) – Thus similar to Lemma 4.3 and 4.4, the upper bound is proven. ∑ j=0 logb n -1
  • 13. 13 The simple format of master theorem • T(n)=aT(n/b)+cnk , with a, b, c, k are positive constants, and a≥1 and b≥2, O(nlogba ), if a>bk . • T(n) = O(nk logn), if a=bk . O(nk ), if a<bk .