Puzzle/logic question

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

gdextreme

Member
Nov 8, 2008
127
0
0
Originally posted by: her209
Probability of picking a normal coin * probability of flipping heads:
19/20 * 1/2

Probability of picking the abnormal coin * probability of flipping heads:
1/20 * 1

19/40 + 2/40 = 21/40 = 52.5%

Here you're ignoring that the coin already gave 4 heads earlier. I got to ask this question to my teacher for a confirmation.
 

gdextreme

Member
Nov 8, 2008
127
0
0
Originally posted by: rocadelpunk
Originally posted by: chuckywang
I'm gonna guess 51/70.

EDIT for rationale:

Write down all possibilities of the first four flips:
The 19 regular coins will have 32 possibilities (2 with first four being heads).
For the sake of consistency, if the flip the 1 trick coin 32 times, you are obviously going to get all heads 32 times.

So therefore, in total you have 32 (from the one trick coin) + 2*19 (from the 19 regular coins) where the first four flips are heads. Of those 70, 32 + 19 = 51 of them have the 5th flip being heads as well.

Hence 51/70.


just to point out...
ignoring a trick coin - say there are 20 regular coins

so it doesn't really matter which coin you pick.

Chances of getting heads on first flip (1/2)
chances of getting heads on first flip and second flip (1/2)*(1/2)
chances of getting heads on first flip and second flip and third (1/2)*(1/2)*(1/2)

so chances of getting five heads in a row is roughly 3%

I'm pretty sure adding just one trick coin won't raise it odds of you getting five heads in a row after selecting a coin out of the 20 will get you anywhere near 70+%

It is given in the question that 4 heads have already occured. But you have included the probability of that happening too. Think like this: There are 19 regular coins which have a probability of 0.5 for showing head on the 5th try (Note here that we have not included the probability of 4 heads ocurring because it is given that that has already occured. Or in other words we have taken the probabilty of heads occuring in the 1st 4 tries as 1 regardless if its trick coin or not since that event has already ocurred) and there is 1 trick coin which has a probability of showing heads as 1. So we expect the answer to be between 0.5 and 1 which is what is obtained.

 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.
 
Oct 27, 2007
17,009
1
0
I wrote a computer program to test this, after one million iterations the odds are 0.729266, very close to KoolAidKid's prediction. You can check my source code (VERY rushed, so could have mistakes) at http://martindoms.com/CoinGame.cs

Edit - and yes I know it could be more efficient, I don't care. It takes < 5 seconds to run 1,000,000 iterations on my shitty lap top, so please no algorithm lectures.
 

rocadelpunk

Diamond Member
Jul 23, 2001
5,589
1
81
Originally posted by: gdextreme
Originally posted by: rocadelpunk
Originally posted by: chuckywang
I'm gonna guess 51/70.

EDIT for rationale:

Write down all possibilities of the first four flips:
The 19 regular coins will have 32 possibilities (2 with first four being heads).
For the sake of consistency, if the flip the 1 trick coin 32 times, you are obviously going to get all heads 32 times.

So therefore, in total you have 32 (from the one trick coin) + 2*19 (from the 19 regular coins) where the first four flips are heads. Of those 70, 32 + 19 = 51 of them have the 5th flip being heads as well.

Hence 51/70.


just to point out...
ignoring a trick coin - say there are 20 regular coins

so it doesn't really matter which coin you pick.

Chances of getting heads on first flip (1/2)
chances of getting heads on first flip and second flip (1/2)*(1/2)
chances of getting heads on first flip and second flip and third (1/2)*(1/2)*(1/2)

so chances of getting five heads in a row is roughly 3%

I'm pretty sure adding just one trick coin won't raise it odds of you getting five heads in a row after selecting a coin out of the 20 will get you anywhere near 70+%

It is given in the question that 4 heads have already occured. But you have included the probability of that happening too. Think like this: There are 19 regular coins which have a probability of 0.5 for showing head on the 5th try (Note here that we have not included the probability of 4 heads ocurring because it is given that that has already occured. Or in other words we have taken the probabilty of heads occuring in the 1st 4 tries as 1 regardless if its trick coin or not since that event has already ocurred) and there is 1 trick coin which has a probability of showing heads as 1. So we expect the answer to be between 0.5 and 1 which is what is obtained.

thanks : )

yeah i was missing that + conditional.

whoopsy haha
 

Chiropteran

Diamond Member
Nov 14, 2003
9,811
110
106
Originally posted by: TuxDave
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.

But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.
 

silverpig

Lifer
Jul 29, 2001
27,703
11
81
Originally posted by: Chiropteran
Originally posted by: TuxDave
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.

But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.

Nope. You're wrong.
 

CoinOperatedBoy

Golden Member
Dec 11, 2008
1,809
0
76
Originally posted by: Chiropteran
Originally posted by: TuxDave
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.

But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.

Godless Astronomer's program does it properly. It chooses a coin and flips until one produces 4 heads, then records the result of the 5th flip.

Your 52.5% is the chance that a single flip of a randomly chosen coin will be heads. That doesn't directly address OP's specific question.
 

yuchai

