Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Stirling's Formula

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

Stirling Approximation

Stirling formula or Stirling approximation, named after Scottish Mathematician James Stirling, is a formula used to find the approximate value of large factorials (written n!; eg; 3! = 3 x 2 x 1) that make use of Mathematical constant e (the base of the natural logarithm) and π.

The Stirling formula offers the easiest way to calculate the factorial n! especially for a large positive integer n which is a very tedious task to calculate.


Stirling Approximation Formula

The factorial function n! Is approximated by the formula:

n! ~ \[\sqrt{2 \pi n (\frac{n}{e})^{n}}\]

Furthermore, for any positive integer, we have the limits

\[\sqrt{2 \pi}\] nⁿ⁺ \[\frac{1}{2}\] e⁻ⁿ ≤  n!  ≤ nⁿ⁺ \[\frac{1}{2}\] e⁻ⁿ


Stirling Interpolation Formula 

Statement:

 If...x₋₂, x₋₁, x₀, x₁, x₂ are given as a set observation with a common difference n and let y₋₂, y₋₁, y₀, y₁, y₂ are their corresponding values where y = f(x) be the given function, then 

yₚ = yₒ + p (\[\frac{\Delta y_{0} - \Delta y_{-1}}{2}\]) + \[\frac{P^{2}}{2!}\] \[\Delta\]\[^{2}\]y₋₁ + (\[\frac{p(p^{2} - 1)}{3!}\] (\[\frac{\Delta^{3} y_{-1} + \Delta^{3}y_{-2}}{2}\]) \[\frac{p^{2}(p^{2} - 1)}{4!}\]) \[\Delta\]\[^{4}\]y₋₂   

Here, p = \[\frac{x - x_{0}}{h}\]


Proof: 

Stirling interpolation formula will be obtained by taking the average of Gauss Forward difference formula and Gauss Backward difference formula.


Gauss Forward Difference Formula is Given as:

yₚ = yₒ + p\[\Delta\]yₒ + \[\frac{p(p - 1)}{2!}\] \[\Delta\]\[^{2}\]y₋₁ + \[\frac{p(p + 1)(p - 1)}{3!}\] \[\Delta\]\[^{3}\]y₋₁ \[\frac{p(p - 1)(p + 1)(p - 2)}{4!}\] + \[\Delta\]\[^{4}\]y₋₂+ …..


Gauss Backward Difference Formula is Given as:

yₚ = yₒ + p\[\Delta\]y₋₁ + \[\frac{p(p - 1)}{2!}\] \[\Delta\]\[^{2}\]y₋₁ + \[\frac{p(p + 1)(p - 1)}{3!}\] \[\Delta\]\[^{3}\]y₋₂ \[\frac{p(p - 1)(p + 1)(p - 2)}{4!}\] + \[\Delta\]\[^{4}\]y₋₂+ …..

Now, stirling formulas is given as 

\[\frac{\text{Gauss Forward Difference Formula + Gauss Backward Difference Formula}}{2}\]

yₚ = yₒ + p

yₚ = yₒ + p (\[\frac{\Delta y_{0} - \Delta y_{-1}}{2}\]) + \[\frac{P^{2}}{2!}\] \[\Delta\]\[^{2}\]y₋₁ + \[\frac{p(p^{2} - 1)}{3!}\] (\[\frac{\Delta^{3} y_{-1} - \Delta^{3} y_{-2}}{2}\]) \[\frac{p^{2}(p^{2} - 1)}{4!}\] \[\Delta\]\[^{4}\]y₋₂


Stirling Formula Example

1. Find the Factorial 11 Using the Stirling  Formula.


Solution:

Using the Stirling Formula  - \[\sqrt{2 \pi}\] nⁿ⁺ \[\frac{1}{2}\] e⁻ⁿ 

We have:


11! = \[\sqrt{2 \pi}\] 11¹¹⁺ \[\frac{1}{2}\] x e⁻¹¹ = 39615625.05

Therefore, the value of factorial 11 = 39615625.05


2. Calculate the Solution Using the Stirling Formula


x

f(x)

20

49225

25

48316

30

47236

35

45926

40

44306


x = 28


Solution:

The table for the values of x and y


x

20

25

30

35

40

y

49225

48316

47236

45926

44036


Stirling methods to determine the solution.

h = 25 - 20 = 5

Considering x₀ = 30 and p = \[\frac{x - x_{0}}{h}\] = \[\frac{x - 30}{5}\] 

The difference table is given below:


x

p = \[\frac{x-30}{5}\]

y

Δy

Δ²y

Δ³y

Δ⁴y

20

-2

49225








-909




25

-2

48316


-171






-1080


-59


30

0

47236


-230


-21




-1310


-80


35

1

45926


-310






-1620




40

2

44306






x = 28

p =  \[\frac{x - x_{0}}{h}\] =  \[\frac{28 - 30}{5}\] = 0.4

y₀ = 47236, \[\Delta\]y₀ = -1310, \[\Delta\]\[^{2}\]y₋₁ = - 230  \[\Delta\]\[^{3}\]y₋₁ = - 80, \[\Delta\]\[^{4}\]y₋₁= - 21

Stirling formula is given as:

yₚ = yₒ + p (\[\frac{\Delta y_{0} - \Delta y_{-1}}{2}\]) + \[\frac{P^{2}}{2!}\] \[\Delta\]\[^{2}\]y₋₁ + \[\frac{p(p^{2} - 1)}{3!}\] (\[\frac{\Delta^{3} y_{-1} - \Delta^{3} y_{-2}}{2}\]) \[\frac{p^{2}(p^{2} - 1)}{4!}\] \[\Delta\]\[^{4}\]y₋₂

y\[_{-0.4}\] =  47236 + (-0.4) . \[\frac{(-1310 - 1080)}{2}\] + \[\frac{(0.16)}{2}\] . (-230) + \[\frac{(-0.4)(0.16 - 1)}{6}\] + \[\frac{(-80 + 59)}{2}\] + \[\frac{(-0.16)(0.16 - 1)}{24}\] . (-21)

y\[_{-0.4}\] = 47236 + 478 - 18.4 - 3.892 + 0.1176

y\[_{-0.4}\] = 47691.8256

Therefore, the solution of Stirling interpolation is 

y(28) = 47691.8256

FAQs on Stirling's Formula

1. When to Use the Stirling Interpolation Formula?

Stirling interpolation formula can be used when:

  • The value of p lies between - ½ and ½ 

  • Stirling formula can also be used outside this range , but the accuracy of the calculated value will be less.

  • It provides the best approximation for the range -¼ < q < ¼ 

2. What are the Pros and Cons of the Stirling Formula?

The main benefit of the Stirling formula is that it minimizes much quicker than other difference formulas hence considering the first few numbers of terms itself will be the better approximation whereas the disadvantage of the Stirling formula is that it will be applicable only when there is a uniform difference between any two consecutive x.

3. What Does Interpolation Mean?

Interpolation is the process of estimating unknown values that lie between the known values. The Stirling interpolation formula is used to determine the value of a function at an intermediate point within the range of a discrete set of known data points.