SlideShare a Scribd company logo
1 of 8
1
Asymptotic Efficiency of Recurrences
• Find the asymptotic bounds of recursive
equations.
– Substitution method
• domain transformation
• Changing variable
– Recursive tree method
– Master method (master theorem)
• Provides bounds for: T(n) = aT(n/b)+f(n) where
– a ≥ 1 (the number of subproblems).
– b>1, (n/b is the size of each subproblem).
– f(n) is a given function.
2
Recurrences
• MERGE-SORT
– Contains details:
• T(n) = Θ(1) if n=1
T(n/2)+ T(n/2)+ Θ(n) if n>1
• Ignore details, T(n) = 2T(n/2)+ Θ(n).
– T(n) = Θ(1) if n=1
2T(n/2)+ Θ(n) if n>1
3
The Recursion-tree Method
• Idea:
– Each node represents the cost of a single subproblem.
– Sum up the costs with each level to get level cost.
– Sum up all the level costs to get total cost.
• Particularly suitable for divide-and-conquer
recurrence.
• Best used to generate a good guess, tolerating
“sloppiness”.
• If trying carefully to draw the recursion-tree and
compute cost, then used as direct proof.
4
Recursion Tree for T(n)=3T(n/4)+Θ(n2
)
T(n)
(a)
cn2
T(n/4) T(n/4) T(n/4)
(b)
cn2
c(n/4)2 c(n/4)2
c(n/4)2
T(n/16) T(n/16) T(n/16)T(n/16)T(n/16)T(n/16
)
T(n/16) T(n/16) T(n/16)
(c)
cn2
c(n/4)2 c(n/4)2
c(n/4)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
c(n/16)2
cn2
(3/16)cn2
(3/16)2
cn2
T(1)T(1) T(1)T(1) T(1)T(1) Θ(nlog 4
3
)
3log4n
= nlog 4
3
Total O(n2
)
log 4
n
(d)
5
Solution to T(n)=3T(n/4)+Θ(n2
)
• The height is log 4
n,
• #leaf nodes = 3log4
n
= nlog4
3
. Leaf node cost: T(1).
• Total cost T(n)=cn2
+(3/16) cn2
+(3/16)2
cn2
+
⋅⋅⋅ +(3/16)log4
n-1
cn2
+ Θ(nlog4
3
)
=(1+3/16+(3/16)2
+ ⋅⋅⋅ +(3/16)log4
n-1
) cn2
+ Θ(nlog4
3
)
<(1+3/16+(3/16)2
+ ⋅⋅⋅ +(3/16)m
+ ⋅⋅⋅)
cn2
+ Θ(nlog4
3
)
=(1/(1-3/16)) cn2
+ Θ(nlog4
3
)
=16/13cn2
+ Θ(nlog4
3
)
=O(n2
).
6
Prove the above Guess
• T(n)=3T(n/4)+Θ(n2
) =O(n2
).
• Show T(n) ≤dn2
for some d.
• T(n) ≤3(d (n/4)2
) +cn2
≤3(d (n/4)2
) +cn2
=3/16(dn2
) +cn2
≤ dn2
, as long as d≥(16/13)c.
7
One more example
• T(n)=T(n/3)+ T(2n/3)+O(n).
• Construct its recursive tree (
Figure 4.2, page 71).
• T(n)=O(cnlg3/2
n) = O(nlg n).
• Prove T(n) ≤ dnlg n.
8
Recursion Tree of T(n)=T(n/3)+ T(2n/3)+O(n)

More Related Content

What's hot

Topic Modeling - NLP
Topic Modeling - NLPTopic Modeling - NLP
Topic Modeling - NLPRupak Roy
 
K-means clustering exercise based on eucalidean distance
K-means clustering exercise based on eucalidean distanceK-means clustering exercise based on eucalidean distance
K-means clustering exercise based on eucalidean distancejonecx
 
Machine Learning lecture6(regularization)
Machine Learning lecture6(regularization)Machine Learning lecture6(regularization)
Machine Learning lecture6(regularization)cairo university
 
