### Ball Bearings

If a is the radius of the axle, b the radius of each ball-bearing, and c the radius of the hub, why does the number of ball bearings n determine the ratio c/a? Find a formula for c/a in terms of n.

### Air Routes

Find the distance of the shortest air route at an altitude of 6000 metres between London and Cape Town given the latitudes and longitudes. A simple application of scalar products of vectors.

### Epidemic Modelling

Use the computer to model an epidemic. Try out public health policies to control the spread of the epidemic, to minimise the number of sick days and deaths.

# Stirling Work

### Part 1: Estimate of n

$\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

### Part 2:

$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.

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$

### Part 3:

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 %