🎯 蒙特卡洛法估算 π 演示Monte Carlo π Estimator
用随机撒点的蒙特卡洛方法动态估算圆周率 π:实时显示落在四分之一圆内外的点、当前估计值和收敛曲线,直观理解概率与大数定律。Estimate π with the Monte Carlo method by dropping random points: watch them land inside or outside a quarter circle, with the live estimate and a convergence curve illustrating the law of large numbers.
使用说明与常见问题How-to & FAQ
「蒙特卡洛法估算 π 演示」是什么?What is the Monte Carlo π Estimator tool?
用随机撒点的蒙特卡洛方法动态估算圆周率 π:实时显示落在四分之一圆内外的点、当前估计值和收敛曲线,直观理解概率与大数定律。Estimate π with the Monte Carlo method by dropping random points: watch them land inside or outside a quarter circle, with the live estimate and a convergence curve illustrating the law of large numbers.
如何使用「蒙特卡洛法估算 π 演示」?How do I use the Monte Carlo π Estimator?
点「开始」后程序在正方形内随机撒点,圆内为蓝色、圆外为橙色,π ≈ 4 × 圆内点数 ÷ 总点数。可以调整每帧点数和总点数,观察点越多估计越接近 π。Press Start to drop random points: blue inside the quarter circle, orange outside; π ≈ 4 × inside ÷ total. Adjust points per frame and the total to watch the estimate approach π.
为什么这样能算出 π?Why does this give π?
在边长为 1 的正方形里随机撒点,落在半径为 1 的四分之一圆内的概率等于面积之比 π/4,所以「圆内点数 ÷ 总点数」约等于 π/4,乘以 4 就是 π 的估计值。For random points in a unit square, the chance of landing inside the quarter circle of radius 1 equals the area ratio π/4, so inside ÷ total ≈ π/4 and four times that estimates π.
撒 100 万个点能精确到几位?How accurate is a million points?
误差大约与 1/√N 成正比,100 万个点的标准误差约 0.0016,一般只能保证小数点后 2 位左右。The error shrinks like 1/√N; with a million points the standard error is about 0.0016, so typically only about 2 decimal places are reliable.
「蒙特卡洛法估算 π 演示」免费吗?数据会上传吗?Is the Monte Carlo π Estimator free? Is my data uploaded?
「蒙特卡洛法估算 π 演示」完全免费,无需注册或安装,手机和电脑都能用;所有处理都在你的浏览器本地完成,输入的内容和文件不会上传到服务器。The Monte Carlo π Estimator is completely free with no sign-up or install and works on phones and desktops; everything runs locally in your browser and nothing you enter is uploaded.