Multi objective optimization and Benchmark functions result
Multi objective optimization and Benchmark functions resultMulti objective optimization and Benchmark functions result
Multi objective optimization and Benchmark functions resultPiyush Agarwal
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
Bee algorithm
Bee algorithmBee algorithm
Bee algorithmkousick
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Randomized Algorithms
Randomized AlgorithmsRandomized Algorithms
Randomized AlgorithmsKetan Kamra
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsEhtisham Ali
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theoremRajendran
 
asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations iAli mahmood
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFAkunj desai
 
2-Approximation Vertex Cover
2-Approximation Vertex Cover2-Approximation Vertex Cover
2-Approximation Vertex CoverKowshik Roy
 
Prolog example explanation(Family Tree)
Prolog example explanation(Family Tree)Prolog example explanation(Family Tree)
Prolog example explanation(Family Tree)Gayan Geethanjana
 

What's hot (20)

Topic Modeling - NLP
Topic Modeling - NLPTopic Modeling - NLP
Topic Modeling - NLP
 
K-means clustering exercise based on eucalidean distance
K-means clustering exercise based on eucalidean distanceK-means clustering exercise based on eucalidean distance
K-means clustering exercise based on eucalidean distance
 
Machine Learning lecture6(regularization)
Machine Learning lecture6(regularization)Machine Learning lecture6(regularization)
Machine Learning lecture6(regularization)
 
Multi objective optimization and Benchmark functions result
Multi objective optimization and Benchmark functions resultMulti objective optimization and Benchmark functions result
Multi objective optimization and Benchmark functions result
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
Bee algorithm
Bee algorithmBee algorithm
Bee algorithm
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Np complete
Np completeNp complete
Np complete
 
Computer vision
Computer vision Computer vision
Computer vision
 
Randomized Algorithms
Randomized AlgorithmsRandomized Algorithms
Randomized Algorithms
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
 
L3 cfg
L3 cfgL3 cfg
L3 cfg
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
2-Approximation Vertex Cover
2-Approximation Vertex Cover2-Approximation Vertex Cover
2-Approximation Vertex Cover
 
Prolog example explanation(Family Tree)
Prolog example explanation(Family Tree)Prolog example explanation(Family Tree)
Prolog example explanation(Family Tree)
 
Algorithm big o
Algorithm big oAlgorithm big o
Algorithm big o
 
Swarm intelligence algorithms
Swarm intelligence algorithmsSwarm intelligence algorithms
Swarm intelligence algorithms
 
Geometric algorithms
Geometric algorithmsGeometric algorithms
Geometric algorithms
 

Viewers also liked

Presentation Creation
Presentation CreationPresentation Creation
Presentation Creationlsmartinl
 
Transnational Database for emergency calls - European Electronic Communicatio...
Transnational Database for emergency calls - European Electronic Communicatio...Transnational Database for emergency calls - European Electronic Communicatio...
Transnational Database for emergency calls - European Electronic Communicatio...Petros Kremonas
 
Advertising Media Strategy Lecture 6
Advertising Media Strategy Lecture 6Advertising Media Strategy Lecture 6
Advertising Media Strategy Lecture 6Neil Kelley
 
Wilmar International Corporate Presentation 2017
Wilmar International Corporate Presentation 2017Wilmar International Corporate Presentation 2017
Wilmar International Corporate Presentation 2017None None
 
Hypertension in pregnancy
Hypertension in pregnancyHypertension in pregnancy
Hypertension in pregnancyRashna Sharmin
 
зно реєстрація - частина 2
зно   реєстрація - частина 2зно   реєстрація - частина 2
зно реєстрація - частина 2Vera Konchich
 
Mendoza report (american literature)
Mendoza report (american literature)Mendoza report (american literature)
Mendoza report (american literature)sheluv mendoza
 
Presentación Joost
Presentación JoostPresentación Joost
Presentación JoostSol Rossi
 
Hypertension in pregnancy
Hypertension in pregnancyHypertension in pregnancy
Hypertension in pregnancyRashna Sharmin
 
wetland id hard copy
wetland id hard copywetland id hard copy
wetland id hard copyJesse Jones
 

Viewers also liked (15)

series
series series
series
 
Instituciones
InstitucionesInstituciones
Instituciones
 
