Tutorials › VEE Mathematical Statistics › Weighted Sums of Independent Variables

VEE Mathematical Statistics · Sums and Linear Combinations · Tutorial 340 of 880

Weighted Sums of Independent Variables

Find the distribution and moment generating function of a weighted sum by scaling each variable correctly and using independence.

Intermediate 10 min read

What You'll Learn

  • Transform supports and probabilities when a random variable is multiplied by a coefficient.
  • Use independence to multiply moment generating functions for weighted sums.
  • Handle negative coefficients and identify when a moment generating function exists.
  • Derive a weighted sum’s distribution by convolution after scaling its components.
  • Check weighted-sum results using means, variances, supports, and probabilities.

Why Coefficients Matter in Sums

A sum such as \(X+Y\) gives equal weight to both variables. In many applications, however, the quantities being combined have different units or importance. A portfolio total might be \(3X+Y\), while a net amount might be \(X-2Y\). To find the distribution of such a total, it is not enough to find the distribution of \(X+Y\) and then multiply the answer by a coefficient: each component is scaled separately, and its support and probabilities change.

This tutorial develops a consistent approach for weighted sums of independent random variables. The key steps are to transform each variable, track its support, and then combine the transformed variables. Moment generating functions provide a compact alternative when they exist.

Definition: A weighted sum of random variables \(X_1,\ldots,X_n\) is \(W=c+\sum_{j=1}^{n}a_jX_j\), where \(c\) and the coefficients \(a_j\) are fixed constants. If the \(X_j\) are independent and their moment generating functions exist in a neighborhood of zero, then $$ M_W(t)=e^{ct}\prod_{j=1}^{n}M_{X_j}(a_jt). $$ A coefficient of zero makes that term constant at zero, regardless of the distribution of its variable.

Scale Each Variable Before Combining It

For a nonzero coefficient \(a\), the transformation \(Z=aX\) changes values in the support of \(X\) to values multiplied by \(a\). If \(X\) is discrete, each probability stays attached to its transformed value; if different original values map to the same value, their probabilities must be added. If \(X\) has density \(f_X\), the density transformation includes a factor \(1/|a|\). The absolute value matters, especially for negative coefficients.

Scaling rules: If \(Z=aX\) with \(a\ne 0\), then \(M_Z(t)=M_X(at)\). For a discrete \(X\), \(P(Z=z)=P(X=z/a)\). For a continuous \(X\), $$ f_Z(z)=\frac{1}{|a|}f_X\!\left(\frac{z}{a}\right), $$ on the transformed support. When \(a<0\), the support’s order is reversed. These rules do not apply by division when \(a=0\); in that case \(Z=0\) with probability one.

Once the components have been scaled, independence allows their moment generating functions to be multiplied. Alternatively, their distributions can be combined by the discrete or continuous convolution formula. The support of the final sum is contained in the set of sums of possible component values. For continuous variables, it is contained between the sums of the lower endpoints and the sums of the upper endpoints when those endpoints are finite.

Why the Product Formula Holds

The moment generating function of a random variable \(W\) is \(M_W(t)=E[e^{tW}]\), for values of \(t\) where the expectation is finite. For the weighted sum, the exponential separates into a product:

$$ e^{tW}=e^{tc}\prod_{j=1}^{n}e^{ta_jX_j}. $$

Because the variables are independent, the expectation of this product is the product of the expectations. Taking the constant \(e^{tc}\) outside the expectation gives

$$ M_W(t) =E[e^{tW}] =e^{tc}\prod_{j=1}^{n}E[e^{ta_jX_j}] =e^{tc}\prod_{j=1}^{n}M_{X_j}(a_jt). $$

This also explains why the argument of each component’s MGF is \(a_jt\), not \(t\). The formula requires independence and finiteness of the component MGFs at the indicated arguments. If the variables are not independent, the product step is not justified; the formula cannot be used merely because each marginal MGF is known.

Worked Examples

Worked Example: A Discrete Difference With Unequal Supports

Let independent random variables \(X\) and \(Y\) have \(P(X=0)=0.7\), \(P(X=1)=0.3\), \(P(Y=1)=0.6\), and \(P(Y=4)=0.4\). Find the distribution, mean, and MGF of \(W=X-2Y\). Method: enumerate the independent outcomes and multiply their probabilities. This avoids losing or mis-scaling support values when the coefficient is negative.

The four possible pairs \((X,Y)\) have probabilities found by independence. Their corresponding values of \(W\) are:

$$ \begin{aligned} (X,Y)=(0,1)&:\quad W=-2,\quad P=0.7(0.6)=0.42,\\ (X,Y)=(0,4)&:\quad W=-8,\quad P=0.7(0.4)=0.28,\\ (X,Y)=(1,1)&:\quad W=-1,\quad P=0.3(0.6)=0.18,\\ (X,Y)=(1,4)&:\quad W=-7,\quad P=0.3(0.4)=0.12. \end{aligned} $$

