06 / 22 · Random Variables
Continuous distributions
Interval probabilities, densities and quantiles, with checked examples for uniform, exponential, normal, gamma and beta models.
On this page 8
A rounded measurement can have a probability table even when its underlying value varies continuously. Suppose we construct a mathematical model on the interval from −1 to 3, with more probability near the upper end. Asking for the probability of the exact value 2 will give zero. Asking for the probability of a reading between 0 and 2 will give one half. The interval, including its width, carries the probability.
Densities#
In Discrete distributions, we added probabilities attached to individual values. For an absolutely continuous distribution, we instead define a nonnegative probability density whose total integral is one. For any interval with ,
The integral over a single point is zero, so changing either interval endpoint from open to closed leaves the probability unchanged. A continuous cumulative distribution need not have a density: singular continuous distributions are possible. Here we work with the absolutely continuous case, where these integral formulas apply (Siegrist, Continuous Distributions).
Our independently stipulated example has a linearly increasing density:
Its normalization follows by integrating the line. The same antiderivative gives the interval probability:
A density has units reciprocal to those of the measurement. If we express the same value as , an interval of width corresponds to width on the original scale. Preserving its probability therefore gives, for ,
The density approaches at the upper edge. Values above one are valid; the integral over the whole support is still one. At a continuity point of , the probability in a short interval is approximately for width . The approximation can fail near a boundary or across a rapidly changing density.
Area and accumulated probability
Density f(x)
Cumulative probability F(x)
The distribution function and quantiles#
The cumulative distribution function, or CDF, records the probability accumulated up to a threshold. It is defined for every real-valued random variable. For a density model,
A CDF is nondecreasing and right-continuous, with limits zero and one at the two ends of the real line. Subtracting its values gives . The fundamental theorem of calculus gives wherever the density is continuous; more generally the equality holds almost everywhere for an absolutely continuous CDF.
For our rising density, integration gives
We can also start with a required probability and seek its threshold. For , define the lower quantile by
The infimum selects the first threshold reaching the requested probability. When the CDF is continuous and strictly increasing across its support, solving gives the ordinary inverse. In this example,
The generalized definition also handles flat sections. Consider a separate model which chooses uniformly from with probability and uniformly from otherwise. Its CDF is throughout . Every point in that interval is a median, while the lower-quantile convention selects . An inverse routine needs this convention when a solution is not unique (Siegrist, Distribution and Quantile Functions).
Uniform#
If equal-length subintervals inside a bounded range should have equal probabilities, a constant density implements that assumption. For finite endpoints , write . Requiring total mass one determines the height. Integrating and then solving for the threshold gives
The density is zero outside the interval; the CDF is zero below it and one above it. For our choice and , the interval from 1 to 3 occupies two of the seven available length units, so its probability is . The upper quartile is .
Uniformity belongs to a chosen scale. If is uniform on and , then for . The transformed distribution has a curved CDF. Calling a model uniform therefore requires specifying the variable as well as its allowed range.
Exponential#
The geometric distribution counts independent trials until the first success. To obtain a waiting time, place trials at intervals of length . Set their success probability to , where the rate is fixed and . If counts trials starting at one, define .
For fixed , waiting longer than requires failure in all trials scheduled by that time. There are such trials, hence
Taking logarithms makes the limit explicit. We use as and . The logarithm tends to , giving the exponential distribution:
Here is the survival function. The density comes from differentiating ; the quantile comes from solving . For , both the density and CDF are zero. With our chosen rate , the discretization at approaches the limit as follows:
| Trial spacing | |
|---|---|
| 0.50 | 0.240100 |
| 0.20 | 0.278501 |
| 0.05 | 0.295712 |
The limiting probability is . These are computed probabilities of stipulated models, not observations of a real arrival process.
Reducing the trial spacing
Δ = 0.5
Δ = 0.2
Continuous limit
Success probability in one trial: λΔ.
The exponential law is memoryless. For , conditioning on survival to gives
Elapsed waiting time leaves the conditional distribution of the remaining wait unchanged. This is a substantive modeling assumption. For a uniform wait on , the probability of surviving past 3 given survival past 1 is , whereas surviving past 2 unconditionally has probability .
Conversely, for a proper nonnegative waiting time with positive survival at every finite time, memorylessness implies . Iterating this identity determines on rational times; right-continuity determines it on all times. The result is with (Siegrist, The Exponential Distribution, Memoryless Property). No empirical waiting-time dataset is guaranteed to satisfy this assumption.
Normal#
A symmetric model with an unbounded range is often useful for fluctuations around a center. Define the normal distribution for and by
The second parameter is the variance; is the standard deviation. The normalizing constant follows from the Gaussian integral. One proof squares the integral of and uses polar coordinates to evaluate the resulting two-dimensional integral as (Siegrist, The Normal Distribution, Standard Normal Distribution).
Subtracting the center and measuring distance in units of gives . Define its CDF as . Transforming the two endpoints then gives
For the independently chosen parameters and , the intervals within one, two and three standard deviations have the following probabilities. Their values depend only on the standardized endpoints, so the same table applies to every normal distribution.
| Distance from | Probability inside |
|---|---|
| At most | 0.682689 |
| At most | 0.954500 |
| At most | 0.997300 |
Symmetry gives . The familiar percentages are properties of a normal model. Knowing a variable’s mean and variance alone does not establish these tail probabilities. A normal model also assigns positive probability to every open interval, which matters when the quantity has strict physical bounds.
Gamma#
An exponential variable describes one memoryless waiting stage. A sum of several independent stages with the same rate motivates the gamma family. We use a shape and a rate . Define the gamma function and the density by
The density is zero for negative ; its value at zero can be chosen arbitrarily without changing probabilities. Near zero, the defining integral is finite because ; at infinity, exponential decay dominates the power. Substituting in the density integral gives exactly . Integration by parts gives , and gives for positive integers.
For integer shape , the density is that of a sum of independent exponential variables of rate . This follows by induction using convolution; see the proof in Siegrist, The Gamma Distribution, Poisson Process. At shape one, the formula itself reduces to the exponential density. Positive noninteger shapes remain valid density models, without an interpretation as a literal noninteger count of stages.
For our choice and , we obtain
The CDF is checked directly: its value at zero is zero, its limit is one, and differentiating it gives . Parameters need units too. The rate has inverse units of ; a scale parameter would be . In this example the scale is , so supplying a scale of 2 to an implementation would specify a different distribution.
Beta#
For a continuously varying proportion, the interval is a natural support. The beta family controls how density accumulates near its two ends. For , define
The density is zero outside the interval. Both endpoint integrals are finite because their power exponents exceed −1. Dividing by normalizes the density. The two beta parameters are shapes; the symbol no longer denotes the gamma rate. We choose the distribution family before interpreting its parameters.
Our example uses and . Expanding and integrating over gives . Consequently,
Differentiating the density gives . It rises up to and falls afterwards, so its mode is . When both shape parameters equal one, the density is uniform. A shape below one permits the density to diverge at its corresponding endpoint while remaining integrable. Even then, an exact endpoint has zero probability under the beta model (Siegrist, The Beta Distribution).
What changed#
Sums of point masses have become integrals over intervals. The CDF still answers the same threshold question for discrete and continuous variables. A density plot needs its horizontal scale: its height alone does not specify a probability.
Limitations#
Recording precision changes the observed distribution. Round our rising-density variable to the nearest integer and call the result . Integrating over the rounding bins gives:
| Recorded | −1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|
| Probability | 1/64 | 1/8 | 1/4 | 3/8 | 15/64 |
For instance, corresponds to and has probability . Ties have probability zero. A continuous model for the latent value is compatible with repeated identical recorded readings, and their probabilities require integrating across bins.
A continuous density also cannot represent a genuine atom, such as a positive probability of exactly zero. Such a model needs an explicit discrete component. Finally, a fitted family and its estimated quantiles carry uncertainty: calculating its p99 exactly does not establish the population p99 or a guaranteed upper bound on future observations.
What you should remember#
- Interval probabilities are areas under a density; point probabilities are zero.
- A CDF accumulates mass; a lower quantile picks the first threshold reaching it.
- Uniformity depends on the measurement scale, and exponential waiting assumes memorylessness.
- Normal tail percentages require a normal model.
- Gamma rate and scale are reciprocals; beta shapes describe a bounded density.
Code#
This standard-library calculation reproduces selected values above. It evaluates formulas directly; no fitted model, external dataset or random sample is involved.
from math import exp, erf, sqrt
print(f"rising median: {2 * sqrt(2) - 1:.6f}")
for delta, n in [(0.5, 4), (0.2, 10), (0.05, 40)]:
print(f"survival at 2, delta={delta:.2f}: {(1 - 0.6 * delta) ** n:.6f}")
print(f"continuous survival at 2: {exp(-1.2):.6f}")
print(f"normal within 2 sigma: {erf(2 / sqrt(2)):.6f}")
print(f"gamma CDF at 1: {1 - 5 * exp(-2):.6f}")
rising median: 1.828427
survival at 2, delta=0.50: 0.240100
survival at 2, delta=0.20: 0.278501
survival at 2, delta=0.05: 0.295712
continuous survival at 2: 0.301194
normal within 2 sigma: 0.954500
gamma CDF at 1: 0.323324
Next#
Changing units preserved interval probabilities while changing density heights. Squaring a variable already changed a uniform CDF into a curved one. Functions of random variables develops the general method, including transformations that send several input values to the same output.
References#
Kyle Siegrist, Random: Probability, Mathematical Statistics, and Stochastic Processes, online edition checked 16 November 2026. The following sections support the definitions and named distribution facts; the worked inputs, calculations, code and figures here are independently composed.
- Continuous Distributions, Definition and Basic Properties: density, absolute continuity, zero point mass.
- Distribution and Quantile Functions, Distribution Functions and Quantile Functions: CDF properties and the lower generalized inverse.
- The Continuous Uniform Distribution, The Uniform Distribution on a General Interval: endpoint parameterization.
- The Exponential Distribution, Basic Theory / Memoryless Property: characterization and its proof.
- The Normal Distribution, Standard Normal Distribution and General Normal Distribution: Gaussian integral, standardization, location and scale.
- The Gamma Distribution, Gamma Function and General Gamma Distribution: normalization, recurrence, shape and scale; Poisson-process treatment, Basic Theory: independent exponential sums and convolution proof.
- The Beta Distribution, Beta Function and Standard Beta Distribution: normalization and endpoint behavior.