1 00:00:01,120 --> 00:00:05,080 We now continue the study of the sum of a random number of 2 00:00:05,080 --> 00:00:07,310 independent random variables. 3 00:00:07,310 --> 00:00:10,640 We already figured out what is the expected value of this 4 00:00:10,640 --> 00:00:13,820 sum, and we found a fairly simple answer. 5 00:00:13,820 --> 00:00:17,480 When it comes to the variance, however, it's pretty hard to 6 00:00:17,480 --> 00:00:20,570 guess what the answer will be, and it turns out that the 7 00:00:20,570 --> 00:00:22,700 answer is not as simple. 8 00:00:22,700 --> 00:00:25,830 So this is what we will try to calculate now. 9 00:00:25,830 --> 00:00:30,560 The way to proceed will be to use the law of total variance, 10 00:00:30,560 --> 00:00:34,350 which effectively breaks down the problem by conditioning on 11 00:00:34,350 --> 00:00:36,510 the value of the random variable capital 12 00:00:36,510 --> 00:00:40,520 N. So let us start. 13 00:00:40,520 --> 00:00:44,540 We have already figured out that if I tell you the value 14 00:00:44,540 --> 00:00:48,210 of capital N, then the expected value of the random 15 00:00:48,210 --> 00:00:51,550 variable Y is just this number, capital N, the number 16 00:00:51,550 --> 00:00:54,430 of stores you are visiting, times how much you are 17 00:00:54,430 --> 00:00:58,110 spending in each one of the stores. 18 00:00:58,110 --> 00:01:02,280 Using this information, we can now calculate this term, the 19 00:01:02,280 --> 00:01:05,680 variance of the conditional expectation. 20 00:01:05,680 --> 00:01:07,130 What is it? 21 00:01:07,130 --> 00:01:13,045 It's the variance of capital N times the expected value of X. 22 00:01:13,045 --> 00:01:16,720 Now, the expected value of X is a constant, and when we 23 00:01:16,720 --> 00:01:19,700 multiply a random variable with a constant, what that 24 00:01:19,700 --> 00:01:24,200 does to the variance is it multiplies the variance with 25 00:01:24,200 --> 00:01:26,000 the square of that constant. 26 00:01:30,640 --> 00:01:34,789 And this gives us this term in the law of total variance. 27 00:01:34,789 --> 00:01:39,820 Let us now work towards the second term. 28 00:01:39,820 --> 00:01:43,680 If I tell you the number of stores, then the random 29 00:01:43,680 --> 00:01:48,000 variable Y is just a sum of a given 30 00:01:48,000 --> 00:01:50,950 number of random variables. 31 00:01:50,950 --> 00:01:55,720 And as we discussed before, the conditioning that we have 32 00:01:55,720 --> 00:02:02,170 here may be eliminated because these random variables are now 33 00:02:02,170 --> 00:02:05,690 independent of this random variable, capital N. Their 34 00:02:05,690 --> 00:02:10,440 distribution does not change based on this information, and 35 00:02:10,440 --> 00:02:13,870 so we obtain the unconditional variance. 36 00:02:13,870 --> 00:02:17,340 Now, the unconditional variance of a sum of n random 37 00:02:17,340 --> 00:02:22,570 variables is just n times the variance of each one of them, 38 00:02:22,570 --> 00:02:26,500 which we denote with this notation. 39 00:02:26,500 --> 00:02:29,040 Now, let us take this equality, which is an equality 40 00:02:29,040 --> 00:02:33,110 between numbers, and it's true for any particular choice of 41 00:02:33,110 --> 00:02:35,750 little n, and turn it into an equality 42 00:02:35,750 --> 00:02:38,240 between random variables. 43 00:02:38,240 --> 00:02:42,050 This is the random variable that takes this specific value 44 00:02:42,050 --> 00:02:44,850 when capital N is equal to little n. 45 00:02:44,850 --> 00:02:48,500 So this is a random variable that takes this specific value 46 00:02:48,500 --> 00:02:52,829 when capital N is equal to little n, but this is also the 47 00:02:52,829 --> 00:02:57,400 same as this random variable, n times the variance of X, 48 00:02:57,400 --> 00:03:00,430 because this random variable takes this particular 49 00:03:00,430 --> 00:03:04,860 numerical value when capital N is equal to little n. 50 00:03:04,860 --> 00:03:08,680 Now that we have an expression for the conditional variance 51 00:03:08,680 --> 00:03:12,210 as a random variable, we can take the next step and 52 00:03:12,210 --> 00:03:16,640 calculate the expected value of the conditional variance. 53 00:03:16,640 --> 00:03:22,720 The expected value of the conditional variance is simply 54 00:03:22,720 --> 00:03:25,160 the expected value of this expression that we 55 00:03:25,160 --> 00:03:26,700 calculated up here. 56 00:03:30,340 --> 00:03:34,280 And now the variance of X is a constant and can be pulled 57 00:03:34,280 --> 00:03:37,850 outside the expectation, which leaves us with 58 00:03:37,850 --> 00:03:40,145 this expression here. 59 00:03:43,610 --> 00:03:47,770 Now that we have calculated both terms that go into the 60 00:03:47,770 --> 00:03:51,829 law of total variance, we can add these two terms. 61 00:03:51,829 --> 00:03:57,050 We have one contribution from here, this is this term, and 62 00:03:57,050 --> 00:04:01,410 another contribution from here, which is this term. 63 00:04:01,410 --> 00:04:05,250 What this expression tells us is that the variance of the 64 00:04:05,250 --> 00:04:08,595 total amount that you spend, which is a certain measure of 65 00:04:08,595 --> 00:04:11,090 the amount of randomness in how much you are spending 66 00:04:11,090 --> 00:04:13,990 overall, this amount of randomness 67 00:04:13,990 --> 00:04:16,130 is due to two causes. 68 00:04:16,130 --> 00:04:20,690 One cause is the randomness that there is in how much 69 00:04:20,690 --> 00:04:24,850 money you spend in any given store, and that's captured by 70 00:04:24,850 --> 00:04:29,330 the variance of X. It's the variance of the distribution 71 00:04:29,330 --> 00:04:32,880 of the amount of money that you spend in a typical store. 72 00:04:32,880 --> 00:04:36,030 But there is another source of randomness, and that source of 73 00:04:36,030 --> 00:04:39,020 randomness comes from the fact that the number of stores 74 00:04:39,020 --> 00:04:43,710 itself is random, and this gives us this contribution to 75 00:04:43,710 --> 00:04:45,450 the variance of Y. 76 00:04:45,450 --> 00:04:49,890 By taking into account these two sources of randomness, we 77 00:04:49,890 --> 00:04:52,750 can figure out the overall variance of the random 78 00:04:52,750 --> 00:04:57,120 variable Y. As you can see, this is a formula that would 79 00:04:57,120 --> 00:05:01,880 be hard to guess by just reasoning intuitively. 80 00:05:01,880 --> 00:05:06,190 And so it's a demonstration of the power of the law of the 81 00:05:06,190 --> 00:05:07,440 total variance.