This is also known as the Monty Hall Problem, from a gameshow.

The explanation is easier to realize when considering 100 doors. If you choose 1 out of 100 doors, and then the game host removes/opens all but one of the remaining 99, it's fairly probable that the prize is behind the 99-now-collapsed-into-1 door, wouldn't you think?

It can of course be generalized to a case with n doors.

  • Probability of winning if you keep the door you originally picked:
    1 / n
  • Probability of winning if you choose another unopened door:
    ((n - 1) / n) * (1 / (n - 2))
The latter value is equal to (1 / n) * (n - 1) / (n - 2), which is greater than 1 / n for n >= 3. Thus, it is always better to switch doors.