Probability of a sequence of coin tosses ending in $HHT$ (I win) or $THH$(You win)
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Solution.
$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$
For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!
probability
add a comment |Â
up vote
1
down vote
favorite
I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Solution.
$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$
For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!
probability
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Solution.
$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$
For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!
probability
I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Solution.
$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$
For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!
probability
edited Jul 25 at 18:48
asked Jul 25 at 18:32
Quasar
697412
697412
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46
add a comment |Â
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.
Conversely, if the first two tosses are $HH$ then $THH$ can not come first.
Thus the answer is clearly $frac 14$.
add a comment |Â
up vote
1
down vote
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.
Conversely, if the first two tosses are $HH$ then $THH$ can not come first.
Thus the answer is clearly $frac 14$.
add a comment |Â
up vote
4
down vote
accepted
Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.
Conversely, if the first two tosses are $HH$ then $THH$ can not come first.
Thus the answer is clearly $frac 14$.
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.
Conversely, if the first two tosses are $HH$ then $THH$ can not come first.
Thus the answer is clearly $frac 14$.
Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.
Conversely, if the first two tosses are $HH$ then $THH$ can not come first.
Thus the answer is clearly $frac 14$.
answered Jul 25 at 18:51
lulu
34.9k14071
34.9k14071
add a comment |Â
add a comment |Â
up vote
1
down vote
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.
add a comment |Â
up vote
1
down vote
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.
A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?
Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.
answered Jul 25 at 18:57
orlp
6,6051228
6,6051228
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2862698%2fprobability-of-a-sequence-of-coin-tosses-ending-in-hht-i-win-or-thhyou-wi%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46