# Copyright 2007 Pearson Education Inc Publishing as Pearson

• Slides: 27

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1

Chapter 16 Random Variables Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Expected Value: Center n A random variable assumes a value based on the outcome of a random event. n We use a capital letter, like X, to denote a random variable. n A particular value of a random variable will be denoted with a lower case letter, in this case x. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3

Expected Value: Center (cont. ) n There are two types of random variables: n Discrete random variables can take one of a finite number of distinct outcomes. n n Example: Number of credit hours Continuous random variables can take any numeric value within a range of values. n Example: Cost of books this term Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4

Expected Value: Center (cont. ) n n A probability model for a random variable consists of: n The collection of all possible values of a random variable, and n the probabilities that the values occur. Of particular interest is the value we expect a random variable to take on, notated μ (for population mean) or E(X) for expected value. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5

Greedy Pig All students stand up. I will roll a die. Each student will get the number of points on the die. Students then may choose to keep their points by sitting down, or remain standing for another roll. With each roll, points accumulate for those who choose to remain standing. BUT…if I roll a 5, all those still standing lose their points, ending the round with a score of 0. Let’s play a couple of practice rounds. What strategy were you using? (There is an optimal strategy. ) Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6

Let’s Play a Game!! A player will pay me \$5 and then draw a card from a deck. If you draw the ace of hearts, I will pay you \$100. For any other ace, I will pay you \$10, and for any other heart, I will pay you \$5. If you draw anything else, you lose. Who wants to play? Would you play for a top prize of \$200? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7

Expected Value: Center (cont. ) n n The expected value of a (discrete) random variable can be found by summing the products of each possible value by the probability that it occurs: Note: Be sure that every possible outcome is included in the sum and verify that you have a valid probability model to start with. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 8

Example 1: Expected Value Given: x 2 4 6 8 P(X=x). 3 . 4 . 2 . 1 Find the expected value of the random variable. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 9

Example 1 continued…. We know that: μ = E(X) = Σx. P(x) = 2 P(2) + 4 P(4) + 6 P(6) + 8 P(8) =2(. 3) + 4(. 4) + 6(. 2) + 8(. 1) =4. 2 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 10

Example 2: Finding Probability Models For an insurance company, x (particular value of a random variable) is \$10, 000 if you die that year, \$5, 000 if you are disabled, or \$0 if neither occurs. Suppose that the death rate in any year is 1 out of every 1000 people, and that another 2 out of 1000 suffer some kind of disability. We can display the probability model for this insurance policy in a table like this: Policy Holder Outcome Death Payout x 10, 000 1/1000 Disability 5, 000 2/1000 neither 0 997/1000 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Probability P(X=x) 11

Example 2 continued… If we insure exactly 1000 people, find the following. What is the expected value of total payout for the year? What is the payout per policy? If we charge a \$50 premium for a policy, how much money would we expect to make? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 12

Example 2 continued… If we insure exactly 1000 people, find the following. What is the total payout? We expect to pay out 10, 000 + 2(5000) = \$20, 000 What is the expected payout per policy? (like the average) If we charge a \$50 premium for a policy, how much money would we expect to make? Charge: 1, 000(\$50) = \$50, 000 Payout: \$20, 000 Net Profit: \$30, 000 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 13

Example 3: Car Repairs Buck took his minivan in for repair recently because the air conditioner was cutting out intermittently. The mechanic identified the problem as dirt in the control unit. He said that in about 75% of such cases, drawing down and then recharging the coolant a couple times cleans up the problem – and costs only \$60. If that fails, then the control unit must be replaced at an additional cost of \$100 for parts and \$40 for labor. a. Define the random variable and construct the probability model. b. What is the expected value of the cost of this repair? c. What does this mean in context? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 14

Example 3 continued… 1. Outcome Recharging works Replace control unit X=cost Probability \$60 0. 75 \$200 0. 25 2. μ=E(X)=60(. 75) + 200(. 25) = \$95 3. Car owners with this problem will spend an average of \$95 to get it fixed. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 15

First Center, Now Spread… n For data, we calculated the standard deviation by first computing the deviation from the mean and squaring it. We do that with random variables as well. The variance for a random variable is: n The standard deviation for a random variable is: n Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16

