The Beta Coin Experiment

Coin 1 Coin 2 Coin 3 Coin 4 Coin 5 Coin 6 Coin 7 Coin 8 Coin 9 Coin 10 Coin 11 Coin 12 Coin 13 Coin 14 Coin 15 Coin 16 Coin 17 Coin 18 Coin 19 Coin 20 Coin 21 Coin 22 Coin 23 Coin 24 Coin 25 Coin 26 Coin 27 Coin 28 Coin 29 Coin 30 Coin 31 Coin 32 Coin 33 Coin 34 Coin 35 Coin 36 Coin 37 Coin 38 Coin 39 Coin 40 Coin 41 Coin 42 Coin 43 Coin 44 Coin 45 Coin 46 Coin 47 Coin 48 Coin 49 Coin 50
Distribution graph


The random experiment is to toss a coin \(n\) times, where the probability of heads is \(p\). The probability of heads is modeled with a prior beta distribution, having left parameter \(a\) and right parameter \(b\). The prior probability density function and the true probability of heads are shown in blue in the graph on the right. On each run, the number of heads \(Y\) is recorded in the data table. On each run, the posterior beta probability density function, which has left parameter \(a + Y\) and right parameter \(b + n - Y\), is shown in red in graph on the right. Also, the Bayesian estimate of \(p\), \[U = \frac{a + Y}{a + b + n}\] is shown on the graph in red and recorded in the data table on each run. Finally, the second table gives the true bias and mean square error of \(U\), and on each run gives the empirical bias and mean square error, based on the all of the runs of the experiment to that point. The parameters \(n\), \(p\), \(a\), and \(b\) can be varied with input controls.