Pólya's Experiment

Description

This app models Pólya's urn experiment. An urn initially contains \(a\) red and \(b\) green balls. On each trial, a ball is selected at random from the urn, and then replaced along with \(c\) new balls of the same color. In this simulation, the red balls are numbered consecutively \((1, 2, \ldots)\) and the green balls are numbered consecutively in the same manner. Random variable \(Y\) gives the number of red balls selected after \(n\) trials, \(M = Y / n\) gives the proportion of red balls selected in the \(n\) trials, and \( Z = (a + c Y) / (a + b + c n)\) the proportion of red balls in the urn. As a function of \( n \), the proportion \( Z \) is a martingale. The variables \(Y\), \(M\), and \(Z\) are recorded in the data table, and the distribution of \(Y\) is described in the distribution graph and table. The parameters \(a\), \(b\), \(c\), and \(n\) can be varied with the input controls.