Continuous Random Variables and PDFs
How do you assign probability to an outcome that can be any real number? Consider the exact lifetime of a lightbulb, measured with infinite precision. The event "the bulb lasts exactly 1000.000000... hours" should intuitively have probability zero. Yet the bulb must last some amount of time. This apparent paradox is resolved by abandoning point-mass probability. Instead, we spread probability continuously over an interval, using a density rather than a mass function. This idea matters because most quantities we measure in the physical world — time, distance, temperature, voltage — are naturally modeled as continuous, not discrete. Discrete random variables assign probability directly to outcomes. Continuous random variables instead assign probability to sets via integration of a density function. The shift from summing to integrating is not a cosmetic change. It requires new machinery (calculus). It also produces genuinely different phenomena, such as individual outcomes having probability exactly zero while still being "possible." The big picture is that the Cumulative Distribution Function (CDF), which you already know works uniformly for discrete and continuous variables alike, becomes differentiable in the continuous case. Its derivative is the probability density function (PDF). This article builds the PDF from first principles, proves the fundamental relationship linking it to the CDF, and carefully establishes the integration rules. These rules let you compute probabilities of intervals, means, and more. By the end, you will have a rigorous definition of a continuous random variable. You will also have a complete proof of the CDF–PDF correspondence, in both directions, under appropriate hypotheses. You will work through computations with asymmetric, non-trivial densities. You will gain a clear sense of where the continuity hypothesis is essential and where it can fail. This sets the stage for concrete families — the Uniform Distribution and the Exponential Distribution — and for defining Expectation of continuous variables in later material.
- A continuous random variable has a CDF that is (absolutely) continuous; its PDF wherever the derivative exists.
- Probabilities of events come from integrating the density: .
- Any single point has probability zero: for continuous , so are interchangeable in probability statements.
- A function is a valid PDF iff and ; nothing else is required.
- The PDF is not a probability itself — it is a probability density, and can exceed 1.
- Key idea: integrating the density over a set replaces summing the mass function over a set, turning calculus into the engine of continuous probability.
Where this lives today
Continuous densities are the working language of statistics: maximum likelihood estimation, Bayesian posterior computation, and hypothesis testing all manipulate densities directly, often multiplying and integrating them as in this article. In physics, the Maxwell–Boltzmann and Boltzmann distributions describe molecular speeds and energies as densities over continuous state spaces, and quantum mechanics interprets as a probability density for particle position. In engineering, signal and noise models (Gaussian noise densities in communication systems) rely on exactly the interval-integration rule proven here. In computer science and machine learning, generative models (normalizing flows, diffusion models) are built by explicitly tracking how a density transforms, using the CDF–PDF relationship as the base case. In finance, continuous-time models (Black–Scholes) posit densities for asset log-returns and integrate them to price derivatives. Cryptographic random number generators are tested against continuous density assumptions (e.g. uniformity) via statistical tests built on the CDF. This machinery is also the direct prerequisite for defining Expectation of a continuous random variable as , and for deriving concrete families such as the Uniform Distribution and the Exponential Distribution, where the density takes an explicit closed form.
:::quiz[A random variable equals with probability and is otherwise continuous on . Which statement is true?]
- is a continuous random variable with a valid PDF on all of
- 's CDF is continuous everywhere
- 's CDF has a jump of size at , so no single PDF describes all of 's distribution ✓
- since single points always have probability zero
Ask the tutor: How do we extend this framework to define the expectation and variance of a continuous random variable, and why does generalize the discrete weighted average?
Let be a probability space and let be a random variable with CDF
We say is a continuous random variable if there exists a function , called a probability density function (PDF) of , such that
Equivalently, for every Borel set for which the integral makes sense,
A function qualifies as a PDF of some random variable exactly when
The PDF is not unique: two functions that agree except on a set of Lebesgue measure zero define the same CDF and hence the same distribution.
Intuition
Think of probability as a unit amount of sand poured along the real line. For a discrete random variable, the sand collects in discrete piles at specific points — the probability mass function tells you the height of each pile. For a continuous random variable, the sand is smeared into a continuous layer with no piles at all: at any single point the layer has zero volume, but over an interval it has positive area. The density is the height of the sand at ; the probability of landing in an interval is the area under that height function over , i.e. . This picture immediately explains two facts that often confuse newcomers. First, can be larger than — it is a density (mass per unit length), not a probability, so there is no upper bound on its value, only on the total area under it. Second, for any single point : a single point is a "sliver" of zero width, contributing zero area no matter how tall the density is there. The CDF is the running total area swept out from up to . As increases, accumulates area continuously and smoothly (no jumps), which is precisely why is continuous when is continuous. The PDF is the rate of accumulation — the derivative of the CDF — exactly as in the Fundamental Theorem of Calculus, where an area function's derivative recovers the original integrand.
Let be a real-valued random variable with CDF .
(1) (PDF CDF properties). Suppose is continuous with density , i.e. for all . Then: (a) is continuous on (indeed uniformly continuous where is integrable); (b) at every point at which is continuous, is differentiable at and ; (c) for all ,
and consequently for every real number .
(2) (Converse, under a regularity hypothesis). Suppose is continuous on and piecewise continuously differentiable, meaning there is a finite or countable set with no accumulation point in any bounded interval such that is continuously differentiable on , and is (Lebesgue) integrable. Define
Then , , and
so is a valid density for .
We prove part (1) and part (2) separately. The technique throughout is the Fundamental Theorem of Calculus (FTC) together with basic properties of the Lebesgue/Riemann integral, plus monotonicity of (which holds for any CDF, established independently of this theorem).
Proof of (1). (a) Continuity of . Fix and let . Since is integrable over (its total integral is ), the function is integrable for any , and by the definition of the improper integral,
As , the interval (or ) shrinks to a single point, and since is integrable (in particular, absolutely continuous integral: for any there is such that any set of Lebesgue measure less than has -integral less than — this is the absolute continuity of the Lebesgue integral, a standard property of integrable functions), we get . Hence is continuous at every , i.e. continuous everywhere. (b) Differentiability where is continuous. Suppose is continuous at . By the FTC (the version for the Lebesgue/Riemann integral of a function continuous at a point), the function is differentiable at with derivative . Concretely: for ,
Given , continuity of at gives such that for . For ,
Letting shows the difference quotient converges to , so . (c) Interval probabilities. By countable additivity of (a defining axiom of probability, established prior to this theorem) applied to (a disjoint union), and using , :
By definition of as an integral,
using additivity of the integral over adjacent intervals. This proves . To upgrade to , note
We must show . Since is continuous at (by part (a)),
where the first equality is continuity of probability measures from above (a consequence of countable additivity), and the last uses continuity of established in (a). Hence , completing (c).
Proof of (2). We are given continuous everywhere, continuously differentiable off a set with no accumulation points in bounded intervals (so on any bounded interval, is finite), and integrable where defined; define off and on . Nonnegativity. is a CDF, hence non-decreasing (a basic property of CDFs, proved directly from monotonicity of probability: ). A non-decreasing differentiable function has non-negative derivative wherever it is differentiable (if , then for small , , contradicting monotonicity). Hence for , and on . So everywhere. Fundamental Theorem of Calculus on each subinterval. List the points of in increasing order (possible since has no accumulation point in any bounded interval, hence is countable and can be enumerated as an increasing — possibly bi-infinite — sequence ; if is finite this is just a finite list). On each closed interval , is continuous on the closed interval and continuously differentiable on the open interval (since ). Because is integrable and is continuous, the FTC (Barrow's rule) gives, for ,
the second equality because a.e. on and the countable set has Lebesgue measure zero, so it does not affect the value of the integral. Telescoping to get . Fix , and suppose (for concreteness) . Chaining the previous identity across all preceding subintervals and using as (a general property of CDFs, proved from continuity of measure and ) as the base case, we obtain
where the sum of integrals over adjacent intervals combines into a single integral over by countable additivity of the Lebesgue integral for a non-negative integrand, and . (If is finite, the same argument works with a single finite sum and no limit needed, and if is empty, this is simply the FTC applied to all of .) Total integral is . Letting in and using (another standard CDF property, from and continuity of measure), we get
Combining nonnegativity, total integral , and , we conclude is a valid density for .
∎Under the hypotheses of Theorem part (1), for any ,
and for a Borel set that is a finite or countable disjoint union of intervals ,
The first identity follows from together with , using as in the proof above. The second is countable additivity of applied to the disjoint intervals, combined with part (1)(c) on each piece, and countable additivity of the Lebesgue integral for the non-negative function to sum the pieces into .
∎Worked examples
Example 1 (asymmetric density on a bounded interval). Let have density
for a constant to be determined. Step 1: find . We need :
So , giving . Also on since there, so is a genuine density. Step 2: the CDF. For ,
For , ; for , (check: , consistent). This is continuous everywhere (matches at : ; at : ), confirming is continuous with this PDF, in accordance with Theorem part (1)(a). Step 3: compute an asymmetric interval probability, .
Compute numerators: , , sum . And , , sum . So
Step 4: a single-point check. , consistent with Theorem part (1)(c), even though : the density is positive but the point mass is still zero, since a point has zero length.
Example 2 (piecewise CDF given directly; recover density via the converse direction). Suppose we are told the CDF of a random variable is
Step 1: check is continuous (a hypothesis of Theorem part (2)). At : left limit , right value . Match. At : from the left, ; from the right, . Match. At : from the left, ; the value for is . Match. So is continuous everywhere, and it is smooth except possibly at the three junction points (this is the countable set in Theorem part (2), which is finite here). Step 2: differentiate piecewise.
- For : .
- For : .
- For : .
- For : .
At the junction points themselves, set arbitrarily (say ), per Theorem part (2), since a finite set of points does not affect any integral. Step 3: assemble the density.
This is the familiar "triangular" density, peaking at with height . Nonnegativity is clear ( on , on ). Check total integral:
confirming Theorem part (2)'s conclusion directly, as an independent check. Step 4: use it. Compute two ways. Via the CDF directly:
Via the density (splitting at ):
First term: . Second term: at : ; at : ; difference . Sum: . Both methods agree exactly, confirming Theorem part (2) end-to-end.
The theorem's converse direction (part 2) requires to be continuous. Drop this hypothesis and consider a random variable that is with probability and otherwise uniform on with the remaining probability, i.e.
This is non-decreasing, right-continuous, with limits and at — a perfectly legitimate CDF — but it has a jump discontinuity of size at :
If we naively tried to apply the "recover the density by differentiating" procedure, we would compute for and elsewhere, and define
The construction in Theorem part (2) fails outright: the resulting is not even a valid density (it fails to integrate to ), and in fact no density can represent at all, because
for any candidate density : any single point contributes zero to a Lebesgue integral (Theorem part 1(c) forces for any continuous ), yet here . This shows precisely why continuity of is indispensable: is a mixed random variable (part discrete atom, part continuous spread), and it possesses neither a discrete probability mass function on all of nor a continuous PDF on all of — the CDF–PDF correspondence of this article simply does not apply to it.
Scope, edge cases & common traps
| Situation | What happens | Correct handling |
|---|---|---|
| has a jump | is not continuous there (may be discrete or mixed) | Use PMF or split into atomic + continuous parts |
| undefined at finitely many points | No effect on any probability | Assign any value (e.g. ) there; integrals unaffected |
| on some interval | Perfectly fine | Density, not probability; only is required |
| for continuous | Always exactly | and interchangeable in all interval probabilities |
| continuous but not differentiable on an uncountable set (e.g. Cantor-type) | Converse (part 2) does not apply as stated | Requires measure-theoretic (Radon–Nikodym) treatment, beyond this scope |
| Two different densities with a.e. | Same distribution | PDF is unique only up to a measure-zero set |
The mathematician behind it
Origins · 1 minAndrey Nikolaevich Kolmogorov and how this was discovered
Kolmogorov is the architect of modern probability's axiomatic foundation. His 1933 monograph Grundbegriffe der Wahrscheinlichkeitsrechnung built probability on measure theory, making precise exactly the machinery — Lebesgue integrals, measurable sets, the Radon–Nikodym theorem — needed to define densities rigorously for arbitrary (not just "nice") continuous distributions. Before this synthesis, mathematicians like Laplace, Gauss, and Pearson had used densities freely in specific models (errors, heights, gases) without a unifying formal framework connecting the density to an abstract underlying probability measure.
Why is for a continuous random variable, if is a possible outcome?
This reflects the difference between "possible" and "positive probability." A continuous random variable spreads one unit of total probability over an uncountable continuum of outcomes. If any single point had positive probability , then since there are infinitely many (even uncountably many) such points in any interval, summing (in the appropriate sense) infinitely many copies of would force the total probability to be infinite, contradicting that total probability is . Formally, the proof uses continuity of the CDF: whenever is continuous at , as shown in the theorem above. The outcome is still possible; it simply carries zero measure, exactly like a single point on a line carrying zero length.
Can a probability density function take values greater than 1?
Yes, and this is a common point of confusion. The density measures probability per unit length, not probability itself. If a distribution concentrates its mass over a very short interval, the density there must be correspondingly tall to make the area (which is capped by total probability ) work out. For instance, a uniform density on has constant height for , since . The only universal constraints are everywhere and ; there is no pointwise upper bound.
Is the PDF of a continuous random variable unique?
Not exactly — it is unique only up to changes on a set of Lebesgue measure zero (such as a finite or countable set of points). If and differ only on such a "negligible" set, then for every Borel set , so they induce the identical CDF and thus the identical distribution. This is why, in Theorem part (2), we were free to assign an arbitrary value (e.g. ) at the finitely many junction points without changing any probability statement whatsoever. In practice, one typically picks the most natural or continuous representative.
How does this relate to the discrete case and probability mass functions?
Discrete and continuous random variables are both special cases of a general theory built on measure theory, but they behave very differently in detail. A discrete variable has a countable support and a probability mass function summing to ; probabilities of events are computed by summing over the relevant outcomes. A continuous variable instead has an uncountable support with for every , and probabilities come from integrating a density . Sums become integrals, and the CDF is a step function in the discrete case versus a continuous function in the continuous case. Some variables (as in the counterexample above) are "mixed," having both an atomic part and a continuous part, and require combining both approaches.
What exactly is required for a piecewise-defined CDF to correspond to a valid density?
Per Theorem part (2), you need: (i) continuous everywhere (no jumps, so no positive-probability single points); (ii) continuously differentiable except possibly at a "sparse" set of points (finite in every bounded interval); and (iii) the resulting derivative integrable. Under these conditions, differentiating piece-by-piece and patching arbitrary values at the finitely many exceptional points yields a valid density. If fails to be continuous (an atom exists), or if the non-differentiable set is too large (e.g. uncountable, as in exotic constructions like the Cantor function), this elementary approach breaks down and one needs the more general Radon–Nikodym framework from measure theory.
Why does the definition require an integral rather than just "a nonnegative function"?
Because probability must be additive over disjoint events, and the only way for a function on a continuum to generate an additive set function consistently (with total mass ) is via integration — this is precisely what Lebesgue's integration theory formalizes. Simply specifying "how much stuff is at each point" is not enough (each point individually must contribute zero, yet the aggregate over any interval must be well-defined and additive across sub-intervals); integration is the operation that achieves exactly this. This is also why the two defining conditions, and , are simultaneously necessary and sufficient: they are exactly what is needed for the set function to be a legitimate probability measure.
How does this connect to what comes next, like the Uniform and Exponential distributions?
This article establishes the general machinery — what a PDF is, how it relates to the CDF, and how to integrate it to get probabilities — without committing to any specific formula. The Uniform Distribution is the simplest concrete example, with a constant density on an interval, useful for illustrating every definition here with the least algebraic overhead. The Exponential Distribution introduces a genuinely non-constant density, , modeling waiting times, and its CDF is a direct application of the correspondence proven above. Once densities are established, the next natural construction is Expectation, defined as , generalizing the discrete weighted average to the continuous, integral setting.