DISCRETE RANDOM VARIABLES Achievement Standards: 90643 (3.3) part, external; 90646 (3.6) part, external Key words: Sigma notation, Expected value, variance, winnings, profit, gain, return, independent, standard deviation. 1. SIGMA NOTATION This notation will be used at times during this topic. 5 a Examples: A= { 1,3,5,7,9,11,……) i =1 1 = 1 + 3 + 5 + 7 + 9 = 25 5 (4i + 1) = 5 + 9 + 13 + 17 + 21 = 65 i=1 Nulake p 147 Sigma p121, Ex 7.01, Ex 7.02, 7.03 2. EXPECTATION For a given probability function the mean () or expected value of X (E[X]) is given by the formula: E[X] = xip(xi) Example 1: Spinner A probability distribution for the result of spinning this spinner is: x P(X=x) 0 0.1 1 0.3 2 0.4 In this example the mean, or expected, value is: 3 0.2 3 0 1 2 E[X] = 0 0.1 + 1 0.3 + 2 0.4 + 3 0.2 = 1.7 Example 2: Raffle A raffle has 100 tickets and has a first prize of $200, second prize of $100 and a third prize of $50. Prizewinners are drawn, without replacement, in order (1st, 2nd, 3rd). Let X be a random variable representing the winnings of a single ticket buyer. x P(X=x) 200 0.01 100 0.01 50 0.01 0 0.97 E[X] = 200 0.01 + 100 0.01 + 50 0.01 + 0 0.9 = $ 3.50 (Note that this means that if the raffle is to be fair tickets should sell at $3.50) Example 3: Car Insurance A racing car valued at $200 000 has the probability of being a total loss estimated at 0.002, a 50% loss with probability 0.01, and a 25% loss with probability 0.1. What should the insurance company charge if it wants to make an average profit of $1 000 per car that it insures? Let X be a random variable representing the amount that the company has to pay out. x P(X=x) 200 000 0.002 100 000 0.01 50 000 0.1 0 0.888 E[X] = $6 400, so the company would have to charge $7 400. 3. EXPECTED VALUE OF A LINEAR FUNCTION OF A RANDOM VARIABLE E[aX+b] = aE[X] + b Nulake p 156 Sigma p130, Ex 7.04 pi(axi +b) = (pi (axi) + pi (b)) = (pi axi) + ( pi b) = a (pi xi) + b ( pi), ( pi) = 1, axi = axi Proof: E[aX+b] = = aE[X] + b Example: The random variable X is defined by the following probability distribution: x P(X=x) 0 0.1 1 0.3 2 0.4 3 0.2 giving E[X] = 1.7 Then the probability distribution for 3X+2 is: x P(X=x) 2 0.1 5 0.3 8 0.4 Note that 3E[X]+2 = 3 1.7 + 2 = 7.1 = E[3X+2] 11 0.2 giving E[3X+2] = 7.1 4. VARIANCE OF A RANDOM VARIABLE Var[X] = E[(X-)2] = E[X2] - 2 Proof: Nulake p 152 Sigma p135, Ex 7.05, 7.06 Var[X] = E[(X-)2] = E[X2 – 2X + 2] = E[X2] – E[2X] + E[2] = E[X2] – 2E[X] + E[2] = E[X2] – 22 + 2 = E[X2] – 2 Example: X P(X=x) 1 0.1 2 0.4 3 0.2 4 0.3 giving = E[X] = 2.7 (X-)2 P(X=x) 2.89 0.1 0.49 0.4 0.09 0.2 1.69 0.3 giving Var[X] = E[(X-)2] = 1.01 X2 P(X=x) 1 0.1 4 0.4 9 0.2 16 0.3 giving E[X2] = 8.3 Note that E[X2] – 2 = 8.3 – 2.72 = 1.01 = Var[X] The standard deviation () of a random variable X is defined as the square root of the variance. Var[X] 5. VARIANCE OF A FUNCTION OF A RANDOM VARIABLE Var[aX + b] = a2Var[X] Proof: Example: Nulake p 160 Sigma p138, Ex 7.07 Var[aX+b] = E[(aX+b)2] - aX+b2 = E[ a2X 2 +2abX+b2] – E[aX+b] 2 = (a2E[X 2] + 2abE[X] + b2) – (aE[X]+b)2 = (a2E[X 2] + 2abE[X] + b2) – (a2E[X] 2+2abE[X]+b2) = a2E[X 2] - a2E[X] 2 = a2(E[X 2] - E[X] 2) = a2Var[X] X P(X=x) 0 0.1 1 0.2 2 0.3 3 0.4 E[X] = 2, E[X2] = 5; so Var[X] = 1 Then for Y = 3X – 1 E[Y] = E[3X- 1] = 3E[X] – 1 =32-1 =5 Var[Y] = Var[3X- 1] = 9Var[X] =91 =9 6. SUMS AND DIFFERENCES OF RANDOM VARIABLES (a) E[ X + Y ] = E[X] + E[Y], Nulake p 160 Sigma p143, Ex 7.09, 7.10 E[ X – Y ] = E[X] - E[Y] (b) If X and Y are independent then Var[ X Y ] = Var[X] + Var[Y] (c) This means that for independent random variables X and Y we have: E[ aX + bY + c] = aE[X] + bE[Y] + c, Var[aX + bY + c] = a2Var[X] + b2Var[Y] Example: Empty jam containers have a mean weight of 250g with a standard deviation of 20g. The contents have a mean weight of 900g with a standard deviation of 15g. (a) Find the mean and standard deviation of a filled container Answer: If X represents the weight of an empty container then: E[X] = 250, Var[X] = 202 = 400 If Y represents the weight of the contents then: E[Y] = 900, Var[Y] = 152 = 225 If T = X + Y (T represents the total weight) Then E[T] = E[X + Y] Var[T] = Var[X + Y] = E[X] + E[Y] = Var[X] + Var[Y] (assuming X,Y indpt) = 250 + 900 = 400 + 225 = 1150g = 625 So then mean weight of a full container is 1150g, with a standard deviation of 625 = 25g. (b) If the price of making the contents is 0.3 cents per gram plus a fixed cost of 25 cents, find the mean and standard deviation of the cost of making the contents of a jar of jam. Answer: If C represents the cost of making the contents then C = 0.3Y + 25 cents. E[C] = E[0.3Y + 25] Var[C] = Var[ 0.3Y + 25] = 0.3E[Y] + 25 = 0.09Var[Y] = 0.3 900 + 25 = 0.09 225 = 295c = 20.25c So the mean cost of making the contents of a jar of jam is $2.95 and the standard deviation is 20·25 = 4.5cents. (d) For identically distributed independent random variables X1, X2, ……….Xn, each with mean , and standard deviation : E[X1, + X2, ……….+ Xn] = E[X1] + E[X2] ……….+ E[Xn] = + +…………………..+ = n Var[X1, + X2, ……….+ Xn] = Var[X1] + Var[X2] ……….+ Var[Xn] = 2 + 2 +……………,……..+ 2 = n2 Example 1: Blocks of cheese have mean weight 5kg with a standard deviation of 0.5kg. A carton consists of 25 such blocks. What is the mean and standard deviation of the contents of a carton? Answer: Let X1, X2, ……….X25 be random variables representing the weights of blocks 1 to 25. Then each Xi is a random variable with = 5, 2 = 0.25. Take Y be a random variable representing the weight of the contents of a carton. Then Y = X1, + X2, ……….+ X25. E[Y] = E[X1, + X2, ……….+ X25] = E[X1] + E[X2] ……….+ E[X25] = 25 5 (assuming identical) = 125 Kg Var[Y] = Var[X1, + X2, ……….+ X25] = Var[X1] + Var[X2] ……….+ Var[X25] (assuming independent) = 25 0.25 (assuming identical) = 6.25 So y = 2.5 Example 2: Packets of 12 matchboxes have mean weight 125g and a standard of 10g. What is the mean and standard deviation of a single box? Answer: If X1, X2, ……….X12 represent the weights of the boxes then: E[X1, + X2, ……….+ X25] = 125 E[X1] + E[X2] ……….+ E[X25] = 125 12 = 125 = 10.4g, where is the mean weight of a single box. Var[X1, + X2, ……….+ X12] = 100 Var[X1] + Var[X2] ……….+ Var[X12] = 100 (assuming independent) 12 2 = 100 2 = 8.333 = 2.89g (2DP) where is the s.d. of the weight of a single box