1 00:00:00,440 --> 00:00:03,540 Our discussion of random variable so far has involved 2 00:00:03,540 --> 00:00:06,700 nothing but standard probability calculations. 3 00:00:06,700 --> 00:00:09,780 Other than using the PMF notation, we have 4 00:00:09,780 --> 00:00:11,240 done nothing new. 5 00:00:11,240 --> 00:00:14,670 It is now time to introduce a truly new concept that plays a 6 00:00:14,670 --> 00:00:17,250 central role in probability theory. 7 00:00:17,250 --> 00:00:20,750 This is the concept of the expected value or expectation 8 00:00:20,750 --> 00:00:23,220 or mean of a random variable. 9 00:00:23,220 --> 00:00:26,930 It is a single number that provides some kind of summary 10 00:00:26,930 --> 00:00:29,590 of a random variable by telling us what 11 00:00:29,590 --> 00:00:31,430 it is on the average. 12 00:00:31,430 --> 00:00:34,000 Let us motivate with an example. 13 00:00:34,000 --> 00:00:36,820 You play a game of chance over and over, let 14 00:00:36,820 --> 00:00:39,120 us say 1,000 times. 15 00:00:39,120 --> 00:00:43,910 Each time that you play, you win an amount of money, which 16 00:00:43,910 --> 00:00:47,350 is a random variable, and that random variable takes the 17 00:00:47,350 --> 00:00:50,640 value 1, with probability 2/10, the value of 2, with 18 00:00:50,640 --> 00:00:55,140 probability 5/10, the value of 4, with probability 3/10. 19 00:00:55,140 --> 00:00:58,920 You can plot the PMF of this random variable. 20 00:00:58,920 --> 00:01:03,720 It takes values 1, 2, and 4. 21 00:01:03,720 --> 00:01:06,810 And the associated probabilities are 22 00:01:06,810 --> 00:01:16,050 2/10, 5/10, and 3/10. 23 00:01:22,330 --> 00:01:25,860 How much do you expect to have at the end of the day? 24 00:01:25,860 --> 00:01:29,170 Well, if you interpret probabilities as frequencies, 25 00:01:29,170 --> 00:01:36,820 in a thousand plays, you expect to have about 200 times 26 00:01:36,820 --> 00:01:42,650 this outcome to occur and this outcome about 500 times and 27 00:01:42,650 --> 00:01:46,160 this outcome about 300 times. 28 00:01:46,160 --> 00:01:52,670 So your average gain is expected to be your total 29 00:01:52,670 --> 00:01:59,800 gain, which is 1, 200 times, plus 2, 500 30 00:01:59,800 --> 00:02:05,110 times, plus 4, 300 times. 31 00:02:05,110 --> 00:02:06,430 This is your total gain. 32 00:02:06,430 --> 00:02:10,720 And to get to the average gain, you divide by 1,000. 33 00:02:10,720 --> 00:02:14,400 And the expression that you get can also be written in a 34 00:02:14,400 --> 00:02:25,480 simpler form as 1 times 2/10 plus 2 times 5/10 35 00:02:25,480 --> 00:02:29,880 plus 4 times 3/10. 36 00:02:29,880 --> 00:02:34,010 So this is what you expect to get, on the average, if you 37 00:02:34,010 --> 00:02:35,340 keep playing that game. 38 00:02:38,470 --> 00:02:40,170 What have we done? 39 00:02:40,170 --> 00:02:44,640 We have calculated a certain quantity which is a sort of 40 00:02:44,640 --> 00:02:48,690 average of the random variable of interest. 41 00:02:48,690 --> 00:02:53,720 And what we did in this summation here, we took each 42 00:02:53,720 --> 00:02:57,320 one of the possible values of the random variable. 43 00:02:57,320 --> 00:02:59,470 Each possible value corresponds to 44 00:02:59,470 --> 00:03:01,610 one term in the summation. 45 00:03:01,610 --> 00:03:05,260 And what we're adding is the numerical value of the random 46 00:03:05,260 --> 00:03:08,970 variable times the probability that this 47 00:03:08,970 --> 00:03:13,060 particular value is obtained. 48 00:03:13,060 --> 00:03:18,040 So when x is equal to 1, we get 1 here and then the 49 00:03:18,040 --> 00:03:20,140 probability of 1. 50 00:03:20,140 --> 00:03:23,890 When we add the term corresponding to x equals 2, 51 00:03:23,890 --> 00:03:28,320 we get little x equals to 2 and next to it the probability 52 00:03:28,320 --> 00:03:32,090 that x is equal to 2, and so on. 53 00:03:32,090 --> 00:03:36,010 So this is what we call the expected value of the random 54 00:03:36,010 --> 00:03:38,010 variable x. 55 00:03:38,010 --> 00:03:40,820 This is the formula that defines it, but it's also 56 00:03:40,820 --> 00:03:44,170 important to always keep in mind the interpretation of 57 00:03:44,170 --> 00:03:45,250 that formula. 58 00:03:45,250 --> 00:03:48,880 The expected value of a random variable is to be interpreted 59 00:03:48,880 --> 00:03:53,980 as the average that you expect to see in a large number of 60 00:03:53,980 --> 00:03:58,460 independent repetitions of the experiment. 61 00:03:58,460 --> 00:04:03,100 One small technical caveat, if we're dealing with a random 62 00:04:03,100 --> 00:04:07,780 variable that takes values in a discrete but infinite set, 63 00:04:07,780 --> 00:04:11,110 this sum here is going to be an infinite sum 64 00:04:11,110 --> 00:04:12,990 or an infinite series. 65 00:04:12,990 --> 00:04:16,320 And there's always a question whether an infinite series has 66 00:04:16,320 --> 00:04:19,380 a well-defined limit or not. 67 00:04:19,380 --> 00:04:24,640 In order for it to have a well-defined limit, we will be 68 00:04:24,640 --> 00:04:30,450 making the assumption that this infinite series is, as 69 00:04:30,450 --> 00:04:34,480 it's called, absolutely convergent, namely that if we 70 00:04:34,480 --> 00:04:37,159 replace the x's by their absolute values-- 71 00:04:37,159 --> 00:04:40,510 so we're adding positive numbers, 72 00:04:40,510 --> 00:04:42,020 or nonnegative numbers-- 73 00:04:42,020 --> 00:04:45,150 the sum of those numbers is going to be finite. 74 00:04:45,150 --> 00:04:48,330 So this is a technical condition that we need in 75 00:04:48,330 --> 00:04:52,060 order to make sure that this expected value is a 76 00:04:52,060 --> 00:04:54,200 well-defined and finite quantity. 77 00:04:57,930 --> 00:05:00,790 Let us now calculate the expected value of a very 78 00:05:00,790 --> 00:05:04,160 simple random variable, the Bernoulli random variable that 79 00:05:04,160 --> 00:05:07,770 takes the value 1 with probability p and the value 0 80 00:05:07,770 --> 00:05:10,300 with probability 1 minus p. 81 00:05:10,300 --> 00:05:15,320 The expected value consists of two terms. 82 00:05:15,320 --> 00:05:17,180 X can take the value 1. 83 00:05:17,180 --> 00:05:19,040 This happens with probability p. 84 00:05:19,040 --> 00:05:21,540 Or it can take the value of zero. 85 00:05:21,540 --> 00:05:24,300 This happens with probability 1 minus p. 86 00:05:24,300 --> 00:05:29,450 And therefore, the expected value is just equal to p. 87 00:05:29,450 --> 00:05:34,409 As a special case, we may consider the situation where X 88 00:05:34,409 --> 00:05:38,630 is the indicator random variable of a certain event, 89 00:05:38,630 --> 00:05:47,450 A, so that X is equal to 1 if and only if event A occurs. 90 00:05:47,450 --> 00:05:51,530 In this case, the probability that X equals to 1, which is 91 00:05:51,530 --> 00:05:54,670 our parameter p, is the same as the probability 92 00:05:54,670 --> 00:05:56,480 that event A occurs. 93 00:05:56,480 --> 00:06:00,170 And we have this relation. 94 00:06:00,170 --> 00:06:02,920 And so with this correspondence, we readily 95 00:06:02,920 --> 00:06:06,840 conclude that the expected value of an indicator random 96 00:06:06,840 --> 00:06:12,070 variable is equal to the probability of that event. 97 00:06:12,070 --> 00:06:15,120 Let us move now to the calculation of the expected 98 00:06:15,120 --> 00:06:18,720 value of a uniform random variable. 99 00:06:18,720 --> 00:06:21,000 Let us consider, to keep things simple, a random 100 00:06:21,000 --> 00:06:26,750 variable which is uniform on the set from 0 to n. 101 00:06:26,750 --> 00:06:30,020 It's uniform, so the probability of the values that 102 00:06:30,020 --> 00:06:33,590 it can take are all equal to each other. 103 00:06:33,590 --> 00:06:37,550 It can take one of n plus 1 possible values, and so the 104 00:06:37,550 --> 00:06:41,860 probability of each one of the values is 1 over n plus 1. 105 00:06:41,860 --> 00:06:43,909 We want to calculate the expected value 106 00:06:43,909 --> 00:06:45,330 of this random variable. 107 00:06:45,330 --> 00:06:46,870 How do we proceed? 108 00:06:46,870 --> 00:06:49,730 We just recall the definition of the expectation. 109 00:06:49,730 --> 00:06:54,090 It's a sum where we add over all of the possible values. 110 00:06:54,090 --> 00:06:57,159 And for each one of the values, we multiply by its 111 00:06:57,159 --> 00:06:58,409 corresponding probability. 112 00:07:04,270 --> 00:07:06,935 So we obtain a summation of this form. 113 00:07:09,970 --> 00:07:15,370 We can factor out a factor of 1 over n plus 1, and we're 114 00:07:15,370 --> 00:07:20,930 left with 0 plus 1 plus all the way up to n. 115 00:07:20,930 --> 00:07:25,840 And perhaps you remember the formula for us summing those 116 00:07:25,840 --> 00:07:34,020 numbers, and it is n times n plus 1 over 2. 117 00:07:34,020 --> 00:07:37,590 And after doing the cancellations, we obtain a 118 00:07:37,590 --> 00:07:41,060 final answer, which is n over 2. 119 00:07:41,060 --> 00:07:46,790 Incidentally, notice that n over 2 is just the midpoint of 120 00:07:46,790 --> 00:07:50,909 this picture that we have here in this diagram. 121 00:07:50,909 --> 00:07:52,850 This is always the case. 122 00:07:52,850 --> 00:07:58,030 Whenever we have a PMF which is symmetric around a certain 123 00:07:58,030 --> 00:08:00,940 point, then the expected value will be 124 00:08:00,940 --> 00:08:03,060 the center of symmetry. 125 00:08:03,060 --> 00:08:07,060 More general, if you do not have symmetry, the expected 126 00:08:07,060 --> 00:08:11,900 value turns out to be the center of gravity of the PMF. 127 00:08:11,900 --> 00:08:15,600 If you think of these bars as having weight, where the 128 00:08:15,600 --> 00:08:18,770 weight is proportional to their height, the center of 129 00:08:18,770 --> 00:08:22,750 gravity is the point at which you should put your finger if 130 00:08:22,750 --> 00:08:25,490 you want to balance that diagram so that it doesn't 131 00:08:25,490 --> 00:08:30,060 fall in one direction or the other. 132 00:08:30,060 --> 00:08:33,289 And we now close this segment by providing one more 133 00:08:33,289 --> 00:08:36,039 interpretation of expectations. 134 00:08:36,039 --> 00:08:39,130 Suppose that we have a class consisting of n students and 135 00:08:39,130 --> 00:08:41,740 that the ith student has a weight which 136 00:08:41,740 --> 00:08:44,730 is some number xi. 137 00:08:44,730 --> 00:08:47,600 We have a probabilistic experiment where we pick one 138 00:08:47,600 --> 00:08:51,170 of the students at random, and each student is equally likely 139 00:08:51,170 --> 00:08:53,820 to be picked as any other student. 140 00:08:53,820 --> 00:08:56,650 And we're interested in the random variable X, which is 141 00:08:56,650 --> 00:08:59,970 the weight of the student that was selected. 142 00:08:59,970 --> 00:09:02,300 To keep things simple, we will assume that the 143 00:09:02,300 --> 00:09:05,690 xi's are all distinct. 144 00:09:05,690 --> 00:09:11,540 And we first find the PMF of this random variable. 145 00:09:11,540 --> 00:09:16,110 Any particular xi that this possible is associated to 146 00:09:16,110 --> 00:09:18,620 exactly one student, because we assumed that 147 00:09:18,620 --> 00:09:20,460 the xi's are distinct. 148 00:09:20,460 --> 00:09:24,140 So this probability would be the probability or selecting 149 00:09:24,140 --> 00:09:29,770 the ith student, and that probability is 1 over n. 150 00:09:29,770 --> 00:09:33,230 And now we can proceed and calculate the expected value 151 00:09:33,230 --> 00:09:38,470 of the random variable X. This random variable X takes 152 00:09:38,470 --> 00:09:43,340 values, and the values that it takes are the xi's. 153 00:09:43,340 --> 00:09:48,540 A particular xi would be associated with a probability 154 00:09:48,540 --> 00:09:53,840 1 over n, and we're adding over all the i's or over all 155 00:09:53,840 --> 00:09:55,040 of the students. 156 00:09:55,040 --> 00:09:58,330 And so this is the expected value. 157 00:09:58,330 --> 00:10:03,910 What we have here is just the average of the weights of the 158 00:10:03,910 --> 00:10:06,060 students in this class. 159 00:10:06,060 --> 00:10:10,360 So the expected value in this particular experiment can be 160 00:10:10,360 --> 00:10:14,550 interpreted as the true average over the entire 161 00:10:14,550 --> 00:10:17,550 population of the students. 162 00:10:17,550 --> 00:10:19,400 Of course, here we're talking about two 163 00:10:19,400 --> 00:10:21,730 different kinds of averages. 164 00:10:21,730 --> 00:10:25,280 In some sense, we're thinking of expected values as the 165 00:10:25,280 --> 00:10:28,540 average in a large number of repetitions of experiments. 166 00:10:28,540 --> 00:10:32,040 But here we have another interpretation as the average 167 00:10:32,040 --> 00:10:34,040 over a particular population.