Python Specials #3 Monte Carlo Simulation

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Coder & Maker
89
3

In this example, we simulate flipping a fair coin (p=0.5) 10,000 times (num_trials). We use numpy to generate a binomial distribution with n=1 and p=0.5 to simulate each coin flip. We then calculate the running average of the results and plot it against the number of trials. Finally, we plot a horizontal line at the true probability of success (p=0.5) for comparison.

Note that Monte Carlo simulations can be used to simulate a wide range of probability distributions and processes, not just coin flips. The basic idea is to generate a large number of random samples from the distribution of interest and use these samples to estimate probabilities, expected values, and other properties of the distribution.

Thanks for watching. For more videos and to support us, you can subscribe and follow our channel. Good luck...
All Coder & Maker videos :    • ALL VIDEOS  
More Python Specials videos:    • Python Specials  
More Python Examples videos:    / playlist  
list=PLN6LC3AB64ggeDF1_fR-77gdlNrtz-8VQ
Python Basics Videos :    • Python Basics  
Python Turtle Graphics Module:    • Python Turtle  Graphics  
Python Matplotlib Module Tutorials:    • Python Matplotlib Module  
Python Numpy Module Tutorials:    • Python Numpy Module  
Python Random Module Tutorials:    • Python Random Module  
Python Thonny Graphics Tutorials:    • Python Turtle Tutorials  


Download Thonny Ide: https://thonny.org


Auf dieser Seite können Sie das Online-Video Python Specials #3 Monte Carlo Simulation mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coder & Maker 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 89 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!