Updated 26 Apr 2010
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? -Whitaker
This program demonstrates that yes, your chances of winning are improved if you switch.
Marcus (2023). Monty Hall (https://www.mathworks.com/matlabcentral/fileexchange/26398-monty-hall), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
fixed bug where round by round mode for more than 3 doors only showed monty opening one door when in fact he opens all other doors except two
Add more comments and explanation;