Thread Rating:

Trevor
Trevor
  • Threads: 7
  • Posts: 34
Joined: Nov 14, 2014
November 29th, 2017 at 6:46:25 AM permalink
Hi there,

How many times would i have to flip 2 coins before i've seen a heads on both coins. They don't have to come together. I just want to have seen at least 1 heads on both coins.

cheers

Trev
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27122
Joined: Oct 14, 2009
November 29th, 2017 at 9:38:55 AM permalink
I get 8/3
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Doc
Doc
  • Threads: 46
  • Posts: 7287
Joined: Feb 27, 2010
November 29th, 2017 at 11:30:16 AM permalink
Quote: Trevor

How many times would i have to flip 2 coins before i've seen a heads on both coins. They don't have to come together. I just want to have seen at least 1 heads on both coins.


I'm thinking I must not even understand the question.

Issue #1: Does sentence #2 ("They don't have to come together.") mean that the two coins don't have to show heads at the same time and that you just want to see a series of results that include the head side of each coin? Example, if the two coins are a nickel and a dime, you want to flip the two until you have seen the head side of the nickel and the head side of the dime. Is that what the question is describing?

Issue #2: If the suggested interpretation of Issue #1 is correct, is sentence #1 ("How many times would I have to flip ... ?") asking about the maximum number of flips before the criteria would be met or the expected number of flips? If you're asking about the maximum, I think the answer may be infinity.

Apparently, I need more info in order to understand what is being asked.
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 29th, 2017 at 12:59:23 PM permalink
Quote: Doc

I'm thinking I must not even understand the question.

Issue #1: Does sentence #2 ("They don't have to come together.") mean that the two coins don't have to show heads at the same time and that you just want to see a series of results that include the head side of each coin? Example, if the two coins are a nickel and a dime, you want to flip the two until you have seen the head side of the nickel and the head side of the dime. Is that what the question is describing?

Issue #2: If the suggested interpretation of Issue #1 is correct, is sentence #1 ("How many times would I have to flip ... ?") asking about the maximum number of flips before the criteria would be met or the expected number of flips? If you're asking about the maximum, I think the answer may be infinity.

Apparently, I need more info in order to understand what is being asked.



Fwiw, I took the question to be a simplified 2 dice question. What is your expectation for any particular number? Tt, ht, th, hh. 1/4 of the time the first roll satisfies it. 2/4 half-satisfies it. 1/4 no help. 2nd roll, depends on first roll, but 2 of 7 (th, hh) satisfies the ht roll, 2 of 7 (ht, hh) satisfies the th roll, 3 in 7 (copy ht or th, tt) doesn't help. 3rd roll, repeats that. Until you get the both heads at some point.

Not sure where 8/3 comes from.
If the House lost every hand, they wouldn't deal the game.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6741
Joined: Jun 22, 2011
November 29th, 2017 at 1:09:37 PM permalink
Quote: beachbumbabs

Not sure where 8/3 comes from.


It comes from the expected number of tosses needed for each coin to come up heads at least once.


The expected number of tosses before any heads at all show up is:
0 x 3/4 + 1 x 1/4 x 3/4 + 2 x (1/4)2 x 3/4 + 3 x (1/4)3 x 3/4 + ...
= 3/16 x (1 + 2 x 1/4 + 3 x (1/4)2 + 4 x (1/4)3 + ...)
= 3/16 x (1 + 1/4 + (1/4)2 + ...)2
= 3/16 x 16/9 = 1/3

The first toss that has at least one head will be two heads 1/3 of the time, so the expected number of additional tosses is 1/3.

