1MA01: Probability Sinéad Ryan TCD November 29, 2013 Expected value The expected value of a discrete random variable X is X E(X) = kP(X = k) k where the sum is over all possible values of k. Also called the mean of X and sometimes written μ = E(X). Example 1: Roll a die. Let X be the number rolled. Find μ. by P.E.L.O. P(X = 1) = P(X = 2) = . . . = P(X = 6) = 61 . Then μ = 6 X kP(X = k) k=1 = 1 1 = 3.5 6 +2 1 6 +3 1 6 +4 1 6 +5 1 6 +6 1 6 (and since each number is equally likely this is just the average.) a histogram looks like: P(X) 1/6 1 2 3 4 X 5 6 Example 2: Roll a die once. If it lands on 6 you win $4, otherwise you lose $1. . Find μ. Let M be the amount won. μ = E(M) = 4(1/ 6) + (−1)(5/ 6) = −1/ 6 ∼ −$0.167. A histogram looks like: 0.8 P(X) 0.6 0.4 0.2 0 -1 4 µ=-0.167 M Variance and Standard Deviation Definition Let X be a discrete random variable with expected value, μ = E(X) then the variance is Var(X) = E[(X − μ)2 ] = X (k − μ)2 P(X = k) k where the sum is taken over all possible values of X. the standard deviation of X is p SD(X) = Var(X) the symbol σ is commonly used for SD(X). Note that the variance is a sum of terms that are products of two positive numbers ie (k − μ)2 is always positive because of the square and P(X = k) is positive since it is a probability. the term (k − μ)2 can be thought of as the square of the distance between the average value μ and k. an example Roll a die. Let X be the number rolled. Find Var(X) and SD(X) Recall for the same experiment we showed earlier that μ = 72 . Then Var(X) = 6 X (k − μ)2 P(X = k) k =1 2 1 7 2 1 7 2 1 + 2− + 3− 6 2 6 2 6 2 2 2 7 1 7 1 7 1 = + 4− + 5− + 6− 2 6 2 6 2 6 35 = . 12 = 1− 7 2 The standard deviation is σ = SD(X) = Æ 35 12 ≈ 1.708. The calculation of Var can be simplifed. Theorem Let X be a discrete random variable with expected value μ = E(X). Then X k 2 P(X = k) Var(X) = E(X2 ) − μ2 with E(X2 ) = k As an exercise check that in the previous example ! 6 X 35 2 Var(X) = k P(X = k) − μ2 = 12 k=1 Expected value of binomial distributions For binomial (n,p) distributions the definitions for Var(X) and SD(X) given above work but can be simplified E(X) = np Var(X) = npq p SD(X) = npq