What a logarithm is
A logarithm answers the question “to what power must I raise the base to get this number?”. Since 2³ = 8, the base-2 logarithm of 8 is 3: log₂(8) = 3. Logarithms turn multiplication into addition and powers into multiplication, which is why they appear in sound levels, earthquake magnitudes, pH, compound interest and algorithm analysis.
The common logarithms
- Natural log ln(x): base e ≈ 2.71828, used in growth, decay and calculus.
- Common log log₁₀(x): base 10, used for orders of magnitude, decibels and pH.
- Binary log log₂(x): base 2, used in computing and information theory.
Any base can be computed with the change of base formula: log_b(x) = ln(x) ÷ ln(b).
Worked example: x = 8, base 2
- log₂(8) = 3, because 2³ = 8.
- ln(8) = 2.079442.
- log₁₀(8) = 0.903090.
- Check with the change of base: 2.079442 ÷ ln(2) = 2.079442 ÷ 0.693147 = 3.
- The inverse operations: 2⁸ = 256, e⁸ ≈ 2,980.96, 10⁸ = 100,000,000.
Logarithm rules
- log(a × b) = log(a) + log(b)
- log(a ÷ b) = log(a) − log(b)
- log(aⁿ) = n × log(a)
- log_b(1) = 0 and log_b(b) = 1
- The logarithm is defined only for positive numbers, and the base must be positive and different from 1.
Logs of powers of two
| x | log₂ x | ln x | log₁₀ x |
|---|---|---|---|
| 0.5 | −1 | −0.693 | −0.301 |
| 1 | 0 | 0 | 0 |
| 2 | 1 | 0.693 | 0.301 |
| 4 | 2 | 1.386 | 0.602 |
| 16 | 4 | 2.773 | 1.204 |
| 32 | 5 | 3.466 | 1.505 |
Practical uses
- Solving for time: money growing at 5% a year doubles after ln(2) ÷ ln(1.05) = 14.2 years.
- Decibels: a sound 100 times more intense is 10 × log₁₀(100) = 20 dB louder.
- pH: pH = −log₁₀ of the hydrogen ion concentration; each unit is a factor of 10.
- Computing: a binary search through 1,000,000 sorted items needs about log₂(1,000,000) ≈ 20 steps.
- Antilog: the antilogarithm is just the power: if log₁₀(x) = 2.5, then x = 10^2.5 ≈ 316.2.