Home › Logarithms › Lesson 4

Inequalities, Growth Rates and Stirling's Estimate

Lesson 4 of 13

Key idea of this section

ln x = o(xᵋ) as x → ∞ for every ε > 0;   ln x = o(x−ε) as x → 0⁺
ln n! = n ln n − n + ½ ln(2πn) + O(1/n)

The logarithm grows slower than any power

Theorem 4.1. For every ε > 0 and x > 1, 0 < ln x < xᵋ/ε. Consequently ln x / xᵋ → 0 as x → ∞, and xᵋ ln x → 0 as x → 0⁺.

Proof. Apply ln y ≤ y − 1 < y with y = xᵋ: ε ln x = ln(xᵋ) < xᵋ. For the second limit put x = 1/y: xᵋ ln x = −ln y / yᵋ → 0 as y → ∞. ∎

Equivalently, eˣ grows faster than any polynomial: xᵏ/eˣ → 0 for every k. In complexity theory this gives the familiar hierarchy 1 ≺ log log n ≺ log n ≺ nᵋ ≺ n ≺ n log n ≺ n² ≺ 2ⁿ, where f ≺ g means f = o(g).

Concavity and the AM–GM inequality

Because ln is strictly concave, Jensen's inequality gives, for positive x₁, …, xₙ and weights wᵢ ≥ 0 with ∑ wᵢ = 1,

∑ wᵢ ln xᵢ ≤ ln(∑ wᵢ xᵢ),

with equality if and only if all xᵢ with wᵢ > 0 coincide. Exponentiating gives the weighted AM–GM inequality ∏ xᵢwᵢ ≤ ∑ wᵢ xᵢ. Here is a self-contained proof using only Proposition 1.6. Let A = ∑ wᵢxᵢ. Then ln(xᵢ/A) ≤ xᵢ/A − 1, and multiplying by wᵢ and summing gives ∑ wᵢ ln(xᵢ/A) ≤ A/A − 1 = 0, which is the claim. Equality forces xᵢ/A = 1 whenever wᵢ > 0.

The same technique proves Young's inequality ab ≤ aᵖ/p + bq/q for conjugate exponents 1/p + 1/q = 1, and from it Hölder's inequality. In each case the logarithm converts a product inequality into a statement about a concave function.

Logarithmic mean

For distinct positive a, b, the logarithmic mean is L(a, b) = (a − b)/(ln a − ln b). It satisfies

√(ab) < L(a, b) < (a + b)/2.

Proof. Assume a > b and put s = a/b > 1. The left inequality √(ab) < (a − b)/ln(a/b) is equivalent to ln s < (s − 1)/√s, that is, with t = √s > 1, to 2 ln t < t − 1/t. Both sides vanish at t = 1, and the derivative of (t − 1/t) − 2 ln t is 1 + 1/t² − 2/t = (1 − 1/t)² > 0. The right inequality is equivalent to ln s > 2(s − 1)/(s + 1). Both sides vanish at s = 1, and the derivative of the difference is 1/s − 4/(s + 1)² = (s − 1)²/(s(s + 1)²) > 0. ∎

The logarithmic mean appears in heat-exchanger design (the log-mean temperature difference) and is the value of ∫₀¹ aᵗ b¹⁻ᵗ dt.

Comparing sums with integrals

For a monotone function f on [1, n], the sum ∑ f(k) is squeezed between integrals. Applied to f = ln, which is increasing,

∫₁ⁿ ln t dt ≤ ∑ₖ₌₂ⁿ ln k ≤ ∫₁ⁿ⁺¹ ln t dt.

Since ∫ ln t dt = t ln t − t, this gives n ln n − n + 1 ≤ ln n! ≤ (n + 1) ln(n + 1) − n. Hence ln n! = n ln n − n + O(ln n), and in particular ln n! ~ n ln n. Dividing by ln 2, log₂ n! ~ n log₂ n. This is the information-theoretic lower bound for comparison sorting: a decision tree that distinguishes n! orderings has depth at least ⌈log₂ n!⌉.

Stirling's formula

Theorem 4.2 (de Moivre, Stirling, 1730). ln n! = n ln n − n + ½ ln(2πn) + εₙ, where 0 < εₙ < 1/(12n).

Proof of the first part (the constant is postponed). Let dₙ = ln n! − (n + ½) ln n + n. Then

dₙ − dₙ₊₁ = (n + ½) ln((n + 1)/n) − 1.

Put x = 1/(2n + 1), so that (n + 1)/n = (1 + x)/(1 − x) and n + ½ = 1/(2x). Using the series of Lesson 5, ln((1 + x)/(1 − x)) = 2(x + x³/3 + x⁵/5 + …), so

dₙ − dₙ₊₁ = x²/3 + x⁴/5 + x⁶/7 + … .

This is positive, so dₙ is decreasing, and it is at most (x²/3)(1 + x² + x⁴ + …) = x²/(3(1 − x²)) = 1/(12n(n + 1)) = 1/(12n) − 1/(12(n + 1)). Hence dₙ − 1/(12n) is increasing. So dₙ converges to a limit C with C < dₙ < C + 1/(12n). The value C = ½ ln(2π) follows from Wallis' product π/2 = ∏ (2k)²/((2k − 1)(2k + 1)): writing the partial products in terms of factorials and substituting n! ≈ eC nn+1/2 e⁻ⁿ gives e2C = 2π. ∎

For n = 10, ln 10! = ln 3628800 = 15.104413, while 10 ln 10 − 10 = 13.025851 and adding ½ ln(20π) = 2.070231 gives 15.096082. The remaining error 0.008331 is just under 1/120 = 0.008333, as the theorem predicts.

Exercise

  • (a)
    Show that ln(1 + x) ≥ x/(1 + x) for x > −1, and deduce that ∑ₖ₌₁ⁿ 1/k ≥ ln(n + 1).
  • (b)
    Determine limx→0⁺ xˣ and limx→∞ x1/x.
  • (c)
    Use Stirling's formula to show that the central binomial coefficient satisfies ln C(2n, n) = 2n ln 2 − ½ ln(πn) + O(1/n).
Show solution

Answers: (a) Proposition 1.6 with x replaced by 1 + x gives ln(1 + x) ≥ 1 − 1/(1 + x) = x/(1 + x). For the sum, ln(1 + 1/k) ≤ 1/k by the upper bound, so ∑ₖ₌₁ⁿ 1/k ≥ ∑ ln((k + 1)/k) = ln(n + 1). (b) xˣ = exp(x ln x) → e⁰ = 1 by Theorem 4.1, and x1/x = exp(ln x / x) → 1. (c) ln C(2n, n) = ln (2n)! − 2 ln n!. Stirling gives 2n ln 2n − 2n + ½ ln(4πn) − 2(n ln n − n + ½ ln(2πn)) + O(1/n) = 2n ln 2 + ½ ln(4πn) − ln(2πn) + O(1/n) = 2n ln 2 − ½ ln(πn) + O(1/n).

V.3.1