Probabilities of Getting 50 Tails in 100 Coin Tosses Using Binomial Distribution

In summary: So for ##n = 100## we have:\begin{array}{cc}n & P \\100 & 0.0795892373871786\end{array}For higher values of ##n##, the geometric distribution approaches the normal distribution, so you get a simpler answer. For ##n = 1000## you get ##P = 0.079788456
  • #1
Manel
10
0

Homework Statement


You throw a coin a 100 times, what's the probability of getting 50 tails?

Homework Equations


1d53e4a0d17e17adfeb7f53ecca9df5d.png

977b495e5d962b18db3c56fdabf2cbc6.png


The Attempt at a Solution


We have n=100 , p=1/2, q=1/2 and k=50 we substitute in the first equation we get:
P= 100!/ (50! * 50!) * (1/2)^100
The factorials are not simple to calculate so i used Stirling formula ( logarithmic approximation) and i found that Log P=0 so P=1 which i think is incorrect because 1 is the sum of all the probabilities...so where is my mistake?
 
Physics news on Phys.org
  • #2
Log p? I'm not sure what expression it is you calculated the log of. Try this:
Since
[tex] \binom{100}{50} = \dfrac{100!}{50! \cdot 50!}
[/tex]
its logarithm is
[tex]
\log{100!} - \log{50! \cdot 50!} = \log{100!} - \left(\log 50! + \log 50!\right) = \log{100!} - 2\log{50!}
[/tex]

use the approximation to work that out, then go back and finish the calculation. (Or, you can use Wolfram Alpha to get the coefficient). It is possible that the intent of the problem is to use the normal approximation, but unless that is specifically requested ...
 
  • #3
I suggest not using the Stirling formula. Computing those factorials relatively accurately should not be a big problem for a computer.

Edit: To clarify, the Stirling formula is not accurate enough for this problem. In order to get something more reasonable you need to include the next term of the approximation as well:
$$
\ln(n!) \simeq n(\ln n - 1) + \frac 12 \ln(2\pi n)
$$
 
Last edited:
  • #4
statdad said:
Log p? I'm not sure what expression it is you calculated the log of. Try this:
Since
[tex] \binom{100}{50} = \dfrac{100!}{50! \cdot 50!}
[/tex]
its logarithm is
[tex]
\log{100!} - \log{50! \cdot 50!} = \log{100!} - \left(\log 50! + \log 50!\right) = \log{100!} - 2\log{50!}
[/tex]

use the approximation to work that out, then go back and finish the calculation. (Or, you can use Wolfram Alpha to get the coefficient). It is possible that the intent of the problem is to use the normal approximation, but unless that is specifically requested ...

That's exactly what i did but in order to get that i had to introduce the Log in both sides of the equation, that's why i got Log P
 
  • #5
Orodruin said:
I suggest not using the Stirling formula. Computing those factorials relatively accurately should not be a big problem for a computer.

Edit: To clarify, the Stirling formula is not accurate enough for this problem. In order to get something more reasonable you need to include the next term of the approximation as well:
$$
\ln(n!) \simeq n(\ln n - 1) + \frac 12 \ln(2\pi n)
$$
I used the next term too and i got a negative result ! I got 1/2 Log2 - 1/2 Log 100π !
 
  • #6
Then I suggest you redo the algebra. The ##100\log(1/2)## term should cancel with the leading terms from the Stirling approximation and you should be left with the correction terms from ##\ln(100!)## and ##2\ln(50!)##. Do note that the result for ##\ln(P)## should be negative as long as the probability is smaller than 1. I tried this problem both by computing the factorials and by using the correction to the Stirling formula. Both gave similar results.
 
  • #7
Orodruin said:
Then I suggest you redo the algebra. The ##100\log(1/2)## term should cancel with the leading terms from the Stirling approximation and you should be left with the correction terms from ##\ln(100!)## and ##2\ln(50!)##. Do note that the result for ##\ln(P)## should be negative as long as the probability is smaller than 1. I tried this problem both by computing the factorials and by using the correction to the Stirling formula. Both gave similar results.
oh yes yes that's ok i found P=0.08 ...that was Log P which is negative sorry ...Thank you
 
  • #8
