Chapter 3 Discrete Random Variables and Probability...

16
Chapter 3 Discrete Random Variables and Probability Distributions Part 2: Mean and Variance of a Discrete Random Variable Section 3.4 1 / 16

Transcript of Chapter 3 Discrete Random Variables and Probability...

Page 1: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Chapter 3Discrete Random Variables and Probability Distributions

Part 2: Mean and Variance of a Discrete Random Variable

Section 3.4

1 / 16

Page 2: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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 aspecific meaning in mathematics...

2 / 16

Page 3: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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 functiondefined 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 isE(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

Page 4: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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 iscloser 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 thepossible 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

Page 5: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Discrete Random Variable - Expected Value

In statistics, the mean or expected value of a random variable is ameasure of center for the distribution.

As in the graphic below, the distribution would balance at the blackarrow or at the value of µ.

5 / 16

Page 6: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Expected Value of a Function of a Discrete RandomVariable

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

h(x) · f(x)

=∑x

h(x) · P (X = x)

You can use this formula to find the expected value of any function of adiscrete random variable X.

6 / 16

Page 7: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Expected Value of a Function of a Discrete RandomVariable

Example (Cylinders in the engine of a car)

Let X be the number of cylinders in the engine of the next car to be tunedup at a certain facility. Based on past data, the probability mass functionfor 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 costbe represented as the function h(X), and for this shop we have

h(X) = 20 + 3X + 0.5X2

{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

Page 8: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Expected Value of a Function of a Discrete RandomVariable

Example (Cylinders in the engine of a car, cont.)

x 4 6 8

f(x) 0.55 0.25 0.20

h(X) = 20 + 3X + 0.5X2

Find E[h(X)].

ANS:

8 / 16

Page 9: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Variance of a Discrete Random Variable

In statistics, a very special function of X for which we take theexpected value is (X − µ)2 where µ was defined earlier as E(X).

We use E[(X − µ)2] to quantify the spread in a distribution. And thisvalue is called the variance of a distribution.

As mentioned earlier, the mean is a measure of center for adistribution.

But what about the spread? How do we quantify spread? Variance isa measure of the spread or dispersion (or variability) in thedistribution of a random variable.

9 / 16

Page 10: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Variance of a Discrete Random Variable

The two probability mass functions shown above (viewed as a loadingon 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: xmax − xmin

This one is minimally informative as it is only related to the max andmin...

10 / 16

Page 11: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Variance of a Discrete Random Variable

As a more informative measure of spread, we could include how far allthe values in a distribution are from the center of the distribution(then all values contribute to the measure of spread, not just max andmin).

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 varianceof a distribution.

11 / 16

Page 12: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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(X2)− µ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− µ)2f(x) ‘1st formula’

=∑x

x2f(x)− µ2 ‘2nd formula’

where f(x) is the probability mass function for X.12 / 16

Page 13: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Standard Deviation of a Discrete Random Variable

Variance is in units2, so we often work with standard deviationinstead 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 spreador dispersion of a distribution.

13 / 16

Page 14: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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

Page 15: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

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 theupper faces on the coins are both tails, you win $1; if the faces are bothheads, you win $2; if the coins do not match (one shows a head the othera tail), you lose $1.

Let X represent the amount won.

1) What is the probability distribution for X?ANS:

15 / 16

Page 16: Chapter 3 Discrete Random Variables and Probability ...homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch3_pt2.pdfDiscrete Random Variables and Probability Distributions ... The mean

Variance of a Discrete Random Variable

Example (Coin toss game, cont.)

2) Find the mean and variance of X.ANS:

16 / 16