• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

A Puzzle

RevDMV

Rear Admiral
Rear Admiral
Saw this on job posting today. You have to send your solution along with your resume. So clever Mics people what's you take?


You have 5 unmarked bags with 100 beads each. Bags #1-4 contain 4 red beads and 96 black beads; bag #5 contains 7 red beads and 93 black beads. You randomly select one of the five bags and remove three beads without looking inside the bag. One is red, and the other two are black. What is the probability that you drew the beads from bag #5?

Return the three beads to the bag and give it a good shake to mix things up. In the best-case scenario, what is the minimum number of beads you can withdraw, one at a time, to identify this bag as bag #5 with at least 50% certainty?
 
I'm lousy at math, my guess is 20% for the first question, and 5 for the second question.
 
I may be oversimplifying things but:


Odds are 1 in 5

The minimum would be 5 beads, if they were all red.
 
You have 5 unmarked bags with 100 beads each. Bags #1-4 contain 4 red beads and 96 black beads; bag #5 contains 7 red beads and 93 black beads. You randomly select one of the five bags and remove three beads without looking inside the bag. One is red, and the other two are black. What is the probability that you drew the beads from bag #5?

the probability of drawing this combination from any of bag 1-4 is (4*96*95)/1e6 = 3.648%, and from bag 5 is (7*93*92)/1e6 = 5.989%. So, I think, the probability of drawing this combination from bag 5 is 5.989 / (3.648*4+5.989) = 29.1%

Return the three beads to the bag and give it a good shake to mix things up. In the best-case scenario, what is the minimum number of beads you can withdraw, one at a time, to identify this bag as bag #5 with at least 50% certainty?
if my calculation above is correct, then under the best case scenario, after drawing 2 beads, both red, you'll have (7*6)/(4*3*4+7*6) which is just under 50%. assuming what I did above is correct.
 
the probability of drawing this combination from any of bag 1-4 is (4*96*95)/1e6 = 3.648%, and from bag 5 is (7*93*92)/1e6 = 5.989%. So, I think, the probability of drawing this combination from bag 5 is 5.989 / (3.648*4+5.989) = 29.1%

Imo it is simpler than that.
There are 23 red beads in total, and seven of that in bag #5, so the chance that the red bead you took is from #5 (which means the black ones are also) is 7/23= 0,3 -> 30%

And regarding question 2: I think the answer is 5 beads, when the first 5 beads you withdraw are all red. As long as you just draw 4 it's still about 1/5 with bag you've got, but as soon as you get the fifth red one you know it has to be #5. The question does say "best-case-scenario", which to me means you are incredibly lucky in taking only red beads.
 
You have 5 unmarked bags with 100 beads each. Bags #1-4 contain 4 red beads and 96 black beads; bag #5 contains 7 red beads and 93 black beads. You randomly select one of the five bags and remove three beads without looking inside the bag. One is red, and the other two are black. What is the probability that you drew the beads from bag #5?
1 in 5.

Return the three beads to the bag and give it a good shake to mix things up. In the best-case scenario, what is the minimum number of beads you can withdraw, one at a time, to identify this bag as bag #5 with at least 50% certainty?
5.
 
the probability of drawing this combination from any of bag 1-4 is (4*96*95)/1e6 = 3.648%, and from bag 5 is (7*93*92)/1e6 = 5.989%. So, I think, the probability of drawing this combination from bag 5 is 5.989 / (3.648*4+5.989) = 29.1%

Imo it is simpler than that.
There are 23 red beads in total, and seven of that in bag #5, so the chance that the red bead you took is from #5 (which means the black ones are also) is 7/23= 0,3 -> 30%

that sounds good to me.

And regarding question 2: I think the answer is 5 beads, when the first 5 beads you withdraw are all red. As long as you just draw 4 it's still about 1/5 with bag you've got, but as soon as you get the fifth red one you know it has to be #5. The question does say "best-case-scenario", which to me means you are incredibly lucky in taking only red beads.

nah, the question asks how many to give you a 50% certainty that you got bag 5, not 100% certainty.
 
At least 50% certainty.

Draw 4 red beads, it's still a 1 in 5 chance of having a specific bag: 20%

Draw a 5th red bead and it instantly goes up to 100% certainty of having bag #5.
 
If it says at least 50% percent certainty, that includes 50% certainty, so it could be four beads for the second question.
 
^^ Er, true. Never mind. I should know better than to tackle a math question. :rommie:
 
:D Getting a job as his assistant isn't a long term position usually. :)

You know, if I set this sort of math question on a job application, I would divide the completed applications as follows:

1) anyone who gets the wrong answer - factory line
2) anyone who gets the right answer and can prove they did it themselves - engineer/systems designer/accountancy
3) anyone who gets the right answer and can't prove they did it themselves - sales
4) anyone who writes that the test is pointless and they're not going to waste their time working it out - fast-track to management
 
At least 50% certainty.

Draw 4 red beads, it's still a 1 in 5 chance of having a specific bag: 20%

Draw a 5th red bead and it instantly goes up to 100% certainty of having bag #5.

if drawing one red bead will give you a 30% probability of picking bag 5, I don't think you'll need 4 red beads to tell you you've got bag 5.

nah, the question asks how many to give you a 50% certainty that you got bag 5, not 100% certainty.

Yeah, that threw me off too. Although I have to admit, that I don't even understand your solution. ;)

it's just the reverse of the first question.

doing the way you did:
- picking one red bead, the probability of getting bag 5 is 7/23;
- after you picked a red bead off bag 5, then there are 6 left in bag 5, and 22 in total, that give 6/22.
- and together they give ~57%
although I don't think it's right.

now, the way I did it: the probability of getting two red beads from bag 1-4 is p1 = 4/100 * 3/99; the probability of getting that from bag 5 is p2 = 7/100 * 6/99. So, the probability of picking bag 5 is p2/(p1*4+p2).

wait, we can use the Bayes theorem to do this using conditional probabilities. so, the probability of getting bag 5 given we have two red beads is written as P(B=5|X=2 red), where B is the bag number and X is two red beads. this is equals to: P(X|B) * P(B) / P(X). Now, P(X=2 red | B = 5) = p2 from above, P(B) = 1/5, P(X) is the tricky one. P(X) is the probability of picking 2 red beads regardless of the bag, I think it's 23/500 * 22/499. If that's the case, then P(B=5|X=2 red) = 41%. So that means you'll probable need 3 to give at least 50% certainty. But I can't be bothered with the maths anymore.
 
You could put something clever like:

"Depends on whether the person is right or left handed"

or

"Since it didn't specity being blindfolded or even looking away, the ods are 100% since I know which bags have what and can look into them and pick out that result."

or some kind of bullshit that makes them think you're clever.
 
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top