Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#1 2007-12-11 17:03:20

ganesh
Moderator

Offline

James Stirling Formula



This is a brilliant approximation for factorials, particularly, factorials of higher order numbers.
For example, 1000! as per this formula is 4.023537292 x 10^2567. The actual value as per the calculator in the scientific mode is 4.0238726 x 10^2567.
  coolcoolcool


Character is who you are when no one is looking.
 

#2 2007-12-12 03:44:40

mikau
Super Member

Offline

Re: James Stirling Formula

sweetness!


A logarithm is just a misspelled algorithm.
 

#3 2007-12-12 03:56:04

Identity
Power Member

Offline

Re: James Stirling Formula

mikau wrote:

sweetness!

Very much so, if you think an error of

is ok. smile

 

#4 2007-12-12 04:18:01

mikau
Super Member

Offline

Re: James Stirling Formula

I just like how it contains both pi and e.


A logarithm is just a misspelled algorithm.
 

#5 2007-12-12 04:31:17

TheDude
Power Member

Offline

Re: James Stirling Formula

Identity wrote:

mikau wrote:

sweetness!

Very much so, if you think an error of

is ok. smile

Which comes out to a relative error of 0.008%.  I'll take that.


Wrap it in bacon
 

#6 2007-12-12 04:36:09

Daniel123
Power Member

Offline

Re: James Stirling Formula

Identity wrote:

mikau wrote:

sweetness!

Very much so, if you think an error of

is ok. smile

.. not exactly big!

EDIT: Aah post collison

Last edited by Daniel123 (2007-12-12 04:37:01)

 

#7 2007-12-12 05:17:37

mikau
Super Member

Offline

Re: James Stirling Formula

depends on what your priorities are i guess.


A logarithm is just a misspelled algorithm.
 

#8 2007-12-12 05:19:17

Identity
Power Member

Offline

Re: James Stirling Formula

ganesh wrote:



This is a brilliant approximation for factorials, particularly, factorials of higher order numbers.
For example, 1000! as per this formula is 4.023537292 x 10^2567. The actual value as per the calculator in the scientific mode is 4.0238726 x 10^2567.
  coolcoolcool

So does this actually converge on the factorial value as n goes to infinity?

 

#9 2007-12-12 05:22:16

luca-deltodesco
Super Member
Award: Wink Alive

Offline

Re: James Stirling Formula

well both n! and the approximation both diverge to infinity as n goes to infinity tongue


The Beginning Of All Things To End.
The End Of All Things To Come.
 

#10 2007-12-12 05:35:06

TheDude
Power Member

Offline

Re: James Stirling Formula

Yes.

http://en.wikipedia.org/wiki/Stirling%27s_approximation


Wrap it in bacon
 

#11 2007-12-12 05:35:32

mikau
Super Member

Offline

Re: James Stirling Formula

i think he meant, does

Last edited by mikau (2007-12-12 05:36:33)


A logarithm is just a misspelled algorithm.
 

#12 2007-12-12 06:39:54

mathsyperson
Moderator

Offline

Re: James Stirling Formula

I agree that percentage difference is more important than absolute difference.

If you consider the absolute argument the other way, you could say that 10mg of poison on your food is only 10mg more than the recommended amount and so not worth worrying about.

On the same theme, I would guess that this is false:



, but this is true:


Why did the vector cross the road?
It wanted to be normal.
 

#13 2007-12-12 09:01:51

luca-deltodesco
Super Member
Award: Wink Alive

Offline

Re: James Stirling Formula

isnt that identical? the only time that that would converge to 1, is if the first converged to 0?


The Beginning Of All Things To End.
The End Of All Things To Come.
 

#14 2007-12-12 10:18:16

MathsIsFun
Administrator

Offline

Re: James Stirling Formula

Because the error may grow, but not as fast as n! grows.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman
 

#15 2007-12-12 12:19:35

mikau
Super Member

Offline

Re: James Stirling Formula

yeah. Note


but

Last edited by mikau (2007-12-12 12:20:49)


A logarithm is just a misspelled algorithm.
 

#16 2007-12-12 13:35:00

Ricky
Moderator

Offline

Re: James Stirling Formula

What additional requirement can we impose so that Luca's statement holds?


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."
 

#17 2007-12-13 01:05:42

mathsyperson
Moderator

Offline

Re: James Stirling Formula

Equality? That is, instead of

just getting arbitrarily close to 1, it actually has to get there.


Why did the vector cross the road?
It wanted to be normal.
 

#18 2007-12-13 02:53:20

Ricky
Moderator

Offline

Re: James Stirling Formula

Certainly you can come up with a restriction far less restricting than that.  Remember, this restriction can't apply to Mikau's example.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."
 

#19 2007-12-13 04:07:28

mikau
Super Member

Offline

Re: James Stirling Formula

if the two limits each converge to the same finite number?

Last edited by mikau (2007-12-13 04:08:17)


A logarithm is just a misspelled algorithm.
 

#20 2007-12-13 04:21:43

Ricky
Moderator

Offline

Re: James Stirling Formula

Bingo.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."
 

#21 2007-12-13 04:32:25

TheDude
Power Member

Offline

Re: James Stirling Formula

It is also possible for the absolute error to approach 0 while the limits themselves diverge to infinity.  As a trivial example, let f(x) = x^2 and g(x) = x^2 + 1/x.  Then


and

but

Last edited by TheDude (2007-12-13 07:09:28)


Wrap it in bacon
 

#22 2007-12-13 06:55:02

mikau
Super Member

Offline

Re: James Stirling Formula

Ricky wrote:

Bingo.

awesome! But are there any other restrictions that would do it?


A logarithm is just a misspelled algorithm.
 

Board footer

Powered by FluxBB