The Bernoulli distribution models one experiment with exactly two outcomes: success, coded as 1, with probability $p$, and failure, coded as 0, with probability $1-p$. Repeating it is what the rest of this page is about.
Probability mass function
Parameters and support
Where these come from
Directly from the definition: $E[X] = 1 \cdot p + 0 \cdot (1-p) = p$. Because a 0/1 variable satisfies $X^2 = X$, we also get $E[X^2] = p$, so $\text{Var}(X) = p - p^2 = p(1-p)$.
A website shows an ad to one visitor. Past data says $8\%$ of visitors click it.
Chaining many independent trials of this kind is exactly how the next distribution, the Binomial, gets built.
Move the slider to change $p$ and see how the mass shifts between the two possible outcomes, $0$ and $1$.
Shape of the PMF
Two bars and nothing else. Moving $p$ simply shifts mass from one bar to the other, and the two heights always add to $1$.
Sums of independent trials
Add up $n$ independent Bernoulli$(p)$ trials and the count of successes is Binomial.
Link to the other distributions
Every distribution on this page is a different question asked about repeating this one trial: how many successes in a fixed batch, or how many attempts until a target number of successes.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Bernoulli}(p)$ | a variable equal to 1 with probability $p$ and 0 otherwise |
| $p$ | probability of success on a single trial |
| $p_X(k)$ | probability mass function, that is $P(X = k)$ |
Run $n$ independent Bernoulli$(p)$ trials and count the successes. That count $X$ follows a Binomial distribution. The combinatorial factor counts how many different orderings of successes and failures give the same total.
Probability mass function
Reminder · counting the orderings
$\dbinom{n}{k} = \dfrac{n!}{k!(n-k)!}$ is the number of ways to place $k$ successes among $n$ trial slots, one for every distinct ordering with the same total of successes.
Example, $n=4$ and $k=2$: the six orderings are SSFF, SFSF, SFFS, FSSF, FSFS, FFSS.
Parameters and support
Where these come from
Write $X = X_1 + \cdots + X_n$ as a sum of independent Bernoulli$(p)$ indicators. Expectations always add, giving $np$, and because the trials are independent the variances add too, giving $np(1-p)$.
A player makes $70\%$ of free throws and takes $10$ of them in a game. What is the probability of making exactly $8$?
Making 8 is above average but not unusual: it happens in roughly one game out of four.
Move the sliders and watch the shape change: a small $p$ pushes mass toward $0$, a large $p$ pushes it toward $n$, and the middle case gives the familiar bell-like shape.
Shape of the PMF
A single hump with its peak near $np$. It is skewed right for small $p$, skewed left for large $p$, and close to symmetric around $p = 0.5$.
Closed under addition
Two independent Binomials that share the same $p$ add up to another Binomial, exactly as if the trials had been run as one larger batch.
Link to the other distributions
Setting $n = 1$ gives back the Bernoulli. Letting $n \to \infty$ and $p \to 0$ with $np = \lambda$ held fixed gives the Poisson, which is section 06.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Binomial}(n,p)$ | number of successes out of $n$ independent trials, each with success probability $p$ |
| $n$ | fixed number of trials, decided before the experiment starts |
| $\dbinom{n}{k}$ | binomial coefficient, the number of ways to choose $k$ successes out of $n$ trials |
Repeat independent Bernoulli$(p)$ trials until the first success shows up. $X$ counts how many trials that takes, including the successful one, so the smallest possible value is $1$.
Probability mass function
Parameters and support
Where these come from
A one-step argument is quickest. The first trial either succeeds or resets the problem, so $E[X] = 1 + (1-p)E[X]$, which rearranges to $E[X] = 1/p$. The same conditioning applied to $E[X^2]$ gives the variance.
Roll a fair die repeatedly. What is the probability the first six appears exactly on the third roll?
Waiting for a target of $r$ successes instead of just one gives the Negative Binomial in the next section.
Move the slider to change $p$. A small $p$ spreads the probability across many trials, a large $p$ concentrates it near $k = 1$.
Shape of the PMF
Always decreasing. The tallest bar is at $k = 1$ and every following bar is the previous one multiplied by $1-p$, which is why the tail decays geometrically.
Memorylessness
If no success has happened in the first $s$ trials, the number of extra trials still needed behaves like a fresh Geometric. Past failed attempts leave no trace, so ten sixless rolls do not make the eleventh roll any more promising.
Link to the other distributions
It is the Negative Binomial with $r = 1$, and the discrete counterpart of the exponential distribution, which is the only continuous distribution that is also memoryless.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Geometric}(p)$ | number of trials up to and including the first success |
| $k$ | index of the trial on which the first success lands, starting at 1 |
| $P(X > t)$ | tail probability, here equal to $(1-p)^t$: no success in the first $t$ trials |
The Geometric idea taken one step further: instead of stopping at the first success, keep going until the $r$-th success shows up. $X$ counts the total number of trials needed.
Probability mass function
Parameters and support
Where these come from
Split the wait into $r$ independent stretches: the trials until the first success, then until the second, and so on. Each stretch is Geometric$(p)$, so both the mean and the variance are just $r$ copies of the geometric ones.
A salesperson closes $20\%$ of calls. What is the probability that the third sale happens exactly on the tenth call?
The tenth call is an early finish compared to the average of fifteen, which is why its probability is only about $6\%$.
Move the sliders to change $r$, the number of successes to wait for, and $p$, the chance of success on each trial. Setting $r = 1$ brings back the Geometric shape from the previous section.
Shape of the PMF
Mass starts at $k = r$, climbs to a peak and then decays. A larger $r$ pushes that peak to the right and flattens the curve, since more successes mean a longer and less predictable wait.
Closed under addition
Waiting for $r_1$ successes and then for $r_2$ more is the same as waiting for $r_1 + r_2$ from the start, as long as $p$ is shared.
Link to the other distributions
Setting $r = 1$ recovers the Geometric exactly. It is the waiting-time counterpart of the Binomial: the Binomial fixes the trials and counts successes, this one fixes the successes and counts trials.
| Symbol | Meaning |
|---|---|
| $X \sim \text{NegBinom}(r,p)$ | number of trials up to and including the $r$-th success |
| $r$ | fixed target number of successes, decided before the experiment starts |
| $\dbinom{k-1}{r-1}$ | ways to place the first $r-1$ successes among the first $k-1$ trials |
The Poisson distribution counts how many times an event happens in a fixed interval of time or space, when events occur independently at a constant average rate $\lambda$. Unlike the Binomial, there is no fixed number of trials behind it.
Probability mass function
Parameters and support
Where these come from
Read them off the Binomial limit. Take Binomial$(n, \lambda/n)$ and let $n \to \infty$: the mean $np = \lambda$ stays put, while the variance $np(1-p) = \lambda(1 - \lambda/n)$ climbs to $\lambda$ as $p$ vanishes.
A book averages $2.3$ typos per page. What is the probability a randomly chosen page has exactly $2$ typos?
The same setup fits calls arriving at a helpdesk per hour, cars passing a sensor per minute, or particles detected per second.
Move the slider to change $\lambda$. Small rates keep the mass near $0$, larger rates push it rightward and spread it into a wider, more symmetric hump.
Shape of the PMF
The peak sits at $\lfloor \lambda \rfloor$. Small rates leave most of the mass at $0$ and give a sharply skewed shape, while large rates drift right and look increasingly symmetric.
Rates add up
Combining two independent streams of rare events gives another Poisson stream whose rate is the sum of the two.
Link to the other distributions
It is the limit of the Binomial when trials are many and successes are rare, which is what section 06 works through numerically. The gaps between consecutive Poisson events follow an exponential distribution.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Poisson}(\lambda)$ | count of events in a fixed interval with average rate $\lambda$ |
| $\lambda$ | expected number of events in that interval, both mean and variance |
| $k!$ | factorial, correcting for the orderings of the $k$ events within the interval |
Take a Binomial$(n,p)$ where $n$ is large and $p$ is small, while their product $np = \lambda$ stays fixed at a moderate value. Under these conditions, the Binomial PMF gets closer and closer to a Poisson PMF with that same $\lambda$.
Rule of thumb for using the approximation
A factory produces $n = 2000$ chips, each defective independently with $p = 0.001$. Here $n$ is large and $p$ is tiny, so $\lambda = np = 2$ is a good Poisson rate to approximate the exact Binomial.
| k | Binomial(2000, 0.001) | Poisson(2) |
|---|---|---|
| 0 | 0.1352 | 0.1353 |
| 1 | 0.2707 | 0.2707 |
| 2 | 0.2708 | 0.2707 |
| 3 | 0.1805 | 0.1804 |
| 4 | 0.0902 | 0.0902 |
The two columns line up to four decimal places. This is exactly why the Poisson distribution is used to model rare events without needing to track the exact number of trials behind them.
Ignore leap years and assume all $365$ birthdays are equally likely. With $n$ people in a room, how likely is it that at least two of them share a birthday? It is easier to compute the complement: the probability that all $n$ birthdays are different.
The "paradox" in the name comes from how small $n$ needs to be. It feels like it should take hundreds of people, but $23$ is already enough to cross $50\%$.
The reason is that probability grows with the number of pairs of people, not the number of people itself, and pairs grow much faster: $23$ people already form $\binom{23}{2} = 253$ pairs.
Move the slider to change how many people are in the room. The dashed line marks $50\%$, and the highlighted point shows exactly where the current group size lands on the curve.
The distributions in this visual guide are not unrelated, they are different questions asked about the same repeated Bernoulli$(p)$ trial: how many successes in a fixed number of trials, or how many trials until a target number of successes.
| Starting point | Question asked | Distribution |
|---|---|---|
| Bernoulli(p) | fix the number of trials $n$, count successes | Binomial(n, p) |
| Bernoulli(p) | count trials needed for 1 success | Geometric(p) |
| Bernoulli(p) | count trials needed for $r$ successes | NegBinom(r, p) |
| Binomial(n, p) | let $n \to \infty$, $p \to 0$, $np = \lambda$ fixed | Poisson(λ) |
| NegBinom(r, p) | set $r = 1$ | Geometric(p) |
| Distribution | PMF | Support | Mean | Variance |
|---|---|---|---|---|
| Bernoulli(p) | $p^k(1-p)^{1-k}$ | $k \in \{0,1\}$ | $p$ | $p(1-p)$ |
| Binomial(n, p) | $\binom{n}{k}p^k(1-p)^{n-k}$ | $k = 0,\dots,n$ | $np$ | $np(1-p)$ |
| Geometric(p) | $(1-p)^{k-1}p$ | $k = 1,2,\dots$ | $1/p$ | $(1-p)/p^2$ |
| NegBinom(r, p) | $\binom{k-1}{r-1}p^r(1-p)^{k-r}$ | $k = r, r+1,\dots$ | $r/p$ | $r(1-p)/p^2$ |
| Poisson(λ) | $e^{-\lambda}\lambda^k/k!$ | $k = 0,1,2,\dots$ | $\lambda$ | $\lambda$ |