Python Specials #3 Monte Carlo Simulation

Pubblicato il: 01 gennaio 1970
sul canale di: 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


In questa pagina del sito puoi guardare il video online Python Specials #3 Monte Carlo Simulation della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Coder & Maker 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 89 volte e gli è piaciuto 3 spettatori. Buona visione!