Editing Asymptotic analysis

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 289: Line 289:
 
We would like to have some way to tackle the general case, without so much messy mathematical reasoning in each individual case. By ''general case'', we mean that we assume that to solve an instance of size <math>n</math> using some algorithm, we divide it into chunks of size about <math>\frac{n}{b}</math>, and solve <math>a</math> subproblems using those chunks, along with extra work in the amount of <math>f(n)</math>, unless <math>n < c</math> for some constant <math>c</math>, which represents a base case that can be solved in <math>O(1)</math> time. For example, in the first of the three examples above, we have <math>a = 2, b = 2, f(n) = n</math>; in the second, <math>a = 3, b = 2, f(n) = n</math>, and in the third, <math>a = 2, b = 2, f(n) = n \log n</math>.
 
We would like to have some way to tackle the general case, without so much messy mathematical reasoning in each individual case. By ''general case'', we mean that we assume that to solve an instance of size <math>n</math> using some algorithm, we divide it into chunks of size about <math>\frac{n}{b}</math>, and solve <math>a</math> subproblems using those chunks, along with extra work in the amount of <math>f(n)</math>, unless <math>n < c</math> for some constant <math>c</math>, which represents a base case that can be solved in <math>O(1)</math> time. For example, in the first of the three examples above, we have <math>a = 2, b = 2, f(n) = n</math>; in the second, <math>a = 3, b = 2, f(n) = n</math>, and in the third, <math>a = 2, b = 2, f(n) = n \log n</math>.
  
====The master theorem====
+
===The master theorem===
 
The authoritative statement of the '''master theorem''' is from CLRS<ref name="CLRS">Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. ''Introduction to Algorithms'', Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Sections 4.3 (The master method) and 4.4 (Proof of the master theorem), pp. 73–90.</ref>. Suppose that <math>a \geq 1</math> and <math>b > 1</math> above, and <math>f</math> is positive. Then, there are three cases:
 
The authoritative statement of the '''master theorem''' is from CLRS<ref name="CLRS">Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. ''Introduction to Algorithms'', Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Sections 4.3 (The master method) and 4.4 (Proof of the master theorem), pp. 73–90.</ref>. Suppose that <math>a \geq 1</math> and <math>b > 1</math> above, and <math>f</math> is positive. Then, there are three cases:
 
# If <math>f(n) \in O(n^{\log_b a - \epsilon})</math> for some <math>\epsilon > 0</math>, then the overall running time is <math>\Theta(n^{\log_b a})</math>.
 
# If <math>f(n) \in O(n^{\log_b a - \epsilon})</math> for some <math>\epsilon > 0</math>, then the overall running time is <math>\Theta(n^{\log_b a})</math>.
Line 303: Line 303:
 
An actual proof of the master theorem is given in CLRS.
 
An actual proof of the master theorem is given in CLRS.
  
====Akra&ndash;Bazzi theorem====
+
===Akra&ndash;Bazzi theorem===
 
TODO
 
TODO
  

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)