Загрузка...

Monte Carlo approximation of Pi

Random points, a simple shape, and somehow… a way to recover π.
The ONLY idea here is random sampling. We drop points uniformly into the square [-1, 1] × [-1, 1], and inside that square sits a circle of radius 1.
Now the key step: take the number of points that land inside the circle, divide by the total number of points, and you’re estimating an area ratio.
The square has area 4, and the circle has area π. So that ratio, multiplied by 4, gives you an estimate of π.
No complicated formulas. No clever tricks. Just randomness doing the work.
At first, the estimate is noisy. With 20 points it’s rough, with 100 it starts improving, and with 600 it gets surprisingly close. As you increase the number of samples, the estimate converges—not smoothly, but reliably.
This is Monte Carlo in action: turning randomness into signal. Each individual point is meaningless on its own, but together they reveal structure.
Same randomness, same process—but at scale, something stable emerges. That’s the real idea here.

Did you expect something this simple to approximate π so well, or does it still feel a bit unintuitive?
#montecarlo #math #statistics #probability #datascience #simulation #python #coding #algorithms #numericalmethods #ai #machinelearning #stochastic #visualization #randomness #maths #stem

Видео Monte Carlo approximation of Pi канала Proof by Confusion
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять