From a Density Formula to Probabilities
For a discrete random variable, probabilities can be assigned to individual outcomes and added over a set. A continuous law is described differently: a nonnegative function distributes probability across the real line, and the probability of a set is found by integrating that function over the set. The distinction matters in practice. A formula for a density is useful only when we know which sets to integrate over and how its nonzero regions relate to the distribution.
This tutorial develops that connection. The main tools are the set-integral definition of a density, a precise way to identify the support of a law from a density formula, and interval calculations for uniform and piecewise-constant densities.
The integral is with respect to length on the real line. Thus, the formula for \(f\) is not itself a list of probabilities: it specifies how to calculate probabilities by integration. A density is allowed to be defined piecewise, and it may be zero on part of the real line. For a proposed density, its values must be nonnegative and its total integral must be one.
How a Density Defines a Probability Law
The set-based definition gives probabilities not just for intervals but for every Borel set, including unions of intervals. This is what makes a density a description of a distribution rather than only a rule for one type of event.
Proof. First, \(\mu(A)\geq 0\) because \(f\geq 0\). Also, \(\mu(\varnothing)=0\) and $$ \mu(\mathbb{R})=\int_{\mathbb{R}}f(x)\,dx=1. $$ Now let \(A_1,A_2,\ldots\) be pairwise disjoint Borel sets. Their indicator functions satisfy $$ \mathbf{1}_{\cup_{j=1}^{\infty}A_j}(x) =\sum_{j=1}^{\infty}\mathbf{1}_{A_j}(x). $$ The partial sums on the right increase to the indicator on the left. By the Monotone Convergence Theorem, applied to the nonnegative functions \(f(x)\sum_{j=1}^{m}\mathbf{1}_{A_j}(x)\), $$ \begin{aligned} \mu\left(\bigcup_{j=1}^{\infty}A_j\right) &=\int_{\mathbb{R}} f(x)\mathbf{1}_{\cup_j A_j}(x)\,dx\\ &=\lim_{m\to\infty}\sum_{j=1}^{m}\int_{\mathbb{R}} f(x)\mathbf{1}_{A_j}(x)\,dx\\ &=\sum_{j=1}^{\infty}\mu(A_j). \end{aligned} $$ Thus \(\mu\) is countably additive, is nonnegative, and assigns total mass one. It is a probability measure. \(\square\)
Reading Support from a Density
A density formula often includes regions where it is zero. Those regions cannot contribute probability, but the support of a distribution is defined in terms of neighborhoods, not simply by checking the density at a single point.
The neighborhood definition handles boundaries and gaps uniformly. For example, a point at the edge of a region where \(f\) is positive can be in the support even when the density is defined to be zero at that exact point. Conversely, a point in the middle of an interval where the density is zero is outside the support if some neighborhood around it also has zero integral.
Justification. By the set-integral definition, the probability that \(X\) lies in the open interval \((x-\varepsilon,x+\varepsilon)\) equals \(\int_{x-\varepsilon}^{x+\varepsilon} f(t)\,dt\). Therefore, this interval has positive probability for every \(\varepsilon>0\) exactly when \(x\) satisfies the displayed condition. That is precisely the neighborhood definition of support. Changing the value of \(f\) at a single point does not change any of these integrals, so it cannot change the support. \(\square\)
Interval Probabilities by Integration
For an interval \(I\), the probability is the integral of the density over the portion of the real line in \(I\). With a density, including or excluding an interval endpoint does not change this integral: a single point has length zero. This lets us choose convenient endpoint notation in calculations.
The cumulative distribution function follows immediately by taking the set to be \((-\infty,x]\): $$ F(x)=P(X\leq x)=\int_{-\infty}^{x}f(t)\,dt. $$ For an interval that crosses a breakpoint in a piecewise formula, split the integral at each breakpoint and add the pieces. Only portions of the interval on which the density is nonzero contribute.
Worked Example: An Interval Probability for a Uniform Law
Suppose \(X\) has the uniform distribution on \([2,8]\). Its density is constant on that interval and zero outside it: $$ f(x)= \begin{cases} \frac{1}{6},&2\leq x\leq 8,\\ 0,&\text{otherwise}. \end{cases} $$ The total integral is \(\int_2^8 \frac{1}{6}\,dx=\frac{8-2}{6}=1\), as required.
To find \(P(3<X\leq 5)\), integrate over the interval \((3,5]\), where the density is \(1/6\): $$ P(3<X\leq 5)=\int_3^5\frac{1}{6}\,dx =\frac{1}{6}(5-3) =\frac{1}{3}. $$ The support is \([2,8]\): points in this interval have positive probability in every neighborhood, including its endpoints, while a point outside it has a neighborhood with zero probability.
Worked Example: Crossing a Breakpoint in a Piecewise-Constant Density
Let \(X\) have density $$ f(x)= \begin{cases} \frac{1}{4},&0\leq x<2,\\ \frac{1}{6},&2\leq x\leq 5,\\ 0,&\text{otherwise}. \end{cases} $$ The pieces contribute \(\frac{1}{4}(2-0)=\frac{1}{2}\) and \(\frac{1}{6}(5-2)=\frac{1}{2}\), so the total integral is \(1\).
For \(P(1<X\leq 4)\), the interval crosses the breakpoint at \(2\). From \(1\) to \(2\) the density is \(1/4\); from \(2\) to \(4\) it is \(1/6\). Therefore, $$ \begin{aligned} P(1<X\leq 4) &=\int_1^2\frac{1}{4}\,dx+\int_2^4\frac{1}{6}\,dx\\ &=\frac{1}{4}(2-1)+\frac{1}{6}(4-2)\\ &=\frac{1}{4}+\frac{1}{3} =\frac{7}{12}. \end{aligned} $$ The support is \([0,5]\), since every neighborhood of each point in that interval intersects a region of positive density in positive length. Points outside it have a neighborhood on which the density is zero.
Worked Example: A Density with a Gap in Its Support
Consider the density $$ f(x)= \begin{cases} \frac{1}{4},&-3\leq x\leq -1\text{ or }2\leq x\leq 4,\\ 0,&\text{otherwise}. \end{cases} $$ The two intervals each have length \(2\), so $$ \int_{\mathbb{R}} f(x)\,dx =\frac{1}{4}(2)+\frac{1}{4}(2)=1. $$ There is a zero-density gap between \(-1\) and \(2\), and the support is \([-3,-1]\cup[2,4]\).
To calculate \(P(-2.5<X<3)\), intersect the event interval with the two regions where the density is positive. The overlap lengths are \(1.5\) for \((-2.5,-1)\) and \(1\) for \((2,3)\). Hence $$ \begin{aligned} P(-2.5<X<3) &=\frac{1}{4}(1.5)+\frac{1}{4}(1)\\ &=\frac{1}{4}\left(\frac{3}{2}+1\right) =\frac{5}{8}. \end{aligned} $$ The gap contributes zero because the density is zero there.
Common Mistakes and a Reliable Check
One common mistake is to treat the region where a formula is written as the support without checking what happens around its boundaries or across gaps. The support is determined by positive probability in every neighborhood. For a piecewise-constant density, this usually means taking the closure of the regions with positive density and retaining genuine gaps between them.
Another mistake is to use the density’s height as the probability of an interval. For example, in the uniform example the density is \(1/6\), but the probability of \((3,5]\) is \(1/3\), because the interval has length \(2\). The calculation is height times length in this constant-density case, not height alone.
A dependable calculation has three checks: identify the part of the event interval where the density is nonzero; split at every breakpoint; and verify that the result is between zero and one. For a proposed density, also check nonnegativity and total integral one before using it to calculate probabilities.
Check Your Understanding
Use the set-integral definition and show the relevant calculations.
- A density equals \(1/5\) on \([0,5]\) and zero elsewhere. Find \(P(1<X\leq 4)\) and state the support.
- A density equals \(1/3\) on \([0,3)\) and zero elsewhere. Verify its total integral and identify its support.
- A density equals \(1/2\) on \([-2,0]\), equals \(1/4\) on \([2,4]\), and is zero elsewhere. Verify its total integral and state its support.
- For the density in question 3, calculate \(P(-1<X<3)\) by splitting the integral into its nonzero pieces.
- Why is the support not determined by checking only whether \(f(x)>0\) at a single point?