Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania...

20
Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania [email protected]

Transcript of Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania...

Page 1: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Random Variables

Jim Bohan

Manheim Township School District

Lancaster, Pennsylvania

[email protected]

Page 2: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Definition of a Random Variable

A variable is a random variable if its value is determined by a probability event. Random Variables are generally denoted by capital letters.For example:Let X be the random variable whose value is the outcome of flipping a coin. Therefore, X {head, tail}Let Y be the random variable whose value is the outcome of rolling a die. Therefore, Y {1, 2, 3, 4, 5, 6}

Page 3: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Combining Random Variables

It is common to add or subtract values of random variables.

When random variables are combined using arithmetic operations, it is important to understand exactly what the combination produces.

For example:Let X {1, 2, 3} and Y {50, 60, 70}Then, X + Y {51, 52, 53, 61, 62, 63, 71, 72, 73}.X + Y is the set of all possible sums of X and Y.

Page 4: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Probability & Random Variables

Since a random variable takes on values based on a probability event, it is most appropriate to consider the probability that is associated with the value of the variable.Therefore, for example, it is important to link the probability of .5 with each of the values of the random X defined as the outcome of flipping a coin.

Page 5: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Another Example

Let W be the random variable whose value is the outcome of the number of head from flipping three coins. The set of values and their probabilities is then

1 3 3 13, , 2, , 1, , 0,

8 8 8 8W

Page 6: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Probability Distributions

A Probability Distribution is the set of the values and their corresponding probabilities of a random variable.

For example, the Probability Distribution for the random variable W = number of heads on three dice is 1 3 3 1

3, , 2, , 1, , 0,8 8 8 8

W

Page 7: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Describing Probability Distributions

We can calculate the mean and standard deviation of a probability distribution.For discrete random variables:

For continuous random variables, the mean and standard deviation is usually given.

2

1 1

n n

i i i ii i

X X p s X X p

Page 8: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Operations on Random Variables

Consider the random variable X whose values are the values of the roll of a die.

Calculate its mean and variance:

22

1 1

n n

i i X i ii i

X X p s X X p

Page 9: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Operations - continued

Consider the random variable Y = X + X, that is, the sum of the values on two dice.

List the distribution (values and probabilities) and calculate its mean and variance:

22

1 1

n n

i i Y i ii i

Y Y p s Y Y p

Page 10: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Summary of measures;X = value on one die

Random Variable

Mean Variance

X

X

Y = X + X

Page 11: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Relationships – sum on two dice

Mean of the sum =

Variance of the sum =

Page 12: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Another Example

Let H ={heights of husbands}.

Let W={heights of their wives}.

The values are in the table below:

Husband WifeH W65 5656 4872 7075 7170 68

Page 13: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Tasks

1. List all of the values in H – W:

2. Calculate the values of the mean and variance for H and for W.

3. Calculate the values of the mean and variance for H – W.

Page 14: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Summary of measures;H= heights of husbands

W=heights of wives

Random Variable

Mean Variance

H

W

H - W

Page 15: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Relationships – husbands & wives

• Mean of the sum =

• Variance of the sum =

Page 16: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

A Variation

Reconsider the data of the heights of the husbands and their wives. Let us consider the differences of heights of each married couple.

H W H - W65 56 956 48 872 70 275 71 370 68 2

Page 17: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

Recalculate all of the means…

Random Variable

Mean Variance

H

W

H - W

Page 18: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

An Unexpected Change

Clearly the mean of the differences = the difference of the means of the individual random variables.

However, the variance of the differences is NOT the sum of the variances of the individual random variables.

Why does the variance rule fail?

Page 19: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

The Reason

When we only considered the married couples, then the random variable of the husband’s height and the random variable of the wife’s height were not independent!

The rule for means appears to be true but the rule on variances is contingent on whether the random variables are independent.

Page 20: Random Variables Jim Bohan Manheim Township School District Lancaster, Pennsylvania jim_bohan@mtwp.k12.pa.us.

The Rules for Combing Random Variables

Means: The mean of a sums = the sum of the means. The mean of the difference = the difference of the means

Variances: The variance of the sum or difference = the sum of the

variances when the variables are independent. The variance of the sum or difference cannot be determined

from the variances of the variables when the variables are not independent.