There are n items in a box labeled H and m in a box labeled T. A coin that comes up heads with probability p and tails with probability 1 − p is flipped. Each time it comes up heads, an item is removed from the H box, and each time it comes up tails, an item is removed from the T box. (If a box is empty and its outcome occurs, then no items are removed.) Find the expected number of coin flips needed for both boxes to become empty. Hint: Condition on the number of heads in the first n + m flips.

Short Answer

Expert verified

The expected number of coin flips needed for both boxes to become empty isE[X]=i=0nnipn+mCipi(1p)n+mi+i=n+1n+min1pn+mCipi(1p)n+mi.

Step by step solution

01

Given information

A coin that comes up heads with probability p and tails with probability 1 − p is flipped.

It comes up heads, an item is removed from the H box, and each time it comes up tails

Item is removed from the T box

02

Solution

The solution will be shown below,

E[X]=i=1n+mE[XY=i]P{Y=i}

=i=0n+mE[XY=i]n+mCipi(1p)n+mi

If the numeral of Heads in the first n+mflips is i,in, Then many more flips is the numeral of flips needed to receive additional (n-i) Heads. Similarly, if the number of Heads in the first n+mflips is i,j>n, then because there would keep existed a total of n+m-i<mtails, the numeral of more flips is the number required to receive an additional (i-n) Heads. Since the number of flips needed for j outcomes of a particular type is a negative Binomial Random variable whose mean is j divided by the probability of that outcome,

Therefore,

E[X]=i=0nnipn+mCipi(1p)n+mi+i=n+1n+min1pn+mCipi(1p)n+mi

03

Final answer 

The expected number of coin flips needed for both boxes to become empty is E[X]=i=0nnipn+mCipi(1p)n+mi+i=n+1n+min1pn+mCipi(1p)n+mi.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free