Why Support and Density Checks Matter
An expectation calculation is an integral with respect to a probability distribution. For a continuous random variable, that integral is often written using a density; for a discrete variable, it is a sum of probability-weighted values. In either case, the calculation depends on using the correct probability weights over the values the variable can actually take. A missing support limit, an extra or misplaced density factor, or an omitted atom can change the answer.
The key distinction is between the function \(g(x)\), whose value is being averaged, and the density \(f(x)\), which supplies probability weight. For a variable with density \(f\), the expected value of \(g(X)\), when it exists, is obtained by integrating \(g(x)f(x)\). The integration may be over the support or over the whole real line, provided the density is zero almost everywhere outside the support.
The support of a distribution is commonly taken to be the smallest closed set having probability one. For calculations with a density, it is enough to use any full-probability set outside which the density is zero almost everywhere. These descriptions need not identify the same pointwise set: densities can be changed on sets of Lebesgue measure zero without changing the distribution. What matters in an expectation integral is the probability measure, not a particular pointwise version of its density.
Worked Examples: Finding the Correct Weights
Worked Example: A Missing Support Limit
Let \(X\sim\operatorname{Uniform}(1,3)\), so its density is \(f(x)=1/2\) for \(1\leq x\leq3\) and zero otherwise. Calculate \(E[X^2]\).
The function being averaged is \(g(x)=x^2\). The density contributes the factor \(1/2\), and the support determines the limits:
If one instead integrates \(x^2/2\) from \(0\) to \(3\), the result is \(9/2\), not \(13/3\). That calculation has assigned positive density to values between \(0\) and \(1\), even though \(X\) cannot fall there. Integrating over all real numbers would also be correct if the density were written with its support indicator; omitting the support while treating the density as \(1/2\) everywhere is not.
Worked Example: Keeping the Density Factor in Place
Let \(X\) have an exponential distribution with rate \(2\), so \(f(x)=2e^{-2x}\) for \(x\geq0\), and \(f(x)=0\) for \(x<0\). Find \(E[X]\).
The integrand is \(x f(x)\), not just \(x\): the value \(x\) is weighted by the probability density at \(x\).
The boundary term at infinity is zero because \(xe^{-2x}\to0\), and the boundary term at zero is also zero. Integrating \(x\) without the factor \(2e^{-2x}\) would not calculate an expectation: it would omit the distribution’s probability weights and would diverge on this unbounded interval.
Worked Example: A Point Mass and a Continuous Density
Suppose \(X\) has probability \(1/4\) at \(0\), and its remaining probability \(3/4\) is spread uniformly over \([0,1]\). Its distribution consists of an atom of mass \(1/4\) at zero and a continuous density \(3/4\) on \([0,1]\). Find \(E[1+X^2]\).
The atom contributes its probability times the function value there. The continuous part contributes an integral against its density:
The continuous density has total integral \(3/4\), not \(1\), because the remaining probability is at the atom. A density value at zero cannot stand in for the atom’s probability: the continuous component assigns zero probability to the singleton \(\{0\}\), even though its density is \(3/4\) there.
Worked Example: Integrating Over a Zero-Probability Region
Let \(X\sim\operatorname{Uniform}(0,1)\), and calculate \(E[(X-2)^2]\). The density is \(1\) on \([0,1]\) and zero outside that interval.
Using the support directly gives
The same calculation can be written over the larger interval \([-2,2]\), as long as the density remains explicit:
The part of the larger interval outside \([0,1]\) contributes nothing because the density there is zero. But replacing the density by \(1\) over all of \([-2,2]\) would describe a different weighting and would not be an expectation under the stated distribution.
Two Rules for Auditing an Integral
The examples illustrate two useful facts. First, the exact endpoints are not essential if the integrand still includes the correct density over the whole domain. Second, an expectation for a distribution with both atoms and a continuous component must account for each part of its probability measure.
Proof. Since \(P(X\in S)=1\), the complement has probability zero. By the defining property of a density, \(\int_{S^c}f(x)\,dx=P(X\in S^c)=0\). Because \(f\geq0\), it follows that \(f=0\) almost everywhere on \(S^c\). Thus \(g(x)f(x)=0\) almost everywhere there, and adding the integral over \(S^c\) does not change the integral over \(S\). Absolute integrability ensures both integrals are well-defined and finite. \(\square\)
This result explains why integrating over a larger region is not itself an error. The error occurs when extending the limits but failing to extend the density correctly—for example, by treating a density that is zero outside \([1,3]\) as a positive constant there.
Proof. The distribution measure of \(X\) is the sum of its atomic measure and its continuous measure. For any measurable set \(A\), its probability is
Integrating \(g\) with respect to this sum of measures gives the sum of the integrals against the two component measures. Integration against the atomic measure gives \(\sum_j p_jg(a_j)\); integration against the continuous measure gives \(\int_{\mathbb R}g(x)f_c(x)\,dx\). The assumption \(E[|g(X)|]<\infty\) ensures these contributions are well-defined and their sum is finite. \(\square\)
Common Errors and Their Corrections
A quick audit can catch most mistakes before they become long calculations. For each expectation, identify the function, the probability weights, and the set over which those weights apply.
- Using the wrong limits. The support has been omitted, so the calculation implicitly assigns weight to impossible values. Restore the support limits, or write the density on the whole real line with its zero values outside the support.
- Dropping or duplicating the density. For a continuous variable, the integrand is \(g(x)f(x)\). The function \(g(x)\) alone is not the expectation integrand, while multiplying by the density twice applies the probability weights twice.
- Treating an atom as a density value. A density value is not a probability at a point. Include an atom of mass \(p\) through the term \(p\,g(a)\); do not try to encode it as \(f(a)\).
- Assuming every region in the integration limits has positive probability. A larger integration domain is valid when the density is zero off the support. It is not valid to replace that zero density with a positive value.
- Omitting a component of a mixed distribution. The continuous density may integrate to less than one. Check whether the remaining probability is assigned to atoms before concluding that the density is complete.
A density is only defined up to changes on Lebesgue-null sets. Consequently, changing its value at a point cannot change a density-based expectation integral. An atom is different: its probability is positive at a singleton, so its contribution must be represented separately in the distribution measure.
Check Your Understanding
For each question, identify the probability weights before deciding how to calculate the expectation.
- If \(X\sim\operatorname{Uniform}(2,5)\), what is the correct integral for \(E[X]\), and what error results from using limits \(0\) to \(5\) with density \(1/3\) throughout?
- A density is zero outside \([-1,1]\). Why may an expectation integral be written from \(-4\) to \(4\), and what must the integrand retain?
- A variable has an atom of probability \(0.2\) at \(3\) and a continuous component. How does the atom contribute to \(E[g(X)]\)?
- Why does the value \(f(3)\) of a continuous density not give \(P(X=3)\)?
- What does it indicate if the continuous density of a mixed distribution integrates to \(0.7\), rather than \(1\)?