Checking Whether A Coin Is Fair - Posterior Probability Density Function

Posterior Probability Density Function

One method is to calculate the posterior probability density function of Bayesian probability theory.

A test is performed by tossing the coin N times and noting the observed numbers of heads, h, and tails, t. The symbols H and T represent more generalised variables expressing the numbers of heads and tails respectively that might have been observed in the experiment. Thus N = H+T = h+t.

Next, let r be the actual probability of obtaining heads in a single toss of the coin. This is the property of the coin which is being investigated. Using Bayes' theorem, the posterior probability density of r conditional on h and t is expressed as follows:

 f(r | H=h, T=t) = \frac {\Pr(H=h | r, N=h+t) \, g(r)} {\int_0^1 \Pr(H=h |r, N=h+t) \, g(r) \, dr}. \!

where g(r) represents the prior probability density distribution of r, which lies in the range 0 to 1.

The prior probability density distribution summarizes what is known about the distribution of r in the absence of any observation. We will assume that the prior distribution of r is uniform over the interval . That is, g(r) = 1. (In practice, it would be more appropriate to assume a prior distribution which is much more heavily weighted in the region around 0.5, to reflect our experience with real coins.)

The probability of obtaining h heads in N tosses of a coin with a probability of heads equal to r is given by the binomial distribution:

Substituting this into the previous formula:

 f(r | H=h, T=t) = \frac{{N \choose h}\,r^h\,(1-r)^t} {\int_0^1 {N \choose h}\,r^h\,(1-r)^t\,dr} = \frac{r^h\,(1-r)^t}{\int_0^1 r^h\,(1-r)^t\,dr} .

This is in fact a beta distribution (the conjugate prior for the binomial distribution), whose denominator can be expressed in terms of the beta function:

As a uniform prior distribution has been assumed, and because h and t are integers, this can also be written in terms of factorials:

Read more about this topic:  Checking Whether A Coin Is Fair

Famous quotes containing the words probability and/or function:

    Legends of prediction are common throughout the whole Household of Man. Gods speak, spirits speak, computers speak. Oracular ambiguity or statistical probability provides loopholes, and discrepancies are expunged by Faith.
    Ursula K. Le Guin (b. 1929)

    The function of literature, through all its mutations, has been to make us aware of the particularity of selves, and the high authority of the self in its quarrel with its society and its culture. Literature is in that sense subversive.
    Lionel Trilling (1905–1975)