Tutorials › Exam P - Probability › Sums of Independent Discrete and Continuous Variables

Exam P · Sums of Independent Variables · Tutorial 818 of 915

Sums of Independent Discrete and Continuous Variables

Condition on the discrete variable to build a sum’s density from weighted, shifted copies of the continuous variable’s density.

Advanced 10 min read

What You'll Learn

  • Apply conditioning to express the sum’s density as a weighted mixture.
  • Shift each component density and identify its support before adding components.
  • Construct piecewise densities using all support breakpoints.
  • Use conditional distributions to calculate probabilities for the sum.
  • Check a proposed density by integrating its pieces and verifying total probability.

Why Conditioning Simplifies a Mixed Sum

A sum can be difficult to describe directly when one summand is discrete and the other is continuous. Conditioning on the discrete value turns the sum into a shifted copy of the continuous variable. The distribution of the full sum is then a weighted combination of those shifted distributions.

The key is to shift both the density formula and its support. A component contributes only where its shifted support reaches; overlapping components must be added, while gaps in the supports remain gaps in the density. This approach is aligned with the SOA Exam P (Probability) syllabus.

Definition: Let \(X\) be a discrete random variable with possible values \(x_j\) and probabilities \(p_j=P(X=x_j)\). Let \(Y\) be an independent continuous random variable with density \(f_Y\). For \(Z=X+Y\), the density is $$ f_Z(z)=\sum_j p_j f_Y(z-x_j). $$ A term contributes only when \(z-x_j\) lies in the support of \(Y\). If \(X\) has finitely many values, the sum has finitely many terms. If it has countably many values, the terms are summed over those values.

The shifted density for the event \(X=x_j\) is \(f_Y(z-x_j)\), because on that event \(Z=x_j+Y\), so \(Y=z-x_j\) when \(Z=z\). Multiplying by \(p_j\) weights that shifted component by the probability of the conditioning event. If several values of \(X\) can contribute at the same \(z\), their weighted densities are added.

Because \(Y\) has a density and \(X\) is independent of \(Y\), this sum has a density, even though \(X\) itself is discrete. The density is defined up to its values at individual points; changing a density at finitely or countably many endpoints does not change probabilities.

Why the Weighted-Shift Formula Holds

The formula follows by conditioning on the possible values of \(X\). For any interval \((a,b)\), the events \(X=x_j\) are disjoint and cover all possibilities for \(X\). Independence means the conditional distribution of \(Y\), given \(X=x_j\), is still its original distribution.

$$ \begin{aligned} P(a<Z<b) &=\sum_j P(X=x_j)\,P(a<x_j+Y<b\mid X=x_j)\\ &=\sum_j p_j\,P(a-x_j<Y<b-x_j)\\ &=\sum_j p_j\int_{a-x_j}^{b-x_j} f_Y(y)\,dy\\ &=\int_a^b \sum_j p_j f_Y(z-x_j)\,dz. \end{aligned} $$

In the last line, the integration variable is shifted by \(x_j\) in each term. The resulting integrand is the density of \(Z\). This justification also shows why independence is essential: if \(X\) and \(Y\) are dependent, the conditional distribution of \(Y\) can change with the value of \(X\), and the original density \(f_Y\) cannot automatically be used in every component.

The corresponding cumulative distribution function can be built in the same way:

$$ F_Z(z)=P(Z\le z)=\sum_j p_j F_Y(z-x_j). $$

This form is often convenient for probability calculations. For example, \(P(Z\le c)\) is found by evaluating each shifted \(F_Y(c-x_j)\) and weighting it by \(p_j\). For a density, by contrast, carefully tracking support intervals is usually the main task.

A Reliable Piecewise-Density Method

For each possible value \(x_j\), first identify the support of \(x_j+Y\) by shifting every endpoint of the support of \(Y\) by \(x_j\). Then calculate the weighted component \(p_jf_Y(z-x_j)\). Sort all shifted endpoints: these are the points at which the set of contributing components may change. On each interval between consecutive endpoints, add only the terms whose supports contain that interval.

1
List the discrete values and weights.
Record \(x_j\) and \(p_j=P(X=x_j)\), checking that the probabilities sum to 1.
2
Shift the continuous support.
If \(Y\) has support \((a,b)\), the component \(x_j+Y\) has support \((x_j+a,x_j+b)\).
3
Weight each shifted density.
Write \(p_jf_Y(z-x_j)\), including the support condition for that term.
4
Partition and add.
Use all shifted endpoints as breakpoints. Add the active weighted terms separately on each resulting interval.
5
Check the result.
Integrate the pieces across their supports. Their total must be 1; also confirm that no component was placed outside its shifted support.

Worked Examples

Worked Example: Two Overlapping Uniform Components

A hypothetical index adjustment \(X\) is 0 with probability 0.6 and 2 with probability 0.4. Independently, a continuous error \(Y\) is uniform on \((-1,2)\). Find the density of \(Z=X+Y\), and calculate \(P(Z<1)\).

Method. Condition on \(X\), shift the uniform support, and add the weighted densities where the supports overlap. For \(Y\), the support length is \(2-(-1)=3\), so \(f_Y(y)=1/3\) on \((-1,2)\) and zero elsewhere.

When \(X=0\), the shifted support is \((-1,2)\), and the weighted density is \(0.6(1/3)=0.2\). When \(X=2\), the shifted support is \((1,4)\), and the weighted density is \(0.4(1/3)=2/15\), or approximately 0.1333. The supports overlap on \((1,2)\).

Thus the first component alone contributes on \((-1,1)\), both components contribute on \((1,2)\), and the second component alone contributes on \((2,4)\):

$$ f_Z(z)= \begin{cases} 0.2, & -1<z<1,\\ 0.2+\dfrac{2}{15}=\dfrac{1}{3}, & 1<z<2,\\ \dfrac{2}{15}, & 2<z<4,\\ 0, & \text{otherwise}. \end{cases} $$

At the endpoints, the density may be assigned any values without changing probabilities. For \(P(Z<1)\), the component \(X=0\) contributes \(0.6P(Y<1)=0.6(2/3)=0.4\). The component \(X=2\) contributes zero, because it would require \(Y<-1\), outside the support of \(Y\). Therefore \(P(Z<1)=0.4\).

Check. Integrating the density gives \(0.2(2)+(1/3)(1)+(2/15)(2)=0.4+1/3+4/15=1\). Integrating below 1 gives \(0.2(2)=0.4\), agreeing with the conditional calculation. A common mistake is to add the \(X=2\) component throughout \((0,2)\); it cannot contribute below 1 because its support begins at 1.

Worked Example: An Exponential Variable With Three Possible Shifts

A hypothetical processing delay has a discrete setup component \(X\) with values \(-1,1,3\), having probabilities 0.25, 0.50, and 0.25, respectively. Independently, a nonnegative waiting time \(Y\) is exponential with rate 2, so \(f_Y(y)=2e^{-2y}\) for \(y\ge0\). Find the piecewise density of \(Z=X+Y\), then calculate \(P(Z<2)\).

Method. Shift the exponential density by each possible setup value, and include each term only to the right of its shifted lower endpoint. There is no finite upper endpoint because \(Y\) is unbounded above.

For \(X=-1\), the support starts at \(-1\), and the weighted density is \(0.25(2e^{-2(z+1)})=0.5e^{-2(z+1)}\). For \(X=1\), it starts at 1, and the weighted density is \(0.50(2e^{-2(z-1)})=e^{-2(z-1)}\). For \(X=3\), it starts at 3, and the weighted density is \(0.25(2e^{-2(z-3)})=0.5e^{-2(z-3)}\).

The lower endpoints \(-1,1,3\) partition the real line into intervals with different active components. Therefore:

$$ f_Z(z)= \begin{cases} 0, & z<-1,\\ 0.5e^{-2(z+1)}, & -1<z<1,\\ 0.5e^{-2(z+1)}+e^{-2(z-1)}, & 1<z<3,\\ 0.5e^{-2(z+1)}+e^{-2(z-1)}+0.5e^{-2(z-3)}, & z>3. \end{cases} $$

For \(P(Z<2)\), condition on \(X\). If \(X=-1\), the event requires \(Y<3\), with probability \(1-e^{-6}\). If \(X=1\), it requires \(Y<1\), with probability \(1-e^{-2}\). If \(X=3\), it is impossible because \(Y\ge0\) implies \(Z\ge3\). Hence

$$ \begin{aligned} P(Z<2) &=0.25(1-e^{-6})+0.50(1-e^{-2})+0.25(0)\\ &=0.75-0.25e^{-6}-0.50e^{-2}\\ &\approx 0.6817. \end{aligned} $$

The probability is rounded to four decimals. Check. Both the density and the conditional probability use the same three weights, which sum to 1. Omitting the \(X=3\) case from the density for \(z>3\) would leave out a valid component, even though that case contributes nothing to \(P(Z<2)\).

