💧 Bernoulli Trial Simulator
Run independent Bernoulli trials with a given number of trials and success probability, then report the observed frequency and deviation.
📐 工作原理與說明
伯努利試驗蒙特卡洛模擬:每次試驗獨立以機率 p 判定成功,進行 n 次;實際頻率 = 成功次數 / n;理論機率為 p;實際頻率與理論值之差即抽樣偏差,其標準誤為 sqrt(p*(1-p)/n),隨 n 增大而減小。
📚 深度解析:伯努利試驗模擬
💡 常見使用場景
- 模擬重複獨立試驗,觀察成功頻率與理論機率的偏差。
- 用大樣本演示頻率趨近機率,輔助理解標準誤。
模擬
設試驗 1000 次、成功機率 30%,頁面逐次獨立抽樣後輸出成功次數、實際頻率、與理論值的偏差及標準誤。
❓ 常見問題(FAQ)
- 模擬結果為什麼每次不同?
- 每次執行都是獨立隨機抽樣,頻率會在理論機率附近波動;樣本越大,波動越小。
- 標準誤怎麼理解?
- 標準誤 = √(p(1−p)/n),衡量實際頻率偏離理論機率的典型幅度;n 越大越小。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Single trial | Each trial is independent with a constant success probability p | Bernoulli trial definition |
| Successes | The number of successes in n trials follows the binomial distribution B(n,p) | Binomial distribution |
| Standard error | Standard error of the frequency sqrt(p·(1−p)/n) | Sampling theory |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準