The first toss that has at least one head will be one head and one tail 2/3 of the time; this is 1 toss plus the expected number for the other coin to come up heads, or 1 + (1/2 x 1 + (1/2)2 x 2 + (1/2)3 x 3 + ...)
= 1 + 1/2 x (1 + 1/2 x 2 + (1/2)2 x 3 + ...)
= 1 + 1/2 x (1 + 1/2 + (1/2)2 + ...)2
= 1 + 1/2 x 4 = 3
Thus, the expected number of additional tosses if the first toss with any heads has one head and one tail is 2/3 x 3 = 2, and the total number of expected tosses is 1/3 + 1/3 + 2 = 8/3.

Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27122
Joined: Oct 14, 2009
November 29th, 2017 at 9:17:23 PM permalink
Let me rephrase the question.

You flip two coins at the same time until you've seen each coin land on heads. What is the expected number of flips that will take?

For example, consider the following set of flips, where the first letter is the outcome of coin 1 and the second coin 2:

HT
TT
HT
TH

This required four flips. You saw coin 1 land on heads the first flip but it took three more flips for coin 2 to land on heads.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Trevor
Trevor
  • Threads: 7
  • Posts: 34
Joined: Nov 14, 2014
November 30th, 2017 at 12:56:50 AM permalink
Quote: Wizard

Let me rephrase the question.

You flip two coins at the same time until you've seen each coin land on heads. What is the expected number of flips that will take?

For example, consider the following set of flips, where the first letter is the outcome of coin 1 and the second coin 2:

HT
TT
HT
TH

This required four flips. You saw coin 1 land on heads the first flip but it took three more flips for coin 2 to land on heads.



Hi Guys,

Yes. What he said.

How did you come up with 8/3.

Trev
Trevor
Trevor
  • Threads: 7
  • Posts: 34
Joined: Nov 14, 2014
November 30th, 2017 at 2:02:05 AM permalink
ThatDonGuy said:

The expected number of tosses before any heads at all show up is:
..... =1/3

I thought it would be 3/4. There are 4 possible permutations with 3 giving at least 1 head.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6741
Joined: Jun 22, 2011
November 30th, 2017 at 6:00:32 AM permalink
Quote: Trevor

ThatDonGuy said:

The expected number of tosses before any heads at all show up is:
..... =1/3

I thought it would be 3/4. There are 4 possible permutations with 3 giving at least 1 head.


3/4 of the time, the first toss will have at least one head; this is 0 tosses "before any heads show up"
1/4 x 3/4 of the time, the first toss will be two tails, and the second toss will be at least one head; this is 1 toss.
1/4 x 1/4 x 3/4 of the time, the first two tosses will be two tails, and the third toss will be at least one head; this is 2 tosses.
And so on.
The expected number of tosses at the start that are both tails is:
0 x 3/4 + 1 x 1/4 x 3/4 + 2 x (1/4)2 x 3/4 + 3 x (1/4)3 x 3/4 + ... = 1/3.


1 + 2 x + 3 x2 + 4 x3 + ... = (1 + x + x2 + x3 + ...)2

Also, for -1 < x < 1, 1 + 1/x + (1/x)2 + (1/x)2 + ... = 1 / (1-x)

Trevor
Trevor
  • Threads: 7
  • Posts: 34
Joined: Nov 14, 2014
November 30th, 2017 at 7:52:32 AM permalink
Quote: ThatDonGuy

3/4 of the time, the first toss will have at least one head; this is 0 tosses "before any heads show up"
1/4 x 3/4 of the time, the first toss will be two tails, and the second toss will be at least one head; this is 1 toss.
1/4 x 1/4 x 3/4 of the time, the first two tosses will be two tails, and the third toss will be at least one head; this is 2 tosses.
And so on.
The expected number of tosses at the start that are both tails is:
0 x 3/4 + 1 x 1/4 x 3/4 + 2 x (1/4)2 x 3/4 + 3 x (1/4)3 x 3/4 + ... = 1/3.


1 + 2 x + 3 x2 + 4 x3 + ... = (1 + x + x2 + x3 + ...)2

Also, for -1 < x < 1, 1 + 1/x + (1/x)2 + (1/x)2 + ... = 1 / (1-x)



