Factorial Calculation Using Stirlings Formula

Calculation using Stirling's formula gives an approximate value for the factorial function n! for n < 0. The factorial function n! is important in computing binomial, hypergeometric, and other probabilities. If n is not too large, then n! can be computed directly, multiplying the integers from 1 to n, or person can look up factorials in some tables. Stirling’s formula provides an approximation which is relatively easy to compute and is sufficient for most of the purposes.
Using n! ≈ √(2n) x n(n+1/2)x e -n
where n is number of elements.

Number of elements (n) =

n! ≈