The Uniform distribution spreads probability flat across an interval $[a,b]$. No sub-region is favored over another of the same length, so the density is a constant.
Probability density function
Cumulative distribution function
Parameters and support
Where these come from
Both follow from integrating $x \cdot f(x)$ and $x^2 \cdot f(x)$ over $[a,b]$ with the constant density $1/(b-a)$. No shortcuts are needed, the flat shape keeps the calculus simple.
A tram passes every $10$ minutes. A rider arrives at a random moment, with no idea of the schedule. The waiting time $X$ is Uniform$(0, 10)$. Suppose we want the probability that the tram passes while the rider has waited between $2$ and $5$ minutes.
Take $X \sim$ Uniform$(0, 10)$. Move $a$ and $b$ to set the interval and watch the shaded rectangle show $P(a \le X \le b)$.
Shape of the density
A flat rectangle. The CDF that goes with it is a straight diagonal line rising from $0$ at $x=a$ to $1$ at $x=b$.
A building block for simulation
Uniform$(0,1)$ is the raw material behind most random number generators. Plugging a Uniform$(0,1)$ draw into the inverse of any CDF produces a sample from that distribution, including the Exponential coming up next.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Uniform}(a, b)$ | a variable spread evenly across $[a,b]$ |
| $a, b$ | lower and upper bounds of the support |
The Exponential distribution models the waiting time until an event that occurs at a constant average rate $\lambda$. It is the continuous counterpart of counting arrivals, and it is closely tied to the Poisson distribution seen in the discrete visual guide.
Probability density function
Cumulative distribution function
Parameters and support
Where these come from
Both follow from integrating $x \cdot f(x)$ and $x^2 \cdot f(x)$ over $[0, \infty)$ with density $\lambda e^{-\lambda x}$. Integration by parts handles the extra factor of $x$, and the same pattern of terms explains why the variance carries $\lambda^2$ in the denominator instead of $\lambda$.
A call center receives calls at an average rate of $\lambda = 4$ per hour. The gap $X$ between two consecutive calls is Exponential$(4)$, measured in hours.
Move $\lambda$ to change how fast events arrive, then move $t$ to shade $P(X \le t)$, the probability that the wait ends by time $t$.
The memoryless property
Having already waited $s$ time units without an event does not change the distribution of the remaining wait. The Exponential is the only continuous distribution with this property.
Shape of the density
Tallest at $x=0$ and decaying steadily. A larger $\lambda$ raises the density near zero and makes it decay faster, since events are expected sooner.
Sums of independent waits
Add up $k$ independent Exponential$(\lambda)$ waiting times and the total is Gamma, covered next.
Link to the Poisson distribution
If events follow a Poisson process with rate $\lambda$, the gap between consecutive events is Exponential$(\lambda)$, while the count of events in a fixed interval is Poisson. Section 04 works through this pairing.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Exponential}(\lambda)$ | a waiting time with constant average rate $\lambda$ |
| $\lambda$ | rate parameter, events per unit of time |
| $1/\lambda$ | mean waiting time |
The Exponential is the wait for the first event, and the Gamma distribution is the wait for the $k$-th one. It is exactly the sum of $k$ independent Exponential$(\lambda)$ waits, and this distribution is also called the Erlang distribution.
Probability density function
Parameters and support
The formula above uses an integer shape $k$, which keeps $(k-1)!$ in place of the more general Gamma function $\Gamma(k)$ used for non-integer shapes.
Where these come from
Because $X = X_1 + \cdots + X_k$ with each $X_i \sim \text{Exponential}(\lambda)$ independent, both the mean and the variance of a sum of independent variables simply add up across the $k$ terms.
Back at the support line from Section 02, calls arrive at $\lambda = 4$ per hour. How long until the third call comes in?
Move $k$ to change how many waits are stacked, and $\lambda$ to change the rate of each one. At $k=1$ this is exactly the Exponential curve from Section 02. Move $t$ to shade $P(X \le t)$.
Shape of the density
Starts at $0$, rises to a single peak, then decays. As $k$ grows the peak moves right and the curve becomes more symmetric, gradually looking closer to a bell shape.
Special case k = 1
Setting $k=1$ turns the formula back into $f(x) = \lambda e^{-\lambda x}$, the Exponential distribution from Section 02.
Link to the Poisson process
In a Poisson process with rate $\lambda$, the Gamma$(k,\lambda)$ distribution gives the exact waiting time until the $k$-th arrival, tying the Exponential and Poisson connection in Section 04 to a general $k$.
| Symbol | Meaning |
|---|---|
| $X \sim \text{Gamma}(k, \lambda)$ | waiting time for $k$ events at rate $\lambda$, sum of $k$ Exponential$(\lambda)$ waits |
| $k$ | shape parameter, number of waits stacked together |
| Erlang$(k, \lambda)$ | the same distribution, another name for it |
A Poisson process is a stream of random events happening at a constant average rate $\lambda$. It can be described two equivalent ways: count how many events land in a fixed interval, or measure the gap between one event and the next.
Same rate, two questions
Poisson answers "how many events show up in this stretch of time." Exponential answers "how long until the next one." Gamma$(k,\lambda)$ generalizes the second question to "how long until $k$ of them show up."
Goals in a match can be modeled loosely as a Poisson process with an average rate of $\lambda = 2.1$ goals per $90$ minutes, roughly matching a competitive team like FC Barcelona over a season.
| Question | Distribution | Answer |
|---|---|---|
| Goals in a full match | Poisson(2.1) | $E[\text{goals}] = 2.1$ |
| Minutes until the first goal | Exponential(2.1/90) | $E[\text{wait}] \approx 43$ min |
| Minutes until the second goal | Gamma(2, 2.1/90) | $E[\text{wait}] \approx 86$ min |
The same rate $\lambda$ drives every row. Only the question being asked changes.
Each dot is a random arrival on a timeline of length $10$. Move $\lambda$ to change the rate, or resample to draw a fresh set of arrivals with exponential gaps between them.
| Distribution | Support | Mean | Variance | |
|---|---|---|---|---|
| Uniform(a, b) | $1/(b-a)$ | $x \in [a,b]$ | $(a+b)/2$ | $(b-a)^2/12$ |
| Exponential(λ) | $\lambda e^{-\lambda x}$ | $x \ge 0$ | $1/\lambda$ | $1/\lambda^2$ |
| Gamma(k, λ) | $\lambda^k x^{k-1} e^{-\lambda x}/(k-1)!$ | $x \ge 0$ | $k/\lambda$ | $k/\lambda^2$ |