Re: Formula Stirlinga
- To: mathgroup at smc.vnet.net
- Subject: [mg130695] Re: Formula Stirlinga
- From: "Barrie Stokes" <Barrie.Stokes at newcastle.edu.au>
- Date: Fri, 3 May 2013 03:51:29 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130502014311.555F56A80@smc.vnet.net>
It works correctly. Try this n = 1000 Log[n!] // N n Log[n] - n // N n Log[n] - n + 1 // N Sqrt[2 \[Pi] n] (n/E)^n // N n! // N %% - % n!/(Sqrt[2 \[Pi] n] (n/E)^n) // N The proportional error at n=1000 is (n! - Sqrt[2*Pi*n]*(n/Exp[1])^n)/n! // N = -0.000083329858430 and check out http://en.wikipedia.org/wiki/Stirling%27s_approximation where the ratio n!/(Sqrt[2 \[Pi] n] (n/E)^n) is given limits. Cheers Barrie >>> On 02/05/2013 at 11:43 am, in message <20130502014311.555F56A80 at smc.vnet.net>, <karchevskymi at gmail.com> wrote: > n = 1000; > N[n! - Sqrt[2*Pi*n]*(n/Exp[1])^n] = 3.35308734163*10^2563 > Why does Stirling's formula works incorrect?
- References:
- Formula Stirlinga
- From: karchevskymi@gmail.com
- Formula Stirlinga