Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions examples/Monty_Hall.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, \"Do you want to pick door No. 2?\" Is it to your advantage to switch your choice?\n",
"\n",
"By intution it seems that there shouldn't be any benefit of switching the door. But using Bayes' Theorem we can show that by switching the door the contestant has more chances of winning.\n",
"By intuition, it may seem that there is no benefit in switching doors. However, using Bayes' Theorem, we can show that switching actually increases the probability of winning.",
"\n",
"You can also checkout the wikipedia page: https://en.wikipedia.org/wiki/Monty_Hall_problem"
]
Expand All @@ -26,9 +26,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Probabilistic Interpretetion:\n",
"So have 3 random variables Contestant $C \\in \\{1, 2, 3\\}$, Host $H \\in \\{1, 2, 3\\}$ and prize $P \\in \\{1, 2, 3 \\}$. The prize has been put randomly behind the doors therefore: $P(P=1) = P(P=2) = P(P=3) = \\frac{1}{3}$. Also, the contestant is going to choose the door randomly, therefore: $P(C=1) = P(C=2) = P(C=3) = \\frac{1}{3}$. For this problem we can build a Bayesian Network structure like:\n",
"\n"
### Probabilistic Interpretation

We define three random variables:

- Contestant (C): The door initially chosen by the contestant.
- Host (H): The door opened by the host (always revealing a goat).
- Prize (P): The door hiding the prize.

Each of these variables can take values from {0, 1, 2}, representing the three doors.

Since the prize is placed randomly:
P(P=0) = P(P=1) = P(P=2) = 1/3

Similarly, the contestant initially picks a door at random:
P(C=0) = P(C=1) = P(C=2) = 1/3
]
},
{
Expand Down