The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Logarithms Figure: The Federal Sentencing Guidelines for Fraud Figure gives the actual point function for fraud, a table mapping dollars stolen to points. Notice that the punishment increases by one level each time the amount of money stolen roughly doubles. That means that the level of punishment (which maps roughly linearly to the amount of time served) grows logarithmically with the amount of money stolen. Think for a moment about the consequences of this. Michael Milken sure did. It means that the total sentence grows extremely slowly with the amount of money you steal. Knocking off five liquor stores for $10,000 each will get you far more time than embezzling $100,000 once. The corresponding benefit of stealing really large amounts of money is even greater. The moral of logarithmic growth is clear: ``If you are gonna do the crime, make it worth the time!'' Two mathematical properties of logarithms are important to understand: ● The base of the logarithm has relatively little impact on the growth rate: Compare the following three values: , , and . A big change in the base of the logarithm produces relatively little difference in the value of the log. This is a consequence of the formula for changing the base of the logarithm: Changing the base of the log from a to c involves multiplying or dividing by . This will be lost to the big Oh notation whenever a and c are constants, as is typical. Thus we are usually file:///E|/BOOK/BOOK/NODE16.HTM (2 of 3) [19/1/2003 1:28:14]

Logarithms justified in ignoring the base of the logarithm when analyzing algorithms. When performing binary search in a telephone book, how important is it that each query split the book exactly in half? Not much. Suppose we did such a sloppy job of picking our queries such that each time we split the book 1/3 to 2/3 instead of 1/2 to 1/2. For the Manhattan telephone book, we now use queries in the worst case, not a significant change from . The power of binary search comes from its logarithmic complexity, not the base of the log. ● Logarithms cut any function down to size: The growth rate of the logarithm of any polynomial function is . This follows because The power of binary search on a wide range of problems is a consequence of this observation. For example, note that doing a binary search on a sorted array of things requires only twice as many comparisons as a binary search on n things. Logarithms efficiently cut any function down to size. Next: Modeling the Problem Up: Introduction to Algorithms Previous: Growth Rates Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK/NODE16.HTM (3 of 3) [19/1/2003 1:28:14]

Logarithms<br />

Figure: <strong>The</strong> Federal Sentencing Guidelines for Fraud<br />

Figure gives the actual point function for fraud, a table mapping dollars stolen to points. Notice that<br />

the punishment increases by one level each time the amount of money stolen roughly doubles. That<br />

means that the level of punishment (which maps roughly linearly to the amount of time served) grows<br />

logarithmically with the amount of money stolen. Think for a moment about the consequences of this.<br />

Michael Milken sure did. It means that the total sentence grows extremely slowly with the amount of<br />

money you steal. Knocking off five liquor stores for $10,000 each will get you far more time than<br />

embezzling $100,000 once. <strong>The</strong> corresponding benefit of stealing really large amounts of money is even<br />

greater. <strong>The</strong> moral of logarithmic growth is clear: ``If you are gonna do the crime, make it worth the<br />

time!''<br />

Two mathematical properties of logarithms are important to understand:<br />

● <strong>The</strong> base of the logarithm has relatively little impact on the growth rate: Compare the following<br />

three values: , , and . A<br />

big change in the base of the logarithm produces relatively little difference in the value of the log.<br />

This is a consequence of the formula for changing the base of the logarithm:<br />

Changing the base of the log from a to c involves multiplying or dividing by . This will be<br />

lost to the big Oh notation whenever a and c are constants, as is typical. Thus we are usually<br />

file:///E|/BOOK/BOOK/NODE16.HTM (2 of 3) [19/1/2003 1:28:14]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!