For this activity, I conducted a series of experiments to determine the probability of getting a specific number of heads
For each series of coin tosses. Specifically, I focused on three scenarios: tossing a coin 10 times, 50 times & 100 times.
For each scenario, I calculated the probability of getting exactly 5 head in 10 tosses , 25 heads in 50 tosses & 50 heads
in 100 tosses.
First, I generated sequences of outcomes for each number of tosses using Python. This involved simulating the coin tosses and recording the number of heads obtained in each experiment. I printed all possible outcomes to provide a comprehensive view of the results.
Next, I calculated the theoretical probability of getting the specified number of heads using the binomial distribution formula. This provided an exact probability based on mathematical principles.
To verify these results, I performed a Monte Carlo simulation. This involved running a large number of experiments (1000 repetitions) for each scenario and calculating the empirical probability of getting the specified number of heads. The Monte Carlo simulation results were then compared with the theoretical probabilities to check for consistency.
Overall, this activity demonstrated how theoretical probabilities can be verified using Monte Carlo simulations, providing a practical application of proabability theory in python.
Monte Carlo Simulation
After calculating the theoretical probabilities, I performed Monte Carlo simulations to verify these results. The simulations involved running 1000 experiments for each scenario (10, 50, and 100 tosses) and calculating the empirical probability of getting the specified number of heads. The Monte Carlo results were then compared with the theoretical probabilities to ensure consistency.
Please click here to view Monte Carlo simulation.
Conclusion
This activity demonstrated the practical application of probability theory using Python, highlighting how theoretical probabilities can be verified through Monte Carlo simulations.