The Practice of Statistics Third Edition Chapter 7: Random Variables Copyright © 2008 by W. H....

24
The Practice of Statistics Third Edition Chapter 7: Random Variables Copyright © 2008 by W. H. Freeman & Company Daniel S. Yates

Transcript of The Practice of Statistics Third Edition Chapter 7: Random Variables Copyright © 2008 by W. H....

The Practice of StatisticsThird Edition

Chapter 7:Random Variables

Copyright © 2008 by W. H. Freeman & Company

Daniel S. Yates

• Discrete random variables– Number of sales– Number of calls– Shares of stock– People in line– Mistakes per page

• Continuous random variables– Length– Depth– Volume– Time– Weight

Probability Histogram can be used to display the probability distribution of a discrete random variable.

Probability distribution of digits in table of random digits

6

Probability distribution of the random variable X, the number of siblings of a randomly selected student

Probability histogram for the random variable X, the number of siblings of a randomly selected student

Probability Distribution of Grades

0 = F

1 = D

2 = C

3 = B

4 = A

Ex. What is the probability distribution of the discrete random variable X, that is the sum of a pair of dice.

X can take on values {2,3,4,5,6,7,8,9,10,11,12}

P(X=2) = 1/36 = 0.028 P(X=8) = 5/36 = 0.139

P(X=3) = 2/36 = 0.056 P(X=9) = 4/36 = 0.111

P(X=4) = 3/36 = 0.083 P(X=10) = 3/36 = 0.083

P(X=5) = 4/36 = 0.111 P(X=11) = 2/36 = 0.056

P(X=6) = 5/36 = 0.139 P(X=12) = 1/36 = 0.028

P(X=7) = 6/36 = 0.167

Ex. Probability density curve

Probability Density Curves

• Any individual value has zero probability

• Only intervals between numbers have probability

• Therefore, P(X>a) and P(X>a) are equal

• Area under probability density curve equals 1

• The normal distribution is a probability density curveEx.

7.2 Means and Variances of random variables

aka. Expected value

Example

Find the mean (expected) size of an American household

Inhabitants 1 2 3 4 5 6 7

Proportion of households

0.25 0.32 0.17 0.15 0.07 0.03 0.01

x = (1)(0.25) + (2)(0.32) + (3)(0.17) + (4)(0.15) + (5)(0.07) +(6)(0.03) + (7)(0.01) = 2.6

Example

• In a roulette wheel in a U.S. casino, a $1 bet on “even” wins $1 if the ball falls on an even number (same for “odd,” or “red,” or “black”).

• The odds of winning this bet are 47.37%

0526.5263.1$4737.1$

5263.38/20)1$(

4737.38/18)1$(

loseP

winP

On average, bettors lose about a nickel for each dollar they put down on a bet like this.(These are the best bets for patrons.)

More About Means and Variances

• Adding or subtracting a constant from data shifts the mean but doesn’t change the variance or standard deviation:

(x ± c) = (x) ± c (X ± c) = (X)

– Example: Consider everyone in a company receiving a $5000 increase in salary.

More About Means and Variances (cont.)

• 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:

(ax) = a(x) (ax) = a2 (x)

– Example: Consider everyone in a company receiving a 10% increase in salary.

More About Means and Variances (cont.)

• In general,– The mean of the sum of two random variables is the

sum of the means.– The mean of the difference of two random variables is

the difference of the means.(x ± y) = (x) ± (y)

– If the random variables are independent, the variance of their sum or difference is always the sum of the variances.

(x ± y) = (x) + (y)

Example

Linda is a sales associate at a large auto dealership. She estimates her car sales as follows:

Cars Sold 0 1 2 3

Probability 0.3 0.4 0.2 0.1

Calculate the mean (x), variance (and standard deviation ( X is the number of cars sold

xi pi xipi (xi-xpi

0 0.3 0.0 (0-1.1)2(0.3) = 0.363

1 0.4 0.4 (1-1.1)2(0.4) = 0.004

2 0.2 0.4 (2-1.1)2(0.2) = 0.162

3 0.1 0.3 (3-1.1)2(0.1) = 0.361

x = 1.1 2x = 0.890 x = 0.943

Linda also sells trucks and SUVs. Following is her estimate of how many trucks and SUVs she will sell:

Trucks and SUVs sold

0 1 2

Probability 0.4 0.5 0.1

Let Y be the number of trucks and SUVs she sells.

y = (0)(0.4) + (1)(0.5) + (2)(0.1) = 0.7 Trucks and SUVs

If she earns $350 for each car sold and $400 for each truck or SUV. What are her expected earnings?

Let Z be her earnings; Z = 350X + 400Y

z = 350x + 400y = (350)(1.1) + (400)(0.7) = $665

What is the standard deviation of her earnings?

Trucks and SUVs sold

0 1 2

Probability 0.4 0.5 0.1

(yi-ypi(0-0.7)2(0.4)

= 0.196(1-0.7)2(0.5)

= 0.045(2-0.7)2(0.1)

= 0.169 y = 0.41

2y

22x

22 400350 z

)41.0(400)890.0(350 222 z

1746252 z

174625z 88.417z