expected values and variances

25
Expected values and variances

Upload: graiden-burt

Post on 02-Jan-2016

42 views

Category:

Documents


4 download

DESCRIPTION

Expected values and variances. Formula. For a discrete random variable X and pmf p(X): Expected value: Variance: Alternate formula for variance: Var(x)=E(X^2)-[E(X)]^2 Standard Deviation: =sqrt(variance). Answers to some questions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Expected values and variances

Expected values and variances

Page 2: Expected values and variances

Formula

For a discrete random variable X and pmf p(X): Expected value:

Variance:

Alternate formula for variance: Var(x)=E(X^2)-[E(X)]^2

Standard Deviation: =sqrt(variance)

Page 3: Expected values and variances

Answers to some questions

Assuming you are playing a poker game, each player gets 13 cards. On average, how many aces should you have at your hand?

Page 4: Expected values and variances

Average number of Aces

Let X= number of aces a player has at hand. Then X is a discrete random variable since it can only take values of 0, 1, 2, 3 and 4. We want to find its pmf and then find its expected value.

pmfX 0 1 2 3 4

P(X) 0.3038 0.4388 0.2135 0.0412 0.0026

Page 5: Expected values and variances

Average number of Aces

The average number of aces a player has at hand is the expected value of this discrete random variable X,0*0.3038+1*0.4388+2*0.2134+3*0.0412+4*0.0026

=0.9998, almost 1.That means if you play poker many, many times,

and if you add up the total number of Aces you have got and find its average, it should be around 1.

Page 6: Expected values and variances

Calculating variance and standard deviation for number of Aces

P(X) X Xp(X) X-mu (X-mu)^2 (X-mu)^2P(x)0.3038 0 0 -0.696 0.484416 0.1471655810.4388 1 0.4388 -0.561 0.314721 0.138099575

0.2135 2 0.427-0.7863 0.61826769 0.132000152

0.0412 3 0.1236-0.9586 0.91891396 0.037859255

0.0026 4 0.0104-0.9972 0.99440784 0.00258546

Page 7: Expected values and variances

Average number of Aces

The variance and standard deviation of the number of Aces are therefore:

Var(X)= 0.457710023, Std. Dev.= 0.676542699 The interpretation of variance and standard

deviation will be more meaningful if we have an underlying distribution. But here, we do not.

The best we can say is that the number of Aces changes quite a bit, since you can only have at most 4 Aces.

Page 8: Expected values and variances

Average number of Aces

An important thing here is that, the variance and standard deviation we calculate here are for “number of Aces”.

It is a very common mistake that people may say they are for “the average number of Aces”. That is WRONG!!!.

Both expected value and variance(std. dev.) are used to summarize the number of Aces you have at hand.

The summary for the “average number of Aces” is totally a different issue.

Page 9: Expected values and variances

Average number of suits

Assuming you are playing a poker game, each player gets 13 cards. On average, how many different suits should you have at your hand?

Page 10: Expected values and variances

Average number of suits

Let Y=number of suits a player has at hand. It is also a discrete random variable whose pmf is:

Y 1 2 3 4

P(Y) 1.57*10^-12 0.0001 0.0510 0.9489

Page 11: Expected values and variances

Average number of suits

The average number of suits a player has at hand is the expected value of the discrete random variable Y, E(Y)=1*1.57^(-12)+2*0.0001+3*0.051+4*0.9489

=3.9488, almost 4.That means you will almost always have all

four suits in your hand.

Page 12: Expected values and variances

Variance and standard deviation

y p(y) yp(y) y-mu (y-mu)^2 (y-mu)^2P(y)4 0.9489 3.7956 0.0512 0.00262144 0.0024874843 0.051 0.153 -0.9488 0.90022144 0.0459112932 0.0001 0.0002 -1.9488 3.79782144 0.0003797821 0 0 -2.9488 8.69542144 0

Page 13: Expected values and variances

Variance and standard deviation

The variance and standard deviation of the number of suits in your hand are:

Var(Y)= 0.04877856 Std. Dev. 0.220858688 Again, they are for “number of suits in your

