Q.7.26
Question
A coin that comes up heads with probability p is flipped until either a total of n heads or of m tails is amassed. Find the expected number of flips. Hint: Imagine that one continues to flip even after the goal is attained. Let X denote the number of flips needed to obtain n heads, and let Y denote the number of flips needed to obtain m tails. Note that max(X, Y) + min(X, Y) = X + Y. Compute E[max(X, Y)] by conditioning on the number of heads in the first n + m − 1 flips.
Step-by-Step Solution
VerifiedThe expected number of flips will be .
A coin that comes up heads with probability p is flipped until either a total of n heads or of m tails is amassed.
From the given information we need to calculate the results,
The expectation values of X and Y are given as follows:
conditioning on N, E[M] is given below,
If then heads need to be obtained,
If then tails need to be obtained.
So,
Now simplify the equation we get,
now we need to solve by using the above results,
Thus the result is
The expected number of flips will be .