Oh i see. Thanks ThatDonGuy
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
November 30th, 2017 at 8:19:58 PM permalink
Quote: Trevor

How many times would i have to flip 2 coins before i've seen a heads on both coins. They don't have to come together. I just want to have seen at least 1 heads on both coins.

at 1st read I did not get what the event was as you described.
now I got it.
sounds like a 3x3 matrix card game I play (maybe later)

I also get 2.67 rolls on average
but from the distribution (i used a transition matrix in Excel)...
(that is interesting to me)
flipprobcumulative probflip*prob
10.250.250.25
20.31250.56250.625
30.2031250.7656250.609375
40.113281250.878906250.453125
50.0595703130.9384765630.297851563
60.0305175780.9689941410.183105469
70.0154418950.9844360350.108093262
80.0077667240.9922027590.062133789
90.0038948060.9960975650.035053253
100.0019502640.9980478290.01950264
110.0009758470.9990236760.01073432
120.0004881020.9995117780.005857229
130.0002440960.9997558740.003173247
140.0001220590.9998779330.001708828
156.10324E-050.9999389660.000915485
163.05169E-050.9999694830.00048827
171.52586E-050.9999847410.000259396
187.62935E-060.9999923710.000137328
193.81469E-060.9999961857.2479E-05
201.90735E-060.9999980933.81469E-05
.sumavg # flips2.666624705


why the question?
as 2.67 is not 2 or 3 flips
Sally

the math for those so interested
ABCDprobprob
no H 1 coin1 coin * 2(A*2)1coin^2(A*A)B-C (no HH)both coins H cumulativeboth coins H on X flip
0.510.250.750.250.25
0.250.50.06250.43750.56250.3125
0.1250.250.0156250.2343750.7656250.203125
0.06250.1250.003906250.121093750.878906250.11328125
0.031250.06250.0009765630.0615234380.9384765630.059570313
0.0156250.031250.0002441410.0310058590.9689941410.030517578
0.00781250.0156256.10352E-050.0155639650.9844360350.015441895
0.003906250.00781251.52588E-050.0077972410.9922027590.007766724
0.0019531250.003906253.8147E-060.0039024350.9960975650.003894806
0.0009765630.0019531259.53674E-070.0019521710.9980478290.001950264
0.0004882810.0009765632.38419E-070.0009763240.9990236760.000975847
0.0002441410.0004882815.96046E-080.0004882220.9995117780.000488102
0.000122070.0002441411.49012E-080.0002441260.9997558740.000244096
6.10352E-050.000122073.72529E-090.0001220670.9998779330.000122059
3.05176E-056.10352E-059.31323E-106.10342E-050.9999389666.10324E-05
1.52588E-053.05176E-052.32831E-103.05173E-050.9999694833.05169E-05
7.62939E-061.52588E-055.82077E-111.52587E-050.9999847411.52586E-05
3.8147E-067.62939E-061.45519E-117.62938E-060.9999923717.62935E-06
1.90735E-063.8147E-063.63798E-123.81469E-060.9999961853.81469E-06
9.53674E-071.90735E-069.09495E-131.90735E-060.9999980931.90735E-06
Last edited by: mustangsally on Dec 1, 2017
I Heart Vi Hart
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27122
Joined: Oct 14, 2009
December 1st, 2017 at 9:47:03 AM permalink
Welcome back, Sally! Long time no hear.

Can I interest you in playing Clue?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
December 1st, 2017 at 3:28:35 PM permalink
I think there is a slightly easier approach.

The expect number of flips for coin A to get a head is obviously 2.

Using a simple recursive equation of x = 1/4 x + 1/4, you get x= 1/3 chance that coin B comes up heads after coin A does.

So the expectation is 2 flips for A plus 1/3 chance of another 2 flips for B.

2 + 1/3 * 2 = 8/3
It’s all about making that GTA
  • Jump to: