Discrete Random Variables

As we discussed last class, we will want to discuss the distribution of a random variable, which is a description of how the probabilities are spread out across the real numbers. The main two ways we want to talk about discrete random variables is using their probability mass functions (pmfs) and cumulative distribution functions (cdfs). There are other ways that we can discuss the distributions of random variables, and these will be very similar to some descriptive statistics concepts.

Definition: let $X$ be a discrete random variable with range $\{x_1,x_2,...\}.$ The expected value of $X$ is $$\mathbb{E}(X) = \sum_{j=1}^\infty x_jf(x_j).$$ The expected value is one way to talk about the center of a distribution, much the same way that the mean is a way to talk about the center of a data set. Similarly, we can define the variance of a distribution by \begin{align} \mathbb{V}(X) &= \sum_{j=1}^\infty f(x_j)(x_j-\mathbb{E}(X))^2\\ &= \sum_{j=1}^{\infty} f(x_j)(x_j^2 - 2\mathbb{E}(X)x_j+\mathbb{E}(X)^2)\\ &= \left(\sum_{j=1}^\infty f(x_j)x_j^2\right) -\mathbb{E}(X)^2. \end{align} The last line follows since $\mathbb{E}(X)$ is just a constant, and can be factored out of the sum. What's left is simply $\mathbb{E}(X)$ again. The standard deviation of a distribution is $$\sigma_X = \sqrt{\mathbb{V}(X)}.$$ It ends up being useful to define $$\mathbb{E}(X^n) = \sum_{j=1}^\infty f(x_j)x_j^n$$ for any value of $n$. So that $$\mathbb{V}(X) = \mathbb{E}(X^2) - \mathbb{E}(X)^2.$$ The quantity $\mathbb{E}(X^n)$ is called the $n$th moment of $X$. As we saw, the first moment of a distribution is related to its center, and the second moment is related to its spread. The third moment is related to something called the skew of the distribution, which describes whether most of the probability is distributed above or below the expected value.

Example Consider an experiment where a single die is rolled, and let $X$ be the number that is shown on the die after it is rolled. The expected value of $X$ is \begin{align} \mathbb{E}(X) &= \sum_{j=1}^6 f(x_j) x_j \\ & = \sum_{j=1}^6 \frac{1}{6} j\\ &= \frac{1}{6} \frac{6\cdot 7}{2} = \frac{7}{2}. \end{align} The variance is given by \begin{align} \mathbb{V}(X) &= \mathbb{E}(X^2) - \mathbb{E}(X)^2\\ &= \sum_{j=1}^6 \frac{1}{6}j^2 - \left(\frac{7}{2}\right)^2\\ &= \frac{1}{6}\frac{6\cdot 7\cdot 13}{6} - \frac{49}{4}\\ &= \frac{35}{12}. \end{align}

Exercises:

  • Suppose that a company offers a $5 extended warranty on their products. If you don't use the warranty, this $5 is pure profit for them, however if you do use the warranty, they must spend $50 to replace your product, leaving them with a $45 loss. If the probability that a product malfunctions and you use the warranty is 1/40, can the company expect to make a profit on these waranties?
  • A carnival game consists of drawing one ball from a box containing two yellow balls, five red balls, and eight white balls. If the ball is yellow, you win $5. If the ball is red, you win $2. If the ball is white, you lose $3.00. What is your expected winnings?