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?

  • It depends... Can the user press the same color more than once? (From what I understand, I think it's not possible, but Ward answer confused me) – Denilson Sá Maia Jan 29 '11 at 12:50
  • 1
    One, me putting a redstone torch in front of said locked door and walking through. – Nick T Jun 24 '11 at 2:13
  • 1
    @Nick Every experienced lock-maker knows to set it up so the door is closed when powered. :P – Maxpm Jun 24 '11 at 6:26
  • 1
    I don't see how this is on topic. It is a pure math question that has nothing really to do with gaming. – pppery Jun 25 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. – Frank Jul 8 at 2:38
  1. You have 4/12 of a chance of picking the first colour right.

  2. You have 3/11 of a chance of picking the second colour right from the remaining eleven colours, if you got the first right.

  3. 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.

  4. 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. – Ronan Jan 30 '11 at 11:44
  • 2
    You 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. – Sadly Not Jan 30 '11 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) – juan Jun 24 '11 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. – Sadly Not Feb 24 '12 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%


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.