Skip to main content
### Number and algebra

### Geometry and measure

### Probability and statistics

### Working mathematically

### For younger learners

### Advanced mathematics

# Stirling Work

### Part 1: Estimate of n

### Part 2:

### Part 3:

Or search by topic

Age 16 to 18

Challenge Level

- Problem
- Student Solutions

$\sqrt{n} > 100$

$n> 10^4$

$\sqrt{n} > 1000\ 000$

$n> 10^{12}$

$\sqrt{n} > 1000\ 000\ 000\ 000$

$n> 10^{24}$

$n^n> 100$

$n\log n> \log 100$

Using the interval bisection method: $n$ is greater than 3.59728502354042

$n^n> 1000\ 000$

$n\log n> \log 1\ 000\ 000$

Using the interval bisection method: $n$ is greater than 7.06579672829962

$n^n> 1000\ 000\ 000\ 000$

$n\log n> \log 1000\ 000\ 000\ 000$

Using the interval bisection method: $n$ is greater than
11.3673178030006

Interval
Bisection tables

$n!=1 \times 2 \times 3 \times 4 \times \dots (n-1) \times
n$

Taking logs:

$$

\begin{align*} \ln(n!) &= \ln (1 \times 2 \times 3 \times 4
\times \dots (n-1) \times n) \\&= \ln 1 + \ln 2 +\ln 3
+...\ln(n-1) +\ln(n) \\&= \sum_{i=1}^n\ln(i)
\approx\int^n_1\ln(x)\,dx

\end{align*}$$

where we've assumed n is large when replacing the sum by an integral. We can evaluate this integral using integrating by parts:

$$ \int \ln(x) \,dx = x \ln(x) - \int 1 \,dx = x\ln(x) - x =
\ln(x^x) - x$$

Substituting the limits of integration gives: $$\ln(n!) = \ln(n^n)
-n - (\ln(1^1) - 1)$$

Taking exponentials: $$n!= e^{\ln(n^n) -n + 1}=n^n e^{1-n}$$

Comparing with the form of the approximation given (for large n)
it can be seen that we should use the approximation:

$$n! \sim A n^{ +n\pm 0.5} e^{-n} $$

We now need to find the value of the constant A and work out the
remaining sign in the term $n^{\pm0.5}$.

If we temporarily let the constant $= 1$ and then compare the
values obtained from $An^{n-0.5}e^{-n}$ and $An^{n+0.5}e^{-n}$ with
$n!$ for a range of $n$, the results are listed in the spreadsheet
below.

Spreadsheet

From the spreadsheet it can be seen that $An^{n+0.5}e^{-n}$ with a
constant $A$ greater than unity, will provide the appropriate form.
If we were to use the other possible form, $An^{n-0.5}e^{-n}$, we
would need an extremely large value of $A$.

Estimate of $A$:

By simply dividing column E by coumn D in the above spreadsheet it
can be seen the value of $A$ starts at around 2.6 (for small $n$)
and tends to around 2.5 (for large $n$). The exact value of $A$ is
actually $\sqrt{2\pi} \approx 2.506628275$

There appears to be no limit to the factorial which may be
calculated if the answer is left in an algebraic form. Using the
formula in Excel, $142!$ was the largest number that I was able to
compute. The value of the real and approximated results are listed
below.

$142!= 2.695364137888160 \times 10^{245}$

$\sqrt{2\pi} \times 142^{142 +0.5}e^{-142} =2.693782818480670
\times 10^{245}$

Percentage difference = 0.058668118 %