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.11.2-8

Exercise 1.2.11.2-8

not stated yet in Lean solution written

RatingM23
MarkersM (mathematical)
KindK4, find an estimate: give an asymptotic form or a bound from the written solution
SectionSection 1.2.11.2 of Volume 1. Companion chapter: Euler's summation formula

The task

Find the asymptotic value of ln⁡((an2+bn)!)\ln\bigl((an^2+bn)!\bigr) with an absolute error of O(n−2)O(n^{-2}).

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

Use Stirling's formula (18) with N=an2+bnN=an^2+bn, and expand ln⁡N\ln N in powers of 1/n1/n.

Hint 2

Collect the terms by their power of nn. The terms in nn cancel.

Solution

Show the solution

Here a>0a>0 and bb is real, and N!N! means Γ(N+1)\Gamma(N+1) when NN is not an integer. By (18), ln⁡N!=(N+12)ln⁡N−N+σ+112N+O(N−3)\ln N!=(N+\frac12)\ln N-N+\sigma+\frac1{12N}+O(N^{-3}) with σ=ln⁡2π\sigma=\ln\sqrt{2\pi}. Write ln⁡N=2ln⁡n+ln⁡a+ln⁡(1+ban)\ln N=2\ln n+\ln a+\ln\bigl(1+\frac b{an}\bigr), and ln⁡(1+u)=u−u22+u33−u44+⋯\ln(1+u)=u-\frac{u^2}2+\frac{u^3}3-\frac{u^4}4+\cdots with u=banu=\frac b{an}.

Multiply N+12=an2+bn+12N+\frac12=an^2+bn+\frac12 by the series of ln⁡(1+u)\ln(1+u):

an2⋅(⋯ )=bn−b22a+b33a2n−b44a3n2,bn⋅(⋯ )=b2a−b32a2n+b43a3n2,12(⋯ )=b2an−b24a2n2.an^2\cdot(\cdots)=bn-\frac{b^2}{2a}+\frac{b^3}{3a^2n}-\frac{b^4}{4a^3n^2},\quad bn\cdot(\cdots)=\frac{b^2}a-\frac{b^3}{2a^2n}+\frac{b^4}{3a^3n^2},\quad\tfrac12(\cdots)=\frac b{2an}-\frac{b^2}{4a^2n^2}.

The sum is bn+b22a+1n(b2a−b36a2)+1n2(b412a3−b24a2)+O(n−3)bn+\frac{b^2}{2a}+\frac1n\Bigl(\frac b{2a}-\frac{b^3}{6a^2}\Bigr)+\frac1{n^2}\Bigl(\frac{b^4}{12a^3}-\frac{b^2}{4a^2}\Bigr)+O(n^{-3}). Add (an2+bn+12)(2ln⁡n+ln⁡a)(an^2+bn+\frac12)(2\ln n+\ln a) and subtract NN. The term bnbn cancels with −bn-bn, and 112N=112an2+O(n−3)\frac1{12N}=\frac1{12an^2}+O(n^{-3}). The result is

ln⁡((an2+bn)!)=2an2ln⁡n+an2(ln⁡a−1)+2bnln⁡n+bnln⁡a+ln⁡n+12ln⁡a+b22a+σ+3ab−b36a2n+O(n−2).\ln\bigl((an^2+bn)!\bigr)=2an^2\ln n+an^2(\ln a-1)+2bn\ln n+bn\ln a+\ln n+\tfrac12\ln a+\frac{b^2}{2a}+\sigma+\frac{3ab-b^3}{6a^2n}+O(n^{-2}).

The term of order n−2n^{-2} is 1n2(b412a3−b24a2+112a)\frac1{n^2}\bigl(\frac{b^4}{12a^3}-\frac{b^2}{4a^2}+\frac1{12a}\bigr).

Check

For a=3a=3, b=2b=2 and n=100n=100 the error of the formula without the n−2n^{-2} term is −3.384×10−6-3.384\times10^{-6}, which equals −0.03384/n2-0.03384/n^2. The n−2n^{-2} coefficient is 16324−436+136=−0.03395\frac{16}{324}-\frac4{36}+\frac1{36}=-0.03395. With it, the error is 1.1×10−81.1\times10^{-8} at n=100n=100 and 8.9×10−118.9\times10^{-11} at n=500n=500. Here ln⁡Γ\ln\Gamma of Python (mpmath) is the exact value.

Remarks

Such formulas help to compare quotients of factorials of nearly equal size, where the large terms cancel and the terms in 1/n1/n decide the result.

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

In Lean

not stated yet The exercise is not stated in Lean yet.

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

Something is wrong? Report it.