/LLN

Law of Large Numbers Simulator

Primary LanguageJavaScript

The Law of Large Numbers Web Project

Law of Large Numbers Simulator by Josh Schiavone
Try it here: https://josh0xa.github.io/LLN/

Purpose and What Is?

I developed this project to play around with the famous Statistics Law of Large Numbers. In probability theory, the law of large numbers (LLN) is a theorem that describes the result of performing the same experiment a large number of times. According to the law, the average of the results obtained from a large number of trials should be close to the expected value and tends to become closer to the expected value as more trials are performed.

Principal

After each trial, we obtain an $\overline{X}$ and from the simulation as we increase the number of trials, that sample mean ( $\overline{X}$ ) converges closer and closer to the theoretitcal mean ( $\mu$ ). Thus,
                                                              $\overline{X}_n \to \mu \quad\textrm{as}\ n \to \infty \ \textrm{where, } \overline{X}_n=\left(\frac{1}{n}\right)\sum X_i$

Example (0.25 Probability)

Screen Shot 2022-12-26 at 11 11 21 PM

Graph Visual (p=0.25, n=1000)

Screen Shot 2022-12-26 at 11 13 21 PM

Graph Visual (p=0.5, n=1000)

Screen Shot 2022-12-26 at 11 14 10 PM

License

MIT License. Copyright (c) 2023 Josh Schiavone