Glossary Math & Statistics

Logarithm

A logarithm answers "what power do I raise the base to in order to get this number?": log_b(x) = y means b^y = x.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

log₁₀ 1000 = 3 and log₂ 8 = 3. The common bases are 10 (written log or lg), e ≈ 2.718 (the natural log, ln) and 2 (computing). Any base can be reached from another: log_b x = ln x / ln b. Logarithms turn multiplication into addition, log(x × y) = log x + log y, and powers into multiplication, log(xⁿ) = n × log x, which is why they measure sound (decibels), earthquakes and acidity (pH): each step is a fixed multiple.

Why it matters

Logs answer "how long" and "how many" questions about growth: doubling times, the number of bits needed to count something, the number of halvings in a binary search. Software disagrees on what log means: in Python, JavaScript and C, log is the natural log, while on most calculators and in Excel's LOG it is base 10. Floating point also shows through: Python's math.log(1000, 10) returns 2.9999999999999996, while math.log10(1000) returns exactly 3.0.

Example

log₂ 1,000,000 = 19.93     → 20 bits are needed to number a million items
ln 2 / ln 1.07 = 10.24     → years for money to double at 7% a year
10 × log₁₀ 2   = 3.01 dB   → doubling the power adds about 3 dB

The rule of 72 approximates the doubling time as 72 / 7 = 10.29 years.

Common confusion

A logarithm is the inverse of an Exponent: if 10³ = 1000, then log₁₀ 1000 = 3.

AdSense Placeholder
Slot: footer_leaderboard