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.

Key takeaways
  • A continuous random variable XX has a CDF FF that is (absolutely) continuous; its PDF f=F′f = F' wherever the derivative exists.
  • Probabilities of events come from integrating the density: P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_a^b f(x)\,dx.
  • Any single point has probability zero: P(X=a)=0P(X = a) = 0 for continuous XX, so <,≤<, \le are interchangeable in probability statements.
  • A function ff is a valid PDF iff f≥0f \ge 0 and ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1; 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 ∣ψ(x)∣2|\psi(x)|^2 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 ∫xf(x) dx\int x f(x)\,dx, 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 ZZ equals 00 with probability 0.30.3 and is otherwise continuous on (0,1](0,1]. Which statement is true?]

  • ZZ is a continuous random variable with a valid PDF on all of R\mathbb R
  • ZZ's CDF is continuous everywhere
  • ZZ's CDF has a jump of size 0.30.3 at z=0z=0, so no single PDF describes all of ZZ's distribution ✓
  • P(Z=0)=0P(Z=0)=0 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 E[X]=∫xf(x) dxE[X] = \int x f(x)\,dx generalize the discrete weighted average?

DefinitionContinuous random variable and probability density function

Let (Ω,F,P)(\Omega, \mathcal F, P) be a probability space and let X:Ω→RX : \Omega \to \mathbb R be a random variable with CDF

FX(x)=P(X≤x),x∈R.F_X(x) = P(X \le x), \qquad x \in \mathbb R.

We say XX is a continuous random variable if there exists a function fX:R→[0,∞)f_X : \mathbb R \to [0,\infty), called a probability density function (PDF) of XX, such that

FX(x)=∫−∞xfX(t) dtfor every x∈R.F_X(x) = \int_{-\infty}^{x} f_X(t)\, dt \qquad \text{for every } x \in \mathbb R.

Equivalently, for every Borel set A⊆RA \subseteq \mathbb R for which the integral makes sense,

P(X∈A)=∫AfX(x) dx.P(X \in A) = \int_A f_X(x)\, dx.

A function ff qualifies as a PDF of some random variable exactly when

f(x)≥0 for all x,∫−∞∞f(x) dx=1.f(x) \ge 0 \text{ for all } x, \qquad \int_{-\infty}^{\infty} f(x)\, dx = 1.

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 f(x)f(x) is the height of the sand at xx; the probability of landing in an interval [a,b][a,b] is the area under that height function over [a,b][a,b], i.e. ∫abf(x) dx\int_a^b f(x)\,dx. This picture immediately explains two facts that often confuse newcomers. First, f(x)f(x) can be larger than 11 — 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, P(X=a)=0P(X = a) = 0 for any single point aa: a single point is a "sliver" of zero width, contributing zero area no matter how tall the density is there. The CDF F(x)=P(X≤x)F(x) = P(X \le x) is the running total area swept out from −∞-\infty up to xx. As xx increases, FF accumulates area continuously and smoothly (no jumps), which is precisely why FF is continuous when XX 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.

Figure
The PDF as height, the CDF as accumulated area, for a density peaked near 1
x f(x) a=0.5 b=1.5 area = P(a≤X≤b) Density f(x): triangular peak at x=1
Figure
The CDF F(x) rises smoothly, with slope equal to f(x)
x F(x) 0 1 a=0.5 b=1.5 F(b)−F(a) = shaded area above
TheoremCDF–PDF Correspondence

Let XX be a real-valued random variable with CDF F(x)=P(X≤x)F(x) = P(X \le x).

(1) (PDF ⇒\Rightarrow CDF properties). Suppose XX is continuous with density ff, i.e. F(x)=∫−∞xf(t) dtF(x) = \int_{-\infty}^x f(t)\,dt for all xx. Then: (a) FF is continuous on R\mathbb R (indeed uniformly continuous where ff is integrable); (b) at every point x0x_0 at which ff is continuous, FF is differentiable at x0x_0 and F′(x0)=f(x0)F'(x_0) = f(x_0); (c) for all a≤ba \le b,

P(a≤X≤b)=F(b)−F(a)=∫abf(x) dx,P(a \le X \le b) = F(b) - F(a) = \int_a^b f(x)\,dx,

