Professor Turing

Study guides

Frequentist and Bayesian

Last updated: 2026-11-26

In the frequentist reading, a probability describes how often something happens over repeated trials, and an unknown quantity such as a coin's chance of heads is a fixed number. In the Bayesian reading, a probability expresses a degree of belief, so you can put probabilities on the unknown number and revise them with data.

Start learning No account needed

1. What probability means in each

Wikipedia on probability interpretations describes the frequency view, which ties probability to relative frequency over many repetitions, and the subjective or Bayesian view, which treats a probability as a rational degree of belief. It covers other interpretations too, and notes problems or open debates for each of these two.

In statistics the difference shows up in what is allowed to have a probability. NIST's handbook says the classical approach treats a parameter as a fixed but unknown constant, so strictly speaking you cannot make probability statements about it. The Bayesian approach treats it as random: you start with a prior distribution, use the data and Bayes' formula to revise it, and get a posterior distribution.

2. A worked example: 14 heads in 20 flips

You flip a coin 20 times and get 14 heads. Call the coin's chance of heads p. The numbers on this page are computed by scripts/frequentist-vs-bayesian-worked-example.py in the Professor Turing repository. Output:

data: 14 heads in 20 flips, proportion = 0.70
if p = 0.5: P(14 or more heads) = 0.0577, two-sided p-value = 0.1153
95% Wilson confidence interval: 0.481 to 0.855
flat prior Beta(1,1): posterior Beta(15,7), mean = 15/22 = 0.682, P(p > 0.5) = 0.961, 95% credible interval 0.478 to 0.854
near-fair prior Beta(20,20): posterior Beta(34,26), mean = 34/60 = 0.567, P(p > 0.5) = 0.851, 95% credible interval 0.441 to 0.688
140 of 200, flat prior: posterior mean = 141/202 = 0.698
140 of 200, near-fair prior: posterior mean = 160/240 = 0.667
flat prior, 20 flips: P(p <= 0.5) = 0.039
gap between the two posterior means: 0.115 at 20 flips, 0.031 at 200 flips

3. The frequentist analysis

The estimate of p is the observed proportion, 0.70. To test whether the coin is fair, assume p = 0.5 and ask how often 20 flips would give 14 or more heads. The answer is 0.0577. Counting results as far out in either direction gives a two-sided p-value of 0.1153. At a 0.05 cutoff chosen in advance, neither one rejects a fair coin.

The 95% Wilson interval, a standard interval for a proportion, runs from 0.481 to 0.855. The 95% describes the method: over many repeated samples, intervals built this way are meant to capture the true p about 95% of the time. For this one interval, the frequentist reading does not assign p a 95% chance of being inside.

4. The Bayesian analysis

First choose a prior. A Beta distribution is the usual conjugate prior for a proportion: with independent flips, adding the heads to its first number and the tails to its second gives the posterior. A flat prior, Beta(1,1), spreads belief evenly from 0 to 1. After 14 heads and 6 tails it becomes Beta(15,7). The posterior mean is 0.682, the probability that p is above 0.5 is 0.961, and 95% of the posterior lies between 0.478 and 0.854.

Now suppose you had good reason, before flipping, to think this coin was close to fair, and you write that as Beta(20,20). The same flips give Beta(34,26): a mean of 0.567, a probability of 0.851 that p is above 0.5, and an interval from 0.441 to 0.688.

5. Why the answers differ

Two things differ. The question is different: the p-value starts from p = 0.5 and asks about data, while the posterior starts from the data you saw and asks about p. And the Bayesian answer includes the prior. With the flat prior, the credible interval is numerically close to the Wilson interval here, although the two are read differently.

More data can shrink the effect of the prior. With 140 heads in 200 flips, the posterior means are 0.698 and 0.667. The gap between them falls from 0.115 to 0.031.

6. A common misconception: the p-value is the chance the coin is fair

Wikipedia on p-values defines a p-value as the probability, assuming the null hypothesis is correct, of results at least as extreme as the one observed. The figure 0.0577 was calculated by assuming the coin is fair, so it describes data under that assumption and does not tell you how probable the assumption is. It is the probability of a result at least this high in heads, given p = 0.5. The Bayesian analysis with a flat prior does give a probability about p: 0.039 that p is 0.5 or lower. That is a different quantity from 0.0577, and it changes if you change the prior.

