Stirling's approx for large factorials - need trick please

  • Thread starter mmwave
  • Start date
  • Tags
    Factorials
In summary, you can use the log rule to approximate the number of possible outcomes in a 1000 coin flip.
  • #1
mmwave
647
2
To calculate the multiplicities of 600 heads in 1000 coin tosses you start with 1000 choose 600 or
1000! / (600! * (1000-600)!) which equals 1000! / (600!) * (400!).

Since you can't calculate this easily, apply Stirling's approx.
N! = N^N * e^(-N) * sqrt(2piN). Applying this to numerator and denominator and leaving out sqrt terms since they are not the problem:

1000^1000 * e^(-1000)
--------------------------------
600^600*e-600 * 400^400 *e-400

Now the exponential terms cancel, but you still can't calculate the remaining terms.

Question: What is the trick to reduce this to something I can calculate? Here's my best attempt.

I tried factoring the bases and canceling terms but that gives

10*10 ^1000 * 10^1000 10^1000
--------------------------------------- = --------------------
10*10 ^600 * 10*10 ^400 * 6^400 * 4^400 6^600 * 4 ^400

You can cancel common factor of 2^1000 the same way giving

5^1000 / (3^600 * 2^400)

I still can't calculate this. Is there another approach or am I missing some other opportunity for canceling?
 
Physics news on Phys.org
  • #2
If only there was a way to transform exponentiation into multiplication, and multiplication into addition...
 
  • #3
I tried the log formula for large factorials first but I got numbers I couldn't take the antilog of. But you made me think of taking the logs where I left off and subtracting the log of 2^N then antilog. If that doesn't work then I'm still lost.
 
  • #4
Well, the result does have 291 decimal digits.
 
  • #5
ok... you know omega=1000!/600!400!.
So ln(omega)=ln(1000!/600!400!)
sterling: N! \approx (N/e)^N*sqrt(2PiN)
so,
ln(omega)=ln((1000^1000)*sqrt(2000Pi)/((600^600)*sqrt(1200Pi)*(400^400)*sqrt(800Pi))

log rules:ln(ab)=lna+lnb , ln(a/b)=lna-lnb , ln(a^b)=blna

so,
ln(omega)=ln(1000^1000)+ln(sqrt(.02575161)-ln(600^600)-ln(400^400)
ln(omega)=1000ln1000-3.65925-600ln600-400ln400
ln(omega)=669.4
so, omega=e^669.4

let e^a=2^b, so ln(e^a)=ln(2^b), so a=bln2, so b=a/ln2

so omega=e^669.4=2^965.8
this is the number of ways to obtain 600 heads out of 1000 coins.

we know there exists 2^1000 possible outcomes from 1000 coin flips, so the probability is given by

P=omega/2^1000=2^965.8/2^1000=2^-34.2=5*10^-11
 
  • #6
The mean of the distribution of the number of heads is 500 and the standard deviation is [tex]\sqrt{600 * 0.5 * 0.5} \approx 15.8[/tex], so another approach is to evaluate the Normal pdf with that mean and standard deviation at x=600. This approximation gives p = 5.2 * 10^-11. By way of comparison, Wolfram Alpha says p = 4.6 * 10^-11 for 600 heads and 400 tails.
 
  • #7
mmwave said:
To calculate the multiplicities of 600 heads in 1000 coin tosses you start with 1000 choose 600 or
1000! / (600! * (1000-600)!) which equals 1000! / (600!) * (400!).

Since you can't calculate this easily

Yeah, 16 microseconds with Pari, what a drag.

http://pari.math.u-bordeaux.fr/
 

1. What is Stirling's approximation for large factorials?

Stirling's approximation is a mathematical formula that approximates the value of large factorials, which are factorials with very large numbers as the input. It is given by n! ≈ √(2πn)(n/e)^n, where n is the input number.

2. Why is Stirling's approximation used for large factorials?

Stirling's approximation is used for large factorials because it provides a good estimate of the value without having to actually calculate the entire factorial, which can be very time-consuming for large numbers.

3. How accurate is Stirling's approximation for large factorials?

Stirling's approximation is accurate to within an error of O(1/n), which means that the error decreases as the input number increases. For very large numbers, the error becomes negligible.

4. Can Stirling's approximation be used for all factorials?

No, Stirling's approximation is only accurate for large factorials. For smaller numbers, it may provide a less accurate estimate of the value.

5. Are there any tricks to make Stirling's approximation more accurate?

Yes, there are certain tricks that can be used to improve the accuracy of Stirling's approximation, such as using a higher-order approximation or incorporating additional terms in the formula. However, these may also increase the complexity of the calculation.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
841
  • Introductory Physics Homework Help
Replies
26
Views
840
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
Replies
76
Views
4K
Replies
14
Views
2K
Replies
1
Views
3K
  • Introductory Physics Homework Help
Replies
1
Views
1K
Replies
7
Views
1K
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
958
Back
Top