Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-12-10 18:03:20

Jai Ganesh
Administrator
Registered: 2005-06-28
Posts: 48,406

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.
  cool:cool::cool:


It appears to me that if one wants to make progress in mathematics, one should study the masters and not the pupils. - Niels Henrik Abel.

Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.

Offline

#2 2007-12-11 04:44:40

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

sweetness!


A logarithm is just a misspelled algorithm.

Offline

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

Identity
Member
Registered: 2007-04-18
Posts: 934

Re: James Stirling Formula

mikau wrote:

sweetness!

Very much so, if you think an error of

is ok. smile

Offline

#4 2007-12-11 05:18:01

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

I just like how it contains both pi and e.


A logarithm is just a misspelled algorithm.

Offline

#5 2007-12-11 05:31:17

TheDude
Member
Registered: 2007-10-23
Posts: 361

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

Offline

#6 2007-12-11 05:36:09

Daniel123
Member
Registered: 2007-05-23
Posts: 663

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-11 05:37:01)

Offline

#7 2007-12-11 06:17:37

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

depends on what your priorities are i guess.


A logarithm is just a misspelled algorithm.

Offline

#8 2007-12-11 06:19:17

Identity
Member
Registered: 2007-04-18
Posts: 934

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.
  cool:cool::cool:

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

Offline

#9 2007-12-11 06:22:16

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

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.

Offline

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

TheDude
Member
Registered: 2007-10-23
Posts: 361

Re: James Stirling Formula

Yes.

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


Wrap it in bacon

Offline

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

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

i think he meant, does

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


A logarithm is just a misspelled algorithm.

Offline

#12 2007-12-11 07:39:54

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

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.

Offline

#13 2007-12-11 10:01:51

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

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.

Offline

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

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,713

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

Offline

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

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

yeah. Note


but

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


A logarithm is just a misspelled algorithm.

Offline

#16 2007-12-11 14:35:00

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

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..."

Offline

#17 2007-12-12 02:05:42

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

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.

Offline

#18 2007-12-12 03:53:20

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

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..."

Offline

#19 2007-12-12 05:07:28

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: James Stirling Formula

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

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


A logarithm is just a misspelled algorithm.

Offline

#20 2007-12-12 05:21:43

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

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..."

Offline

#21 2007-12-12 05:32:25

TheDude
Member
Registered: 2007-10-23
Posts: 361

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-12 08:09:28)


Wrap it in bacon

Offline

#22 2007-12-12 07:55:02

mikau
Member
Registered: 2005-08-22
Posts: 1,504

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.

Offline

Board footer

Powered by FluxBB