This project simulates the famous Monty Hall Problem using Python and adds an intelligent twist by introducing a strategy-aware AI agent. The simulation compares the effectiveness of two strategies: switching and not switching. A randomly selected guest plays the game, and the outcome is analyzed with both statistics and visuals.
The Monty Hall Problem is a probability puzzle based on a game show scenario:
- A player is shown 3 doors.
- Behind one door is a car (the prize), and behind the other two are goats.
- The player selects one door.
- The host (Monty) opens one of the other two doors, always revealing a goat.
- The player is given a choice: stick with the original door or switch to the remaining unopened door.
Mathematically, switching gives a ~66.7% chance to win, while sticking with the original door gives only ~33.3%.
- ✅ Simulates the Monty Hall game logic over multiple trials
- 🤖 Includes a guest AI agent that plays using the switching strategy
- 🔁 Implements both switching and non-switching strategies
- 📊 Calculates win percentage for both strategies
- 👤 Randomly selects a guest to demonstrate the decision-making process
- 📈 Displays results using a matplotlib bar chart
- 💬 Provides a final result and a custom message based on whether the guest wins or loses