and consequently P(X=a)=0P(X = a) = 0 for every real number aa.

(2) (Converse, under a regularity hypothesis). Suppose FF is continuous on R\mathbb R and piecewise continuously differentiable, meaning there is a finite or countable set D⊂RD \subset \mathbb R with no accumulation point in any bounded interval such that FF is continuously differentiable on R∖D\mathbb R \setminus D, and F′F' is (Lebesgue) integrable. Define

f(x)={F′(x)x∉D0x∈D.f(x) = \begin{cases} F'(x) & x \notin D \\ 0 & x \in D. \end{cases}

Then f≥0f \ge 0, ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1, and

F(x)=∫−∞xf(t) dtfor all x,F(x) = \int_{-\infty}^{x} f(t)\,dt \quad \text{for all } x,

so ff is a valid density for XX.

Proof

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 FF (which holds for any CDF, established independently of this theorem).

Proof of (1). (a) Continuity of FF. Fix x0∈Rx_0 \in \mathbb R and let xn→x0x_n \to x_0. Since f≥0f \ge 0 is integrable over R\mathbb R (its total integral is 11), the function g(x)=f(x)1[−M,M](x)g(x) = f(x)\mathbf 1_{[-M,M]}(x) is integrable for any MM, and by the definition of the improper integral,

F(xn)−F(x0)=∫−∞xnf(t) dt−∫−∞x0f(t) dt=∫x0xnf(t) dt(signed appropriately).F(x_n) - F(x_0) = \int_{-\infty}^{x_n} f(t)\,dt - \int_{-\infty}^{x_0} f(t)\,dt = \int_{x_0}^{x_n} f(t)\,dt \quad (\text{signed appropriately}).

As xn→x0x_n \to x_0, the interval [x0,xn][x_0, x_n] (or [xn,x0][x_n,x_0]) shrinks to a single point, and since ff is integrable (in particular, absolutely continuous integral: for any ε>0\varepsilon>0 there is δ>0\delta>0 such that any set of Lebesgue measure less than δ\delta has ff-integral less than ε\varepsilon — this is the absolute continuity of the Lebesgue integral, a standard property of integrable functions), we get F(xn)−F(x0)→0F(x_n) - F(x_0) \to 0. Hence FF is continuous at every x0x_0, i.e. continuous everywhere. (b) Differentiability where ff is continuous. Suppose ff is continuous at x0x_0. By the FTC (the version for the Lebesgue/Riemann integral of a function continuous at a point), the function x↦∫−∞xf(t) dt=F(x)x \mapsto \int_{-\infty}^x f(t)\,dt = F(x) is differentiable at x0x_0 with derivative f(x0)f(x_0). Concretely: for h≠0h \ne 0,

F(x0+h)−F(x0)h=1h∫x0x0+hf(t) dt.\frac{F(x_0+h) - F(x_0)}{h} = \frac{1}{h}\int_{x_0}^{x_0+h} f(t)\,dt.

Given ε>0\varepsilon > 0, continuity of ff at x0x_0 gives δ>0\delta > 0 such that ∣f(t)−f(x0)∣<ε|f(t) - f(x_0)| < \varepsilon for ∣t−x0∣<δ|t - x_0| < \delta. For 0<∣h∣<δ0 < |h| < \delta,

∣1h∫x0x0+hf(t) dt−f(x0)∣=∣1h∫x0x0+h(f(t)−f(x0)) dt∣≤1∣h∣⋅∣h∣⋅ε=ε.\left| \frac{1}{h}\int_{x_0}^{x_0+h} f(t)\,dt - f(x_0) \right| = \left| \frac{1}{h}\int_{x_0}^{x_0+h} \big(f(t) - f(x_0)\big)\,dt \right| \le \frac{1}{|h|} \cdot |h| \cdot \varepsilon = \varepsilon.

Letting h→0h \to 0 shows the difference quotient converges to f(x0)f(x_0), so F′(x0)=f(x0)F'(x_0) = f(x_0). (c) Interval probabilities. By countable additivity of PP (a defining axiom of probability, established prior to this theorem) applied to (−∞,b]=(−∞,a]∪(a,b](-\infty, b] = (-\infty,a] \cup (a,b] (a disjoint union), and using P(X≤b)=F(b)P(X\le b) = F(b), P(X≤a)=F(a)P(X \le a) = F(a):

P(a<X≤b)=F(b)−F(a).P(a < X \le b) = F(b) - F(a).

By definition of FF as an integral,

F(b)−F(a)=∫−∞bf(t) dt−∫−∞af(t) dt=∫abf(t) dt,F(b) - F(a) = \int_{-\infty}^b f(t)\,dt - \int_{-\infty}^a f(t)\,dt = \int_a^b f(t)\,dt,

using additivity of the integral over adjacent intervals. This proves P(a<X≤b)=∫abf(x) dxP(a < X \le b) = \int_a^b f(x)\,dx. To upgrade to P(a≤X≤b)P(a \le X \le b), note

P(a≤X≤b)=P(X=a)+P(a<X≤b).P(a \le X \le b) = P(X=a) + P(a< X \le b).

We must show P(X=a)=0P(X=a)=0. Since FF is continuous at aa (by part (a)),

P(X=a)=lim⁡n→∞P(a−1n<X≤a)=lim⁡n→∞[F(a)−F(a−1n)]=F(a)−F(a)=0,P(X = a) = \lim_{n\to\infty} P\left(a - \tfrac1n < X \le a\right) = \lim_{n\to\infty} \left[F(a) - F(a - \tfrac1n)\right] = F(a) - F(a) = 0,

where the first equality is continuity of probability measures from above (a consequence of countable additivity), and the last uses continuity of FF established in (a). Hence P(a≤X≤b)=P(a<X≤b)=∫abf(x) dxP(a \le X \le b) = P(a < X \le b) = \int_a^b f(x)\,dx, completing (c).

Proof of (2). We are given FF continuous everywhere, continuously differentiable off a set DD with no accumulation points in bounded intervals (so on any bounded interval, DD is finite), and F′F' integrable where defined; define f=F′f = F' off DD and f=0f=0 on DD. Nonnegativity. FF is a CDF, hence non-decreasing (a basic property of CDFs, proved directly from monotonicity of probability: x≤y⇒{X≤x}⊆{X≤y}⇒F(x)≤F(y)x \le y \Rightarrow \{X\le x\} \subseteq \{X \le y\} \Rightarrow F(x) \le F(y)). A non-decreasing differentiable function has non-negative derivative wherever it is differentiable (if F′(x0)<0F'(x_0) < 0, then for small h>0h>0, F(x0+h)<F(x0)F(x_0+h) < F(x_0), contradicting monotonicity). Hence f(x)=F′(x)≥0f(x) = F'(x) \ge 0 for x∉Dx \notin D, and f=0≥0f = 0 \ge 0 on DD. So f≥0f \ge 0 everywhere. Fundamental Theorem of Calculus on each subinterval. List the points of DD in increasing order (possible since DD has no accumulation point in any bounded interval, hence is countable and can be enumerated as an increasing — possibly bi-infinite — sequence ⋯<d−1<d0<d1<…\dots < d_{-1} < d_0 < d_1 < \dots; if DD is finite this is just a finite list). On each closed interval [dk,dk+1][d_k, d_{k+1}], FF is continuous on the closed interval and continuously differentiable on the open interval (dk,dk+1)(d_k, d_{k+1}) (since D∩(dk,dk+1)=∅D \cap (d_k,d_{k+1}) = \emptyset). Because F′F' is integrable and FF is continuous, the FTC (Barrow's rule) gives, for dk≤x≤dk+1d_k \le x \le d_{k+1},

F(x)−F(dk)=∫dkxF′(t) dt=∫dkxf(t) dt,F(x) - F(d_k) = \int_{d_k}^{x} F'(t)\, dt = \int_{d_k}^x f(t)\,dt,

the second equality because f=F′f = F' a.e. on (dk,dk+1)(d_k,d_{k+1}) and the countable set DD has Lebesgue measure zero, so it does not affect the value of the integral. Telescoping to get F(x)=∫−∞xfF(x) = \int_{-\infty}^x f. Fix xx, and suppose (for concreteness) x∈[dm,dm+1]x \in [d_m, d_{m+1}]. Chaining the previous identity across all preceding subintervals and using F(y)→0F(y) \to 0 as y→−∞y \to -\infty (a general property of CDFs, proved from continuity of measure and ⋂n{X≤−n}=∅\bigcap_n \{X \le -n\} = \emptyset) as the base case, we obtain

F(x)=lim⁡N→∞[F(d−N)+∑k=−Nm−1(F(dk+1)−F(dk))]+(F(x)−F(dm))=∫−∞xf(t) dt,F(x) = \lim_{N\to\infty}\Big[F(d_{-N}) + \sum_{k=-N}^{m-1}\big(F(d_{k+1})-F(d_k)\big)\Big] + \big(F(x) - F(d_m)\big) = \int_{-\infty}^{x} f(t)\, dt,

where the sum of integrals over adjacent intervals combines into a single integral over (−∞,x](-\infty, x] by countable additivity of the Lebesgue integral for a non-negative integrand, and F(d−N)→0F(d_{-N}) \to 0. (If DD is finite, the same argument works with a single finite sum and no limit needed, and if DD is empty, this is simply the FTC applied to all of R\mathbb R.) Total integral is 11. Letting x→∞x \to \infty in F(x)=∫−∞xf(t) dtF(x) = \int_{-\infty}^x f(t)\,dt and using F(x)→1F(x) \to 1 (another standard CDF property, from ⋃n{X≤n}=Ω\bigcup_n \{X \le n\} = \Omega and continuity of measure), we get

∫−∞∞f(t) dt=lim⁡x→∞F(x)=1.\int_{-\infty}^{\infty} f(t)\,dt = \lim_{x\to\infty} F(x) = 1.

Combining nonnegativity, total integral 11, and F(x)=∫−∞xfF(x) = \int_{-\infty}^x f, we conclude ff is a valid density for XX. ■\blacksquare

∎
CorollaryComplement and monotonicity of density integrals

Under the hypotheses of Theorem part (1), for any aa,

P(X>a)=1−F(a)=∫a∞f(x) dx,P(X > a) = 1 - F(a) = \int_a^{\infty} f(x)\,dx,

and for a Borel set AA that is a finite or countable disjoint union of intervals A=⨆i(ai,bi]A = \bigsqcup_i (a_i,b_i],

P(X∈A)=∑i∫aibif(x) dx=∫Af(x) dx.P(X \in A) = \sum_i \int_{a_i}^{b_i} f(x)\,dx = \int_A f(x)\,dx.
Proof

The first identity follows from P(X>a)=1−P(X≤a)=1−F(a)P(X>a) = 1 - P(X\le a) = 1-F(a) together with F(∞)−F(a)=∫a∞fF(\infty) - F(a) = \int_a^\infty f, using F(∞)=1F(\infty)=1 as in the proof above. The second is countable additivity of PP 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 ff to sum the pieces into ∫Af\int_A f.

∎

Worked examples

Example 1 (asymmetric density on a bounded interval). Let XX have density

f(x)={c (3x2+2x),0≤x≤20,otherwise,f(x) = \begin{cases} c\,(3x^2 + 2x), & 0 \le x \le 2 \\ 0, & \text{otherwise,} \end{cases}

for a constant cc to be determined. Step 1: find cc. We need ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1:

∫02c(3x2+2x) dx=c[x3+x2]02=c(8+4)=12c.\int_0^2 c(3x^2+2x)\,dx = c\big[x^3 + x^2\big]_0^2 = c(8+4) = 12c.

So 12c=112c = 1, giving c=112c = \dfrac{1}{12}. Also f(x)=3x2+2x12≥0f(x) = \frac{3x^2+2x}{12} \ge 0 on [0,2][0,2] since x≥0x \ge 0 there, so ff is a genuine density. Step 2: the CDF. For 0≤x≤20 \le x \le 2,

F(x)=∫0x3t2+2t12 dt=x3+x212.F(x) = \int_0^x \frac{3t^2+2t}{12}\,dt = \frac{x^3+x^2}{12}.

For x<0x<0, F(x)=0F(x)=0; for x>2x>2, F(x)=1F(x)=1 (check: 8+412=1\frac{8+4}{12}=1, consistent). This FF is continuous everywhere (matches at x=0x=0: 0=00=0; at x=2x=2: 12/12=1=112/12=1=1), confirming XX is continuous with this PDF, in accordance with Theorem part (1)(a). Step 3: compute an asymmetric interval probability, P(0.5≤X≤1.5)P(0.5 \le X \le 1.5).

P(0.5≤X≤1.5)=F(1.5)−F(0.5)=1.53+1.5212−0.53+0.5212.P(0.5 \le X \le 1.5) = F(1.5) - F(0.5) = \frac{1.5^3+1.5^2}{12} - \frac{0.5^3+0.5^2}{12}.

Compute numerators: 1.53=3.3751.5^3 = 3.375, 1.52=2.251.5^2=2.25, sum =5.625=5.625. And 0.53=0.1250.5^3=0.125, 0.52=0.250.5^2=0.25, sum =0.375=0.375. So

P(0.5≤X≤1.5)=5.625−0.37512=5.2512=0.4375.P(0.5\le X\le 1.5) = \frac{5.625 - 0.375}{12} = \frac{5.25}{12} = 0.4375.

Step 4: a single-point check. P(X=1)=0P(X = 1) = 0, consistent with Theorem part (1)(c), even though f(1)=3+212=512≈0.417≠0f(1) = \frac{3+2}{12} = \frac{5}{12} \approx 0.417 \ne 0: 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 YY is

F(y)={0,y<0y22,0≤y<11−(2−y)22,1≤y<21,y≥2.F(y) = \begin{cases} 0, & y < 0 \\ \dfrac{y^2}{2}, & 0 \le y < 1 \\ 1 - \dfrac{(2-y)^2}{2}, & 1 \le y < 2 \\ 1, & y \ge 2. \end{cases}

Step 1: check FF is continuous (a hypothesis of Theorem part (2)). At y=0y=0: left limit 00, right value 02/2=00^2/2 = 0. Match. At y=1y=1: from the left, 12/2=0.51^2/2 = 0.5; from the right, 1−(2−1)2/2=1−0.5=0.51 - (2-1)^2/2 = 1 - 0.5 = 0.5. Match. At y=2y=2: from the left, 1−(2−2)2/2=1−0=11 - (2-2)^2/2 = 1-0=1; the value for y≥2y\ge 2 is 11. Match. So FF is continuous everywhere, and it is smooth except possibly at the three junction points y=0,1,2y=0,1,2 (this is the countable set DD in Theorem part (2), which is finite here). Step 2: differentiate piecewise.

  • For y<0y<0: F′(y)=0F'(y) = 0.
  • For 0<y<10<y<1: F(y)=y2/2⇒F′(y)=yF(y) = y^2/2 \Rightarrow F'(y) = y.
  • For 1<y<21<y<2: F(y)=1−(2−y)22⇒F′(y)=−2(2−y)(−1)2=2−yF(y) = 1 - \frac{(2-y)^2}{2} \Rightarrow F'(y) = -\frac{2(2-y)(-1)}{2} = 2-y.
  • For y>2y>2: F′(y)=0F'(y) = 0.

At the junction points themselves, set ff arbitrarily (say 00), per Theorem part (2), since a finite set of points does not affect any integral. Step 3: assemble the density.

f(y)={y,0≤y≤12−y,1≤y≤20,otherwise.f(y) = \begin{cases} y, & 0 \le y \le 1 \\ 2-y, & 1 \le y \le 2 \\ 0, & \text{otherwise.} \end{cases}

This is the familiar "triangular" density, peaking at y=1y=1 with height f(1)=1f(1)=1. Nonnegativity is clear (y≥0y\ge0 on [0,1][0,1], 2−y≥02-y \ge 0 on [1,2][1,2]). Check total integral:

∫01y dy+∫12(2−y) dy=12+[2y−y22]12=12+[(4−2)−(2−12)]=12+[2−1.5]=12+12=1,\int_0^1 y\,dy + \int_1^2 (2-y)\,dy = \frac12 + \left[2y - \frac{y^2}{2}\right]_1^2 = \frac12 + \big[(4-2)-(2-\tfrac12)\big] = \frac12 + \big[2 - 1.5\big] = \frac12+\frac12=1,

confirming Theorem part (2)'s conclusion ∫f=1\int f = 1 directly, as an independent check. Step 4: use it. Compute P(0.25≤Y≤1.75)P(0.25 \le Y \le 1.75) two ways. Via the CDF directly:

F(1.75)−F(0.25)=[1−(2−1.75)22]−0.2522=[1−0.06252]−0.06252=1−0.03125−0.03125=0.9375.F(1.75) - F(0.25) = \left[1 - \frac{(2-1.75)^2}{2}\right] - \frac{0.25^2}{2} = \left[1 - \frac{0.0625}{2}\right] - \frac{0.0625}{2} = 1 - 0.03125 - 0.03125 = 0.9375.

Via the density (splitting at y=1y=1):

∫0.251y dy+∫11.75(2−y) dy=[y22]0.251+[2y−y22]11.75.\int_{0.25}^1 y\,dy + \int_1^{1.75} (2-y)\,dy = \left[\frac{y^2}{2}\right]_{0.25}^1 + \left[2y-\frac{y^2}{2}\right]_1^{1.75}.

First term: 12−0.06252=0.5−0.03125=0.46875\frac12 - \frac{0.0625}{2} = 0.5 - 0.03125 = 0.46875. Second term: at y=1.75y=1.75: 3.5−3.06252=3.5−1.53125=1.968753.5 - \frac{3.0625}{2} = 3.5-1.53125=1.96875; at y=1y=1: 2−0.5=1.52-0.5=1.5; difference =1.96875−1.5=0.46875= 1.96875-1.5=0.46875. Sum: 0.46875+0.46875=0.93750.46875+0.46875 = 0.9375. Both methods agree exactly, confirming Theorem part (2) end-to-end.

CounterexampleDropping continuity of FF: a CDF with an atom is not covered

The theorem's converse direction (part 2) requires FF to be continuous. Drop this hypothesis and consider a random variable ZZ that is 00 with probability 12\tfrac12 and otherwise uniform on [0,1][0,1] with the remaining 12\tfrac12 probability, i.e.

FZ(z)={0,z<012+z2,0≤z<11,z≥1.F_Z(z) = \begin{cases} 0, & z<0\\ \tfrac12 + \tfrac{z}{2}, & 0 \le z < 1\\ 1, & z \ge 1. \end{cases}

This FZF_Z is non-decreasing, right-continuous, with limits 00 and 11 at −∞,∞-\infty,\infty — a perfectly legitimate CDF — but it has a jump discontinuity of size 12\tfrac12 at z=0z=0:

FZ(0)−lim⁡z↑0FZ(z)=12−0=12=P(Z=0).F_Z(0) - \lim_{z\uparrow 0} F_Z(z) = \frac12 - 0 = \frac12 = P(Z=0).

If we naively tried to apply the "recover the density by differentiating" procedure, we would compute FZ′(z)=12F_Z'(z) = \tfrac12 for 0<z<10<z<1 and FZ′(z)=0F_Z'(z)=0 elsewhere, and define

g(z)={12,0<z<10,otherwise,∫−∞∞g(z) dz=12≠1.g(z) = \begin{cases}\tfrac12, & 0<z<1\\ 0,&\text{otherwise,}\end{cases} \qquad \int_{-\infty}^{\infty} g(z)\,dz = \frac12 \ne 1.

The construction in Theorem part (2) fails outright: the resulting gg is not even a valid density (it fails to integrate to 11), and in fact no density can represent ZZ at all, because

∫−∞0g(z) dz=0≠12=P(Z≤0)=FZ(0)\int_{-\infty}^{0} g(z)\,dz = 0 \ne \frac12 = P(Z \le 0) = F_Z(0)

for any candidate density gg: any single point contributes zero to a Lebesgue integral (Theorem part 1(c) forces P(Z=0)=0P(Z=0)=0 for any continuous ZZ), yet here P(Z=0)=12≠0P(Z=0)=\tfrac12\ne 0. This shows precisely why continuity of FF is indispensable: ZZ is a mixed random variable (part discrete atom, part continuous spread), and it possesses neither a discrete probability mass function on all of R\mathbb R nor a continuous PDF on all of R\mathbb R — the CDF–PDF correspondence of this article simply does not apply to it.

Scope, edge cases & common traps

SituationWhat happensCorrect handling
FF has a jumpXX is not continuous there (may be discrete or mixed)Use PMF or split into atomic + continuous parts
ff undefined at finitely many pointsNo effect on any probabilityAssign any value (e.g. 00) there; integrals unaffected
f(x)>1f(x) > 1 on some intervalPerfectly fineDensity, not probability; only ∫f=1\int f = 1 is required
P(X=a)P(X=a) for continuous XXAlways exactly 00<< and ≤\le interchangeable in all interval probabilities
FF continuous but not differentiable on an uncountable set (e.g. Cantor-type)Converse (part 2) does not apply as statedRequires measure-theoretic (Radon–Nikodym) treatment, beyond this scope
Two different densities f1,f2f_1,f_2 with f1=f2f_1=f_2 a.e.Same distributionPDF is unique only up to a measure-zero set

The mathematician behind it

Origins · 1 minAndrey Nikolaevich Kolmogorov and how this was discovered
AN
Andrey Nikolaevich Kolmogorov
1903–1987 · Soviet Union, 20th-century mathematics

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.

History
- 1738: Daniel Bernoulli and later Laplace use continuous density-like reasoning in error theory.
- 1809: Gauss derives the normal density from a maximum-likelihood argument on measurement errors.
- 1901–1905: Lebesgue develops the integral that makes rigorous "area under a density" precise.
- 1933: Kolmogorov's axioms unify discrete and continuous probability under measure theory.
- 1940s–1950s: Radon–Nikodym theorem clarifies exactly when a distribution admits a density.
Why is P(X=a)=0P(X=a)=0 for a continuous random variable, if aa 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 p>0p>0, then since there are infinitely many (even uncountably many) such points in any interval, summing (in the appropriate sense) infinitely many copies of pp would force the total probability to be infinite, contradicting that total probability is 11. Formally, the proof uses continuity of the CDF: P(X=a)=F(a)−lim⁡x↑aF(x)=0P(X=a) = F(a) - \lim_{x\uparrow a}F(x) = 0 whenever FF is continuous at aa, 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 f(x)f(x) 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 11) work out. For instance, a uniform density on [0,0.1][0, 0.1] has constant height f(x)=10f(x) = 10 for x∈[0,0.1]x \in [0,0.1], since 10×0.1=110 \times 0.1 = 1. The only universal constraints are f≥0f\ge 0 everywhere and ∫−∞∞f(x) dx=1\int_{-\infty}^\infty f(x)\,dx = 1; 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 f1f_1 and f2f_2 differ only on such a "negligible" set, then ∫Af1=∫Af2\int_A f_1 = \int_A f_2 for every Borel set AA, so they induce the identical CDF and thus the identical distribution. This is why, in Theorem part (2), we were free to assign ff an arbitrary value (e.g. 00) at the finitely many junction points DD 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 p(x)=P(X=x)p(x) = P(X=x) summing to 11; probabilities of events are computed by summing pp over the relevant outcomes. A continuous variable instead has an uncountable support with P(X=x)=0P(X=x)=0 for every xx, and probabilities come from integrating a density ff. 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) FF continuous everywhere (no jumps, so no positive-probability single points); (ii) FF continuously differentiable except possibly at a "sparse" set of points DD (finite in every bounded interval); and (iii) the resulting derivative F′F' integrable. Under these conditions, differentiating piece-by-piece and patching arbitrary values at the finitely many exceptional points yields a valid density. If FF 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 11) 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, f≥0f\ge0 and ∫f=1\int f = 1, are simultaneously necessary and sufficient: they are exactly what is needed for the set function A↦∫AfA \mapsto \int_A f 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, f(x)=λe−λxf(x) = \lambda e^{-\lambda x}, modeling waiting times, and its CDF 1−e−λx1 - e^{-\lambda x} is a direct application of the correspondence proven above. Once densities are established, the next natural construction is Expectation, defined as ∫xf(x) dx\int x f(x)\,dx, generalizing the discrete weighted average to the continuous, integral setting.

Before this

Where this leads