1 00:00:00,260 --> 00:00:02,730 We now introduce a new of random variable, the 2 00:00:02,730 --> 00:00:04,520 exponential random variable. 3 00:00:04,520 --> 00:00:07,360 It has a probability density function that is determined by 4 00:00:07,360 --> 00:00:10,740 a single parameter lambda, which is a positive number. 5 00:00:10,740 --> 00:00:14,250 And the form of the PDF is as shown here. 6 00:00:14,250 --> 00:00:18,340 Note that the PDF is equal to 0 when x is negative, which 7 00:00:18,340 --> 00:00:21,510 means that negative values of X will not occur. 8 00:00:21,510 --> 00:00:23,240 They have zero probability. 9 00:00:23,240 --> 00:00:25,590 And so our random variable is a 10 00:00:25,590 --> 00:00:28,360 non-negative random variable. 11 00:00:28,360 --> 00:00:31,360 The shape of the PDF is as shown in this diagram. 12 00:00:31,360 --> 00:00:34,740 It's 0 for negative values, and then for positive values, 13 00:00:34,740 --> 00:00:39,300 it starts off, it starts off at a value equal to lambda. 14 00:00:39,300 --> 00:00:42,620 This is because if you plug in x equal to 0 in this 15 00:00:42,620 --> 00:00:47,680 expression, you get lambda times e to the 0, which leaves 16 00:00:47,680 --> 00:00:49,170 you just with lambda. 17 00:00:49,170 --> 00:00:52,230 So it starts off with lambda, and then it decays 18 00:00:52,230 --> 00:00:54,200 at the rate of lambda. 19 00:00:54,200 --> 00:00:57,760 Notice that when lambda is small, the initial value of 20 00:00:57,760 --> 00:00:59,360 the PDF is small. 21 00:00:59,360 --> 00:01:03,140 But then the decay rate is also small, so that the PDF 22 00:01:03,140 --> 00:01:06,280 extends over a large range of x's. 23 00:01:06,280 --> 00:01:11,190 On the other hand, when lambda is large, then the PDF starts 24 00:01:11,190 --> 00:01:13,940 large, so there's a fair amount of probability in the 25 00:01:13,940 --> 00:01:15,390 vicinity of 0. 26 00:01:15,390 --> 00:01:18,789 But then it decays pretty fast, so there's much less 27 00:01:18,789 --> 00:01:22,560 probability for larger values of x. 28 00:01:22,560 --> 00:01:25,300 Another observation to make is that the shape of this 29 00:01:25,300 --> 00:01:28,770 exponential PDF is quite similar to the shape of the 30 00:01:28,770 --> 00:01:32,550 geometric PDF that we have seen before, the only 31 00:01:32,550 --> 00:01:36,280 difference being that here we have a discrete distribution, 32 00:01:36,280 --> 00:01:39,650 but here we have a continuous analog of that distribution. 33 00:01:42,150 --> 00:01:45,229 Let's now carry out a calculation. 34 00:01:45,229 --> 00:01:50,050 Let us fix some positive number a, and let us calculate 35 00:01:50,050 --> 00:01:53,550 the probability that our random variable takes a value 36 00:01:53,550 --> 00:01:56,390 larger than or equal to a. 37 00:01:56,390 --> 00:01:59,720 So what we're trying to do is to calculate the probability 38 00:01:59,720 --> 00:02:02,160 that the random variable falls inside this 39 00:02:02,160 --> 00:02:04,890 interval from a to infinity. 40 00:02:04,890 --> 00:02:08,630 Whenever we have a PDF, we can calculate the probability of 41 00:02:08,630 --> 00:02:13,660 falling inside an interval by integrating over that interval 42 00:02:13,660 --> 00:02:14,910 the value of the PDF. 43 00:02:17,540 --> 00:02:19,470 Therefore, we have to calculate 44 00:02:19,470 --> 00:02:21,790 this particular integral. 45 00:02:21,790 --> 00:02:26,140 And at this point, we can recall a fact from calculus, 46 00:02:26,140 --> 00:02:35,860 namely that the integral of the function e to the ax is 1 47 00:02:35,860 --> 00:02:39,030 over a times e to the ax. 48 00:02:39,030 --> 00:02:45,070 We can use this fact by making the correspondence between a 49 00:02:45,070 --> 00:02:46,445 and minus lambda. 50 00:02:49,210 --> 00:02:52,680 And using this correspondence, we can now continue the 51 00:02:52,680 --> 00:02:54,640 calculation of our integral. 52 00:02:54,640 --> 00:02:56,829 We have a factor of lambda. 53 00:02:56,829 --> 00:02:59,850 And then a factor of 1 over a, where a 54 00:02:59,850 --> 00:03:02,840 stands for minus lambda. 55 00:03:02,840 --> 00:03:06,030 So we get the minus 1 over lambda. 56 00:03:06,030 --> 00:03:08,840 And then the same exponential function, e to the 57 00:03:08,840 --> 00:03:10,830 minus lambda x. 58 00:03:10,830 --> 00:03:14,070 And because the range of integration is from a to 59 00:03:14,070 --> 00:03:19,060 infinity, we need to evaluate the integral at a and infinity 60 00:03:19,060 --> 00:03:20,930 and take the difference. 61 00:03:20,930 --> 00:03:23,000 Now, this lambda cancels that lambda. 62 00:03:23,000 --> 00:03:25,270 We're left with a minus sign. 63 00:03:25,270 --> 00:03:29,710 And from the upper limit, we get e to the minus lambda 64 00:03:29,710 --> 00:03:31,790 times infinity. 65 00:03:31,790 --> 00:03:34,780 And then from the second term, we have a minus sign that 66 00:03:34,780 --> 00:03:38,810 cancels with that minus sign and gives us a plus term, plus 67 00:03:38,810 --> 00:03:42,360 e to the minus lambda a. 68 00:03:42,360 --> 00:03:47,680 Now, e to the minus infinity is 0. 69 00:03:47,680 --> 00:03:51,160 And so we're left just with the last term. 70 00:03:51,160 --> 00:03:55,370 And the answer is e to the minus lambda a. 71 00:03:55,370 --> 00:03:59,480 So this gives us the tail probability for an exponential 72 00:03:59,480 --> 00:04:02,660 random variable. 73 00:04:02,660 --> 00:04:05,630 It tells us that the probability of falling higher 74 00:04:05,630 --> 00:04:09,120 than a certain number falls off exponentially with that 75 00:04:09,120 --> 00:04:11,430 certain number. 76 00:04:11,430 --> 00:04:13,960 An interesting additional observation-- 77 00:04:13,960 --> 00:04:20,225 if we let a equal to 0 in this calculation, we obtain the 78 00:04:20,225 --> 00:04:25,050 integral of the PDF over the entire range of x's. 79 00:04:25,050 --> 00:04:27,780 And in that case, this probability becomes e to the 80 00:04:27,780 --> 00:04:30,570 minus lambda 0, which is equal to 1. 81 00:04:30,570 --> 00:04:37,380 So we have indeed verified that the integral of this PDF 82 00:04:37,380 --> 00:04:39,880 is equal to 1, as it should be. 83 00:04:43,390 --> 00:04:46,110 Now, let's move to the calculation of the expected 84 00:04:46,110 --> 00:04:48,980 value of this random variable. 85 00:04:48,980 --> 00:04:51,920 We can use the definition. 86 00:04:51,920 --> 00:04:58,340 Since the PDF is non-zero only for positive values of x, we 87 00:04:58,340 --> 00:05:00,860 only need to integrate from 0 to infinity. 88 00:05:00,860 --> 00:05:03,775 We integrate x times the PDF. 89 00:05:07,420 --> 00:05:10,510 And this is an integral that you may have encountered at 90 00:05:10,510 --> 00:05:11,860 some point before. 91 00:05:11,860 --> 00:05:15,230 It is evaluated by using integration by parts. 92 00:05:15,230 --> 00:05:20,570 And the final answer turns out to be 1 over lambda. 93 00:05:20,570 --> 00:05:24,600 Regarding the calculation of the expected value of the 94 00:05:24,600 --> 00:05:28,520 square of the random variable, we need to write down a 95 00:05:28,520 --> 00:05:30,710 similar integral, except that now we 96 00:05:30,710 --> 00:05:32,300 will have here x squared. 97 00:05:35,590 --> 00:05:39,980 This is just another integration by parts, only a 98 00:05:39,980 --> 00:05:41,670 little more tedious. 99 00:05:41,670 --> 00:05:47,670 And the answer turns out to be 2 over lambda squared. 100 00:05:47,670 --> 00:05:52,600 Finally, to calculate the variance, we use the handy 101 00:05:52,600 --> 00:05:54,170 formula that we have. 102 00:06:02,120 --> 00:06:05,540 And the expected value of X squared is this term. 103 00:06:05,540 --> 00:06:08,060 The expected value of X is this term. 104 00:06:08,060 --> 00:06:11,520 When we square it, it becomes similar to this term, but we 105 00:06:11,520 --> 00:06:12,930 have here a 2. 106 00:06:12,930 --> 00:06:14,180 There we have a 1. 107 00:06:14,180 --> 00:06:19,080 And so we're left with just 1 over lambda squared. 108 00:06:19,080 --> 00:06:21,020 And this is the variance of the 109 00:06:21,020 --> 00:06:22,970 exponential random variable. 110 00:06:22,970 --> 00:06:28,290 Notice that when lambda is small, the PDF, as we 111 00:06:28,290 --> 00:06:32,330 discussed before, falls off very slowly, which means that 112 00:06:32,330 --> 00:06:35,290 large x's are also quite possible. 113 00:06:35,290 --> 00:06:39,360 And so the average of this random variable will be on the 114 00:06:39,360 --> 00:06:40,990 higher side. 115 00:06:40,990 --> 00:06:44,350 The PDF extends over a large range, and that translates 116 00:06:44,350 --> 00:06:46,440 into having a large mean. 117 00:06:46,440 --> 00:06:50,650 And because when that happens, the PDF actually spreads, the 118 00:06:50,650 --> 00:06:52,710 variance also increases. 119 00:06:52,710 --> 00:06:55,190 And this is reflected in this formula for the variance. 120 00:06:58,170 --> 00:07:01,410 The exponential random variable is, in many ways, 121 00:07:01,410 --> 00:07:03,200 similar to the geometric. 122 00:07:03,200 --> 00:07:06,630 For example, the expression for the mean, which is 1 over 123 00:07:06,630 --> 00:07:11,310 lambda, can be contrasted with the expression for the mean of 124 00:07:11,310 --> 00:07:14,770 the geometric, which is 1 over p. 125 00:07:18,120 --> 00:07:21,570 And the relationship between these two distributions, the 126 00:07:21,570 --> 00:07:24,400 discrete and the continuous analog, is a theme that we 127 00:07:24,400 --> 00:07:26,930 will revisit several times. 128 00:07:26,930 --> 00:07:30,520 At this point, let me just say that the exponential random 129 00:07:30,520 --> 00:07:34,400 variable is used to model many important 130 00:07:34,400 --> 00:07:36,490 and real world phenomena. 131 00:07:36,490 --> 00:07:40,050 Generally, it models the time that we have to wait until 132 00:07:40,050 --> 00:07:41,500 something happens. 133 00:07:41,500 --> 00:07:44,220 In the discrete case, the geometric random variable 134 00:07:44,220 --> 00:07:48,150 models the time until we see a success for the first time. 135 00:07:48,150 --> 00:07:51,850 In the continuous case, an exponential can be used to 136 00:07:51,850 --> 00:07:56,140 model the time until a customer arrives, the time 137 00:07:56,140 --> 00:08:00,390 until a light bulb burns out, the time until a machine 138 00:08:00,390 --> 00:08:05,300 breaks down, the time until you receive an email, or maybe 139 00:08:05,300 --> 00:08:08,240 the time until a meteorite falls on your house.