Thus \(W\) has values \(-8,-7,-2,-1\), with respective probabilities \(0.28,0.12,0.42,0.18\). The probabilities sum to \(0.28+0.12+0.42+0.18=1\), as required. Its mean is

$$ E[W]=(-8)(0.28)+(-7)(0.12)+(-2)(0.42)+(-1)(0.18) =-2.24-0.84-0.84-0.18=-4.10. $$

As a check, \(E[X]=0(0.7)+1(0.3)=0.3\) and \(E[Y]=1(0.6)+4(0.4)=2.2\), so \(E[X-2Y]=0.3-2(2.2)=-4.1\). The MGFs are \(M_X(t)=0.7+0.3e^t\) and \(M_Y(t)=0.6e^t+0.4e^{4t}\). Therefore

$$ M_W(t)=M_X(t)M_Y(-2t) =(0.7+0.3e^t)(0.6e^{-2t}+0.4e^{-8t}). $$

Expanding gives \(M_W(t)=0.42e^{-2t}+0.28e^{-8t}+0.18e^{-t}+0.12e^{-7t}\), which matches the enumerated distribution. A common mistake is to use \(M_Y(2t)\) rather than \(M_Y(-2t)\); the negative coefficient reverses the sign of the MGF argument.

Worked Example: A Weighted Sum of Exponential Variables

Suppose \(X\) and \(Y\) are independent, with \(X\) exponential of rate \(4\) and \(Y\) exponential of rate \(1\). Find the density, MGF, and probability \(P(2X+Y\leq 1)\). Rates are per unit of the same time scale, and both variables are nonnegative. Method: scale \(X\), then convolve the two resulting densities. This avoids treating the rate of \(2X\) as twice the original rate.

Set \(U=2X\). Since \(f_X(x)=4e^{-4x}\) for \(x\geq0\), the scaling rule gives

$$ f_U(u)=\frac{1}{2}f_X\!\left(\frac{u}{2}\right) =\frac{1}{2}\left(4e^{-4u/2}\right) =2e^{-2u},\qquad u\geq0. $$

Thus \(U\) is exponential with rate \(2\), while \(Y\) has density \(e^{-y}\) for \(y\geq0\). For \(W=U+Y\), independence and continuous convolution give, for \(w\geq0\),

$$ \begin{aligned} f_W(w) &=\int_0^w f_U(u)f_Y(w-u)\,du\\ &=\int_0^w 2e^{-2u}e^{-(w-u)}\,du\\ &=2e^{-w}\int_0^w e^{-u}\,du =2(e^{-w}-e^{-2w}). \end{aligned} $$

The support is \(w\geq0\), since both summands are nonnegative. The density is nonnegative there because \(e^{-w}\geq e^{-2w}\). Integrating the density from \(0\) to \(w\) gives \(F_W(w)=1-2e^{-w}+e^{-2w}\) for \(w\geq0\). Therefore

$$ P(W\leq1)=1-2e^{-1}+e^{-2}\approx0.3996. $$

For the MGF, \(M_X(t)=4/(4-t)\) for \(t<4\) and \(M_Y(t)=1/(1-t)\) for \(t<1\). Hence

$$ M_W(t)=M_X(2t)M_Y(t) =\frac{4}{4-2t}\frac{1}{1-t} =\frac{2}{(2-t)(1-t)},\qquad t<1. $$

The restriction \(t<1\) is the intersection of the component restrictions \(2t<4\) and \(t<1\). As a check, \(E[W]=2E[X]+E[Y]=2(1/4)+1=1.5\). The common scaling error is to assign \(2X\) rate \(8\); multiplying an exponential variable by \(2\) divides its rate by \(2\), giving rate \(2\).

Worked Example: Two Scaled Uniform Variables

Let \(X\sim\operatorname{Uniform}(0,2)\) and \(Y\sim\operatorname{Uniform}(0,1)\) be independent. Find the density and MGF of \(W=X+2Y\), and calculate \(P(W\leq3)\). Method: identify the transformed supports and convolve the densities. This avoids adding the original supports without accounting for the coefficient on \(Y\).

The density of \(X\) is \(1/2\) on \([0,2]\). The variable \(V=2Y\) is uniform on \([0,2]\), with density \(f_V(v)=\frac12 f_Y(v/2)=1/2\) on that interval. Thus \(W=X+V\) has support \([0,4]\). For a fixed \(w\), the convolution integrates over values of \(x\) that satisfy both \(0\leq x\leq2\) and \(0\leq w-x\leq2\). The length of this interval is \(w\) for \(0\leq w\leq2\), and \(4-w\) for \(2\leq w\leq4\). The product of the two densities is \(1/4\), so

$$ f_W(w)= \begin{cases} w/4,&0\leq w\leq2,\\ (4-w)/4,&2<w\leq4,\\ 0,&\text{otherwise}. \end{cases} $$

