00:01
So today we're going to explore the monty hall problem.
00:05
And we're going to simulate it with python.
00:10
So how the monty hall problem works is that you have...
00:15
It's a game show.
00:16
There are three doors.
00:17
You've got door one.
00:19
You've got door two.
00:22
And door three.
00:24
Door one.
00:25
Door two.
00:25
Door three.
00:26
And then randomly placed behind each of the three doors is either a goat or a car.
00:32
Let's just say it goes goat, car, goat.
00:34
Let's just say it's that.
00:34
It doesn't matter.
00:35
They're randomly placed there and then as the contestant on the game show we're given the option to choose one of these three doors and if we select the car we get the car and the premise at the time was that if you got the goat that's the that's the lame duck prize but the car is the big prize so you'd randomly pick one so let's just say you pick door one you wouldn't know the goats there but this is your choice this is the choice and then what happens next is monty hall would would then reveal where the other goat was.
01:04
He would say, oh, here is the other goat.
01:07
So that he would show us this.
01:09
And then we'd be given the choice to switch.
01:14
Do we want to switch? that means we made this choice for door one, but should we choose to car, or should we switch to door two? and knowing that this is the goat, of course we should switch, but we wouldn't know that.
01:31
We wouldn't see that.
01:31
So the question is, should we stay or switch? and that's the question.
01:42
And we're going to simulate this, and we should find that if we switch, we should win.
01:50
Win with a switch.
01:57
Roughly two -thirds, which is 66%, or 0 .66 probability.
02:05
Probability.
02:07
That means we win with staying, it would be about a third.
02:18
So we should see this.
02:25
All right, let's go ahead and do this.
02:27
So here's the python code.
02:37
Here's the code snippet here.
02:43
All right, so how this works, let me zoom in on this and we'll annotate this.
02:51
I you're importing the random library...