Chapter 3 Discrete Random Variables and Probability Distributions Part 2: Mean and Variance of a Discrete Random Variable Section 3.4 1 / 16
Discrete Random Variable - Expected Value In a random experiment, there are a variety of possible outcomes. Some outcomes may be more likely than others. What is the expected value of a random variable? Note: the expectation or expected value of a random variable has a specific meaning in mathematics... 2 / 16
Discrete Random Variable - Expected Value Definition (Mean of a Discrete Random Variable) The mean or expected value of a discrete random variable X, denoted as µ or E(X), is µ = E(X) = x x f(x) = x x P (X = x) Example (Mean of a Discrete Random Variable) Consider the random variable X and associated probability mass function defined by P (X = 0) = 0.20, P (X = 1) = 0.30, and P (X = 2) = 0.50. The expected value of X or E(X) by the definition above is E(X) = 0 P (X = 0) + 1 P (X = 1) + 2 P (X = 2) = 0 (0.20) + 1 (0.30) + 2 (0.50) = 1.30 Note that eventhough X can only take on a value of 0, 1, or 2, the expected value is not limited to these values. The expected value is not the same as the most probable value. 3 / 16
Discrete Random Variable - Expected Value Example (Mean of a Discrete Random Variable, cont.) Though the possible values for X are 0, 1, and 2, the expected value is closer to 2 because 2 is more heavily weighted, or more likely to occur. Thus, E(X) = 1.30. The mean of a discrete random variable X is a weighted average of the possible values of X, with weights equal to the probabilities. A probability distribution can be viewed as a loading with a mean equal to the balance point (shown as dark triangles). Parts (a) and (b) above illustrate equal means from very different loadings (or distributions). 4 / 16
Discrete Random Variable - Expected Value In statistics, the mean or expected value of a random variable is a measure of center for the distribution. As in the graphic below, the distribution would balance at the black arrow or at the value of µ. 5 / 16
Expected Value of a Function of a Discrete Random Variable Definition (EV of a Function of a random variable) If X is a discrete random variable with probability mass function f(x), E[(h(X)] = x = x h(x) f(x) h(x) P (X = x) You can use this formula to find the expected value of any function of a discrete random variable X. 6 / 16
Expected Value of a Function of a Discrete Random Variable Example (Cylinders in the engine of a car) Let X be the number of cylinders in the engine of the next car to be tuned up at a certain facility. Based on past data, the probability mass function for X is the following: x 4 6 8 f(x) 0.55 0.25 0.20 The cost, h, of a tune-up is a function of X. Specifically, we let the cost be represented as the function h(x), and for this shop we have h(x) = 20 + 3X + 0.5X 2 {i.e. cars with more cylinders cost more to tune-up} Find the expected value of the cost of the next tune-up, or find E[h(X)]. 7 / 16
Expected Value of a Function of a Discrete Random Variable Example (Cylinders in the engine of a car, cont.) x 4 6 8 f(x) 0.55 0.25 0.20 Find E[h(X)]. ANS: h(x) = 20 + 3X + 0.5X 2 8 / 16
Variance of a Discrete Random Variable In statistics, a very special function of X for which we take the expected value is (X µ) 2 where µ was defined earlier as E(X). We use E[(X µ) 2 ] to quantify the spread in a distribution. And this value is called the variance of a distribution. As mentioned earlier, the mean is a measure of center for a distribution. But what about the spread? How do we quantify spread? Variance is a measure of the spread or dispersion (or variability) in the distribution of a random variable. 9 / 16
Variance of a Discrete Random Variable The two probability mass functions shown above (viewed as a loading on a beam) have the same mean, but not the same spread. There are a variety of ways to quantify spread or dispersion. Consider a simple one... Range: x max x min This one is minimally informative as it is only related to the max and min... 10 / 16
Variance of a Discrete Random Variable As a more informative measure of spread, we could include how far all the values in a distribution are from the center of the distribution (then all values contribute to the measure of spread, not just max and min). We might try to quantify: On average, how far from the center are the observations? For example... Expected absolute distance from the mean: Expected value of X µ {On average, how far from center are the values?} But probably the most often used variability measure is the variance of a distribution. 11 / 16
Variance of a Discrete Random Variable Definition (Variance of a Random Variable) The variance of X, denoted as σ 2 or V (X), is σ 2 = V (X) = E(X µ) 2 1st formula = E(X 2 ) µ 2 2nd formula It is the expected squared distance of X from the mean µ. Definition (Variance of a Discrete Random Variable) If X is a discrete random variable, this is a summation... E(X µ) 2 = x (x µ) 2 f(x) 1st formula = x x 2 f(x) µ 2 2nd formula where f(x) is the probability mass function for X. 12 / 16
Standard Deviation of a Discrete Random Variable Variance is in units 2, so we often work with standard deviation instead which is in the original units of the data. Definition (Standard Deviation of a Random Variable) The standard deviation of X is denoted as σ where σ = σ 2 = V (X). The standard deviation of X is just the square root of the variance of X. NOTE: Though the average absolute distance from center is in the original units and may be more easily interpreted, it turns out that the squared distance function is easier to deal with mathematically than the absolute value function. Remember, variance (and standard deviation) is a measure of spread or dispersion of a distribution. 13 / 16
Variance of a Discrete Random Variable Example (Flaws in a piece of wire) Let X represent the number of flaws in a randomly chosen piece of wire. x 0 1 2 3 f(x) 0.48 0.39 0.12 0.01 Compute the variance and standard deviation of X. ANS: 14 / 16
Variance of a Discrete Random Variable Example (Coin toss game) You and a friend play a game where you each toss a balanced coin. If the upper faces on the coins are both tails, you win $1; if the faces are both heads, you win $2; if the coins do not match (one shows a head the other a tail), you lose $1. Let X represent the amount won. 1) What is the probability distribution for X? ANS: 15 / 16
Variance of a Discrete Random Variable Example (Coin toss game, cont.) 2) Find the mean and variance of X. ANS: 16 / 16