What a Probability Density Measures
A probability density describes how probability is spread across the real line. Its value at one point is not, in general, the probability of that point. To obtain a probability, integrate the density over a set: the interval, or more generally the measurable region, whose probability is wanted. This distinction is important when interpreting continuous measurements, such as waiting times or errors.
Let \(X\) be a real-valued random variable on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). A density is a measurable function \(f:\mathbb{R}\to[0,\infty]\) that represents the law of \(X\) by integration. Integrals below are Lebesgue integrals with respect to length on the real line. The relevant sets \(A\) are Borel sets, which include intervals and the usual sets formed from intervals.
The integral over the entire real line is the total probability, so normalization is essential. A density may be greater than one at some points; what must equal one is its total integral. Also, the density need not be uniquely specified at every point. Changing its value at a single point does not change any of its integrals, and therefore does not change the law it represents.
Proof. First suppose \(f\) is a density for a random variable \(X\). Taking \(A=\mathbb{R}\) in the definition gives \(\int_{\mathbb{R}} f(x)\,dx=\mathbb{P}(X\in\mathbb{R})=1\). Nonnegativity is part of the definition. Conversely, suppose \(f\) is measurable, nonnegative, and has integral one. On the measurable space \((\mathbb{R},\mathcal{B}(\mathbb{R}))\), define \(\mathbb{P}_f(A)=\int_A f(x)\,dx\). This assigns zero to the empty set, assigns one to \(\mathbb{R}\), and is countably additive: for pairwise disjoint Borel sets \(A_1,A_2,\ldots\), the indicator of their union is the sum of their indicators, so additivity of the nonnegative integral gives \(\mathbb{P}_f(\bigcup_{k\ge1}A_k)=\sum_{k\ge1}\mathbb{P}_f(A_k)\). Thus \(\mathbb{P}_f\) is a probability measure. On this probability space, let \(X(x)=x\), the identity random variable. Then \(\mathbb{P}_f(X\in A)=\mathbb{P}_f(A)=\int_A f(x)\,dx\), so \(X\) has density \(f\). \(\square\)
A useful consequence is the interval formula. If \(a<b\), then the probability that \(X\) lies between \(a\) and \(b\) is the integral of \(f\) over that interval. Whether either endpoint is included does not change the answer: a singleton has length zero and hence has integral zero. The following result makes this precise.
Proof. Since a singleton has Lebesgue measure zero, its integral is zero: \(\int_{\{c\}}f(x)\,dx=0\). The density definition therefore gives \(\mathbb{P}(X=c)=0\). The sets \((a,b)\), \([a,b]\), \([a,b)\), and \((a,b]\) differ only by one or both of the endpoint singletons \(\{a\}\) and \(\{b\}\). Those singletons have probability zero, so all four sets have the same probability. By the density definition, the probability of any of them equals the integral over that interval; including or excluding its endpoints does not affect the integral. \(\square\)
For a density \(f\), the distribution function is consequently \(F_X(x)=\mathbb{P}(X\le x)=\int_{-\infty}^{x}f(u)\,du\). This expresses a cumulative probability as an integral, but a density is more than a formula for an interval: its integral gives the probability of every Borel set, including sets that are not single intervals.
Three Standard Densities
Worked Example: A Uniform Law on an Interval
Suppose \(X\) is uniform on \([1,5]\). Its proposed density is \(f(x)=\tfrac14\) for \(1\le x\le5\), and \(f(x)=0\) otherwise. Check that this is normalized, then find \(\mathbb{P}(2\le X<4)\).
The function is nonnegative. Its total integral is
It is therefore a density. The requested set includes 2 but excludes 4; by the interval formula, endpoint choices do not affect the integral. Hence
Check: The interval \([2,4)\) has length \(4-2=2\), and the density there is \(\tfrac14\), so its probability is \(2\cdot\tfrac14=\tfrac12\), as computed. The density height is \(\tfrac14\); it is not the probability of any particular point.
Worked Example: An Exponential Waiting-Time Law
For rate \(2\), the exponential density is \(f(x)=2e^{-2x}\) for \(x\ge0\), and \(f(x)=0\) for \(x<0\). Verify the normalization and calculate the probability that \(X\) lies in \((\tfrac12,1]\).
The density is nonnegative on its support. Its total integral is
Thus it is normalized. The requested interval is contained in the nonnegative support. Integrating gives
Check: The probability from \(0\) to \(1\) is \(\int_0^1 2e^{-2x}\,dx=1-e^{-2}\), while the probability from \(0\) to \(\tfrac12\) is \(\int_0^{1/2}2e^{-2x}\,dx=1-e^{-1}\). Subtracting gives \((1-e^{-2})-(1-e^{-1})=e^{-1}-e^{-2}\), the same result.
Worked Example: The Standard Normal Law
The standard normal density is \(\phi(x)=\tfrac{1}{\sqrt{2\pi}}e^{-x^2/2}\) for \(x\in\mathbb{R}\). We verify its normalization and express \(\mathbb{P}(-1<X\le1)\) in terms of its distribution function.
For normalization, let \(I=\int_{-\infty}^{\infty}e^{-x^2/2}\,dx\). The integrand is positive, so multiplying the two one-dimensional integrals gives the nonnegative double integral \(I^2=\int_{\mathbb{R}^2}e^{-(x^2+y^2)/2}\,dx\,dy\). Evaluating this integral in polar coordinates, whose area element is \(r\,dr\,d\theta\), gives
Since \(I>0\), it follows that \(I=\sqrt{2\pi}\), and therefore \(\int_{\mathbb{R}}\phi(x)\,dx=I/\sqrt{2\pi}=1\).
Define \(\Phi(x)=\int_{-\infty}^{x}\phi(u)\,du\), the standard normal distribution function. Then
The last equality follows from symmetry: \(\phi(-x)=\phi(x)\), so the probability to the left of \(-1\) equals the probability to the right of \(1\), giving \(\Phi(-1)=1-\Phi(1)\). The integral has no elementary antiderivative, so expressing the answer using \(\Phi\) is a standard exact form.
Check: Symmetry also gives \(\int_{-1}^{1}\phi(x)\,dx=2\int_0^1\phi(x)\,dx\). Since \(\int_0^1\phi(x)\,dx=\Phi(1)-\Phi(0)=\Phi(1)-\tfrac12\), this equals \(2\Phi(1)-1\), agreeing with the interval calculation.
Interpreting and Checking a Density
These examples illustrate a practical procedure. First check that the function is measurable and nonnegative. Then integrate over its full support and confirm that the result is one. Only after these checks should it be used to calculate probabilities. For an interval, integrate over the part of the interval that lies in the support. A density that is not normalized cannot be used directly as a probability law; it must first be corrected if a normalized version is intended.
The phrase “density at \(x\)” refers to a function value, not a point probability. For example, in the uniform example, \(f(3)=\tfrac14\), but \(\mathbb{P}(X=3)=\int_{\{3\}}f(x)\,dx=0\). In a small interval around a point, density height helps describe probability per unit length, but the probability is still an integral over the whole interval. The value at a single point alone does not determine that integral.
Common mistake. A tempting but incorrect calculation is \(\mathbb{P}(X=3)=f(3)=\tfrac14\) for the uniform law on \([1,5]\). This confuses a density value with a point mass. The correction is to integrate over the singleton: \(\mathbb{P}(X=3)=\int_{\{3\}}\tfrac14\,dx=0\). For an interval of positive length, such as \([2,4]\), integration instead gives \(\int_2^4\tfrac14\,dx=\tfrac12\).
The density description also makes endpoint conventions manageable. For any finite endpoints \(a<b\), the probabilities of \((a,b)\), \([a,b]\), \([a,b)\), and \((a,b]\) agree for a variable with a density. This does not mean endpoint conventions are always interchangeable for arbitrary random variables: a variable with a point mass can assign positive probability to an endpoint. The zero endpoint probability here follows from the density assumption and the fact that a singleton has zero length.
Check Your Understanding
For each question, state the integration region and keep track of whether the stated endpoints are included or excluded.
- A proposed density equals \(\tfrac13\) on \([0,3]\) and zero elsewhere. Verify normalization and calculate \(\mathbb{P}(1<X\le2)\).
- For the rate-\(2\) exponential density, calculate \(\mathbb{P}(X>1)\) by integrating over its full tail.
- Why does a density value \(f(c)\) not, by itself, give \(\mathbb{P}(X=c)\)? State the point-probability result for a variable with a density.
- Express the standard normal probability \(\mathbb{P}(0<X\le1)\) using \(\Phi\), and explain why including \(0\) would not change it.
- What two checks must a proposed nonnegative function pass before it can be used as a probability density?