hand”, not for “average number of suits in your hand”.

Page 14: Expected values and variances

Purpose of the above two examples 1. How to put a given problem in probability

terms ( define the random variable of interest, find its sample space, etc ).

2. How to find the pmf of the random variable. 3. How to find the expected value and variance

given the pmf of the random variable. The above two examples are for discrete

random variables, the procedure is similar to continuous random variables.

Page 15: Expected values and variances

Another Example

If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance of X.

There are different ways to solve this problem.From the three tosses, we have a total of 8

outcomes.{HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}Each of the above 8 outcomes has a

probability of 1/8.

Page 16: Expected values and variances

Coin Toss Example

One way of finding the mean is to count the number of heads in each outcome and take the average. {3, 2, 2, 2, 1, 1, 1, 0}The mean is therefore 12/8=1.5Then we can find the variance of the 8 numbers,

which is: [(3-1.5)^2+3*(2-1.5)^2+3*(1-1.5)^2+(0-1.5)^2]/

8=0.75

Page 17: Expected values and variances

Coin Toss Example

Another way is to find the pmf.

E(X)=0*(1/8)+1*(3/8)+2*(3/8)+4*(1/8)=1.5 Var(X)=(0-1.5)^2*(1/8)+(1-1.5)^2*(3/8)+(2-

1.5)^2*(3/8)+(3-1.5)^2*(1/8)=0.75

X 0 1 2 3

P(X) 1/8 3/8 3/8 1/8

Page 18: Expected values and variances

Coin Toss Example

Yet another way. In probability, there is something we call Bernoulli

and Binomial trials, which are repetitions of exactly the same experiments with two possible outcomes.

In this case, we repeat the experiment of tossing a fair coin 3 times, each time with 50% chance of getting head and 50% chance of getting tail.

Page 19: Expected values and variances

Coin Toss Example

That is a Binomial experiment, or we say the (discrete) random variable X follows a Binomial distribution.

For Binomial distribution, the outcomes can be summarized with a pmf that does not have to look like a table, but like a function instead.

Use our knowledge:

Page 20: Expected values and variances

Coin Toss Example

There are easier ways to find the expected value and variance of a Binomial random variable.

If X~BIN(n,p)E(X)=npVar(X)=np(1-p) In this case, n=3, p=0.5, so E(X)=np=3*0.5=1.5

and Var(X)=3*0.5*0.5=0.75

Page 21: Expected values and variances

Properties of Expected Values and Variances E(X+Y)=E(X)+E(Y) E(X+c)=E(X)+c E(aX+bY)=aE(X)+bE(Y)

For example, if E(X)=5 and E(Y)=6, then

E(X+5)=5+5=10

E(2X+5)=2*5+5=15

E(3X+2Y)=3*5+2*6=27

Page 22: Expected values and variances

Properties of Expected Values and Variances Var(X+Y)=Var(X)+Var(Y), if X and Y are

independent. Var(aX)=(a^2)Var(X) Var(X+c)=Var(X) Var(aX+bY)=(a^2)Var(X)+(b^2)Var(Y), if X

and Y are independent.

Page 23: Expected values and variances

Properties of Expected Values and Variances Example: if Var(X)=4 and Var(Y)=9, X and

Y are independent.Var(2X+3Y)=4*Var(X)+9*Var(Y)=4*4+9*9=97

Page 24: Expected values and variances

Properties of Expected Value and Variances Example: if you roll a 6-sided fair die and

win $3 based on the number you get, e.g., you get $6 if you roll a 2 and $15 if you roll a $15. Let Y be the money you collect from playing this game what is the expected value and variance of Y.

Page 25: Expected values and variances

Properties of Expected Values and Variances Let X be the outcome of rolling a fair die,

then Y=3*X. Since we know E(X)=3.5, E(Y)=3*3.5=$10.5 and Var(Y)=(3^2)Var(X)=9*3.5=31.5

The standard deviation is sqrt(31.5)=$5.61 Note: Mean and standard deviation have

the same unit.