1 00:00:00,810 --> 00:00:04,620 We now study a model that involves the sum of 2 00:00:04,620 --> 00:00:08,140 independent random variables, but with a twist. 3 00:00:08,140 --> 00:00:12,300 It's going to be the sum of a random number of independent 4 00:00:12,300 --> 00:00:15,470 random variables, as opposed to a fixed number. 5 00:00:15,470 --> 00:00:19,440 This is a model that shows up in a variety of applications, 6 00:00:19,440 --> 00:00:23,580 but it will also help us fine tune our command of the law of 7 00:00:23,580 --> 00:00:27,280 iterated expectations, and the law of total variance. 8 00:00:27,280 --> 00:00:28,980 The story goes as follows-- 9 00:00:28,980 --> 00:00:32,420 you go shopping and you visit a number of stores, except 10 00:00:32,420 --> 00:00:35,590 that the number of stores that you will visit, is itself a 11 00:00:35,590 --> 00:00:37,330 random variable. 12 00:00:37,330 --> 00:00:39,060 At each one of the stores, you spend a 13 00:00:39,060 --> 00:00:40,230 certain amount of money. 14 00:00:40,230 --> 00:00:42,180 We denote it by Xi. 15 00:00:42,180 --> 00:00:45,610 And we make the assumption that the Xi's are drawn from a 16 00:00:45,610 --> 00:00:46,650 certain distribution. 17 00:00:46,650 --> 00:00:48,280 They're identically distributed. 18 00:00:48,280 --> 00:00:51,690 And they're independent of each other. 19 00:00:51,690 --> 00:00:55,110 We also make the assumption that the Xi's are independent 20 00:00:55,110 --> 00:00:59,780 of capital N. This means that no matter how many stores you 21 00:00:59,780 --> 00:01:05,960 visit, the Xi, the amount of money you spend in each one of 22 00:01:05,960 --> 00:01:09,789 the stores that you visit, is a random variable that's drawn 23 00:01:09,789 --> 00:01:12,930 from a common distribution, which does not change, no 24 00:01:12,930 --> 00:01:15,960 matter what capital N is. 25 00:01:15,960 --> 00:01:20,039 With these assumptions in place, let us now focus on the 26 00:01:20,039 --> 00:01:24,260 total amount of money that you're spending. 27 00:01:24,260 --> 00:01:27,450 This is the sum of random variables, but with the extra 28 00:01:27,450 --> 00:01:33,650 twist that the index goes up to capital N, which is itself 29 00:01:33,650 --> 00:01:36,020 a random variable. 30 00:01:36,020 --> 00:01:38,310 How do we deal with this situation? 31 00:01:38,310 --> 00:01:41,670 One approach that's always worth trying when faced with a 32 00:01:41,670 --> 00:01:45,000 complicated problem is to try to condition on some 33 00:01:45,000 --> 00:01:47,840 information that will make the problem easier. 34 00:01:47,840 --> 00:01:51,800 In this case, we can condition on the value of capital N 35 00:01:51,800 --> 00:01:56,650 taking a fixed specific value because in that case, we will 36 00:01:56,650 --> 00:01:59,630 be dealing with the sum of a finite number of random 37 00:01:59,630 --> 00:02:04,350 variables where that number is a fixed, specific number. 38 00:02:04,350 --> 00:02:07,100 And this is a situation we have encountered before and 39 00:02:07,100 --> 00:02:09,009 know how to deal with it. 40 00:02:09,009 --> 00:02:10,720 So let us get started. 41 00:02:10,720 --> 00:02:14,330 Let us calculate the expected value of Y, if we condition on 42 00:02:14,330 --> 00:02:15,670 the number of stores. 43 00:02:15,670 --> 00:02:17,850 Let's say, for example, someone tells us that we 44 00:02:17,850 --> 00:02:20,000 visited five stores. 45 00:02:20,000 --> 00:02:24,260 Then, the expected value of Y is going to be the expected 46 00:02:24,260 --> 00:02:29,490 value of the sum of the amount of money you spent in each one 47 00:02:29,490 --> 00:02:31,230 of those five stores. 48 00:02:31,230 --> 00:02:34,890 In our instance, it's that random variable, capital N. 49 00:02:34,890 --> 00:02:38,690 But since I told you that capital N takes a specific 50 00:02:38,690 --> 00:02:42,930 numerical value, this means that this instance of capital 51 00:02:42,930 --> 00:02:47,000 N, in the index of the summation, can be 52 00:02:47,000 --> 00:02:49,930 replaced by little n. 53 00:02:49,930 --> 00:02:54,620 If I tell you that capital N is equal to little n, then 54 00:02:54,620 --> 00:02:59,780 this number here, capital N, becomes the same as little n. 55 00:02:59,780 --> 00:03:04,350 Here we use now the assumption that capital N is independent 56 00:03:04,350 --> 00:03:06,010 from the Xi's. 57 00:03:06,010 --> 00:03:07,580 Here we have the sum of a fixed 58 00:03:07,580 --> 00:03:09,190 number of random variables. 59 00:03:09,190 --> 00:03:12,080 All of them are independent of capital N. 60 00:03:12,080 --> 00:03:15,330 If I give you some information on capital N, this does not 61 00:03:15,330 --> 00:03:19,490 change the distribution of the Xi's, so the conditioning does 62 00:03:19,490 --> 00:03:21,760 not affect the answer. 63 00:03:21,760 --> 00:03:25,310 The conditional expectation is going to be the same as the 64 00:03:25,310 --> 00:03:27,980 unconditional expectation. 65 00:03:27,980 --> 00:03:29,970 And now we have the expected value of a 66 00:03:29,970 --> 00:03:31,910 sum of random variables. 67 00:03:31,910 --> 00:03:36,160 Each one of them has a common expectation that's denoted 68 00:03:36,160 --> 00:03:37,740 with this notation. 69 00:03:37,740 --> 00:03:41,130 This is the common expected value of all the Xi's, and 70 00:03:41,130 --> 00:03:45,280 we're adding n of them, so we obtain n times this 71 00:03:45,280 --> 00:03:46,530 expectation. 72 00:03:48,490 --> 00:03:52,740 Now let us apply the total expectation theorem. 73 00:03:52,740 --> 00:03:56,720 We take the familiar form of the total expectation theorem, 74 00:03:56,720 --> 00:04:01,410 and in here, ' we can plug in the expression that we have 75 00:04:01,410 --> 00:04:07,960 just found, which is n times expected value of X. Now the 76 00:04:07,960 --> 00:04:10,770 expected value of X is just a number. 77 00:04:10,770 --> 00:04:13,520 And then we have this summation here, which we 78 00:04:13,520 --> 00:04:16,680 recognize to be just the definition of the expected 79 00:04:16,680 --> 00:04:18,800 value of N. 80 00:04:18,800 --> 00:04:22,190 And so we come to the conclusion that the expected 81 00:04:22,190 --> 00:04:25,590 amount of money that you will be spending is equal to the 82 00:04:25,590 --> 00:04:27,340 following product-- 83 00:04:27,340 --> 00:04:30,550 the expected number of stores that you visit times the 84 00:04:30,550 --> 00:04:32,790 expected amount of money that you will be 85 00:04:32,790 --> 00:04:34,760 spending in each store. 86 00:04:34,760 --> 00:04:37,690 This is a quite plausible answer. 87 00:04:37,690 --> 00:04:39,440 It makes sense. 88 00:04:39,440 --> 00:04:42,730 On the average, the amount of money you spend is equal to 89 00:04:42,730 --> 00:04:46,010 the average number of stores times the average amount of 90 00:04:46,010 --> 00:04:48,190 money in each store. 91 00:04:48,190 --> 00:04:50,930 So it is intuitively what you might expect. 92 00:04:50,930 --> 00:04:53,970 On the other hand, we know that reasoning "on the 93 00:04:53,970 --> 00:04:57,360 average" does not always give us the right answers. 94 00:04:57,360 --> 00:05:00,150 So it's important to corroborate this particular 95 00:05:00,150 --> 00:05:04,110 formula by working out a mathematical derivation. 96 00:05:04,110 --> 00:05:08,100 Now let us carry out a second mathematical derivation using 97 00:05:08,100 --> 00:05:11,580 the law of iterated expectations. 98 00:05:11,580 --> 00:05:14,690 To use the law of iterated expectations, we need to put 99 00:05:14,690 --> 00:05:17,040 our hands on this random variable-- 100 00:05:17,040 --> 00:05:20,470 the abstract conditional expectation. 101 00:05:20,470 --> 00:05:22,260 What is this object? 102 00:05:22,260 --> 00:05:25,680 It's a random variable that takes this value whenever 103 00:05:25,680 --> 00:05:28,300 capital N is equal to little n. 104 00:05:28,300 --> 00:05:32,670 So it's an object that takes this value whenever capital N 105 00:05:32,670 --> 00:05:34,790 is equal to little n. 106 00:05:34,790 --> 00:05:40,409 But that object is the same as this random variable because 107 00:05:40,409 --> 00:05:45,530 this is the random variable that takes the value here when 108 00:05:45,530 --> 00:05:48,470 capital N is equal to little n. 109 00:05:48,470 --> 00:05:52,280 Therefore, the abstract conditional expectation takes 110 00:05:52,280 --> 00:05:57,900 this particular form here, which we can substitute inside 111 00:05:57,900 --> 00:06:01,480 this expectation here. 112 00:06:01,480 --> 00:06:05,310 And now notice that the expected value of X is a 113 00:06:05,310 --> 00:06:08,190 constant, so it can be pulled outside this expectation. 114 00:06:08,190 --> 00:06:11,710 And we're left with a product of the expected value of N 115 00:06:11,710 --> 00:06:17,160 times the expected value of X. So this completes the 116 00:06:17,160 --> 00:06:21,980 derivation of the expected value of the sum of a random 117 00:06:21,980 --> 00:06:23,810 number of random variables.