Sub topic 5
Common logarithms, natural logarithms and base 2
Assume you know integer, negative, and fractional exponents, basic algebra, function notation, and how to use a calculator or basic Python. This chapter focuses on three logarithm bases that appear often in mathematics, science, and computing.
Three common bases
A logarithm answers the question: “What exponent produces this number?”
For a base b, the statement
log_b(x) = y
means the same as
b^y = x.
The base must be positive and different from 1. The input x must be positive.
| Logarithm | Meaning | Common use |
|---|---|---|
| `log_10(x)` | The exponent of 10 that gives `x` | Decimal measurements |
| `ln(x)` | `log_e(x)`, where `e ≈ 2.71828` | Calculus, growth, science |
| `log_2(x)` | The exponent of 2 that gives `x` | Computing and information |
The notation log(x) often means log_10(x) in school mathematics and many sciences. In higher mathematics and computer science, log(x) may mean a natural logarithm or a base-2 logarithm. Check the context before calculating.
Special values
Every valid logarithm has these values:
log_b(1) = 0, becauseb^0 = 1.log_b(b) = 1, becauseb^1 = b.
For example:
log_10(1) = 0ln(e) = 1log_2(2) = 1log_2(8) = 3, because2^3 = 8log_10(1000) = 3, because10^3 = 1000
A logarithm does not need to be a whole number. For example, log_10(50) is between 1 and 2 because 50 is between 10^1 and 10^2.
Evaluating the three bases
Scientific calculators usually provide buttons for log and ln. Many also provide log₂. Python's math module provides separate functions:
import math
print(math.log10(1000)) # 3.0
print(math.log(math.e)) # 1.0
print(math.log2(32)) # 5.0
print(round(math.log10(50), 3)) # 1.699
print(round(math.log(20), 3)) # 2.996The functions return decimal approximations when the answer is not a simple whole number.
Comparing logarithm values
The base affects the answer. For the same positive input, log_2(8) = 3, while log_10(8) is about 0.903 and ln(8) is about 2.079.
The input still determines whether the result is positive, zero, or negative:
- If
x > 1, thenlog_b(x) > 0. - If
x = 1, thenlog_b(x) = 0. - If
0 < x < 1, thenlog_b(x) < 0.
This assumes b > 1, as with bases 10, e, and 2.
Exercise
Evaluate log_2(16), log_10(0.01), and ln(1).
Show answer
log_2(16) = 4 because 2^4 = 16; log_10(0.01) = -2 because 10^-2 = 0.01; and ln(1) = 0.