Try
Eight distinct jobs can be placed in order in 8!=40320 ways. The exclamation mark means factorial: multiply the positive integers from 1 through 8. For many more jobs, directly multiplying those factors can exceed a calculator’s number range. Before approximating the product, change its representation.
For positive numbers, ln(ab)=ln a+ln b. Here ln is the natural logarithm, whose inverse is exp. Repeated application gives ln(n!)=ln1+ln2+⋯+ln n for every integer n≥1. A product becomes a sum, preserving its exact value after exponentiation in exact arithmetic. Positivity matters: real ln is undefined at zero and at negative numbers, even when a whole product happens to be positive.
Calculate ln(8!) by summing eight logs, then compare with ln40320. Both are approximately 10.6046029027. A numerical agreement checks this example; the product law proves the identity for every positive factor list.
Predict
Can a smooth area estimate this sum? The function ln x increases for positive x. On each unit interval [k,k+1], its graph stays between the heights ln k and ln(k+1). Predict which endpoint rectangles give a lower bound for the area. The left endpoints do, because they have the smaller heights.
For n=4, the three lower heights are ln1, ln2, ln3; the upper heights are ln2, ln3, ln4. Write their sums as logarithms of products. The lower sum is ln6 and the upper sum is ln24. The area between x=1 and x=4 must lie between them. This is an area comparison; it is not the claim that either rectangle sum equals the curved area.
Experiment
Use this table to construct both sets of rectangles. All widths are one; therefore each rectangle’s numerical area equals its height. Sketch an increasing curve between each lower and upper horizontal edge, and explain why no sampling assumption is needed once monotonicity is known for the entire interval.
Worked construction for [1,4]; decimal heights are rounded, while the symbolic bounds are exact.| Interval | Lower rectangle height | Upper rectangle height |
|---|
| [1,2] | ln1 = 0 | ln2 ≈ 0.693147 |
|---|
| [2,3] | ln2 ≈ 0.693147 | ln3 ≈ 1.098612 |
|---|
| [3,4] | ln3 ≈ 1.098612 | ln4 ≈ 1.386294 |
|---|
| Total area | ln6 ≈ 1.791759 | ln24 ≈ 3.178054 |
|---|
The area under ln x from 1 to n is B(n)=n ln n−n+1. If you know integration, differentiate x ln x−x to check this area formula. Otherwise use it here as a supplied area evaluation; the rectangle inequalities themselves depend on monotonicity and unit widths. For n=4, B(4)≈2.545177 lies between the table’s sums.
Rearrange the same comparison to estimate ln(n!), rather than the area. Since the lower rectangle sum is ln(n!)−ln n and the upper is ln(n!), we get
B(n)≤ln(n!)≤B(n)+ln n.
At n=8 this interval is approximately [9.6355323334,11.7149738751], containing our computed log factorial. Predict how wide the log interval is for arbitrary n. Its width is ln n, so it grows even though the estimate becomes relatively accurate compared with the larger quantity n ln n.
Understand
Here is the general proof in full. For k=1 through n−1, monotonicity places the area on [k,k+1] between ln k and ln(k+1). Adding the inequalities gives ln((n−1)!)≤B(n)≤ln(n!). Replace ln((n−1)!) by ln(n!)−ln n and rearrange. At n=1 the sums and area are empty and equal zero; the bound still holds. We use 0!=1 in that endpoint identity.
Because exponentiation increases, the bounds imply
e(n/e)ⁿ≤n!≤en(n/e)ⁿ.
These are useful but coarse multiplicative bounds: the upper estimate is n times the lower. Dividing the logarithmic bounds by n ln n, for n>1, instead gives lower ratio 1−1/ln n+1/(n ln n), with upper ratio larger by 1/n. Both tend to one. Thus ln(n!)~n ln n, where ~ means the ratio tends to one.
Do not exponentiate that ratio conclusion into n!~nⁿ. In fact n!/nⁿ≤en exp(−n), which tends to zero. The correct quantity to control before exponentiating is the difference of logarithms: ln A−ln B=ln(A/B). If that difference tends to zero, then A/B tends to one. Merely making the ratio of the logs tend to one leaves room for a large multiplicative error. For example, n·exp(n) and exp(n) have log ratio 1+(ln n)/n tending to one, but their value ratio n diverges.
A sharper result needs additional analysis. We supply, rather than prove here, this positive-integer consequence of the Stirling expansion and its remainder theorem:
ln(n!)=T(n)+θₙ, where T(n)=(n+1/2)ln n−n+(1/2)ln(2π) and 0≤θₙ≤1/(12n).
The same theorem gives 1/(12n)−1/(360n³)≤θₙ≤1/(12n). These statements specialize the logarithmic gamma expansion and positive-real first-neglected-term error rule in NIST DLMF §5.11, equation 5.11.1 and §5.11(ii), retrieved 25 October 2026. The identity Γ(n)= (n−1)! connects that notation to factorials: add ln n to the logarithmic gamma formula at n. No gamma-function proof or general complex-variable claim is required here. This external theorem is stronger than our rectangle proof; the latter does not establish the square-root factor or these remainder bounds.
Let S(n)=√(2πn)(n/e)ⁿ=exp(T(n)). Then n!/S(n)=exp(θₙ) lies between 1 and exp(1/(12n)). The ratio tends to one, proving the sharper factorial approximation n!~S(n) using the supplied error control. For finite n the relative excess measured against S(n) is at most exp(1/(12n))−1. If instead you divide the approximation error by the true n!, its relative deficit is at most 1−exp(−1/(12n)). Specify the denominator rather than calling both numbers simply “the error.”
Apply
At n=8, calculate T(8)≈10.5941916375. Adding the first correction 1/96 gives approximately 10.6046083041. The corrected log estimate is above the exact log factorial, with difference at most 1/184320, approximately 0.00000542535. The actual difference is approximately 0.00000540140. The theorem controls analytic approximation error; these displayed decimal calculations are not interval-arithmetic certificates for machine rounding.
Now change the question: estimate a ratio, C(2n,n)=(2n)!/(n!)². First write its logarithm as ln((2n)!)−2ln(n!), then substitute the supplied theorem. Simplify the main terms before computing. You should obtain an approximation 4ⁿ/√(πn) with logarithmic remainder θ₂ₙ−2θₙ. Bound that difference using both remainder intervals; do not assume the errors cancel just because the factorials look related. The written practice develops this changed case and verifies n=5 independently.
For large n, retain log factorials and log ratios instead of forming huge factorials and then taking logs. Exponentiate only if the final magnitude is needed and representable. Log-space computation reduces overflow risk, but subtraction can still lose numerical precision and approximate logarithms still have rounding error. An analytic bound is not a complete numerical stability analysis.
Continue
Keep three conclusions separate in your work: the product-to-sum identity, the rectangle inequalities proved here, and the stronger externally supplied Stirling remainder. For each numerical answer, state whether you report a logarithm, an absolute error, or a relative error against a named denominator.
Use the practice to prove the bounds at arbitrary n, repair a false inference about exponentiation, and transfer the error calculation to a factorial ratio. A few accurate decimals do not replace the hypotheses or the limiting argument.