Results
| Sample Size: | - |
| Points Inside: | - |
| π Estimate: | - |
| True π: | - |
| Absolute Error: | - |
| Standard Error: | - |
January 2, 2025
Loading Python environment...
| Sample Size: | - |
| Points Inside: | - |
| π Estimate: | - |
| True π: | - |
| Absolute Error: | - |
| Standard Error: | - |
This app demonstrates a simple application of Monte Carlo simulation: estimating π by random sampling. The method works by comparing areas:
By randomly generating points uniformly in the square and counting how many fall inside the circle, we can estimate this ratio:
\[\frac{\text{points inside circle}}{\text{total points}} \approx \frac{\pi}{4}\]
Therefore:
\[\pi \approx 4 \cdot \frac{\text{points inside circle}}{\text{total points}}\]
As we increase the number of random samples, the Law of Large Numbers guarantees that our estimate converges to the true value of π.