More About Means and Variances n Adding or subtracting a constant from data shifts the mean but doesn’t change the variance or standard deviation: E(X ± c) = E(X) ± c Var(X ± c) = Var(X) n Example: Consider everyone in a company receiving a \$5000 increase in salary. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 17

More About Means and Variances (cont. ) n In general, multiplying each value of a random variable by a constant multiplies the mean by that constant and the variance by the square of the constant: E(a. X) = a. E(X) Var(a. X) = a 2 Var(X) SD(a. X) = a. SD(X) n Example: Consider everyone in a company receiving a 10% increase in salary. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 18

More About Means and Variances (cont. ) In general, n The mean of the sum of two random variables is the sum of the means. n The mean of the difference of two random variables is the difference of the means. n E(X ± Y) = E(X) ± E(Y) n If the random variables are independent, the variance of their sum or difference is always the sum of the variances. Var(X ± Y) = Var(X) + Var(Y) n If the random variables are independent, the standard deviation of their sum or difference is always the square root of the squares of the standard deviations. Pythagorean Theorem of Statistics! Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 19

Using Transformation Rules Given independent random variables with means and standard deviations as shown, find the mean and standard deviation of each of these variables. n. 8 Y Mean SD n 2 X-100 X 120 12 n X+2 Y Y 300 16 n 3 X-Y n Y 1+Y 2 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 20

Example A casino knows that people play the slot machine in hopes of hitting the jackpot, but that most of them lose their dollar. Suppose a certain machine pays out an average of \$0. 92 with a standard deviation of \$120. n Why is the standard deviation so large? n If you play 5 times, what are the mean and standard deviation of the casino’s profit? n If gamblers play this machine 1000 times in a day, what are the mean and standard deviation of the casino’s profit? n Do you think the casino is likely to be profitable? Explain. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 21

Car Dealer Example Suppose a used car dealer runs autos through a two-stage process to get them ready to sell. The mechanical checkup costs \$50 per hour and takes an average of 1. 5 hours, with a standard deviation of. 25 hours. The appearance prep (wash, polish, etc) costs \$6 per hour and takes an average of 1 hour, with a standard deviation of . 083 hours. n What are the mean and standard deviation of the total time spent preparing a car? n What are the mean and standard deviation of the total expense to prepare a car? n What are the mean and standard deviation of the difference in costs for the two phases of the operation? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 22

Answers n n n What are the mean and standard deviation of the total time spent preparing a car? E(T)=2. 5 hours SD(T)=. 263 hours What are the mean and standard deviation of the total expense to prepare a car? E(T)=\$81 SD(T)=\$12. 51 What are the mean and standard deviation of the difference in costs for the two phases of the operation? E(T)=\$69 SD(T)=\$12. 51 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 23

Continuous Random Variables (cont. ) n n When two independent continuous random variables have Normal models, so does their sum or difference. This fact will let us apply our knowledge of Normal probabilities to questions about the sum or difference of independent random variables. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 24

Car Dealers continued… What is the probability that it will take longer than 2. 7 hours to do the appearance prep and the mechanical check-up? Both phases of the process can be described by a Normal model. E(T) =E(M) + E(A) = 1. 5 + 1 = 2. 5 hours SD(D) =. 263 hours (WHY? ) Normal model…… Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 25

Car Dealers continued… What is the probability that it will take longer to do the appearance prep than the mechanical checkup? Both phases of the process can be described by a Normal model. **If the difference in the prep times is less than 0, it means the appearance prep took longer. E(D) =E(M) – E(A) = 1. 5 – 1 =. 5 hours SD(D) =. 263 hours (WHY? ) Normal model…… Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 26

Example 7: Packaging Stereos Consider a company that manufactures and ships small stereo systems that were discussed in Chapter 16 of the book. The times required to pack the stereos can be described by a Normal model with a mean of 9 minutes and standard deviation of 1. 5 minutes. The times for the boxing stage can also be modeled as Normal, with a mean of 6 minutes and standard deviation of 1 minute. n What is the probability that packing and boxing a system takes over 20 minutes? n What is the probability that packing and boxing a system takes between 12 and 17 minutes? n What percentage of the stereo systems take longer to pack than to box? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 27