The density integrates to \(1\): each triangular half has area \(\frac12(2)(1/2)=1/2\). For \(P(W\leq3)\), it is convenient to subtract the upper tail. On \([3,4]\), the density is \((4-w)/4\), so

$$ P(W\leq3)=1-\int_3^4\frac{4-w}{4}\,dw =1-\frac18=0.8750. $$

For \(X\sim\operatorname{Uniform}(0,2)\), \(M_X(t)=(e^{2t}-1)/(2t)\), with limiting value \(1\) at \(t=0\). Since \(2Y\) has the same uniform distribution as \(X\), independence gives

$$ M_W(t)=\left(\frac{e^{2t}-1}{2t}\right)^2, $$

with the value at \(t=0\) defined by continuity. As a check, \(E[W]=1+2(1/2)=2\), the center of the triangular density, and its support endpoints are \(0\) and \(4\). A common mistake is to use the support \([0,3]\), obtained by adding the original endpoints \(2+1\); the scaled variable \(2Y\) has upper endpoint \(2\), so the correct total upper endpoint is \(4\).

A Reliable Calculation Sequence

For a weighted sum, a short sequence of checks prevents most errors. In particular, keep the transformation of each component separate from the later combination of those components.

1
Write the target clearly.
Record the exact coefficients and any constant, for example \(W=c+aX+bY\). Confirm that the variables are independent before using product MGFs or independent convolution.
2
Transform each support.
Multiply each possible value or support endpoint by its coefficient. Reverse the endpoint order for a negative coefficient; treat a zero coefficient as a constant zero.
3
Choose the distribution method.
For a manageable discrete model, enumerate outcomes and combine probabilities at matching values. For continuous variables, use scaled densities and convolution. When available, multiply \(M_{X_j}(a_jt)\).
4
Check the result.
Verify that probabilities sum to one or a density integrates to one, compare the mean with \(c+\sum a_jE[X_j]\), and confirm that the answer respects the transformed support.

Common Exam Traps and Why the Method Matters

  • Forgetting the coefficient inside the MGF. For \(aX\), the MGF is \(M_X(at)\), not \(aM_X(t)\). A constant multiplier of a random variable changes its distribution, not just the numerical value of its MGF.
  • Dropping the absolute value in a density transformation. The density multiplier is \(1/|a|\), ensuring the transformed density has total area one even when \(a<0\).
  • Keeping the original support after scaling. A negative coefficient can make values negative and reverses support order; a positive coefficient can stretch or shrink the support.
  • Multiplying MGFs without independence. The product formula follows from independence. Marginal distributions alone do not justify it for dependent variables.
  • Checking only the mean. A correct mean does not establish a correct distribution. Check support and total probability as well.

Weighted sums appear whenever components are converted to a common total using fixed weights, including hypothetical insurance portfolios with different benefit amounts or measurements combined in different units. The method is valuable because it separates two tasks: first determine what each coefficient does to its variable, then combine the transformed variables under the stated independence assumption. That separation also makes it easier to detect a wrong sign, rate, or endpoint before it contaminates the final result.

Key takeaway: For independent variables, a weighted sum has MGF \(e^{ct}\prod_j M_{X_j}(a_jt)\), when the component MGFs exist at those arguments. For a distribution calculation, transform every component’s support and probabilities or density first, then combine them and check the result.

Check Your Understanding

For each problem, state the support or distribution as requested and use independence only where it is given.

  1. Independent Bernoulli variables \(X,Y\) satisfy \(P(X=1)=0.25\) and \(P(Y=1)=0.5\). Find the distribution and mean of \(W=3X-2Y\). (Answer: \(P(W=0)=0.375,\ P(W=-2)=0.375,\ P(W=3)=0.125,\ P(W=1)=0.125;\ E[W]=-0.25\).)
  2. Let \(X\sim\operatorname{Uniform}(0,1)\) and \(W=-4X\). State the support and density of \(W\), then find \(P(W<-1)\). (Answer: support \([-4,0]\), density \(1/4\) on that interval, and probability \(0.7500\).)
  3. Independent \(X\sim\operatorname{Poisson}(2)\) and \(Y\sim\operatorname{Poisson}(1)\) define \(W=2X+Y\). Find its MGF and mean. (Answer: \(M_W(t)=\exp(2(e^{2t}-1)+(e^t-1))\); \(E[W]=5\).)
  4. Independent \(X\) and \(Y\) are exponential with rates \(3\) and \(2\), respectively. For \(Z=2X+Y\), give the MGF, its interval of finiteness containing zero, and the mean. (Answer: \(M_Z(t)=\frac{3/2}{3/2-t}\frac{2}{2-t}\), finite for \(t<3/2\); \(E[Z]=7/6\).)
  5. Independent \(X\sim N(1,4)\) and \(Y\sim N(0,1)\) define \(W=-2X+3Y\). Find the distribution, using the convention that the second normal parameter is the variance. (Answer: \(W\sim N(-2,25)\).)
Clinical Biostats