Presentation Creation
Presentation CreationPresentation Creation
Presentation Creation
 
Transnational Database for emergency calls - European Electronic Communicatio...
Transnational Database for emergency calls - European Electronic Communicatio...Transnational Database for emergency calls - European Electronic Communicatio...
Transnational Database for emergency calls - European Electronic Communicatio...
 
revised bio data miles
revised bio data milesrevised bio data miles
revised bio data miles
 
Advertising Media Strategy Lecture 6
Advertising Media Strategy Lecture 6Advertising Media Strategy Lecture 6
Advertising Media Strategy Lecture 6
 
Wilmar International Corporate Presentation 2017
Wilmar International Corporate Presentation 2017Wilmar International Corporate Presentation 2017
Wilmar International Corporate Presentation 2017
 
The osi model
The osi modelThe osi model
The osi model
 
Hypertension in pregnancy
Hypertension in pregnancyHypertension in pregnancy
Hypertension in pregnancy
 
зно реєстрація - частина 2
зно   реєстрація - частина 2зно   реєстрація - частина 2
зно реєстрація - частина 2
 
Mendoza report (american literature)
Mendoza report (american literature)Mendoza report (american literature)
Mendoza report (american literature)
 
Ppt05 manajemen stres
Ppt05 manajemen stresPpt05 manajemen stres
Ppt05 manajemen stres
 
Presentación Joost
Presentación JoostPresentación Joost
Presentación Joost
 
Hypertension in pregnancy
Hypertension in pregnancyHypertension in pregnancy
Hypertension in pregnancy
 
wetland id hard copy
wetland id hard copywetland id hard copy
wetland id hard copy
 

Similar to Asymptotic Efficiency of Recurrences

Lecture 5 6_7 - divide and conquer and method of solving recurrences
Lecture 5 6_7 - divide and conquer and method of solving recurrencesLecture 5 6_7 - divide and conquer and method of solving recurrences
Lecture 5 6_7 - divide and conquer and method of solving recurrencesjayavignesh86
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Traian Rebedea
 
Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrencesMegha V
 
Recurrence relation solutions
Recurrence relation solutionsRecurrence relation solutions
Recurrence relation solutionssubhashchandra197
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
recursion tree method.pdf
recursion tree method.pdfrecursion tree method.pdf
recursion tree method.pdfMalikShazen
 
CS330-Lectures Statistics And Probability
CS330-Lectures Statistics And ProbabilityCS330-Lectures Statistics And Probability
CS330-Lectures Statistics And Probabilitybryan111472
 
Recurrences
RecurrencesRecurrences
RecurrencesDEVTYPE
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5Kumar
 
T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxGadaFarhan
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquerVikas Sharma
 
Analysis and design of algorithms part2
Analysis and design of algorithms part2Analysis and design of algorithms part2
Analysis and design of algorithms part2Deepak John
 

Similar to Asymptotic Efficiency of Recurrences (20)

Lecture 5 6_7 - divide and conquer and method of solving recurrences
Lecture 5 6_7 - divide and conquer and method of solving recurrencesLecture 5 6_7 - divide and conquer and method of solving recurrences
Lecture 5 6_7 - divide and conquer and method of solving recurrences
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3
 
Time complexity
Time complexityTime complexity
Time complexity
 
Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrences
 
Recurrence relation solutions
Recurrence relation solutionsRecurrence relation solutions
Recurrence relation solutions
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
recursion tree method.pdf
recursion tree method.pdfrecursion tree method.pdf
recursion tree method.pdf
 
CS330-Lectures Statistics And Probability
CS330-Lectures Statistics And ProbabilityCS330-Lectures Statistics And Probability
CS330-Lectures Statistics And Probability
 
Recurrences
RecurrencesRecurrences
Recurrences
 
Recurrences
RecurrencesRecurrences
Recurrences
 
2.pptx
2.pptx2.pptx
2.pptx
 
Quicksort
QuicksortQuicksort
Quicksort
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5
 
T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptx
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Daa chapter 2
Daa chapter 2Daa chapter 2
Daa chapter 2
 
algo_vc_lecture8.ppt
algo_vc_lecture8.pptalgo_vc_lecture8.ppt
algo_vc_lecture8.ppt
 
