### Introduction

I recently posted the following teaser on Twitter:

Teaser of the week:

You have 10 doors to choose from, 1 has a car behind, the others have a goat. You choose 1. I then open 8 of the other 9 doors to show a goat. What is your chance of winning the car if you switch from your chosen door to the last remaining one? #nocheating

— Matt Thompson (@Vegaskid1973) March 9, 2018

### Self-doubt

This is known as the Monty Hall problem, named after the game show host.

When I first read this problem, my brain initially told me that my chances were 50/50, whether I stuck with my first door or switched to the only other closed door. Of course, I’m a bit of a natural sceptic and so I had this niggle in my head that said 50/50 was too obvious. So off I went to read up on the problem.

A number of people responded to my tweet. Most thought it was also a 50/50 chance even when I tried, in a limited stutter of 280 characters, to explain the real answer. One person said it would be higher than 50/50 but they couldn’t remember the maths and only one person gave the correct answer, so let’s see if we can get there together.

### Breaking it down

Let’s begin with just three doors.

? ? ?

One door has a car behind it, the other two have goats. Your chances of picking the car is 1 in 3, 1/3, 33.3% to use various measures. I will use a probability measure of 0.33… which is on a scale of 0-1. If you add up all the probabilities of events that can happen, they will add up to one. You can only pick the car or a goat. There are no other options. Therefore, the chances of picking a goat are 2/3, or 0.66…. This can be calculated as 1-0.33….

(Note, for numbers that are recurring, I am using two decimal places with the … notation)

The doors can be setup before the game as below, G=goat, C=car:

GGC

GCG

CGG

Remember what happens when you pick your door? Monty will open all but one of the other doors to reveal a goat, so you end up with your chosen door and one unopened door. So one of two situations can happen here.

- You pick the car 1/3 of the time and the other door will always be a goat
- You pick a goat 2/3 of the time and the other door will always be the car

The teaser asks, what is your chance of winning the car if you switch doors. Therefore, 1/3 of the time when you switch, you lose (or win if you prefer goats) and 2/3 of the time when you switch, you will always get the car. So no 50/50 here.

### It gets better

OK, the last section started with the basics using just 3 doors, but my question was with a game using 10 doors. Let’s use the same process but update the numbers accordingly.

? ? ? ? ? ? ? ? ? ?

One door has a car behind it, the other nine have goats. Your chances of picking the car is 1 in 10, 1/10, 10% to use various measures. I will use a probability measure of 0.1 which is on a scale of 0-1. If you add up all the probabilities of events that can happen, they will add up to one. You can only pick the car or a goat. There are no other options. Therefore, the chances of picking a goat are 9/10, or 0.9. This can be calculated as 1-0.1.

- You pick the car 1/10 of the time and the other door will always be a goat
- You pick a goat 9/10 of the time and the other door will always be the car

The teaser asks, what is your chance of winning the car if you switch doors. Therefore, 1/10 of the time when you switch, you lose (or win if you prefer goats) and 9/10 of the time when you switch, you will always get the car.

So…*always, always switch!*

### Still not convinced?

OK, sometimes people like to see this in action and so I’ve created a Python script here that simulates the game. Please don’t troll me too much for the lack of Pythonic code, although I welcome constructive feedback! Hopefully the code is commented well enough for you to see what it is doing.

### Summary

I’ve always loved probability and statistical type problems because they are great examples of using pure mathematics to challenge people’s assumptions and biases. Hopefully, you found this example clear. If not, let me know so I can improve upon it.

Till the next time.