Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 3 of 3

Estimate products without losing the error

Turn positive products into logarithmic sums, prove factorial area bounds, and use a supplied Stirling remainder with explicit error semantics.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

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.
IntervalLower rectangle heightUpper rectangle height
[1,2]ln1 = 0ln2 ≈ 0.693147
[2,3]ln2 ≈ 0.693147ln3 ≈ 1.098612
[3,4]ln3 ≈ 1.098612ln4 ≈ 1.386294
Total arealn6 ≈ 1.791759ln24 ≈ 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.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

For integer n≥1 consider P(n)=∏ from k=1 to n of (k+2)/(k+1). Evaluate it directly and as a sum of logarithms. A learner says the same real-log transformation works for the product (−2)(−3)=6 because its final result is positive. Diagnose the missing hypothesis and explain how absolute values and sign tracking repair a general product of nonzero real factors.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For every integer n≥1 prove n ln n−n+1≤ln(n!)≤n ln n−n+1+ln n using monotonicity of ln x. Identify the exact left and right rectangle sums on [1,n], including the n=1 case. Exponentiate to obtain bounds on n! and explain why the upper/lower ratio does not approach 1.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Use the area bounds to prove ln(n!)~n ln n, (n!)^(1/n)/n→1/e, and n!/n^n→0. State where division requires n>1. Explain why the first conclusion alone cannot be exponentiated to claim n!~n^n.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For positive sequences A(n),B(n), prove A(n)/B(n)→1 iff ln A(n)−ln B(n)→0. Refute the proposed replacement condition ln A(n)/ln B(n)→1 using A(n)=n·exp(n), B(n)=exp(n). Then if |ln A−ln B|≤δ for δ≥0, derive a bound for |A/B−1| and explain which quantity supplies its denominator.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Use the supplied theorem ln(n!)=T(n)+θ_n, where T(n)=(n+1/2)ln n−n+(1/2)ln(2π), 0≤θ_n≤1/(12n), and |θ_n−1/(12n)|≤1/(360n³), with θ_n≤1/(12n). At n=8 bound ln(8!) using both the uncorrected and one-term-corrected estimates. Compare with ln40320. Give a bound on 8!/exp(T(8))−1. State which result is supplied rather than proved by the rectangle argument, and whether the decimal endpoints are outward-rounded certificates.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Assume the supplied Stirling form n!=S(n)exp(θ_n), S(n)=√(2πn)(n/e)^n and 0≤θ_n≤1/(12n). Derive an exact expression for C(2n,n) in terms of 4^n/√(πn) and the two remainders. Bound the logarithm of the ratio to that approximation, prove asymptotic equivalence, and check the bound at n=5 using C(10,5)=252. Avoid forming large factorials when explaining a numerical procedure.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.