In Projects

MATLAB Three Doors Game Simulation

There is a game show where a contestant attempts to pick the correct door amongst three doors. Two of the doors hide goats behind them and one of the doors hides a new car behind it. The player attempts to pick the door with the car behind it to win the new car as a prize. Once the contestant chooses a door, the game host then opens one of the other doors to reveal one of the goats. The host then asks the contestant if they would like to stick with the door they chose or if they would like to change their mind and pick the remaining closed door. What should the contestant do?

The following cases will always prove true:

1) If the contestant does not switch doors, then they must origianlly pick the correct door in order to win (33.3% chance of winning)

2) If the contestant does switch doors, then they must originally pick one of the goat doors in order to win (66.7% chance of winning)

If the contestant does not switch doors then his odds of winning are about 33%. If the contestant switches doors then they increases their odds of winning to about 66%. The advantage of switching doors may not be obvious at first. The MATLAB simulation here demonstrates this statistical advantage by simulating 1000 rounds of the game.

MATLAB Source Download
Visit GitHub to download the source:
https://gist.github.com/KevinKParsons/efcb2c46138df970a2e04490e41b334b

MATLAB Source - three-doors-game-show.m