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-20

Exercise 1.2.5-20

proved in Lean solution written

RatingHM21
MarkersHM (needs higher mathematics)
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

Use the bound 0≤e−t−(1−t/m)m≤t2e−t/m0 \le e^{-t} - (1 - t/m)^m \le t^2e^{-t}/m for 0≤t≤m0 \le t \le m and exercise 19 to show that Γ(x)=∫0∞e−ttx−1 dt\Gamma(x) = \int_0^\infty e^{-t} t^{x-1}\,dt for x>0x > 0.

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

By exercise 19, Γm(x)\Gamma_m(x) is an integral over [0,m][0, m] of (1−t/m)mtx−1(1 - t/m)^m t^{x-1}. Compare it with the integral of e−ttx−1e^{-t}t^{x-1} over the same range.

Hint 2

Bound the difference of the two integrals by 1m∫0mtx+1e−t dt\frac{1}{m}\int_0^m t^{x+1}e^{-t}\,dt. A short proof of the bound on the integrand makes the argument complete.

Hint 3

Then let m→∞m \to \infty. Use that ∫0∞tx+1e−t dt\int_0^\infty t^{x+1}e^{-t}\,dt is finite.

Solution

Show the solution

Step 1: the bound. For 0≤t≤m0 \le t \le m the claim is

0≤e−t−(1−tm)m≤t2e−tm.0 \le e^{-t} - \left(1 - \frac{t}{m}\right)^m \le \frac{t^2 e^{-t}}{m}.

Put s=t/m∈[0,1]s = t/m \in [0, 1]. Since 1−s≤e−s1 - s \le e^{-s} and 1−s≥01 - s \ge 0, this gives (1−s)m≤e−ms=e−t(1-s)^m \le e^{-ms} = e^{-t}, which is the left inequality. For the right one, write a=(1−s)es∈[0,1]a = (1-s)e^s \in [0, 1], so that (1−s)m=e−tam(1-s)^m = e^{-t}a^m and

e−t−(1−s)m=e−t(1−am)≤e−t m (1−a),e^{-t} - (1-s)^m = e^{-t}(1 - a^m) \le e^{-t}\,m\,(1 - a),

because 1−am=(1−a)(1+a+⋯+am−1)≤m(1−a)1 - a^m = (1-a)(1 + a + \cdots + a^{m-1}) \le m(1-a). Expand (1−s)es=∑ksk(1k!−1(k−1)!)(1-s)e^s = \sum_k s^k\left(\frac{1}{k!} - \frac{1}{(k-1)!}\right) with the convention that the second term is 00 for k=0k = 0. This gives

1−a=∑k≥2(k−1) skk!≤s2∑k≥2k−1k!=s2,1 - a = \sum_{k \ge 2} \frac{(k-1)\,s^k}{k!} \le s^2 \sum_{k \ge 2}\frac{k-1}{k!} = s^2,

since sk≤s2s^k \le s^2 for s≤1s \le 1, and ∑k≥2k−1k!=(e−1)−(e−2)=1\sum_{k \ge 2}\frac{k-1}{k!} = (e - 1) - (e - 2) = 1. So e−t−(1−s)m≤e−t m s2=e−t t2/me^{-t} - (1-s)^m \le e^{-t}\,m\,s^2 = e^{-t}\,t^2/m.

Step 2: the integrals. Let G(x)=∫0∞e−ttx−1 dtG(x) = \int_0^\infty e^{-t}t^{x-1}\,dt. This integral converges for x>0x > 0, since tx−1t^{x-1} is integrable near 00 and e−ttx−1e^{-t}t^{x-1} decays faster than each power of tt at infinity. By exercise 19 and Step 1,

0≤∫0me−ttx−1 dt−Γm(x)≤1m∫0mtx+1e−t dt≤G(x+2)m.0 \le \int_0^m e^{-t}t^{x-1}\,dt - \Gamma_m(x) \le \frac{1}{m}\int_0^m t^{x+1}e^{-t}\,dt \le \frac{G(x+2)}{m}.

Also ∫0me−ttx−1 dt→G(x)\int_0^m e^{-t}t^{x-1}\,dt \to G(x) as m→∞m \to \infty. So ∣Γm(x)−G(x)∣≤G(x+2)m+∫m∞e−ttx−1 dt→0|\Gamma_m(x) - G(x)| \le \frac{G(x+2)}{m} + \int_m^\infty e^{-t}t^{x-1}\,dt \to 0. By eq. (15), Γm(x)→Γ(x)\Gamma_m(x) \to \Gamma(x). So Γ(x)=G(x)\Gamma(x) = G(x).

Check

Take x=52x = \frac52, so Γ(x)=1.3293403…\Gamma(x) = 1.3293403\ldots. Python gives Γm(x)=0.8918\Gamma_m(x) = 0.8918, 1.27301.2730 and 1.32351.3235 for m=10m = 10, 100100 and 10001000. The gaps 0.440.44, 0.0560.056 and 0.00580.0058 lie below the bound Γ(x+2)/m=1.16\Gamma(x+2)/m = 1.16, 0.1160.116 and 0.01160.0116. Python tests the inequality of Step 1 on a grid of 401401 points for m=1,2,5,20m = 1, 2, 5, 20, and finds no violation.

Remarks

The error of Γm(x)\Gamma_m(x) is of order 1/m1/m. For x=1x = 1, Γm(1)=m/(m+1)\Gamma_m(1) = m/(m+1), so the order 1/m1/m is the true size.

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.