Orodruin said:
I suggest not using the Stirling formula. Computing those factorials relatively accurately should not be a big problem for a computer.

Edit: To clarify, the Stirling formula is not accurate enough for this problem. In order to get something more reasonable you need to include the next term of the approximation as well:
$$
\ln(n!) \simeq n(\ln n - 1) + \frac 12 \ln(2\pi n)
$$
Just a question, How can we know that we should get to next term of the approximation ( without calculating and finding a wrong result)?
 
  • #9
A priori we do not. In order to know we must know how the next term in the series behaves (in this case as ln(n)) and compare to the contribution of the previous terms. The thing to note here is that as was the case in this problem, terms from different contributions might cancel out to leading order and then you really have to go to the next order in the expansion. Another example of this would be ##f(x) = e^x - e^{-x}## for small ##x##. In that situation we would have ##f(x) \simeq 0## close to ##x = 0## due to ##e^x \simeq 1##. However, as soon as you go to the first order correction, you would obtain ##e^x \simeq 1+x## and thus
$$
f(x) \simeq (1+x) - (1-x) = 2x.
$$
 
  • Like
Likes Manel
  • #10
Manel said:
Just a question, How can we know that we should get to next term of the approximation ( without calculating and finding a wrong result)?

I'm not sure what your "next term" would be, but there is a very simple correction to Stirling that gives an upper bound on ##n!##:
[tex] \text{St}(n) < n! < \text{St1}(n) \\
\text{where} \\
\text{St}(n) = \sqrt{2 \pi n} n^n e^{-n}, \;
\text{St1}(n) = \sqrt{2 \pi n} n^n e^{-n + \frac{1}{12n}}
[/tex]
If we call St1(n) the corrected Stirling, it gives much better accuracy, even for small ##n##:
[tex]
\begin{array}{cccc}
n & n! & \text{Stirling} & \text{Corrected Stirling}\\
1 & 1 & 0.922137 & 1.002274\\
2 & 2 & 1.919004 & 2.000652 \\
5 & 120 & 118.0192 & 120.0026 \\
10 & 3628800 & 3598696 & 3628810 \\
15 & 1.307674e+12 & 1.300431e+12 & 1.307675e+12 \\
20 & 2.432902e+18 & 2.422787e+18 & 2.432903e+18 \\
25 & 1.551121e+25 & 1.545959e+25 & 1.551121e+25 \\
30 & 2.652529e+32 & 2.645171e+32 & 2.652529e+32
\end{array}
[/tex]
Note that
[tex] \log(\text{St1}(n)) = \frac{1}{2} \log(2 \pi) +\frac{1}{2} \log(n) + n \log(n) - n + \frac{1}{12n} [/tex]
Was that the "correction" you cited?
 
  • Like
Likes Manel
  • #11
Ray Vickson said:
I'm not sure what your "next term" would be, but there is a very simple correction to Stirling that gives an upper bound on ##n!##:
[tex] \text{St}(n) < n! < \text{St1}(n) \\
\text{where} \\
\text{St}(n) = \sqrt{2 \pi n} n^n e^{-n}, \;
\text{St1}(n) = \sqrt{2 \pi n} n^n e^{-n + \frac{1}{12n}}
[/tex]
If we call St1(n) the corrected Stirling, it gives much better accuracy, even for small ##n##:
[tex]
\begin{array}{cccc}
n & n! & \text{Stirling} & \text{Corrected Stirling}\\
1 & 1 & 0.922137 & 1.002274\\
2 & 2 & 1.919004 & 2.000652 \\
5 & 120 & 118.0192 & 120.0026 \\
10 & 3628800 & 3598696 & 3628810 \\
15 & 1.307674e+12 & 1.300431e+12 & 1.307675e+12 \\
20 & 2.432902e+18 & 2.422787e+18 & 2.432903e+18 \\
25 & 1.551121e+25 & 1.545959e+25 & 1.551121e+25 \\
30 & 2.652529e+32 & 2.645171e+32 & 2.652529e+32
\end{array}
[/tex]
Note that
[tex] \log(\text{St1}(n)) = \frac{1}{2} \log(2 \pi) +\frac{1}{2} \log(n) + n \log(n) - n + \frac{1}{12n} [/tex]
Was that the "correction" you cited?
So the corrected stirling is the most accurate formula to use if we want better precision?
 
  • #12
