SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Solve the recurrence relations below. Indicate which strategy you are using and show your work.
Big-theta or exact answer required? Big-theta. On any problem where it is appropriate to use the
Master Theorem, big-theta is sufficient (you can't get better from the theorem). But if the master
theorem doesn't apply for a certain problem you'll have to use another technique like
telescoping, or filling out a table and doing guess and check. And then you'll have an exact
answer anyway on your way to getting big-theta. So write the exact answer too as part of your
solution. a. T(1) = 1, T(N) = 2 T(N/4) + N^0.5 b. T(1) = 1, T(N) = T(N - 2) + 2, assuming N is
odd. C. T(1) = 1, T(N) = 3 T(N/2) + 2N
Solution
g(n) = g(n-1) + 2n - 1 = [g(n-2) + 2(n-1) - 1] + 2n - 1 // because g(n-1) = g(n-2) + 2(n-1) -1 // =
g(n-2) + 2(n-1) + 2n - 2 = [g(n-3) + 2(n-2) -1] + 2(n-1) + 2n - 2 // because g(n-2) = g(n-3) + 2(n-
2) -1 // = g(n-3) + 2(n-2) + 2(n-1) + 2n - 3 ... = g(n-i) + 2(n-i+1) +...+ 2n - i ... = g(n-n) + 2(n-
n+1) +...+ 2n - n = 0 + 2 + 4 +...+ 2n - n // because g(0) = 0 // = 2 + 4 +...+ 2n - n = 2*n*(n+1)/2
- n // using arithmetic progression formula 1+...+n = n(n+1)/2 // = n^2 T(m,n) = 2*T(m/2,n/2) +
m*n, m > 1, n > 1 T(m,n) = n, if m = 1 T(m,n) = m, if n = 1 We can solve this recurrence using
the iteration method as follows. Assume m <= n. Then T(m,n) = 2*T(m/2,n/2) + m*n =
2^2*T(m/2^2,n/2^2) + 2*(m*n/4) + m*n = 2^2*T(m/2^2,n/2^2) + m*n/2 + m*n =
2^3*T(m/2^3,n/2^3) + m*n/2^2 + m*n/2 + m*n ... = 2^i*T(m/2^i,n/2^i) + m*n/2^(i-1) +...+
m*n/2^2 + m*n/2 + m*n Let k = log_2 m. Then we have T(m,n) = 2^k*T(m/2^k,n/2^k) +
m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*T(m/m,n/2^k) + m*n/2^(k-1) +...+ m*n/2^2 +
m*n/2 + m*n = m*T(1,n/2^k) + m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*n/2^k +
m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*n*(2-1/2^k) = Theta(m*n)

Weitere Àhnliche Inhalte

Ähnlich wie Solve the recurrence relations below- Indicate which strategy you are.docx

8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
RishikeshJha33
 
Master theorm practive problems with solutions
Master theorm practive problems with solutionsMaster theorm practive problems with solutions
Master theorm practive problems with solutions
Kumar
 
CS330-Lectures Statistics And Probability
CS330-Lectures Statistics And ProbabilityCS330-Lectures Statistics And Probability
CS330-Lectures Statistics And Probability
bryan111472
 
RecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.pptRecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.ppt
ISHAN194169
 
Find the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdfFind the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdf
arihantelectronics
 
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
Miriam SĂĄnchez
 

Ähnlich wie Solve the recurrence relations below- Indicate which strategy you are.docx (20)

Recurrences
RecurrencesRecurrences
Recurrences
 
Contemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manualContemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manual
 
Master
MasterMaster
Master
 
Master method
Master methodMaster method
Master method
 
Daa chapter 2
Daa chapter 2Daa chapter 2
Daa chapter 2
 
Recurrences
RecurrencesRecurrences
Recurrences
 
3.pdf
3.pdf3.pdf
3.pdf
 
Recurrence relation
Recurrence relationRecurrence relation
Recurrence relation
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Computer science-formulas
Computer science-formulasComputer science-formulas
Computer science-formulas
 
8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
8.-DAA-LECTURE-8-RECURRENCES-AND-ITERATION-METHOD.pdf
 
02 Notes Divide and Conquer
02 Notes Divide and Conquer02 Notes Divide and Conquer
02 Notes Divide and Conquer
 
How to Integrate an Equation | Jameel Academy
How to Integrate an Equation | Jameel AcademyHow to Integrate an Equation | Jameel Academy
How to Integrate an Equation | Jameel Academy
 
Master theorm practive problems with solutions
Master theorm practive problems with solutionsMaster theorm practive problems with solutions
Master theorm practive problems with solutions
 
CS330-Lectures Statistics And Probability
CS330-Lectures Statistics And ProbabilityCS330-Lectures Statistics And Probability
CS330-Lectures Statistics And Probability
 
RecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.pptRecurrenceAndMasterTheorem.ppt
RecurrenceAndMasterTheorem.ppt
 
Find the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdfFind the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdf
 
Per4 induction
Per4 inductionPer4 induction
Per4 induction
 
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
162943244 solucionario-parte-4-matematicas-avanzadas-para-ingenieria-2da-edic...
 

Mehr von rennaknapp

Json File - { -student_id-- 101- -first_name-- -James--.docx
Json File -   {     -student_id-- 101-     -first_name-- -James--.docxJson File -   {     -student_id-- 101-     -first_name-- -James--.docx
Json File - { -student_id-- 101- -first_name-- -James--.docx
rennaknapp
 
John plans to add a new operation Peek to the stackADT- This new opera.docx
John plans to add a new operation Peek to the stackADT- This new opera.docxJohn plans to add a new operation Peek to the stackADT- This new opera.docx
John plans to add a new operation Peek to the stackADT- This new opera.docx
rennaknapp
 

Mehr von rennaknapp (20)

Language is C++ I'm having trouble making my code meet these requireme.docx
Language is C++ I'm having trouble making my code meet these requireme.docxLanguage is C++ I'm having trouble making my code meet these requireme.docx
Language is C++ I'm having trouble making my code meet these requireme.docx
 
Land use changes and changing climatic conditions caused by human acti.docx
Land use changes and changing climatic conditions caused by human acti.docxLand use changes and changing climatic conditions caused by human acti.docx
Land use changes and changing climatic conditions caused by human acti.docx
 
Kimberly had to come up With a whictue data collection and analysis pr.docx
Kimberly had to come up With a whictue data collection and analysis pr.docxKimberly had to come up With a whictue data collection and analysis pr.docx
Kimberly had to come up With a whictue data collection and analysis pr.docx
 
Korb et al- (2000) obtained blood samples extracted fom patients infec.docx
Korb et al- (2000) obtained blood samples extracted fom patients infec.docxKorb et al- (2000) obtained blood samples extracted fom patients infec.docx
Korb et al- (2000) obtained blood samples extracted fom patients infec.docx
 
keep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docxkeep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docx
 
l Question 4 1 pts Gatekeeper tumor suppressor genes--- Encode prote.docx
l   Question 4 1 pts Gatekeeper tumor suppressor genes--- Encode prote.docxl   Question 4 1 pts Gatekeeper tumor suppressor genes--- Encode prote.docx
l Question 4 1 pts Gatekeeper tumor suppressor genes--- Encode prote.docx
 
L0-4 During 2022- Jenny- age 14- lives in a household with her father-.docx
L0-4 During 2022- Jenny- age 14- lives in a household with her father-.docxL0-4 During 2022- Jenny- age 14- lives in a household with her father-.docx
L0-4 During 2022- Jenny- age 14- lives in a household with her father-.docx
 
L0-7 In 2022- Jack- age 12 - has interest income of $4-900 on funds he.docx
L0-7 In 2022- Jack- age 12 - has interest income of $4-900 on funds he.docxL0-7 In 2022- Jack- age 12 - has interest income of $4-900 on funds he.docx
L0-7 In 2022- Jack- age 12 - has interest income of $4-900 on funds he.docx
 
Kyle is a student with an emotional behavioral disorder- He has also b.docx
Kyle is a student with an emotional behavioral disorder- He has also b.docxKyle is a student with an emotional behavioral disorder- He has also b.docx
Kyle is a student with an emotional behavioral disorder- He has also b.docx
 
Json File - { -student_id-- 101- -first_name-- -James--.docx
Json File -   {     -student_id-- 101-     -first_name-- -James--.docxJson File -   {     -student_id-- 101-     -first_name-- -James--.docx
Json File - { -student_id-- 101- -first_name-- -James--.docx
 
Make a concept map that shows the hierarchical relationship between th.docx
Make a concept map that shows the hierarchical relationship between th.docxMake a concept map that shows the hierarchical relationship between th.docx
Make a concept map that shows the hierarchical relationship between th.docx
 
Jordan and Alyssa are saving for their daughter Taylor's college educa.docx
Jordan and Alyssa are saving for their daughter Taylor's college educa.docxJordan and Alyssa are saving for their daughter Taylor's college educa.docx
Jordan and Alyssa are saving for their daughter Taylor's college educa.docx
 
John receives $3-400 from an investment at the beginning of every half.docx
John receives $3-400 from an investment at the beginning of every half.docxJohn receives $3-400 from an investment at the beginning of every half.docx
John receives $3-400 from an investment at the beginning of every half.docx
 
Many documents use a specific format for a person's name- Write a prog.docx
Many documents use a specific format for a person's name- Write a prog.docxMany documents use a specific format for a person's name- Write a prog.docx
Many documents use a specific format for a person's name- Write a prog.docx
 
Many crimes- like embezzlement- have definite trends- The demographic.docx
Many crimes- like embezzlement- have definite trends- The demographic.docxMany crimes- like embezzlement- have definite trends- The demographic.docx
Many crimes- like embezzlement- have definite trends- The demographic.docx
 
Management The consequences of unresolved conflict often have devastat.docx
Management The consequences of unresolved conflict often have devastat.docxManagement The consequences of unresolved conflict often have devastat.docx
Management The consequences of unresolved conflict often have devastat.docx
 
Make a star field as in Star Trek (the original series)- like MS's.docx
Make a star field as in Star Trek (the original series)- like  MS's.docxMake a star field as in Star Trek (the original series)- like  MS's.docx
Make a star field as in Star Trek (the original series)- like MS's.docx
 
MAKE a CONCEPT MAP illustrating how glycolysis- the Krebs-Citric acid.docx
MAKE a CONCEPT MAP illustrating how glycolysis- the Krebs-Citric acid.docxMAKE a CONCEPT MAP illustrating how glycolysis- the Krebs-Citric acid.docx
MAKE a CONCEPT MAP illustrating how glycolysis- the Krebs-Citric acid.docx
 
John plans to add a new operation Peek to the stackADT- This new opera.docx
John plans to add a new operation Peek to the stackADT- This new opera.docxJohn plans to add a new operation Peek to the stackADT- This new opera.docx
John plans to add a new operation Peek to the stackADT- This new opera.docx
 
John is a part of a team that has been gathered temporarily to develop.docx
John is a part of a team that has been gathered temporarily to develop.docxJohn is a part of a team that has been gathered temporarily to develop.docx
John is a part of a team that has been gathered temporarily to develop.docx
 

KĂŒrzlich hochgeladen

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

KĂŒrzlich hochgeladen (20)

ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
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
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Solve the recurrence relations below- Indicate which strategy you are.docx

  • 1. Solve the recurrence relations below. Indicate which strategy you are using and show your work. Big-theta or exact answer required? Big-theta. On any problem where it is appropriate to use the Master Theorem, big-theta is sufficient (you can't get better from the theorem). But if the master theorem doesn't apply for a certain problem you'll have to use another technique like telescoping, or filling out a table and doing guess and check. And then you'll have an exact answer anyway on your way to getting big-theta. So write the exact answer too as part of your solution. a. T(1) = 1, T(N) = 2 T(N/4) + N^0.5 b. T(1) = 1, T(N) = T(N - 2) + 2, assuming N is odd. C. T(1) = 1, T(N) = 3 T(N/2) + 2N Solution g(n) = g(n-1) + 2n - 1 = [g(n-2) + 2(n-1) - 1] + 2n - 1 // because g(n-1) = g(n-2) + 2(n-1) -1 // = g(n-2) + 2(n-1) + 2n - 2 = [g(n-3) + 2(n-2) -1] + 2(n-1) + 2n - 2 // because g(n-2) = g(n-3) + 2(n- 2) -1 // = g(n-3) + 2(n-2) + 2(n-1) + 2n - 3 ... = g(n-i) + 2(n-i+1) +...+ 2n - i ... = g(n-n) + 2(n- n+1) +...+ 2n - n = 0 + 2 + 4 +...+ 2n - n // because g(0) = 0 // = 2 + 4 +...+ 2n - n = 2*n*(n+1)/2 - n // using arithmetic progression formula 1+...+n = n(n+1)/2 // = n^2 T(m,n) = 2*T(m/2,n/2) + m*n, m > 1, n > 1 T(m,n) = n, if m = 1 T(m,n) = m, if n = 1 We can solve this recurrence using the iteration method as follows. Assume m <= n. Then T(m,n) = 2*T(m/2,n/2) + m*n = 2^2*T(m/2^2,n/2^2) + 2*(m*n/4) + m*n = 2^2*T(m/2^2,n/2^2) + m*n/2 + m*n = 2^3*T(m/2^3,n/2^3) + m*n/2^2 + m*n/2 + m*n ... = 2^i*T(m/2^i,n/2^i) + m*n/2^(i-1) +...+ m*n/2^2 + m*n/2 + m*n Let k = log_2 m. Then we have T(m,n) = 2^k*T(m/2^k,n/2^k) + m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*T(m/m,n/2^k) + m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*T(1,n/2^k) + m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*n/2^k + m*n/2^(k-1) +...+ m*n/2^2 + m*n/2 + m*n = m*n*(2-1/2^k) = Theta(m*n)