I made this project to show you the idea of the Monty Hall problem so you can make sure that the right solution — always change the door, is really true, which at first glance, conflicts with the common sense.
You choose the door, the program opens it but doesn't show you who is behind. Then it shows you where the goat is so you can deside to change your choice or not. And you get the result with graphs and images. You can also see what was behind each door, jump to the history page or restart the game.
The most interesting thing in the program is the Computer plays page. You specify the number of games to play, then program plays this number of games same randomly changing choice and leaving it. Appeared graphs shows you that the winning probability if change choice really is 67%, if not — 33%.
In the project besides usual java libraries are used:
- Swing, awt
- JFreeChart
- MigLayout
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?