← SciSim / Statistics

Beta Distribution

Tier: Standard Undergraduate
§1 Interactive Simulation
Parameter 1
—
Parameter 2
—
Mean
—
Variance
—
Samples
0
Query prob
—
Parameter 1 (α) —
Parameter 2 (β) —
Query x —
Speed 20/s
§2 The Idea, Step by Step

A picture of a probability you don't yet know

Imagine a new basketball player steps up for free throws. After watching just a few — some swish, some clang — you start to form a hunch about how good she really is. You can't name one exact number, but you can sense a range: probably pretty good, almost certainly not perfect. The Beta distribution draws that hunch as a curve. Along the bottom sits every possible "true skill" from $0$ to $1$ (0% to 100%), and the curve rises wherever you think the truth most likely lies.

TWO DIALS: α AND β

The shape is set by two numbers, and a handy way to read them is this: $\alpha$ counts the successes you have seen (plus one) and $\beta$ counts the misses (plus one). A player who sinks 3 and misses 1 gives Beta$(4,2)$. Your single best guess for her skill is the mean, $\alpha/(\alpha+\beta)=4/6\approx0.67$. Watch more shots and both dials climb together: the curve narrows and your confidence grows.

THE PRECISE STATEMENT

The density is $f(x;\alpha,\beta)=\dfrac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}$ on $[0,1]$, where $B(\alpha,\beta)=\dfrac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}$ is just a constant that rescales the area to exactly $1$. The mean is $\alpha/(\alpha+\beta)$, and the spread shrinks roughly like $1/(\alpha+\beta)$ — more total evidence makes a tighter curve. Beta is also the conjugate prior of the binomial: start with Beta$(\alpha,\beta)$, observe $k$ successes in $n$ trials, and your updated belief is exactly Beta$(\alpha+k,\;\beta+n-k)$. Bayesian updating is nothing more than adding to the dials. In the sim, Parameter 1 is $\alpha$, Parameter 2 is $\beta$, and Query x reports the area to the left of $x$ — the probability that the true rate is below that value.

TRY THIS IN THE SIM ABOVE

Set $\alpha=\beta=1$ and watch the curve flatten into a straight line — the "I know nothing yet" uniform prior. Now drag both up to about $10$ for a tight bell over $0.5$, the look of strong evidence. Finally set $\alpha=\beta=0.5$ to get a U-shape that piles probability near $0$ and $1$ — the belief that a coin is biased one way or the other, you are just not sure which.

§3 Mathematical Derivation

Beta Distribution — Distribution of probabilities [0,1]

$$f(x;\alpha,\beta)=\frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)},\quad x\in[0,1]$$

$E[X]=\alpha/(\alpha+\beta),\quad\text{Var}(X)=\frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}$

KEY PROPERTIES

This distribution has important theoretical and applied properties. See the simulation tabs to explore how shape changes with parameters.

APPLICATIONS

Bayesian statistics (conjugate prior for binomial p), proportion modeling, A/B test click rates, task completion percentages. The Beta distribution is "the distribution for probabilities" — it lives on [0,1] and can take many shapes: uniform (α=β=1), bell (α=β>1), U-shaped (α=β<1), skewed, or J-shaped.

Key Results

Use the interactive simulation above to explore how the PDF shape responds to parameter changes. The Live Sampling tab demonstrates convergence of empirical frequencies to theoretical probabilities.

Ross — A First Course in Probability, 10th ed. 2019
Hogg, McKean & Craig — Introduction to Mathematical Statistics, 8th ed. 2018
DeGroot & Schervish — Probability and Statistics, 4th ed. 2012
§4 FAQ
StatQuest — youtube.com/@statquestSeeing Theory — seeing-theory.brown.edu
§5 Misconceptions & Common Errors
Key Error

Always verify parameter definitions before computing probabilities.
Different textbooks and software packages use different parameterizations. Always check which convention is being used (e.g., rate vs scale for exponential/gamma; shape vs rate for beta). Plug in extreme values and check that the PDF shape matches your expectation.
See the simulation to visualize how parameters affect the distribution shape.

Casella & Berger — Statistical Inference, 2nd ed. 2002
DeGroot & Schervish — Probability and Statistics, 4th ed. 2012
§6 Worked Example, Practice Problems and Uses
WORKED EXAMPLE 1: UPDATING A BELIEF ABOUT A COIN

Start with a Beta(2, 2) prior for the probability $p$ of heads (mean 0.5, variance 0.05). Toss the coin 10 times and see 7 heads and 3 tails. Because the Beta is conjugate to the binomial, the posterior is Beta($2+7,\,2+3$)=Beta(9, 5). Its mean is $9/14\approx0.643$, its mode is $8/12\approx0.667$, and a 95% credible interval is about (0.386, 0.861). The posterior probability that $p>0.5$ is about 0.867. Compare this with the raw frequency of 0.7: the prior pulls the estimate gently toward 0.5.

WORKED EXAMPLE 2: AN A/B TEST CLICK RATE

A button is shown 200 times and clicked 30 times. With a flat Beta(1, 1) prior the posterior is Beta(31, 171). Its mean is $31/202\approx0.153$ and a 95% credible interval is about (0.107, 0.206). Showing the whole interval, not just 15%, makes it clear how uncertain a small test still is.

TRY THIS IN THE SIMULATION

Set both parameters to 1 and you get the uniform distribution. Set both to 0.5 to see a U shape (extreme values are most likely), and both to 5 to see a bell. Set $\alpha=9,\beta=5$ and read the CDF at $x=0.5$: it should be about 0.133, the complement of 0.867 above. Then try $\alpha=\beta=2$ and confirm that the mean is 0.5.

PRACTICE PROBLEMS (ANSWERS BELOW)

1. What is the variance of Beta(2, 2)? 2. A uniform prior is updated with 3 successes and 0 failures. What is the posterior and its mean? 3. Why is the Beta a natural choice for a proportion?

Answers. 1. $\frac{2\cdot2}{4^2\cdot5}=0.05$. 2. Beta(4, 1), mean $4/5=0.8$. 3. It lives on [0, 1], takes many shapes, and stays in the Beta family after binomial data arrive.

Ross — A First Course in Probability, 10th ed. 2019
Hogg, McKean & Craig — Introduction to Mathematical Statistics, 8th ed. 2018
DeGroot & Schervish — Probability and Statistics, 4th ed. 2012