From Possible Values to Probability
A continuous response can take values across a range rather than only from a list of separate possibilities. For such a response, probability is assigned to sets of values by integrating a function over those sets. The function is called a probability density. Its integral over an interval gives the probability that the response falls in that interval.
This is different from assigning a probability directly to each individual value. A density is a function whose accumulated area over a region determines probability. The definition below makes that rule precise and gives two immediate checks for a proposed density: it must be nonnegative (apart from irrelevant changes on sets of length zero) and its total integral must be one.
The formula applies to any Borel set, including intervals. For an interval with endpoints \(a\leq b\), it gives
If a response can only take values in a specified range, the density contributes no probability outside that range: its integral there must be zero. A density may be defined as zero outside the range, which makes the integral over all real numbers straightforward to check.
Checking a Proposed Density
Two checks are central. First, \(f(x)\) must be nonnegative except possibly on a set of length zero. Second, its integral over the entire real line must equal one. The first condition ensures that integrals produce nonnegative probabilities; the second ensures that the probability of the whole possible-value space is one.
For a density given by a formula on a bounded interval, the normalization check is often an ordinary definite integral. For a density on an unbounded interval, an improper integral is used, with the limit evaluated explicitly. In either case, checking only that the formula looks positive is not enough: its total integral must also be exactly one.
Worked Example: A Density Increasing Across an Interval
Consider the function \(f(x)=2x\) for \(0\leq x\leq 1\), and \(f(x)=0\) otherwise. Check whether it is a density, then calculate \(P(1/4\leq X\leq 3/4)\).
Nonnegativity. On \([0,1]\), \(2x\geq 0\); elsewhere, \(f(x)=0\). Thus \(f\) is nonnegative everywhere.
Total integral. The function is zero outside \([0,1]\), so
Both checks pass, so \(f\) is a probability density. The requested probability is the integral over the interval:
The answer is a probability, so it lies between zero and one, as it should.
Calculating Interval Probabilities
For a single interval, the procedure is direct: identify the portion of the density relevant to that interval, integrate over its endpoints, and evaluate the integral. If the interval crosses a point where the formula changes, split the integral at that point and add the pieces. This follows from additivity of the integral over disjoint regions.
If \(f\) is given by different formulas on different ranges, it is helpful to draw or describe those ranges before calculating. In particular, do not integrate a formula beyond the range on which it was defined. Use the correct piece on each part of the requested interval.
Worked Example: An Interval Crossing Two Pieces
Let \(f(x)=1/4\) for \(0\leq x<2\), \(f(x)=1/2\) for \(2\leq x\leq 3\), and \(f(x)=0\) otherwise. Verify that \(f\) is a density and calculate \(P(1\leq X\leq 5/2)\).
Nonnegativity. Each specified value of \(f\) is nonnegative.
Total integral. The two nonzero pieces contribute
Thus \(f\) is a probability density. The interval \([1,5/2]\) crosses the change at \(x=2\), so split it there:
The first piece covers a length of one and contributes \(1/4\); the second covers a length of \(1/2\) and contributes \(1/4\). Their sum is the probability of the full interval.
Worked Example: Integrating Over an Unbounded Range
For \(x\geq 0\), let \(f(x)=(1/3)e^{-x/3}\), and let \(f(x)=0\) for \(x<0\). Check the density conditions and find \(P(1\leq X\leq 4)\).
Nonnegativity. The exponential function is positive, so \(f(x)>0\) for \(x\geq0\); for negative \(x\), \(f(x)=0\).
Total integral. The integral over the nonzero range is improper:
Here \(e^{-M/3}\to0\), so the limit is one and \(f\) is a density. For the interval probability,
The result is positive and less than one, consistent with an interval capturing only part of the total probability.
Why Endpoint Choices Do Not Change the Probability
For a density, including or excluding one interval endpoint does not affect the integral. The reason is that a single point has length zero. More generally, changing a density at a set of length zero does not change any of its integrals. The following result justifies the common interchange of open and closed endpoints in interval calculations.
Proof. By the definition of a density, \(P(X=c)=\int_{\{c\}}f(x)\,dx\). The singleton \(\{c\}\) has length zero, so the integral of a nonnegative measurable function over this set is zero. Hence \(P(X=c)=0\). The difference between any two of the listed intervals consists only of one or both endpoints, whose probabilities are zero. Additivity of probability therefore gives the same probability for each interval. \(\square\)
This result is about probabilities under a density. It does not mean that the response cannot take a particular real value; it says that the probability assigned to any one exact value is zero. Interval probabilities, in contrast, can be positive because an interval has positive length and can accumulate positive integral.
A Reliable Calculation Routine
Identify where the formula applies, set the density to zero elsewhere if appropriate, and verify nonnegativity.
Integrate over every range where the density is nonzero. For an unbounded range, evaluate the required improper-integral limit.
Split at any point where the density changes, and integrate the correct piece over each part.
Add the contributions and confirm that the probability is between zero and one.
Common Mistakes
- Stopping after checking nonnegativity. A nonnegative function is not automatically a density. Its integral over the full real line must also equal one.
- Integrating a piecewise formula over the wrong range. If an interval crosses a boundary between formulas, split the integral at that boundary and use the appropriate formula on each piece.
- Forgetting the zero-density region. Values outside the specified range contribute no probability. Do not extend a nonzero formula beyond its stated domain.
- Reporting an interval integral larger than one without checking the setup. For a valid density, an interval probability cannot exceed the total integral of one. A result outside \([0,1]\) signals an arithmetic error or an invalid density.
Check Your Understanding
Use the integration definition of a density to answer these questions.
- A function is nonnegative everywhere and has total integral \(0.8\). Can it be a probability density as given? Explain.
- For \(f(x)=3x^2\) on \(0\leq x\leq1\), with \(f(x)=0\) elsewhere, verify the density conditions and calculate \(P(0\leq X\leq1/2)\).
- A piecewise density changes formula at \(x=2\). What should you do if the requested interval extends from \(1\) to \(3\)?
- Why does a density assign probability zero to a single exact value?
- For a density on the nonnegative real line, what must be checked when its total integral is written as an integral from zero to infinity?