# Mean and Variance of Random Variables

Just like variables from a data set, random variables are described by measures of central tendency (like the mean) and measures of variability (like variance). This lesson shows how to compute these measures for discrete random variables.

## Mean of a Discrete Random Variable

The mean of the discrete random variable X is also called the
**expected value** of X. Notationally, the expected
value of X is denoted by E(X).
Use the following formula to compute the mean of a discrete
random variable.

E(X) = μ_{x} = Σ [ x_{i} * P(x_{i}) ]

where x_{i} is the value of the random variable for outcome
i, μ_{x} is the mean of random variable X,
and P(x_{i}) is the probability that the random variable
will be outcome i.

**Example 1**

In a recent little league softball game, each player went to bat 4 times. The number of hits made by each player is described by the following probability distribution.

Number of hits, x | 0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|

Probability, P(x) | 0.10 | 0.20 | 0.30 | 0.25 | 0.15 |

What is the mean of the probability distribution?

(A) 1.00

(B) 1.75

(C) 2.00

(D) 2.25

(E) None of the above.

**Solution**

The correct answer is E. The mean of the probability distribution is 2.15, as defined by the following equation.

E(X) = Σ [ x_{i} * P(x_{i}) ]

E(X) = 0*0.10 + 1*0.20 + 2*0.30 + 3*0.25 + 4*0.15 = 2.15

## Median of a Discrete Random Variable

The median of a discrete random variable is the "middle" value. It is the
value of X for
which P(X __<__ x) is greater than or equal to 0.5 *and*
P(X __>__ x) is greater than or equal to 0.5.

Consider the problem presented above in Example 1. In Example 1, the
median is 2; because P(X __<__ 2) is equal to 0.60, and
P(X __>__ 2) is equal to 0.70. The computations are
shown below.

P(X __<__ 2) = P(x=0) + P(x=1) + P(x=2) = 0.10 + 0.20 + 0.30 = 0.60

P(X __>__ 2) = P(x=2) + P(x=3) + P(x=4) = 0.30 + 0.25 + 0.15 = 0.70

## Variability of a Discrete Random Variable

The equation for computing the variance of a discrete random variable is shown below.

σ^{2} = Σ { [ x_{i} - E(x) ]^{2} * P(x_{i}) }

where x_{i} is the value of the random variable for outcome
i, P(x_{i}) is the probability that the random variable
will be outcome i, E(x) is the expected value of the
discrete random variable x.

**Example 2**

The number of adults living in homes on a randomly selected city block is described by the following probability distribution.

Number of adults, x | 1 | 2 | 3 | 4 |
---|---|---|---|---|

Probability, P(x) | 0.25 | 0.50 | 0.15 | 0.10 |

What is the standard deviation of the probability distribution?

(A) 0.50

(B) 0.62

(C) 0.79

(D) 0.89

(E) 2.10

**Solution**

The correct answer is D. The solution has three parts. First, find the expected value; then, find the variance; then, find the standard deviation. Computations are shown below, beginning with the expected value.

E(X) = Σ [ x_{i} * P(x_{i}) ]

E(X) = 1*0.25 + 2*0.50 + 3*0.15 + 4*0.10 = 2.10

Now that we know the expected value, we find the variance.

σ^{2} = Σ { [ x_{i} - E(x) ]^{2} * P(x_{i}) }

σ^{2} = (1 - 2.1)^{2} * 0.25 +
(2 - 2.1)^{2} * 0.50 +
(3 - 2.1)^{2} * 0.15 +
(4 - 2.1)^{2} * 0.10

σ^{2} = (1.21 * 0.25) +
(0.01 * 0.50) +
(0.81) * 0.15) +
(3.61 * 0.10) = 0.3025 + 0.0050 + 0.1215 + 0.3610 = 0.79

And finally, the standard deviation is equal to the square root of the variance; so the standard deviation is sqrt(0.79) or 0.889.