For this activity, I concluded a series of experiments to determine the probability of getting a specific number of heads in a series of coin tosses. Specifically, I focused on three scenarios: tossing a coin 10 times, 50 times, and 100 times for each scenarios, I calculated the probability of getting exactly 5 heads in 10 tosses, 25 heads in 50 tosses, and 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 probability theory in Python.
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.
https://colab.research.google.com/drive/1MLq-QVSM6EpJH3GbZ05yWecxKIeX9vkn?usp=sharing
This activity demonstrated the practical application of probability theory using Python, highlighting how theoretical probabilities can be verified through Monte Carlo simulations.
Get in touch at kr2007pankaj@gmail.com