1 00:00:00,990 --> 00:00:04,200 We will now go through another example to consolidate our 2 00:00:04,200 --> 00:00:07,580 intuition about the content of the law of iterated 3 00:00:07,580 --> 00:00:10,710 expectations and the law of the total variance. 4 00:00:10,710 --> 00:00:12,760 The example is as follows. 5 00:00:12,760 --> 00:00:16,250 We have a class, and that class consists of 30 students 6 00:00:16,250 --> 00:00:19,650 in total who are divided into sections-- 7 00:00:19,650 --> 00:00:22,490 the first and the second section. 8 00:00:22,490 --> 00:00:26,150 Let xi be the score of students i, let's say the 9 00:00:26,150 --> 00:00:28,550 final grade in the class. 10 00:00:28,550 --> 00:00:31,900 We consider the following probabilistic experiment. 11 00:00:31,900 --> 00:00:35,090 We pick a student at random, uniformly, so that each 12 00:00:35,090 --> 00:00:37,620 student is equally likely to be picked. 13 00:00:37,620 --> 00:00:39,720 And we define two random variables-- 14 00:00:39,720 --> 00:00:43,210 X is a numerical random variable that gives us the 15 00:00:43,210 --> 00:00:45,180 score of the selected student. 16 00:00:45,180 --> 00:00:48,890 So if student i is selected, the value of the random 17 00:00:48,890 --> 00:00:52,460 variable capital X is xi. 18 00:00:52,460 --> 00:00:57,350 And capital Y is defined as the random variable, which is 19 00:00:57,350 --> 00:01:00,350 the section of the selected student, so that y takes 20 00:01:00,350 --> 00:01:03,610 values 1 or 2. 21 00:01:03,610 --> 00:01:05,120 We're given some information. 22 00:01:05,120 --> 00:01:07,310 For the first section, the average of the 23 00:01:07,310 --> 00:01:09,270 student scores is 90. 24 00:01:09,270 --> 00:01:11,150 For the second section, the average of the 25 00:01:11,150 --> 00:01:14,000 student scores is 60. 26 00:01:14,000 --> 00:01:18,980 Given that information, what is the expected value of the 27 00:01:18,980 --> 00:01:21,520 student score? 28 00:01:21,520 --> 00:01:25,520 Well, each student is equally likely to be picked, so has 29 00:01:25,520 --> 00:01:28,450 probability 1 over 30 to be picked. 30 00:01:28,450 --> 00:01:33,630 And this multiplies the score of the student, so this is the 31 00:01:33,630 --> 00:01:37,560 expected value of the random variable of interest. 32 00:01:37,560 --> 00:01:38,860 What is this number? 33 00:01:38,860 --> 00:01:41,910 Well, we need to calculate the sum of the xi's. 34 00:01:41,910 --> 00:01:48,600 The sum of the first 10 xi's is equal to 90 times 10, and 35 00:01:48,600 --> 00:01:51,690 the sum of the xi's in the other section is 36 00:01:51,690 --> 00:01:53,515 equal to 60 times 20. 37 00:01:56,590 --> 00:01:58,910 And we carry out the calculation, and we find that 38 00:01:58,910 --> 00:02:01,050 the answer is 70. 39 00:02:01,050 --> 00:02:02,816 Now let us look at conditional expectations. 40 00:02:05,700 --> 00:02:08,840 If Y is equal to 1, this means that a student from section 41 00:02:08,840 --> 00:02:10,460 one was picked. 42 00:02:10,460 --> 00:02:14,920 And within that section, each student is equally likely to 43 00:02:14,920 --> 00:02:18,200 be picked, so the outcome of this random variable is 44 00:02:18,200 --> 00:02:20,850 equally likely to be any one of these xi's. 45 00:02:20,850 --> 00:02:24,170 Each xi gets picked with probability of 1 over 10. 46 00:02:24,170 --> 00:02:28,950 And so, the expected value of this random variable is 90. 47 00:02:28,950 --> 00:02:32,990 Similarly for the second section, the expected value of 48 00:02:32,990 --> 00:02:35,750 the score of a randomly selected student, given that 49 00:02:35,750 --> 00:02:38,930 the student belongs in that section, is equal to 60. 50 00:02:41,810 --> 00:02:45,200 With this information available, now we can describe 51 00:02:45,200 --> 00:02:47,690 the abstract conditional expectation, 52 00:02:47,690 --> 00:02:49,340 which is a random variable. 53 00:02:49,340 --> 00:02:54,410 This random variable takes the value of 90 if a student from 54 00:02:54,410 --> 00:02:57,920 the first section was picked, and the value of 60 if a 55 00:02:57,920 --> 00:03:00,350 student from the second section was picked. 56 00:03:00,350 --> 00:03:03,360 What is the probability of this event that the student 57 00:03:03,360 --> 00:03:05,310 from the first section was picked? 58 00:03:05,310 --> 00:03:09,710 Given that the first section has 10 out of a total of 30 59 00:03:09,710 --> 00:03:13,840 students, this probability is 1/3, and therefore, this 60 00:03:13,840 --> 00:03:16,210 probability is 2/3. 61 00:03:16,210 --> 00:03:18,610 Now that we have the distribution of this random 62 00:03:18,610 --> 00:03:22,230 variable, we can calculate the expected value of this random 63 00:03:22,230 --> 00:03:31,460 variable, which is 1/3 times 90 plus 2/3 times 60. 64 00:03:31,460 --> 00:03:36,800 And this number evaluates to 70, which of course, it's no 65 00:03:36,800 --> 00:03:39,710 coincidence, it's the same as the average 66 00:03:39,710 --> 00:03:41,320 over the entire class. 67 00:03:41,320 --> 00:03:43,980 By the law of iterated expectations, we know that 68 00:03:43,980 --> 00:03:47,490 this quantity should be the same as this quantity. 69 00:03:47,490 --> 00:03:50,550 So the law of iterated expectations allows us to 70 00:03:50,550 --> 00:03:56,515 calculate the overall average in the entire class by taking 71 00:03:56,515 --> 00:04:01,840 the section averages, and weigh them according to the 72 00:04:01,840 --> 00:04:04,790 sizes of the different sections. 73 00:04:04,790 --> 00:04:07,950 It's a divide and conquer method, and it is similar to 74 00:04:07,950 --> 00:04:11,470 what we have been doing when we use the total expectation 75 00:04:11,470 --> 00:04:14,210 theorem to divide and conquer. 76 00:04:14,210 --> 00:04:17,570 We continue with our example, and here is a summary of what 77 00:04:17,570 --> 00:04:18,850 we found so far. 78 00:04:18,850 --> 00:04:21,649 The conditional expectation is a random variable that takes 79 00:04:21,649 --> 00:04:24,630 these two values with certain probabilities. 80 00:04:24,630 --> 00:04:28,790 And the mean of this random variable is equal to 70. 81 00:04:28,790 --> 00:04:30,890 Let us now calculate the variance 82 00:04:30,890 --> 00:04:32,740 of this random variable. 83 00:04:32,740 --> 00:04:37,430 This random variable, with probability 1/3, takes a value 84 00:04:37,430 --> 00:04:43,210 90, which is this much away from the mean of this random 85 00:04:43,210 --> 00:04:45,610 variable, which we square. 86 00:04:45,610 --> 00:04:51,050 And with probability 2/3, it takes a value of 60, which is 87 00:04:51,050 --> 00:04:54,460 this much away from the mean of the random variable. 88 00:04:54,460 --> 00:04:56,440 We square this, as well. 89 00:04:56,440 --> 00:04:59,330 And when we carry out the calculation, we find that this 90 00:04:59,330 --> 00:05:02,580 number is equal to 200. 91 00:05:02,580 --> 00:05:03,850 Let us now continue. 92 00:05:03,850 --> 00:05:09,630 And suppose that somebody gave us this piece of information. 93 00:05:09,630 --> 00:05:13,440 For the first section, this is the deviation of the i-th 94 00:05:13,440 --> 00:05:16,800 student from the mean of that section. 95 00:05:16,800 --> 00:05:20,380 So this is the sum of the squares of the deviations and 96 00:05:20,380 --> 00:05:23,930 then we average over all the students. 97 00:05:23,930 --> 00:05:28,460 We will use this data to calculate certain quantities-- 98 00:05:28,460 --> 00:05:31,080 for example, the variance of the scores 99 00:05:31,080 --> 00:05:33,040 in the first section. 100 00:05:33,040 --> 00:05:37,409 Now in the first section, with probability 1/10, we pick the 101 00:05:37,409 --> 00:05:39,720 ith student that has this score. 102 00:05:39,720 --> 00:05:43,790 And this is the deviation of that student from the mean of 103 00:05:43,790 --> 00:05:45,220 that section. 104 00:05:45,220 --> 00:05:52,000 So this is the same as the mean squared deviation from 105 00:05:52,000 --> 00:05:55,090 the mean of the section. 106 00:05:55,090 --> 00:05:59,930 And this is exactly the variance within that section. 107 00:05:59,930 --> 00:06:02,600 It is the variance of the random variable, which is the 108 00:06:02,600 --> 00:06:07,630 score of a random student, given that we are selecting a 109 00:06:07,630 --> 00:06:09,970 student from the first section. 110 00:06:09,970 --> 00:06:12,050 For the second section, the story similar. 111 00:06:12,050 --> 00:06:16,000 We're given this information, and this tells us the variance 112 00:06:16,000 --> 00:06:20,040 of the student scores within the second section. 113 00:06:20,040 --> 00:06:24,490 So now we can describe the abstract conditional variance. 114 00:06:24,490 --> 00:06:28,840 It is a random variable that takes this value with 115 00:06:28,840 --> 00:06:32,500 probability equal to the probability of selecting 116 00:06:32,500 --> 00:06:35,790 someone from this section, which is 1/3. 117 00:06:35,790 --> 00:06:40,860 Or it takes a value of 20, which is the variance in the 118 00:06:40,860 --> 00:06:42,360 second section. 119 00:06:42,360 --> 00:06:46,940 And the second section is selected with probability 2/3. 120 00:06:46,940 --> 00:06:49,680 With this information at hand, now we can calculate the 121 00:06:49,680 --> 00:06:53,900 expected value of this random variable, which is 1/3 times 122 00:06:53,900 --> 00:06:59,784 10 plus 2/3 times 20, which is 50/3. 123 00:07:03,920 --> 00:07:08,600 At this point, we have the two quantities that are necessary 124 00:07:08,600 --> 00:07:11,570 to apply the law of total variance. 125 00:07:11,570 --> 00:07:14,750 According to the law of total variance, the variance of the 126 00:07:14,750 --> 00:07:19,690 student scores throughout the entire class is equal to this 127 00:07:19,690 --> 00:07:28,550 number, which is 50/3, plus this number, which is 200. 128 00:07:28,550 --> 00:07:32,290 And this is the overall variance. 129 00:07:32,290 --> 00:07:34,350 Now let us interpret the law of total 130 00:07:34,350 --> 00:07:36,880 variance in this context. 131 00:07:36,880 --> 00:07:39,290 The interpretation is as follows. 132 00:07:39,290 --> 00:07:43,159 The variance of the student scores in the entire class 133 00:07:43,159 --> 00:07:46,900 consists of two pieces. 134 00:07:46,900 --> 00:07:53,400 The first piece looks at the variance inside each section, 135 00:07:53,400 --> 00:07:56,180 which is 10 or 20, depending on which section 136 00:07:56,180 --> 00:07:57,190 we're looking at. 137 00:07:57,190 --> 00:08:00,800 And we take the average over the different sections. 138 00:08:00,800 --> 00:08:05,490 So we look at the variability of the scores within a typical 139 00:08:05,490 --> 00:08:10,030 section, and then we average over all the sections. 140 00:08:10,030 --> 00:08:15,190 The other term looks at the means in the different 141 00:08:15,190 --> 00:08:20,880 sections, and figures out how different are these means. 142 00:08:20,880 --> 00:08:26,280 How much do they vary from the overall class average? 143 00:08:26,280 --> 00:08:30,310 It measures the variability between different sections. 144 00:08:30,310 --> 00:08:34,570 So the overall randomness in the test scores can be broken 145 00:08:34,570 --> 00:08:38,150 down into two pieces of randomness. 146 00:08:38,150 --> 00:08:41,630 One source of randomness is that the different sections 147 00:08:41,630 --> 00:08:43,690 have different means. 148 00:08:43,690 --> 00:08:47,680 The other source of randomness is that inside each section, 149 00:08:47,680 --> 00:08:49,960 the students are different from the 150 00:08:49,960 --> 00:08:52,060 means of their section. 151 00:08:52,060 --> 00:08:55,490 And these two pieces of randomness together add up to 152 00:08:55,490 --> 00:08:59,460 the total randomness of the student scores as measured by 153 00:08:59,460 --> 00:09:01,080 the variance of the entire class.