forked from koaning/bespoken
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathedit.py
More file actions
60 lines (45 loc) · 1.45 KB
/
edit.py
File metadata and controls
60 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "altair==5.5.0",
# "marimo",
# "matplotlib==3.10.3",
# "numpy==2.3.1",
# "pandas==2.3.0",
# ]
# ///
import marimo
__generated_with = "0.14.10"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
import random
import pandas as pd
import altair as alt
return alt, mo, pd, random
@app.cell
def _(mo):
mo.md(
r"""
# The Monty Hall Paradox: A Probability Puzzle
Welcome to an exploration of one of the most intriguing probability puzzles in mathematics: The Monty Hall Problem.
**The Scenario:**
- You're on a game show, facing three closed 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 asks you: "Do you want to switch to door No. 2?"
**The Paradox:**
Intuition might suggest that switching doesn't matter, as you now have a 50/50 chance. However, probability theory tells us otherwise!
**The Solution:**
Always switch! By switching, you increase your chances of winning the car from 33.3% to 66.7%.
Let's dive into a simulation to understand why this counterintuitive result is correct.
"""
)
return
@app.cell
def _(mo):
mo.md("## Game Logic and Simulation")
return
if __name__ == "__main__":
app.run()