Problem 58
Question
A coin having probability \(p\) of coming up heads is continually flipped until both heads and tails have appeared. Find (a) the expected number of flips; (b) the probability that the last flip lands on heads.
Step-by-Step Solution
Verified Answer
(a) The expected number of flips until both heads and tails appear is:
\[ E = p\left(1+\frac{1}{1-p}\right) \]
(b) The probability that the last flip lands on heads is:
\[ P(A) = \frac{1-p}{1 + p} \]
1Step 1: Calculate the probability of obtaining both heads and tails in a given number of flips
To find the expected number of flips, let's start by computing the probability of obtaining both heads and tails in a given number of flips. If the first flip is a head (which occurs with probability \(p\)), we can think of this as waiting for a tail to appear. The probability of this happening is the geometric distribution with parameter \((1-p)\). The expected number of flips for this to happen is \(\frac{1}{1-p}\), and since the first flip was a head, we need to add one more flip. Combining these, we get that the expected number of flips for both heads and tails to appear is:
\[
E = p\left(1+\frac{1}{1-p}\right)
\]
2Step 2: Calculate the probability of the last flip landing on heads
To find the probability that the last flip is heads, we need to consider the possible scenarios. Let's denote the last flip landing on heads by event A and the last flip landing on tails by event B. Since the coin can flip either heads or tails at any moment, A and B are complementary events, and therefore:
\[ P(A) = 1-P(B) \]
Now we need to compute the probability of event B. Let's count the flips from the first occurrence of tails: suppose the first tails appears in the \(i\)-th flip and the flips end with tails. In this case both since head and tails need to occur, \(i\) can take on a value from 1 to n-1. Since there are total \(n\) flips. Let's compute the probability that A happens given that the first tails appears in the \(i\)-th flip:
\[
P(A \mid i) = p^{i}
\]
This is true because tails needed to occur, and the remaining flips, from \(i\) to \(n\), must all be heads.
Now we need to compute the likelihood of the first tails appearing in the \(i\)-th flip:
\[ P(i) = p^{i-1}(1-p) \]
Using the law of total probability, we can compute the probability of the last flip landing on - event A:
\[ P(A) = \sum_{i=1}^{n-1} P(A \mid i)P(i) = \sum_{i=1}^{n-1} p^{i}p^{i-1}(1-p) = (1-p)\sum_{i=1}^{n-1} p^{2i-1} \]
Finally, as \(n\) goes to infinity, the probability that the last flip is heads becomes:
\[
\lim_{n \to \infty} P(A) = \frac{1-p}{1 + p}
\]
3Step 3: Summarizing the results
(a) The expected number of flips until both heads and tails appear is:
\[
E = p\left(1+\frac{1}{1-p}\right)
\]
(b) The probability that the last flip lands on heads is:
\[
P(A) = \frac{1-p}{1 + p}
\]
Key Concepts
Geometric DistributionExpected ValueLaw of Total Probability
Geometric Distribution
The geometric distribution models the number of trials needed to get the first success in a sequence of independent Bernoulli trials. In simpler terms, it's about how many times you'll flip the coin before you see a head, if you're looking for heads. This is handy when working with problems that involve finding the expected number of times a particular event happens in succession before a result occurs, like waiting for heads and tails to appear in our question.
In our coin problem, after getting a head, we treat the situation as waiting to get a tail (an opposite outcome). The number of flips needed to get this opposite outcome forms a geometric distribution with parameter \((1 - p)\), where \(p\) is the probability of getting a head. The expected number of flips to achieve this is \(\frac{1}{1-p}\). This parameter captures how likely it is for tails to appear after a head. This efficient way of tracking and calculating outcomes makes geometric distribution essential in probability theory.
In our coin problem, after getting a head, we treat the situation as waiting to get a tail (an opposite outcome). The number of flips needed to get this opposite outcome forms a geometric distribution with parameter \((1 - p)\), where \(p\) is the probability of getting a head. The expected number of flips to achieve this is \(\frac{1}{1-p}\). This parameter captures how likely it is for tails to appear after a head. This efficient way of tracking and calculating outcomes makes geometric distribution essential in probability theory.
Expected Value
Expected value represents the average outcome if an experiment is repeated many times. It gives us a predicted measure of central tendency for a random variable. In exercises solving expected values, you aim to determine what you should anticipate in the long run.
For the coin problem, the expected number of flips for both heads and tails to appear is important. According to the solution, after getting a head initially, we expect it would take \(\frac{1}{1-p}\) flips to see a tail. As the first flip is guaranteed, we add one more flip to this expectation due to \(p\), the initial probability of heads showing up. Thus, the expected number of flips is calculated by \(p\left(1+\frac{1}{1-p}\right)\). This formula helps to predict the expected number of trials needed before seeing both outcomes on the coin.
For the coin problem, the expected number of flips for both heads and tails to appear is important. According to the solution, after getting a head initially, we expect it would take \(\frac{1}{1-p}\) flips to see a tail. As the first flip is guaranteed, we add one more flip to this expectation due to \(p\), the initial probability of heads showing up. Thus, the expected number of flips is calculated by \(p\left(1+\frac{1}{1-p}\right)\). This formula helps to predict the expected number of trials needed before seeing both outcomes on the coin.
Law of Total Probability
The law of total probability is a fundamental rule relating marginal probabilities to conditional probabilities. It helps manage the probabilities of complex events by breaking them down into simpler components. For instance, in our problem, when figuring out the probability that the last flip is a head, the law aids in considering all possible sequences of events that end with heads.
In this context, we analyze scenarios where the first tails appear on the \(i\)-th flip. If heads must also happen, we've created a sequence in which remaining flips until the last are heads. The probability of ending on a head becomes:
In this context, we analyze scenarios where the first tails appear on the \(i\)-th flip. If heads must also happen, we've created a sequence in which remaining flips until the last are heads. The probability of ending on a head becomes:
- Likelihood of getting head till the nth flip, provided tails already appeared in an earlier flip.
- Using our event probability \(P(A)\), the law describes this as the total probability \([P(A) = \sum_{i=1}^{n-1} P(A \mid i)P(i) = (1-p)\sum_{i=1}^{n-1} p^{2i-1}]\) as stated in the exercise.
Other exercises in this chapter
Problem 55
Ten hunters are waiting for ducks to fly by. When a flock of ducks flies overhead, the hunters fire at the same time, but each chooses his target at random, ind
View solution Problem 57
Suppose that the expected number of accidents per week at an industrial plant is \(5 .\) Suppose also that the numbers of workers injured in each accident are i
View solution Problem 60
Each of \(m+2\) players pays 1 unit to a kitty in order to play the following game: A fair coin is to be flipped successively \(n\) times, where \(n\) is an odd
View solution Problem 61
Let \(X_{1}, \ldots\) be independent random variables with the common distribution function \(F,\) and suppose they are independent of \(N,\) a geometric random
View solution