Neither number is the probability that the coin is exactly fair. Under a continuous distribution a single value has probability zero, as Wikipedia on density functions shows with an example, so Beta(1,1) and the posterior from it give p = 0.5 exactly a probability of zero. To ask how probable a fair coin is, you would need a prior that puts some probability on p = 0.5 itself.

7. Test yourself

For each statement, say which approach it belongs to and what it takes as given.

Statement 1. "If the coin were fair, 14 or more heads in 20 flips would happen with probability 0.0577."

Answer to statement 1

Frequentist. It takes p = 0.5 as given and describes how often such data would occur.

Statement 2. "The probability that this coin favors heads is 0.961."

Answer to statement 2

Bayesian. It takes the flat prior, the model of independent flips and the observed data as given. With the Beta(20,20) prior the figure is 0.851.

Statement 3. "This procedure captures the true p in about 95% of repeated samples."

Answer to statement 3

Frequentist. It describes the interval method over samples that could have been drawn.

To go further, see what is Bayes' theorem, what is a p-value and what is a confidence interval.

What the sources found, and their limits

Wikipedia, "Probability interpretations" and "Frequentist probability." They set out the frequency and Bayesian views, among others, and some of the problems raised for them. Limits: reference articles under CC BY-SA 4.0, and only the relevant passages were read. Sources: probability interpretations and frequentist probability, read on 2026-11-25.

NIST/SEMATECH e-Handbook of Statistical Methods, sections 8.1.10 and 7.1.4. The first contrasts the classical and Bayesian treatment of parameters, and lists the advantages and drawbacks of using a prior, including that a poor prior can mislead. The second explains a confidence level through repeated sampling. Limits: 8.1.10 is written about reliability testing. Sources: 8.1.10, Bayesian methodology and 7.1.4, confidence intervals, read on 2026-11-25.

NIST/SEMATECH e-Handbook, section 7.2.4.1. Gives the Wilson interval for a proportion. Source: 7.2.4.1, confidence intervals for a proportion, read on 2026-11-25.

Wikipedia, "P-value." Defines the p-value and reports the American Statistical Association's statement that it does not measure the probability that the studied hypothesis is true. Limits: a reference article under CC BY-SA 4.0. Source: p-value, read on 2026-11-25.

Wikipedia, "Probability density function." Shows that for an idealized continuous quantity the probability of one exact value is zero. Limits: it shows this with a lifetime example, not a coin; a reference article under CC BY-SA 4.0. Source: probability density function, read on 2026-11-25.

Wikipedia, "Conjugate prior" and "Credible interval." The first gives the Beta prior and its update from successes and failures, and notes that Beta(1,1) is uniform. The second defines a credible interval. Limits: an openly edited encyclopedia under CC BY-SA 4.0, and only the relevant passages were read. Sources: conjugate prior and credible interval, read on 2026-11-25.

The coin data, both priors and the comparisons between them are ours.

How Professor Turing helps

Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.

Bring a result you are trying to interpret. Its first reply asks about your attempt, such as what you think the probability refers to, before it teaches anything. You must be 18 or older. Guest conversations are deleted 7 days after your last activity; with an account they are kept while the account is active.

FAQ

Is one approach right and the other wrong? The sources here describe both. They answer differently worded questions, and a Bayesian answer also depends on a prior, so ask which question you need answered and whether you can defend the prior.

Does using Bayes' theorem make an analysis Bayesian? Not by itself. Bayes' theorem is a rule of probability. The Bayesian approach in statistics uses it to update a probability distribution for an unknown parameter.

Is a credible interval the same as a confidence interval? No. A 95% credible interval holds 95% of the posterior probability for the parameter, given the prior and data. A 95% confidence level describes how often the method's intervals capture the true value over repeated sampling.

Start with what you're working on

Tell the tutor which result you are interpreting and let it ask you the questions.

Start learning No account needed

See also: what is Bayes' theorem · odds and probability · all study guides