Expectations Expectations Definition Let X be a discrete rv with set of possible values D and pmf p(x). The expected value or mean value of X , denoted by E (X ) or µX , is X E (X ) = µX = x · p(x) x∈D Expectations Definition Let X be a discrete rv with set of possible values D and pmf p(x). The expected value or mean value of X , denoted by E (X ) or µX , is X E (X ) = µX = x · p(x) x∈D e.g (Problem 30) A group of individuals who have automobile insurance from a certain company is randomly selected. Let Y be the number of moving violations for which the individual was cited during the last 3 years. The pmf of Y is y 0 1 2 3 Then the expected value of p(y) 0.60 0.25 0.10 0.05 moving violations for that group is µY = E (Y ) = 0 · 0.60 + 1 · 0.25 + 2 · 0.10 + 3 · 0.05 = 0.60 Expectations Expectations y 0 1 2 3 p(y) 0.60 0.25 0.10 0.05 Assume the total number of individuals in that group is 100, then there are 60 individuals without moving violation, 25 with 1 moving violation, 10 with 2 moving violations and 5 with 3 moving violations. Expectations y 0 1 2 3 p(y) 0.60 0.25 0.10 0.05 Assume the total number of individuals in that group is 100, then there are 60 individuals without moving violation, 25 with 1 moving violation, 10 with 2 moving violations and 5 with 3 moving violations. The population mean is calculated as µ= 0 · 60 + ·1 · 25 + ·2 · 10 + 3 · 5 = 0.60 100 Expectations y 0 1 2 3 p(y) 0.60 0.25 0.10 0.05 Assume the total number of individuals in that group is 100, then there are 60 individuals without moving violation, 25 with 1 moving violation, 10 with 2 moving violations and 5 with 3 moving violations. The population mean is calculated as µ= 0 · 60 + ·1 · 25 + ·2 · 10 + 3 · 5 = 0.60 100 60 25 10 5 +1· +2· +3· 100 100 100 100 = 0 · 0.60 + 1 · 0.25 + 2 · 0.10 + 3 · 0.05 µ=0· = 0.60 Expectations y 0 1 2 3 p(y) 0.60 0.25 0.10 0.05 Assume the total number of individuals in that group is 100, then there are 60 individuals without moving violation, 25 with 1 moving violation, 10 with 2 moving violations and 5 with 3 moving violations. The population mean is calculated as µ= 0 · 60 + ·1 · 25 + ·2 · 10 + 3 · 5 = 0.60 100 60 25 10 5 +1· +2· +3· 100 100 100 100 = 0 · 0.60 + 1 · 0.25 + 2 · 0.10 + 3 · 0.05 µ=0· = 0.60 The population size is irrevelant if we know the pmf! Expectations Expectations Examples: Let X be a Bernoulli rv with pmf 1 − p x = 0 p(x) = p x =1 0 x 6= 0, or 1 Expectations Examples: Let X be a Bernoulli rv with pmf 1 − p x = 0 p(x) = p x =1 0 x 6= 0, or 1 Then the expected value for X is E (X ) = 0 · p(0) + 1 · p(1) = p Expectations Examples: Let X be a Bernoulli rv with pmf 1 − p x = 0 p(x) = p x =1 0 x 6= 0, or 1 Then the expected value for X is E (X ) = 0 · p(0) + 1 · p(1) = p We see that the expected value of a Bernoulli rv X is just the probability that X takes on the value 1. Expectations Expectations Examples: Consider the cards drawing example again and assume we have infinitely many cards this time. Let X = the number of drawings until we get a ♠. If the probability for getting a ♠ is α, then the pmf for X is ( α(1 − α)x−1 x = 1, 2, 3, . . . p(x) = 0 otherwise Expectations Examples: Consider the cards drawing example again and assume we have infinitely many cards this time. Let X = the number of drawings until we get a ♠. If the probability for getting a ♠ is α, then the pmf for X is ( α(1 − α)x−1 x = 1, 2, 3, . . . p(x) = 0 otherwise The expected value for X is E (X ) = X D x · p(x) = ∞ X x=1 xα(1 − α)x−1 = α ∞ X d [− (1 − α)x ] dα x=1 Expectations Examples: Consider the cards drawing example again and assume we have infinitely many cards this time. Let X = the number of drawings until we get a ♠. If the probability for getting a ♠ is α, then the pmf for X is ( α(1 − α)x−1 x = 1, 2, 3, . . . p(x) = 0 otherwise The expected value for X is E (X ) = X x · p(x) = D ∞ X x=1 ∞ E (X ) = α{− xα(1 − α)x−1 = α ∞ X d [− (1 − α)x ] dα x=1 d X d 1−α 1 [ (1 − α)x ]} = α{− ( )} = dα dα α α x=1 Expectations Expectations Examples 3.20 Let X be the number of interviews a student has prior to getting a job. The pmf for X is ( k x = 1, 2, 3, . . . 2 p(x) = x 0 otherwise P 2 wherePk is chosen so that ∞ x=1 (k/x ) = 1. (It can be showed ∞ 2 that x=1 (1/x ) < ∞, which implies that such a k exists.) The expected value of X is µ = E (X ) = ∞ X x=1 ∞ X1 k = ∞! x· 2 =k x x The expected value is NOT finite! x=1 Expectations Examples 3.20 Let X be the number of interviews a student has prior to getting a job. The pmf for X is ( k x = 1, 2, 3, . . . 2 p(x) = x 0 otherwise P 2 wherePk is chosen so that ∞ x=1 (k/x ) = 1. (It can be showed ∞ 2 that x=1 (1/x ) < ∞, which implies that such a k exists.) The expected value of X is µ = E (X ) = ∞ X x=1 ∞ X1 k = ∞! x· 2 =k x x The expected value is NOT finite! Heavy Tail: x=1 Expectations Examples 3.20 Let X be the number of interviews a student has prior to getting a job. The pmf for X is ( k x = 1, 2, 3, . . . 2 p(x) = x 0 otherwise P 2 wherePk is chosen so that ∞ x=1 (k/x ) = 1. (It can be showed ∞ 2 that x=1 (1/x ) < ∞, which implies that such a k exists.) The expected value of X is µ = E (X ) = ∞ X x=1 ∞ X1 k = ∞! x· 2 =k x x x=1 The expected value is NOT finite! Heavy Tail: distribution with a large amount of probability far from µ Expectations Expectations Example (Problem 38) Let X = the outcome when a fair die is rolled once. If before the 1 die is rolled you are offered either 3.5 dollars or X1 dollars, would you accept the guaranteed amount or would you gamble? Expectations Example (Problem 38) Let X = the outcome when a fair die is rolled once. If before the 1 die is rolled you are offered either 3.5 dollars or X1 dollars, would you accept the guaranteed amount or would you gamble? x 1 2 3 4 5 6 p(x) 16 16 16 16 16 16 Expectations Example (Problem 38) Let X = the outcome when a fair die is rolled once. If before the 1 die is rolled you are offered either 3.5 dollars or X1 dollars, would you accept the guaranteed amount or would you gamble? x 1 2 3 4 5 6 p(x) 16 16 16 16 16 16 1 1 12 13 14 15 16 x Expectations Example (Problem 38) Let X = the outcome when a fair die is rolled once. If before the 1 die is rolled you are offered either 3.5 dollars or X1 dollars, would you accept the guaranteed amount or would you gamble? x 1 2 3 4 5 6 p(x) 16 16 16 16 16 16 1 1 12 13 14 15 16 x Then the expected dollars from gambling is 6 E( X1 1 1 )= · p( ) X x x x=1 1 1 1 1 1 + · + ··· + · 6 2 6 6 6 49 1 = < 120 3.5 =1· Expectations Expectations Proposition If the rv X has a set of possible values D and pmf p(x), then the expected value of any function h(X ), denoted by E [h(X )] or µhX , is computed by X E [h(X )] = h(x) · p(x) D Expectations Expectations Example 3.23 A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Expectations Example 3.23 A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Let X denote the number of computers sold, and suppose that p(0) = 0.1, p(1) = 0.2, p(2) = 0.3, p(3) = 0.4. Let h(X ) denote the profit associated with selling X units, Expectations Example 3.23 A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Let X denote the number of computers sold, and suppose that p(0) = 0.1, p(1) = 0.2, p(2) = 0.3, p(3) = 0.4. Let h(X ) denote the profit associated with selling X units, then h(X ) = revenue − cost = 1000X + 200(3 − X ) − 1500 = 800X − 900. Expectations Example 3.23 A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Let X denote the number of computers sold, and suppose that p(0) = 0.1, p(1) = 0.2, p(2) = 0.3, p(3) = 0.4. Let h(X ) denote the profit associated with selling X units, then h(X ) = revenue − cost = 1000X + 200(3 − X ) − 1500 = 800X − 900. The expected profit is E [h(X )] = h(0) · p(0) + h(1) · p(1) + h(2) · p(2) + h(3) · p(3) = (−900)(0.1) + (−100)(0.2) + (700)(0.3) + (1500)(0.4) = 700 Expectations Expectations Proposition E (aX + b) = a · E (X ) + b (Or, using alternative notation, µaX +b = a · µX + b.) Expectations Proposition E (aX + b) = a · E (X ) + b (Or, using alternative notation, µaX +b = a · µX + b.) e.g. for the previous example, E [h(X )] = E (800X − 900) = 800 · E (X ) − 900 = 700 Expectations Proposition E (aX + b) = a · E (X ) + b (Or, using alternative notation, µaX +b = a · µX + b.) e.g. for the previous example, E [h(X )] = E (800X − 900) = 800 · E (X ) − 900 = 700 Corollary 1. For any constant a, E (aX ) = a · E (X ). 2. For any constant b, E (X + b) = E (X ) + b. Expectations Expectations Definition Let X have pmf p(x) and expected value µ. Then the variance of X, denoted by V (X ) or σX2 , or just σX2 , is V (X ) = X (x − µ)2 · p(x) = E [(X − µ)2 ] D The stand deviation (SD) of X is q σX = σX2 Expectations Expectations Example: For the previous example, the pmf is given as 0 1 2 3 x p(x) 0.1 0.2 0.3 0.4 Expectations Example: For the previous example, the pmf is given as 0 1 2 3 x p(x) 0.1 0.2 0.3 0.4 then the variance of X is 2 V (X ) = σ = 3 X x=0 2 (x − 2)2 · p(x) = (0 − 2) (0.1) + (1 − 2)2 (0.2) + (2 − 2)2 (0.3) + (3 − 2)2 (0.4) =1 Expectations Expectations Recall that for sample variance s 2 , we have Sxx = s2 = n−1 P xi )2 n P xi2 − ( n−1 Expectations Recall that for sample variance s 2 , we have Sxx = s2 = n−1 P xi )2 n P xi2 − ( n−1 Proposition X V (X ) = σ 2 = [ x 2 · p(x)] − µ2 = E (X 2 ) − [E (X )]2 D Expectations Recall that for sample variance s 2 , we have Sxx = s2 = n−1 P xi )2 n P xi2 − ( n−1 Proposition X V (X ) = σ 2 = [ x 2 · p(x)] − µ2 = E (X 2 ) − [E (X )]2 D e.g. for the previous example, the pmf is given as x 0 1 2 3 p(x) 0.1 0.2 0.3 0.4 Then V (X ) = E (X 2 ) − [E (X )]2 = 12 · 0.2 + 22 · 0.3 + 32 · 0.4 − (2)2 = 1 Expectations Expectations Proposition If h(X ) is a function of a rv X , then X 2 V [h(X )] = σh(X {h(x)−E [h(X )]}2 ·p(x) = E [h(X )2 ]−{E [h(X )]}2 ) = D If h(X ) is linear, i.e. h(X ) = aX + b for some nonrandom constant a and b, then 2 2 2 V (aX + b) = σaX +b = a · σX and σaX +b =| a | ·σX In particular, σaX =| a | ·σX , σX +b = σX Expectations Expectations Example 3.23 continued A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Let X denote the number of computers sold, and suppose that p(0) = 0.1, p(1) = 0.2, p(2) = 0.3, p(3) = 0.4. Let h(X ) denote the profit associated with selling X units, then h(X ) = revenue − cost = 1000X + 200(3 − X ) − 1500 = 800X − 900. Expectations Example 3.23 continued A computer store has purchased three computers of a certain type at $500 apiece. It will sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still unsold after a specified period at $200 apiece. Let X denote the number of computers sold, and suppose that p(0) = 0.1, p(1) = 0.2, p(2) = 0.3, p(3) = 0.4. Let h(X ) denote the profit associated with selling X units, then h(X ) = revenue − cost = 1000X + 200(3 − X ) − 1500 = 800X − 900. The variance of h(X ) is V [h(X )] = V [800X − 900] = 8002 V [X ] = 640, 000 And the SD is σh(X ) = p V [h(X )] = 800.