Analysis and design of algorithms part2
Analysis and design of algorithms part2Analysis and design of algorithms part2
Analysis and design of algorithms part2
 
AOA.pptx
AOA.pptxAOA.pptx
AOA.pptx
 
3.pdf
3.pdf3.pdf
3.pdf
 

More from 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
 
Master method
Master method Master method
Master method Rajendran
 
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
 
Np completeness
Np completenessNp completeness
Np completenessRajendran
 
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
 

More from 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
 
Master method
Master method Master method
Master 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
 
Np completeness
Np completenessNp completeness
Np completeness
 
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
 

Recently uploaded

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 

Recently uploaded (20)

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 

Asymptotic Efficiency of Recurrences

  • 1. 1 Asymptotic Efficiency of Recurrences • Find the asymptotic bounds of recursive equations. – Substitution method • domain transformation • Changing variable – Recursive tree method – Master method (master theorem) • Provides bounds for: T(n) = aT(n/b)+f(n) where – a ≥ 1 (the number of subproblems). – b>1, (n/b is the size of each subproblem). – f(n) is a given function.
  • 2. 2 Recurrences • MERGE-SORT – Contains details: • T(n) = Θ(1) if n=1 T(n/2)+ T(n/2)+ Θ(n) if n>1 • Ignore details, T(n) = 2T(n/2)+ Θ(n). – T(n) = Θ(1) if n=1 2T(n/2)+ Θ(n) if n>1
  • 3. 3 The Recursion-tree Method • Idea: – Each node represents the cost of a single subproblem. – Sum up the costs with each level to get level cost. – Sum up all the level costs to get total cost. • Particularly suitable for divide-and-conquer recurrence. • Best used to generate a good guess, tolerating “sloppiness”. • If trying carefully to draw the recursion-tree and compute cost, then used as direct proof.
  • 4. 4 Recursion Tree for T(n)=3T(n/4)+Θ(n2 ) T(n) (a) cn2 T(n/4) T(n/4) T(n/4) (b) cn2 c(n/4)2 c(n/4)2 c(n/4)2 T(n/16) T(n/16) T(n/16)T(n/16)T(n/16)T(n/16 ) T(n/16) T(n/16) T(n/16) (c) cn2 c(n/4)2 c(n/4)2 c(n/4)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 c(n/16)2 cn2 (3/16)cn2 (3/16)2 cn2 T(1)T(1) T(1)T(1) T(1)T(1) Θ(nlog 4 3 ) 3log4n = nlog 4 3 Total O(n2 ) log 4 n (d)
  • 5. 5 Solution to T(n)=3T(n/4)+Θ(n2 ) • The height is log 4 n, • #leaf nodes = 3log4 n = nlog4 3 . Leaf node cost: T(1). • Total cost T(n)=cn2 +(3/16) cn2 +(3/16)2 cn2 + ⋅⋅⋅ +(3/16)log4 n-1 cn2 + Θ(nlog4 3 ) =(1+3/16+(3/16)2 + ⋅⋅⋅ +(3/16)log4 n-1 ) cn2 + Θ(nlog4 3 ) <(1+3/16+(3/16)2 + ⋅⋅⋅ +(3/16)m + ⋅⋅⋅) cn2 + Θ(nlog4 3 ) =(1/(1-3/16)) cn2 + Θ(nlog4 3 ) =16/13cn2 + Θ(nlog4 3 ) =O(n2 ).
  • 6. 6 Prove the above Guess • T(n)=3T(n/4)+Θ(n2 ) =O(n2 ). • Show T(n) ≤dn2 for some d. • T(n) ≤3(d (n/4)2 ) +cn2 ≤3(d (n/4)2 ) +cn2 =3/16(dn2 ) +cn2 ≤ dn2 , as long as d≥(16/13)c.
  • 7. 7 One more example • T(n)=T(n/3)+ T(2n/3)+O(n). • Construct its recursive tree ( Figure 4.2, page 71). • T(n)=O(cnlg3/2 n) = O(nlg n). • Prove T(n) ≤ dnlg n.
  • 8. 8 Recursion Tree of T(n)=T(n/3)+ T(2n/3)+O(n)