1 00:00:00,700 --> 00:00:03,320 In this segment, we will derive the formula for the 2 00:00:03,320 --> 00:00:06,470 variance of the geometric PMF. 3 00:00:06,470 --> 00:00:09,470 The argument will be very much similar to the argument that 4 00:00:09,470 --> 00:00:13,110 we used to drive the expected value of the geometric PMF. 5 00:00:13,110 --> 00:00:15,970 And it relies on the memorylessness properties of 6 00:00:15,970 --> 00:00:18,040 geometric random variables. 7 00:00:18,040 --> 00:00:20,460 So let X be a geometric random variable with 8 00:00:20,460 --> 00:00:21,990 some parameter p. 9 00:00:21,990 --> 00:00:26,410 The way to think about X is like the number of coin flips 10 00:00:26,410 --> 00:00:29,850 that it takes until we obtain heads for the first time, 11 00:00:29,850 --> 00:00:33,360 where p is the probability of heads at each toss. 12 00:00:33,360 --> 00:00:36,340 Recall now the memorylessness property. 13 00:00:36,340 --> 00:00:38,930 If I tell you that X is bigger than 1-- 14 00:00:38,930 --> 00:00:42,540 which means that the first trial was a failure--- 15 00:00:42,540 --> 00:00:44,100 we obtained tails. 16 00:00:44,100 --> 00:00:48,640 Given that event, the remaining number of tosses has 17 00:00:48,640 --> 00:00:52,050 the same geometric PMF as if we were just 18 00:00:52,050 --> 00:00:53,740 starting at this time. 19 00:00:53,740 --> 00:00:57,570 So it has the same geometric PMF as the unconditional PMF 20 00:00:57,570 --> 00:01:01,380 of X. And this is the property that we exploited in order to 21 00:01:01,380 --> 00:01:04,370 find the expected value of X. 22 00:01:04,370 --> 00:01:08,480 Now let us take this observation and add one to the 23 00:01:08,480 --> 00:01:12,190 random variables involved and turn this statement to the 24 00:01:12,190 --> 00:01:14,060 following version. 25 00:01:14,060 --> 00:01:16,730 The conditional PMF of X-- 26 00:01:16,730 --> 00:01:20,030 which is this random variable plus 1-- 27 00:01:20,030 --> 00:01:23,670 is the same as the unconditional PMF of this 28 00:01:23,670 --> 00:01:25,630 random variable plus 1. 29 00:01:25,630 --> 00:01:30,260 So it's the same statement as before except that we added 1. 30 00:01:30,260 --> 00:01:33,360 One consequence of the memorylessness that we have 31 00:01:33,360 --> 00:01:37,410 already seen and exploited is that the expected value of X 32 00:01:37,410 --> 00:01:40,560 in the conditional universe where the first coin flip was 33 00:01:40,560 --> 00:01:43,560 wasted is equal to 1-- 34 00:01:43,560 --> 00:01:45,759 that's the wasted coin flip-- 35 00:01:45,759 --> 00:01:49,550 plus how long you expect to have to flip the coin until 36 00:01:49,550 --> 00:01:52,600 you obtain heads for the first time, starting 37 00:01:52,600 --> 00:01:54,950 from the second flip. 38 00:01:54,950 --> 00:01:59,009 Since the conditional distribution of X in this 39 00:01:59,009 --> 00:02:02,980 universe is the same as the unconditional distribution of 40 00:02:02,980 --> 00:02:06,140 this random variable, it means that the corresponding 41 00:02:06,140 --> 00:02:10,360 expected value in this universe is going to be equal 42 00:02:10,360 --> 00:02:12,890 to the expected value of this random variable, which is 1 43 00:02:12,890 --> 00:02:17,430 plus the expected value of X. And by exactly the same 44 00:02:17,430 --> 00:02:23,400 argument, the random variable X squared has the same 45 00:02:23,400 --> 00:02:28,800 distribution in the conditional universe as the 46 00:02:28,800 --> 00:02:33,400 random variable X plus 1 squared in the 47 00:02:33,400 --> 00:02:36,970 unconditional universe. 48 00:02:36,970 --> 00:02:40,079 So since X in the conditional universe has the same 49 00:02:40,079 --> 00:02:43,390 distribution as X plus 1, it means that X squared in the 50 00:02:43,390 --> 00:02:46,920 conditional universe has the same distribution as X plus 1 51 00:02:46,920 --> 00:02:50,510 squared in the unconditional universe. 52 00:02:50,510 --> 00:02:54,530 So now let us take those facts and use a divide and conquer 53 00:02:54,530 --> 00:02:59,690 method to calculate the expected value of X squared. 54 00:02:59,690 --> 00:03:04,120 We will use exactly the same method that we used in order 55 00:03:04,120 --> 00:03:06,430 to calculate the expected value. 56 00:03:06,430 --> 00:03:08,880 We separate into two scenarios. 57 00:03:08,880 --> 00:03:11,850 In one scenario, X is equal to 1. 58 00:03:11,850 --> 00:03:15,730 And then we have the expected value of X squared given that 59 00:03:15,730 --> 00:03:18,220 X is equal to 1. 60 00:03:18,220 --> 00:03:21,060 And then we have another scenario-- 61 00:03:21,060 --> 00:03:23,900 the scenario that X is bigger than 1. 62 00:03:23,900 --> 00:03:28,340 And then we have the expected value of X squared given that 63 00:03:28,340 --> 00:03:30,579 X is bigger than 1. 64 00:03:30,579 --> 00:03:34,060 So this is just the total expectation theorem. 65 00:03:34,060 --> 00:03:35,790 Now let us calculate terms. 66 00:03:35,790 --> 00:03:39,230 The probability that the first toss results in success, that 67 00:03:39,230 --> 00:03:42,040 X is equal to 1-- this is p. 68 00:03:42,040 --> 00:03:46,680 And if X is equal to 1, then the value of X squared is also 69 00:03:46,680 --> 00:03:48,230 equal to 1. 70 00:03:48,230 --> 00:03:52,930 And then there is probability 1 minus p that the first trial 71 00:03:52,930 --> 00:03:54,070 was not a success. 72 00:03:54,070 --> 00:03:56,329 So we get to continue. 73 00:03:56,329 --> 00:03:58,700 We have this conditional expectation here. 74 00:03:58,700 --> 00:04:00,780 But it is equal to this unconditional 75 00:04:00,780 --> 00:04:02,650 expectation up there. 76 00:04:02,650 --> 00:04:07,740 And now let us expand the terms in this quadratic and 77 00:04:07,740 --> 00:04:13,070 write this as expected value of X squared plus twice the 78 00:04:13,070 --> 00:04:18,459 expected value of X plus 1. 79 00:04:18,459 --> 00:04:22,089 Now we know what this expected value here is. 80 00:04:22,089 --> 00:04:26,910 The expected value of a geometric is just 1/p. 81 00:04:26,910 --> 00:04:31,870 And what we're left with is an equation that involves a 82 00:04:31,870 --> 00:04:33,260 single unknown. 83 00:04:33,260 --> 00:04:36,150 Namely, this quantity is the unknown. 84 00:04:36,150 --> 00:04:39,390 And we can solve this linear equation for this unknown. 85 00:04:39,390 --> 00:04:42,500 We carry out some algebra, which is not so 86 00:04:42,500 --> 00:04:44,360 interesting by itself. 87 00:04:44,360 --> 00:04:49,500 And after we carry out the algebra, what we obtain is 88 00:04:49,500 --> 00:04:55,040 that the expected value of X squared is equal to 2 over p 89 00:04:55,040 --> 00:04:59,020 squared minus 1 over p. 90 00:04:59,020 --> 00:05:04,190 And then we use the formula that the variance of a random 91 00:05:04,190 --> 00:05:09,160 variable is equal to the expected value of the square 92 00:05:09,160 --> 00:05:13,570 of that random variable minus the square of 93 00:05:13,570 --> 00:05:16,120 the expected value. 94 00:05:16,120 --> 00:05:19,050 We already know what that expected value is. 95 00:05:19,050 --> 00:05:21,730 We found the expected value of the square. 96 00:05:21,730 --> 00:05:25,440 And putting all that together, we obtain a final answer. 97 00:05:25,440 --> 00:05:28,960 And this is the expression for the variance of a geometric 98 00:05:28,960 --> 00:05:31,100 random variable. 99 00:05:31,100 --> 00:05:34,090 It goes without saying that for this calculation to make 100 00:05:34,090 --> 00:05:37,530 sense, we need to assume that the parameter that we're 101 00:05:37,530 --> 00:05:39,430 dealing with is positive.