Manel said:
So the corrected stirling is the most accurate formula to use if we want better precision?
I would not bother in this problem: P0 = 0.07958923737, P1 = 0.07978845606 and P2 = 0.07958923413, where P0 = exact, P1 uses Stirling and P2 uses corrected Stirling. To 3 digits we have P0 = 0.0796, P1 = 0.0798 and P2 = 0.0796.

The differences would be more significant in smaller problems, such as for n near 20 instead of 100.
 
  • Like
Likes Manel
  • #13
Manel said:
So the corrected stirling is the most accurate formula to use if we want better precision?

I just realized that what you call "Stirling" and what I call "Stirling" are very different. Your Stirling is essentially ##\log(n!) \sim n \log(n) - n##, which is true, but fails when exponentiated: ## n ! \not\sim n^n e^{-n}## ! What I (and essentially all modern textbooks) call Stirling is ##\log(n!) \sim \frac{1}{2} \log(2 \pi) + \frac{1}{2} \log(n) + n \log(n) - n##. That is true, and also leads to a true result when exponentiated: ##n! \sim \sqrt{2 \pi n} n^n e^{-n}##. What I called the "corrected" Stirling gives results that are even better.

So, when I said it would be OK to use Stirling (uncorrected) I meant the standard Stirling that includes the ##\sqrt{2 \pi n}## factor, not your "bad" Stirling that omits it!
 
  • Like
Likes Manel

FAQ: Probabilities of Getting 50 Tails in 100 Coin Tosses Using Binomial Distribution

1. What is the binomial distribution?

The binomial distribution is a probability distribution that describes the likelihood of a certain number of successes in a fixed number of independent trials, where each trial has a binary outcome (e.g. heads or tails in a coin toss). It is often used to model real-world scenarios, such as the probability of getting a certain number of heads in a certain number of coin tosses.

2. How is the binomial distribution used to calculate the probability of getting 50 tails in 100 coin tosses?

The binomial distribution formula is used to calculate the probability of getting a specific number of successes (50 tails) in a fixed number of trials (100 coin tosses). This formula takes into account the number of trials, the probability of success (in this case, 0.5 for a fair coin), and the desired number of successes. By plugging these values into the formula, we can calculate the probability of getting exactly 50 tails in 100 coin tosses.

3. What assumptions are made when using the binomial distribution for coin tosses?

The binomial distribution assumes that each trial is independent, meaning the outcome of one trial does not affect the outcome of another. It also assumes that the probability of success (e.g. getting a head) remains constant for each trial. Additionally, the trials must be mutually exclusive, meaning that each trial can only have two outcomes (heads or tails).

4. Is it possible to get exactly 50 tails in 100 coin tosses?

Yes, it is possible but the probability is very low. According to the binomial distribution, the probability of getting exactly 50 tails in 100 coin tosses is approximately 0.0796 or 7.96%. This means that out of 1000 trials, we would expect to get exactly 50 tails only 79.6 times.

5. How does the number of coin tosses affect the probability of getting 50 tails?

The more coin tosses, the higher the probability of getting exactly 50 tails. This is because as the number of trials increases, the likelihood of getting a certain number of successes (in this case, 50 tails) becomes more evenly distributed. For example, if we were to increase the number of coin tosses to 1000, the probability of getting exactly 50 tails would increase to approximately 0.179 or 17.9%, making it more likely to occur compared to 100 coin tosses.

Back
Top