taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.5-24

Exercise 1.2.5-24

proved in Lean solution written

RatingHM21
MarkersHM (needs higher mathematics), recommended
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.5 of Volume 1. Companion chapter: Permutations and factorials

The task

Prove that nn/en−1≤n!≤nn+1/en−1n^n/e^{n-1} \le n! \le n^{n+1}/e^{n-1} for each integer n≥1n \ge 1.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Look at the ratio of the bound for n+1n+1 to the bound for nn, and use induction. The ratios are (1+1n)n(1 + \frac1n)^n and (1+1n)n+1(1 + \frac1n)^{n+1}.

Hint 2

Compare these two ratios with ee by the inequality 1+x≤ex1 + x \le e^x, for one xx positive and one xx negative.

Solution

Show the solution

Let an=nn/n!a_n = n^n/n! and bn=nn+1/n!b_n = n^{n+1}/n!. The claim is an≤en−1≤bna_n \le e^{n-1} \le b_n. For n=1n = 1, a1=b1=1=e0a_1 = b_1 = 1 = e^0.

Ratios. For n≥1n \ge 1,

an+1an=(n+1)n+1(n+1) nn=(1+1n)n,bn+1bn=(n+1)n+2(n+1) nn+1=(1+1n)n+1.\frac{a_{n+1}}{a_n} = \frac{(n+1)^{n+1}}{(n+1)\,n^n} = \left(1 + \frac1n\right)^n, \qquad \frac{b_{n+1}}{b_n} = \frac{(n+1)^{n+2}}{(n+1)\,n^{n+1}} = \left(1 + \frac1n\right)^{n+1}.

Upper bound for aa. Put x=1nx = \frac1n in 1+x≤ex1 + x \le e^x. Then 1+1n≤e1/n1 + \frac1n \le e^{1/n}, so (1+1n)n≤e\left(1 + \frac1n\right)^n \le e. Thus an+1≤e ana_{n+1} \le e\,a_n, and induction from a1=1a_1 = 1 gives an≤en−1a_n \le e^{n-1}. This is nn/en−1≤n!n^n/e^{n-1} \le n!.

Lower bound for bb. Put x=−1n+1x = -\frac{1}{n+1}. Then nn+1≤e−1/(n+1)\frac{n}{n+1} \le e^{-1/(n+1)}, so e1/(n+1)≤n+1n=1+1ne^{1/(n+1)} \le \frac{n+1}{n} = 1 + \frac1n. Raise both sides to the power n+1n+1: e≤(1+1n)n+1e \le \left(1 + \frac1n\right)^{n+1}. Thus bn+1≥e bnb_{n+1} \ge e\,b_n, and induction from b1=1b_1 = 1 gives bn≥en−1b_n \ge e^{n-1}. This is n!≤nn+1/en−1n! \le n^{n+1}/e^{n-1}.

Check

For n=5n = 5: 55/e4=57.245^5/e^4 = 57.24, 5!=1205! = 120 and 56/e4=286.185^6/e^4 = 286.18, so 57.24≤120≤286.1857.24 \le 120 \le 286.18. For n=1n = 1 both bounds equal 1=1!1 = 1!. Python tests all nn from 11 to 5959 and finds no violation.

Remarks

The inequality 1+x≤ex1 + x \le e^x holds for every real xx. The two bounds differ by the factor nn. Stirling's formula in Section 1.2.11 gives the sharper value n!≈2πn (n/e)nn! \approx \sqrt{2\pi n}\,(n/e)^n.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.