Senior member
Aug 24, 2004
980
2
76
Originally posted by: Chiropteran
Originally posted by: TuxDave
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.

But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.

The initial chance of picking the broken coin is 5%. But, after you throw 4 times and they all came up as heads, you now have additional information and the probability that you had picked the broken coin is higher.

Think about it for a minute. If you throw 100 more times and they all came up as heads, are you saying that information does not improve the probability that you had picked the broken coin?
 

Kyteland

Diamond Member
Dec 30, 2002
5,747
1
81
Originally posted by: Chiropteran
But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.

That's like stating that you're playing russian roulette where you survived the first five trigger pulls, but your odds on the next pull are still 1/6 so you might as well go for it. :roll:
 
Oct 27, 2007
17,009
1
0
Originally posted by: Chiropteran
Originally posted by: TuxDave
Someone can just write a program.
Step #1: Pick a coin (19/20 fair), (1/20 biased)
Step #2: Flip 4 times. If not all heads, start over to step #1. If all four heads, add one to "Total Samples"
Step #3: Flip a coin, if heads, add one to "Total samples that had head on 5th flip"

Step 3/Step 2. You'll see the answer is closer to KoolAidKid's answer. I guarantee it.

But your step 2 wasn't mentioned by the OP.

He didn't say "flip coins 4 times until you successfully flip one heads all 4 times"


There are 20 coins.

One is picked at random.

It is flipped 4 times, and all 4 flips are heads.

The chance of that coin being the broken coin is 5%, 1/20. It can't possibly be higher because it was picked at random BEFORE it was known that the 4 flips were all heads.

So 5% of the time it'll be heads, the other 95% of the time there is a 50/50 chance of it being heads. 52.5% chance that it will be heads on the 5th flip.

My simulation does this correctly. You're more than welcome to examine the source code or even compile and run it. I was very surprised by the result, but then I've never taken a stats class.
 

Chiropteran

Diamond Member
Nov 14, 2003
9,811
110
106
Originally posted by: CoinOperatedBoy

Godless Astronomer's program does it properly. It chooses a coin and flips until one produces 4 heads, then records the result of the 5th flip.

But that is wrong.

The OP didn't say anything about picking multiple coins and only keeping the one that flipped heads 4 times in a row. It just involved a single pick.
 

TallBill

Lifer
Apr 29, 2001
46,017
62
91
Originally posted by: KoolAidKid
Using Bayes theorem, the probability that you are holding the trick coin given 4 consecutive heads flips is about 0.457. Therefore, the probability of a heads outcome on the next flip is 0.457(1) + (1 - 0.457)*0.5 = 0.7285.

Winner winner, chicken dinner.
 
Oct 27, 2007
17,009
1
0
Originally posted by: Chiropteran
Originally posted by: CoinOperatedBoy

Godless Astronomer's program does it properly. It chooses a coin and flips until one produces 4 heads, then records the result of the 5th flip.

But that is wrong.

The OP didn't say anything about picking multiple coins and only keeping the one that flipped heads 4 times in a row. It just involved a single pick.

No. It picks a single coin and flips it 4 times. If any of those flips gives tails then the experiment is failed, because the experiment is predicated on 4 heads in a row first. If a tail is flipped the jar of coins is reset and we try again. Those failed runs have absolutely no effect on the result.
 

yuchai

Senior member
Aug 24, 2004
980
2
76
The 21/40 or 52.5% that many people are saying is the probability of the first throw coming up as heads.

If after one throw you put the coin back in the jar and then randomly select another coin, the chance of getting heads on the next throw would remain at 52.5%.

In the OP's question, however, we're not putting the coin back into the jar and then randomly picking another coin. We only picked once and are throwing the same coin over and over again. In this case, observing the outcomes that the coin produces would obviously give you insight on whether the picked coin was normal or rigged.
 

Chiropteran

Diamond Member
Nov 14, 2003
9,811
110
106
Originally posted by: GodlessAstronomer
Originally posted by: Chiropteran
Originally posted by: CoinOperatedBoy

Godless Astronomer's program does it properly. It chooses a coin and flips until one produces 4 heads, then records the result of the 5th flip.

But that is wrong.

The OP didn't say anything about picking multiple coins and only keeping the one that flipped heads 4 times in a row. It just involved a single pick.

No. It picks a single coin and flips it 4 times. If any of those flips gives tails then the experiment is failed, because the experiment is predicated on 4 heads in a row first. If a tail is flipped the jar of coins is reset and we try again. Those failed runs have absolutely no effect on the result.



One of the coins is a trick coin that has both sides heads.

Obvious enough.

You pick a random coin from the jar and flip it 4 times, and each time it comes up heads.

You pick a coin at random. This means you have a 5% chance of picking the trick coin, or a 95% chance of picking a normal coin.

You flip it 4 times and it comes up as heads each time. This information is USELESS. It doesn't tell us anything. You could pick up a normal coin and flip heads 4 times, or the trick coin. In a normal situation, there would be a chance of flipping a normal coin and getting tails, but the conditions of the puzzle say that doesn't happen. Is it unlikely to get 4 heads in a row with a normal coin? Not under the conditions of this puzzle. It's 100% likely, because it's a requirement.

What are the chances that the next flip will come up heads?

If you have the trick coin, it's 100%. If you have a normal coin, it's 50%. The chance of picking the trick coin is 5%.
 

Chiropteran

Diamond Member
Nov 14, 2003
9,811
110
106
Originally posted by: yuchai
The 21/40 or 52.5% that many people are saying is the probability of the first throw coming up as heads.

If after one throw you put the coin back in the jar and then randomly select another coin, the chance of getting heads on the next throw would remain at 52.5%.

In the OP's question, however, we're not putting the coin back into the jar and then randomly picking another coin. We only picked once and are throwing the same coin over and over again. In this case, observing the outcomes that the coin produces would obviously give you insight on whether the picked coin was normal or rigged.

In the real world, yes. In the context of the puzzle though, it doesn't give us any insight at all. In the context of the puzzle, it's not unusual at all to flip a real coin 4 times in a row and get heads each time because it's stated in the puzzle.
 

TallBill

Lifer
Apr 29, 2001
46,017
62
91
Originally posted by: Chiropteran
Originally posted by: GodlessAstronomer
Originally posted by: Chiropteran
Originally posted by: CoinOperatedBoy

Godless Astronomer's program does it properly. It chooses a coin and flips until one produces 4 heads, then records the result of the 5th flip.

But that is wrong.

The OP didn't say anything about picking multiple coins and only keeping the one that flipped heads 4 times in a row. It just involved a single pick.

No. It picks a single coin and flips it 4 times. If any of those flips gives tails then the experiment is failed, because the experiment is predicated on 4 heads in a row first. If a tail is flipped the jar of coins is reset and we try again. Those failed runs have absolutely no effect on the result.



One of the coins is a trick coin that has both sides heads.

Obvious enough.

You pick a random coin from the jar and flip it 4 times, and each time it comes up heads.

You pick a coin at random. This means you have a 5% chance of picking the trick coin, or a 95% chance of picking a normal coin.

You flip it 4 times and it comes up as heads each time. This information is USELESS. It doesn't tell us anything. You could pick up a normal coin and flip heads 4 times, or the trick coin. In a normal situation, there would be a chance of flipping a normal coin and getting tails, but the conditions of the puzzle say that doesn't happen. Is it unlikely to get 4 heads in a row with a normal coin? Not under the conditions of this puzzle. It's 100% likely, because it's a requirement.

What are the chances that the next flip will come up heads?

If you have the trick coin, it's 100%. If you have a normal coin, it's 50%. The chance of picking the trick coin is 5%.

But we're not picking the trick coin. We're checking the odds given the fact that 4 flips have already come up heads, which drives up the odds of the trick coin already being selected. Hence, Bayes theorem.
 

Mo0o

Lifer
Jul 31, 2001
24,227
3
76
Originally posted by: Chiropteran
Originally posted by: yuchai
The 21/40 or 52.5% that many people are saying is the probability of the first throw coming up as heads.

If after one throw you put the coin back in the jar and then randomly select another coin, the chance of getting heads on the next throw would remain at 52.5%.

In the OP's question, however, we're not putting the coin back into the jar and then randomly picking another coin. We only picked once and are throwing the same coin over and over again. In this case, observing the outcomes that the coin produces would obviously give you insight on whether the picked coin was normal or rigged.

In the real world, yes. In the context of the puzzle though, it doesn't give us any insight at all. In the context of the puzzle, it's not unusual at all to flip a real coin 4 times in a row and get heads each time because it's stated in the puzzle.

Hmm but if we go a bit further. Let's say you pick a coin at random and flip it a milllion times and it comes up heads everytime. The fact that it keeps coming up heads suggests that you likely picked the trick coin rather than a regular coin. So I think the fact that it did come up heads needs to be factored in somehow.

Using Baye's theorum is correct
 
Oct 27, 2007
17,009
1
0
Chiropteran, statistics can be very counter intuitive. In my program if I comment out the lines that check the first 4 throws (which you claim to be irrelevant) then the odds come to ~0.525. Why is it that you think this changed if the first four rolls are disregarded? If you think there is a problem with the results then you'll need to explain either the logical flaw in KoolAidKid's mathematics or the bug in my software that miraculously gives exactly the result he predicted.
 

Chiropteran

Diamond Member
Nov 14, 2003
9,811
110
106
Originally posted by: TallBill

But we're not picking the trick coin. We're checking the odds given the fact that 4 flips have already come up heads, which drives up the odds of the trick coin already being selected. Hence, Bayes theorem.

The odds of any coin giving you heads 4 times in a row is 100%, because it is stated in the puzzle. There is zero chance of getting tails.
 

Mo0o

Lifer
Jul 31, 2001
24,227
3
76
Originally posted by: Chiropteran
Originally posted by: TallBill

But we're not picking the trick coin. We're checking the odds given the fact that 4 flips have already come up heads, which drives up the odds of the trick coin already being selected. Hence, Bayes theorem.

The odds of any coin giving you heads 4 times in a row is 100%, because it is stated in the puzzle. There is zero chance of getting tails.

please read my comment
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |