I just built a lock for a door in Minecraft. The user has to pick the correct four colors out of twelve. Order doesn't matter. What is the probability of the user guessing the correct colors?
-
1One, me putting a redstone torch in front of said locked door and walking through.– Nick TJun 24, 2011 at 2:13
-
1@Nick Every experienced lock-maker knows to set it up so the door is closed when powered. :P– MaxpmJun 24, 2011 at 6:26
-
1I don't see how this is on topic. It is a pure math question that has nothing really to do with gaming.– ppperyJun 25, 2019 at 13:41
-
1@Soup Please remember that Be Nice applies to all users, no matter how old the question is. Assuming good faith when interacting with other users is expected.– FrankJul 8, 2019 at 2:38
-
4I’m voting to close this question because it's about mathematics, not gaming.– ppperyJul 11, 2022 at 1:06
2 Answers
You have 4/12 of a chance of picking the first colour right.
You have 3/11 of a chance of picking the second colour right from the remaining eleven colours, if you got the first right.
You have 2/10 of a chance of picking the third colour right from the remaining ten colours, if you got the former two colours right.
You have 1/9 of a chance of picking the fourth colour right from the remaining nine colours, if you got the former three colours right.
Hence, the probability of guessing the combination is: 4/12 × 3/11 × 2/10 × 1/9 = 495-1.
In other words, there are 495 different combinations, of which one is correct.
Obviously, all of this is useless, unless you are working on a exploration mode map. It's much faster to just take a pick and destroy your door.
-
You could some how set it up so if any wall is destroyed TNT or lava is released, lava would be better because if you returned it wouldn't have destroyed the wall like TNT would.– RonanJan 30, 2011 at 11:44
-
2You don't need to release lava, having it stream down in the first place behind each wall works just as well. If the lava flows from far enough above and goes deep then the player can't easily block it off to pass through. Jan 30, 2011 at 16:52
-
@Sadly, if the player opens the door with the code, how is he not also killed by the lava? (I have not played Minecraft, just curious)– juanJun 24, 2011 at 15:29
-
@JuanManuel, I dunno, use some pistons or that business :P it's much easier to block off one column of lava than wait for however many more to be released. Feb 24, 2012 at 17:28
Use the Choose function. You have 12 items, from which you can choose 4 and the order of those chosen 4 does not matter. This means you want to calculate 12 choose 4.
n choose k = n! / (k! * (n - k)!)
So, you have 12!/(4!8!) = 495 different choices, giving you a probability of choosing the one correct answer 1/495 = .00202... = 0.2%
Maths.
-
-
it isn't the 'choose' function, it's actually the binomial expansion :) Jun 24, 2011 at 9:12
-
@The Communist Duck: Same thing! en.wikipedia.org/wiki/Binomial_coefficient "often read as 'n choose k'"– RawlingJun 24, 2011 at 9:52
-