Worked Example: Several Overlaps and a Probability Interval

A hypothetical sensor’s discrete calibration offset \(X\) is 0, 1, or 3 with probabilities 0.20, 0.50, or 0.30. Independently, the sensor error \(Y\) is uniform on \((0,2)\). Find the density of \(Z=X+Y\), then calculate \(P(1.5<Z<3.5)\).

Method. The density of \(Y\) is \(1/2\) on \((0,2)\). The shifted supports for \(X=0,1,3\) are \((0,2),(1,3),(3,5)\), with weighted density heights \(0.20/2=0.10\), \(0.50/2=0.25\), and \(0.30/2=0.15\).

The intervals \((0,1),(1,2),(2,3),(3,5)\) have different sets of contributing components. On \((0,1)\) only the first contributes; on \((1,2)\) the first two contribute; on \((2,3)\) only the second contributes; and on \((3,5)\) only the third contributes. The supports for the second and third components meet at 3 but do not overlap on an interval.

$$ f_Z(z)= \begin{cases} 0.10, & 0<z<1,\\ 0.10+0.25=0.35, & 1<z<2,\\ 0.25, & 2<z<3,\\ 0.15, & 3<z<5,\\ 0, & \text{otherwise}. \end{cases} $$

For the requested interval, the density is 0.35 on \((1.5,2)\), 0.25 on \((2,3)\), and 0.15 on \((3,3.5)\). Thus

$$ P(1.5<Z<3.5) =(0.5)(0.35)+(1)(0.25)+(0.5)(0.15) =0.175+0.250+0.075 =0.500. $$

Check. The total density area is \((1)(0.10)+(1)(0.35)+(1)(0.25)+(2)(0.15)=1\). The interval probability is therefore 0.500. A common mistake is to add the first component on \((2,3)\); its support ends at 2, so it makes no contribution there.

Common Mistakes and Final Checks

Most errors in mixed sums come from treating the formula as a sum of densities without also tracking where each density is nonzero. A term \(p_jf_Y(z-x_j)\) is not generally present for every \(z\): its support must be shifted by exactly \(x_j\). To avoid this error, write the shifted supports before writing the piecewise formula.

Other useful checks are to confirm that the discrete probabilities sum to 1, verify that each weighted density has total area \(p_j\), and integrate the final density over its full support. If the component supports do not overlap, the density has separate pieces with gaps; a gap is not filled merely because the overall sum has a broad range of possible values.

Key takeaway: For independent \(X\) discrete and \(Y\) continuous, condition on \(X\), shift the density of \(Y\) by each possible value of \(X\), weight by that value’s probability, and add only the components whose shifted supports include \(z\).

Check Your Understanding

For each problem, identify the shifted supports before combining density components. Probabilities are reported to four decimals where rounding is needed.

  1. Let \(X=0\) with probability 0.25 and \(X=2\) with probability 0.75. Independently, \(Y\) is uniform on \((0,1)\). Give the density of \(Z=X+Y\). (Answer: \(f_Z(z)=0.25\) on \((0,1)\), \(0.75\) on \((2,3)\), and 0 elsewhere.)
  2. Let \(X=-2\) with probability 0.40 and \(X=0\) with probability 0.60. Independently, \(Y\) is uniform on \((-1,1)\). Give the density of \(Z=X+Y\). (Answer: \(f_Z(z)=0.20\) on \((-3,-1)\), \(0.30\) on \((-1,1)\), and 0 elsewhere.)
  3. Let \(X=0\) with probability 0.30 and \(X=2\) with probability 0.70. Independently, \(Y\) is exponential with rate 1. Find \(P(Z>3)\), where \(Z=X+Y\). (Answer: \(0.30e^{-3}+0.70e^{-1}\approx0.2725\).)
  4. Let \(X=0\) with probability 0.60 and \(X=1\) with probability 0.40. Independently, \(Y\) is uniform on \((-1,2)\). Find \(P(0<Z<1)\), where \(Z=X+Y\). (Answer: \(0.60(1/3)+0.40(1/3)=1/3\approx0.3333\).)
  5. Let \(X=-1\) with probability 0.30 and \(X=2\) with probability 0.70. Independently, \(Y\) is exponential with rate 1. Find \(P(Z\le2)\), where \(Z=X+Y\). (Answer: \(0.30(1-e^{-3})\approx0.2851\).)
Clinical Biostats