HW 4 Solutions

STA 211 Spring 2023 (Jiang)

Exercise 1

For any random variable \(X\) and constants \(a\) and \(b\), show that \(E(aX + b) = aE(X) + b\) and \(Var(aX + b) = a^2Var(X)\).

For continuous variables,

\[\begin{align*} E(aX + b) &= \int_{-\infty}^\infty (ax + b)f_X(x)dx\\ &= \int_{-\infty}^\infty axf_X(x)dx + \int_{-\infty}^\infty bf_X(x)dx\\ &= a\int_{-\infty}^\infty xf_X(x)dx + b \int_{-\infty}^\infty f_X(x)dx\\ &= aE(x) + b \end{align*}\]

Similar argument for discrete variables, replacing integrals with sums.

Demonstrating variance property is quite a bit easier with the result from Ex. 2:

\[\begin{align*} Var(aX + b) &= E((aX + b)^2) - (E(aX + b))^2\\ &= E(a^2X^2 + 2aXb + b^2) - (aE(X) + b)^2\\ &= a^2E(X^2) + 2abE(X) + b^2 - (a^2E(X)^2 + 2aE(X)b + b^2)\\ &= a^2 E(X^2) - a^2 E(X)^2\\ &= a^2 \left(E(X^2) - E(X)^2 \right)\\ &= a^2 Var(X) \end{align*}\]

Exercise 2

For any random variable \(X\), show that \(Var(X) = E(X^2) - E(X)^2\).

Note that \(E(X)\) is a constant, and so \(E(XE(X))\) = \(E(X)E(X)\) and similarly \(E(E(X)^2) = E(X)^2\).

\[\begin{align*} Var(X) &= E\left( (X - E(X))^2 \right)\\ &= E\left( X^2 - 2XE(X) + E(X)^2 \right)\\ &= E(X^2) - 2E(X)E(X) + E(X)^2\\ &= E(X^2) - E(X)^2 \end{align*}\]

Exercise 3

Compute the following integral using basic algebra and any fact stated in the slides:

\[\begin{align*} \int_{-\infty}^\infty e^{-x^2}dx \end{align*}\]

Consider a normal distribution with \(\mu = 0\) and \(\sigma^2 = \frac{1}{2}\):

\[\begin{align*} \int_{-\infty}^\infty \frac{1}{\sqrt{\pi}}e^{-x^2}dx &= 1 \end{align*}\]

since it is a pdf. Thus

\[\begin{align*} \int_{-\infty}^\infty e^{-x^2}dx &= \sqrt{\pi} \end{align*}\]