Find the probability that a person tossing 3 coins will get either all heads or all tails for the 2nd time on the 5th toss.

Typically people solve it like:

\begin{align}P &= (\textrm{Probability of getting HHH or TTT in first four trials}) \times (\textrm{probability of getting HHH or Success in the fifth trial})\\ &= { \binom{4}{1} (0.25)^1 (0.75)^3 } \times {0.25}\\ &= 0.1054\end{align}

But if I do Negative binomial with $r=2, ~x=5, ~p=0.25 ~= 0.08899.$

Why this is not treated as negative binomial since we are looking 2nd success on 5 trials? why its different? what understanding am i missing?


1 Answer 1


It is negative binomial, but the negative binomial variate $x$ is the number of failures until the second success rather than the number of tosses:

> dnbinom(x=3, size=2, prob=0.25)
[1] 0.1054687

The NB random variable is defined as the number of failures before $r$ successes are obtained.

  • $\begingroup$ Isn't calculating for 3 failures same as that of 2 successes? I don't understand the params? Thanks $\endgroup$
    – reindeer
    Dec 11, 2022 at 5:32
  • $\begingroup$ You set $x$ to be the number of successes plus the number of failures, but it should be just the number of failures. The definition of NB is the number of failures before $r$ successes are obtained. $\endgroup$ Dec 11, 2022 at 6:07
  • $\begingroup$ OH!! thank you, i got it $\endgroup$
    – reindeer
    Dec 11, 2022 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.