The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
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]
- Page 69 and 70: References FM71 M. Fischer and A. M
- Page 71 and 72: References History of Computing, 7:
- Page 73 and 74: References N. Gibbs, W. Poole, and
- Page 75 and 76: References Hof82 Hof89 Hol75 C. M.
- Page 77 and 78: References IK75 Ita78 O. Ibarra and
- Page 79 and 80: References Kir83 D. Kirkpatrick. Ef
- Page 81 and 82: References object in 2-dimensional
- Page 83 and 84: References LT79 LT80 8:99-118, 1995
- Page 85 and 86: References Mil97 V. Milenkovic. Dou
- Page 87 and 88: References Theoretical Computer Sci
- Page 89 and 90: References Pav82 T. Pavlidis. Algor
- Page 91 and 92: References Rei72 Rei91 Rei94 E. Rei
- Page 93 and 94: References Prentice Hall, Englewood
- Page 95 and 96: References SR95 SS71 SS90 SSS74 ST8
- Page 97 and 98: References Tin90 Mikkel Thorup. On
- Page 99 and 100: References Wel84 T. Welch. A techni
- Page 101 and 102: References Algorithms Mon Jun 2 23:
- Page 103 and 104: Correctness and Efficiency Next: Co
- Page 105 and 106: Correctness NearestNeighborTSP(P) P
- Page 107 and 108: Correctness Figure: A bad example f
- Page 109 and 110: Efficiency Next: Expressing Algorit
- Page 111 and 112: Keeping Score Next: The RAM Model o
- Page 113 and 114: The RAM Model of Computation substa
- Page 115 and 116: Best, Worst, and Average-Case Compl
- Page 117 and 118: The Big Oh Notation Figure: Illustr
- Page 119: Logarithms Next: Modeling the Probl
- Page 123 and 124: Modeling the Problem Figure: Modeli
- Page 125 and 126: About the War Stories Next: War Sto
- Page 127 and 128: War Story: Psychic Modeling Next: E
- Page 129 and 130: War Story: Psychic Modeling have pu
- Page 131 and 132: War Story: Psychic Modeling Next: E
- Page 133 and 134: Exercises (b) If I prove that an al
- Page 135 and 136: Fundamental Data Types Next: Contai
- Page 137 and 138: Containers Next: Dictionaries Up: F
- Page 139 and 140: Dictionaries Next: Binary Search Tr
- Page 141 and 142: Binary Search Trees BinaryTreeQuery
- Page 143 and 144: Priority Queues Next: Specialized D
- Page 145 and 146: Specialized Data Structures Next: S
- Page 147 and 148: Sorting Next: Applications of Sorti
- Page 149 and 150: Applications of Sorting Figure: Con
- Page 151 and 152: Data Structures Next: Incremental I
- Page 153 and 154: Incremental Insertion Next: Divide
- Page 155 and 156: Randomization Next: Bucketing Techn
- Page 157 and 158: Randomization Next: Bucketing Techn
- Page 159 and 160: Bucketing Techniques Algorithms Mon
- Page 161 and 162: War Story: Stripping Triangulations
- Page 163 and 164: War Story: Stripping Triangulations
- Page 165 and 166: War Story: Mystery of the Pyramids
- Page 167 and 168: War Story: Mystery of the Pyramids
- Page 169 and 170: War Story: String 'em Up We were co
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]