Skip to content

ShreenidhiAyinala/MontyHallProblem

Repository files navigation

Have you heard of the Monty Hall Problem?

The Monty Hall problem is a famous probability puzzle named after the host of the TV game show "Let's Make a Deal," Monty Hall. The problem goes as follows:

Suppose you're a contestant on a game show, and you're presented with three closed doors. Behind one of the doors is a valuable prize (let's say a car), and behind the other two doors are goats. The objective of the game is to choose the door that leads to the car.

Here's the process of the game:

  1. Initially, you choose one of the three doors, let's say Door 1, without knowing what's behind it.
  2. After you make your choice, the host, Monty Hall, who knows what's behind each door, opens one of the other two doors to reveal a goat. Let's say Monty opens Door 3, revealing a goat.
  3. Now, you're given a choice: you can either stick with your original choice (Door 1) or switch to the remaining unopened door (Door 2).

The question is: What is the best strategy to maximize your chances of winning the car? Should you stick with your original choice, switch doors, or does it not matter?

To analyze this mathematically, let's consider the probabilities associated with each scenario:

Scenario 1: Stick with the original choice (Door 1): In this case, the probability of the car being behind Door 1 is 1/3 since there are three equally likely doors initially. If you stick with your original choice, your chances of winning the car remain at 1/3.

Scenario 2: Switch to the remaining unopened door (Door 2): If you switch doors, you're essentially betting that your initial choice was wrong and that the car is behind the other unopened door (Door 2). After Monty reveals a goat behind Door 3, the probability of the car being behind Door 2 increases to 2/3 since there are only two remaining doors, and one of them definitely has a car behind it. Therefore, if you switch doors, your chances of winning the car become 2/3.

To further understand why switching is the better strategy, we can use conditional probability. Initially, the probability of choosing the car is 1/3, but the probability of choosing a goat is 2/3. When Monty reveals a goat behind Door 3, the probability distribution shifts. If you chose a goat initially (which has a 2/3 probability), switching will lead you to the car. However, if you chose the car initially (which has a 1/3 probability), switching will lead you to a goat. So by switching, you effectively swap your original probability of 1/3 for the remaining probability of 2/3.

Therefore, the optimal strategy to maximize your chances of winning the car is to switch doors. Despite the initial intuition that it shouldn't matter, the mathematics demonstrate that switching doors increases your probability of winning from 1/3 to 2/3.

To learn more about the mathematical components of this problem, check this out -> https://towardsdatascience.com/solving-the-monty-hall-problem-with-bayes-theorem-893289953e16

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages