If one uses the standard Stirling approximation to the factorial function,
log(N!)≈Nlog(N) – N + ½log(2πN)
the approximation to ℘ is 1/√πN, which is not perfect for the small values of N. Introducing the second order Stirling approximation,
log(N!)≈Nlog(N) – N + ½log(2πN) + 1/12N
the approximation become
which fits almost exactly from the start. This accuracy was already pointed out by William Feller, Section II.9.
Filed under: Kids, R, Statistics Tagged: American elections 2016, Stirling approximation, The Riddler