The most beautiful formula in mathematics is certainly not the triviality 1+eiπ=0, as claimed by many tasteless mathematicians with no self-esteem, but rather Stirling's formula, stating that n!∼nne−n2πn. Quantifying the error of this approximation can be done to any precision using the Euler-MacLaurin complicated formula, but it is often handy to have a simpler estimation; Herbert Robbins[1] found one (original note here) which is surprisingly accurate:
e12n+11<nne−n2πnn!<e12n1.
The inequalities are strict and valid for every n. The proof of this result is given below. For future reference, we can compare (1) with the higher-order expansion:
We have ln(n!)=∑k=1n−1ln(k+1). Robbins' proof consists in a subtle approximation of ln(k+1), as seen as the area of the rectangle [k,k+1]×[0,ln(k+1)]. This area is equal to:
the area Ik of the points in the rectangle under the curve ln(x), that is ∫kk+1ln(x)dx, (in the picture, it's the pink+black zone)
plus the area Tk of the triangle between the points (k,ln(k)),(k,ln(k+1)),(k+1,ln(k+1)), (blue+black zone)
minus the area δk of the small black zone we counted twice, which is equal to Ik minus the area of the points in the rectangle that are not in the preceding triangle.
Clearly, Tk=(ln(k+1)−ln(k))/2. We also recall that the antiderative of ln(x) is xln(x)−x. Consequently, noting Sn=δ2+⋯+δn−1,
How big is Sn? Well, first we can reckon the δk: they are equal to Ik minus the area of the trapezoidal approximation of Ik, which is (ln(k)+ln(k+1))/2:
Now you might want to develop the determinant as ln(1+k−1)=k−1+k−2/2+…: don't do this. Instead, do the following dark magic: first, note that kk+1=1−x1+x where x=(2k+1)−1. Then, use the analytic formula
From the preceding bounds we see that the series δ1+δ2+⋯ is indeed convergent. If s is its sum, Sn=s−∑k>nδk and using again the precedings bounds (they are telescoping), we can estimate:
s−12n1<Sn<s−12n+11
Now go back last line of (1). Take exponentials to get n!/nne−nn=e1−Sn. Then, with c=1−s and the estimate above,
It's obviously not over, since we didn't get the constant c. This, however, is usually done by another means, typically with the Wallis integral asymptotics as they here.
Herbert Robbins does not have the fame he deserves. He's the Robbins of the Robbins-Munro algorithm, the Lai-Robbins bound on bandit algorithms, the backward algorithm for the secretary problem: three essential contributions to different domains of statistics and computational mathematics. His book What is Mathematics ? with Courant is a masterpiece.