1To derive the Stirling approximation note that ln(N!) = ln(1) + ln(2) + + ln(N). This sum can be approximated by the integral 1N ln(x)dx = N ln(N) - N + 1 N ln(N) - N.