Monty Hall problem, a C++ experiment.
Proves it's better to change door.
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?
More information about the problem
- Install Visual Studio Community 2022. Or use Professional/Enterprise version if you have it.
- In the installer check Desktop development with C++.
- Start Developer Command Prompt for VS 2022 or Developer Powershell for VS 2022.
- Inside that terminal you access compiler tools and can run
.\compile.bat
inside the build folder. - Run
.\main.exe
.
- Open the terminal.
- Install Xcode command-line tools.
xcode-select --install
- Run
make
inside build folder. - Run
.\main
.