Stirling's Approximation, etc.

LA home
Computing
Algorithms
 glossary
 Numerical
  Num.Errors
  Polynomials
  Stirling
  Mean&S.D.
  Segmentation
  Superposition
  Integration
  Matrices
  Eigen v.
  Stirling
Stirling's approximation for N!:
N! ~ sqrt(2 π N).(N/e)N + ...
hence
loge(N!) ~ N.loge(N) - N + 0.5 loge(N) + 0.5 loge(2 pi) +...
 
function Stirling(N) // JavaScript
 { return
    (N+0.5)*Math.log(N) - N + Math.log(2*Math.PI)/2;
 }
L
.
A
.
N=

Factorial is generalized by the Γ function to real, and even complex, values. For a positive integer, n, Γn=(n-1)!.

Notes

D. E. Knuth in The Art of Computer Programming, Fundamental Algorithms, Vol.1, p.46, (1969), gives the reference as:
James Stirling. Methodus Differentialis, p.137, (1730).
On page 111 of his book, Knuth derives a more accurate approximation:
N! = sqrt(2 π N) (N/e)N {1 + 1/12N + 1/288N2 - 139/51840N3 - 571/2488320N4 + O(1/N5)}
-- L.A., 1999, 2000, 2007, Australia.
www:

↑ © L. Allison, www.allisons.org/ll/   (or as otherwise indicated).
Created with "vi (Linux)",  charset=iso-8859-1,   fetched Saturday, 17-Aug-2019 21:50:22 EDT.

Free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop, Firefox web-browser, FlashBlock flash on/off.