How many coin tosses does it take until you get n Heads OR m Tails?

By Svante Janson, Lucy Martinez and Doron Zeilberger


.pdf    LaTex source file



Written: Dec. 2025


The negative-binomial distribution famously tells you how many coin tosses would it take until you get n Heads (regardless of the number of Tails), and equivalently, how many coin tosses would it take until you get m Tails (regardless of the number of Heads). In this note we use both discrete and continuous methods to study the `hybrid' random variables: `How many coin tosses would it take until you get (for the first time) n Heads OR m Tails?, and the closely related (as we will show) random variable `How many coin tosses would it take until you get n Heads AND m Tails?'

Maple package


Sample Input and Output for CoinToss.txt

Pictures

Note: the language below is in terms of family planning where Boy is Head and Girl is Tail.

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR(bottom) 100 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 80 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 60 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 40 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 30 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 20 girls look here

  • If you want to see a plot of the expected family size as a function of the Probability of having a boy (from 0.1 to 0.9) where the goal is to have 100 boys AND (top) OR (bottom) 10 girls look here


    If you want to see a plot of the probability density function for the (scaled) discrete random variable "number of coin-tosses until a fair coin reaches either 200 Heads OR 200 Tails",see here (notice how one-sided it is, and it looks like the left side of the Normal Distrubtion.

    If you want to see a plot of the probability density function for the (scaled) discrete random variable "number of coin-tosses until a LOADED coin (prob. of Heads=1/3) to reach either 200 Heads OR 200 Tails", see here (notice how symmetric it is, and it looks like the full Normal Distrubtion.


    Articles of Doron Zeilberger


    Svante Janson's Home Page

    Lucy Martinez's Home Page

    Doron Zeilberger's Home Page