1 00:00:00,000 --> 00:00:00,390 2 00:00:00,390 --> 00:00:01,170 Hi. 3 00:00:01,170 --> 00:00:03,250 In this problem, we'll get some practice working with 4 00:00:03,250 --> 00:00:08,000 PDFs and also using PDFs to calculate CDFs. 5 00:00:08,000 --> 00:00:11,170 So the PDF that we're given in this problem is here. 6 00:00:11,170 --> 00:00:13,390 So we have a random variable, z, which is a continuous 7 00:00:13,390 --> 00:00:14,250 random variable. 8 00:00:14,250 --> 00:00:17,550 And we're told that the PDF of this random variable, z, is 9 00:00:17,550 --> 00:00:21,790 given by gamma times 1 plus z squared in the range of z 10 00:00:21,790 --> 00:00:23,480 between negative 2 and 1. 11 00:00:23,480 --> 00:00:26,520 And outside of this range, it's 0. 12 00:00:26,520 --> 00:00:29,850 All right, so first thing we need to do and the first part 13 00:00:29,850 --> 00:00:32,420 of this problem is we need to figure out what gamma is 14 00:00:32,420 --> 00:00:35,250 because it's not really a fully specified PDF yet. 15 00:00:35,250 --> 00:00:37,490 We need to figure out exactly what the value gamma is. 16 00:00:37,490 --> 00:00:38,620 And how do we do that? 17 00:00:38,620 --> 00:00:40,670 Well, we've done analogous things before for 18 00:00:40,670 --> 00:00:42,360 the discrete case. 19 00:00:42,360 --> 00:00:46,200 So the tool that we use is that the PDF must 20 00:00:46,200 --> 00:00:47,130 integrate to 1. 21 00:00:47,130 --> 00:00:50,240 So in the discrete case, the analogy was that the PMF had 22 00:00:50,240 --> 00:00:52,140 to sum to 1. 23 00:00:52,140 --> 00:00:53,150 So what do we know? 24 00:00:53,150 --> 00:00:56,380 We know that when you integrate this PDF from 25 00:00:56,380 --> 00:01:04,330 negative infinity to infinity, fz of z, it has to equal 1. 26 00:01:04,330 --> 00:01:07,050 All right, so what do we do now? 27 00:01:07,050 --> 00:01:09,300 Well, we know what the PDF is-- 28 00:01:09,300 --> 00:01:11,880 partially, except for gamma-- so let's plug that in. 29 00:01:11,880 --> 00:01:15,150 And the first thing that we'll do is we'll simplify this 30 00:01:15,150 --> 00:01:20,440 because we know that the PDF is actually only non-zero in 31 00:01:20,440 --> 00:01:21,580 the range negative 2 to 1. 32 00:01:21,580 --> 00:01:23,900 So instead of integrating from negative infinity to infinity, 33 00:01:23,900 --> 00:01:26,580 we'll just integrate from negative 2 to 1. 34 00:01:26,580 --> 00:01:30,190 And now let's plug in this gamma times 1 35 00:01:30,190 --> 00:01:34,380 plus z squared dc. 36 00:01:34,380 --> 00:01:36,610 And now the rest of the problem is just applying 37 00:01:36,610 --> 00:01:38,350 calculus and integrating this. 38 00:01:38,350 --> 00:01:42,480 So let's just go through that process. 39 00:01:42,480 --> 00:01:50,720 So we get z plus 1/3 z cubed from minus 2 to 1. 40 00:01:50,720 --> 00:01:53,340 And now we'll plug in the limits. 41 00:01:53,340 --> 00:02:02,280 And we get gamma, and that's 1 plus 1/3 minus minus 2 plus 42 00:02:02,280 --> 00:02:04,816 1/3 times minus 2 cubed. 43 00:02:04,816 --> 00:02:08,470 44 00:02:08,470 --> 00:02:13,980 And then if we add this all up, you get 4/3 plus 2 plus 45 00:02:13,980 --> 00:02:17,130 8/3, which will give you 6. 46 00:02:17,130 --> 00:02:22,280 So what we end up with in the end is that 1 47 00:02:22,280 --> 00:02:23,690 is equal to 6 gamma. 48 00:02:23,690 --> 00:02:24,640 So what does that tell us? 49 00:02:24,640 --> 00:02:29,110 That tells us that, in this case, gamma is 1/6. 50 00:02:29,110 --> 00:02:32,030 51 00:02:32,030 --> 00:02:37,420 OK, so we've actually figured out what this PDF really is. 52 00:02:37,420 --> 00:02:41,870 And let's just substitute that in. 53 00:02:41,870 --> 00:02:46,610 So we know what gamma is. 54 00:02:46,610 --> 00:02:48,970 So it's 1/6. 55 00:02:48,970 --> 00:02:52,190 So from this PDF, we can calculate anything 56 00:02:52,190 --> 00:02:53,430 that we want to. 57 00:02:53,430 --> 00:02:56,930 This PDF, basically, fully specifies everything that we 58 00:02:56,930 --> 00:02:59,420 need to know about this random variable, z. 59 00:02:59,420 --> 00:03:00,980 And one of the things that we can calculate from 60 00:03:00,980 --> 00:03:03,520 the PDF is the CDF. 61 00:03:03,520 --> 00:03:05,830 So the next part of the problem asks us to 62 00:03:05,830 --> 00:03:07,460 calculate the CDF. 63 00:03:07,460 --> 00:03:13,350 So remember the CDF, we use capital F. And the definition 64 00:03:13,350 --> 00:03:19,630 is that you integrate from negative infinity to this z. 65 00:03:19,630 --> 00:03:20,650 And what do you integrate? 66 00:03:20,650 --> 00:03:22,120 You integrate the PDF. 67 00:03:22,120 --> 00:03:26,580 And all use some dummy variable, y, here in the 68 00:03:26,580 --> 00:03:28,420 integration. 69 00:03:28,420 --> 00:03:29,510 So what is it really doing? 70 00:03:29,510 --> 00:03:33,130 It's basically just taking the PDF and taking everything to 71 00:03:33,130 --> 00:03:33,650 the left of it. 72 00:03:33,650 --> 00:03:38,920 So another way to think about this-- this is the probability 73 00:03:38,920 --> 00:03:42,290 that the random variable is less than or equal 74 00:03:42,290 --> 00:03:44,620 to some little z. 75 00:03:44,620 --> 00:03:48,020 It's just accumulating probability as you go from 76 00:03:48,020 --> 00:03:49,270 left to right. 77 00:03:49,270 --> 00:03:51,580 78 00:03:51,580 --> 00:03:54,120 So the hardest part about calculating the CDFs, really, 79 00:03:54,120 --> 00:03:59,710 is actually just keeping track of the ranges, because unless 80 00:03:59,710 --> 00:04:03,340 the PDF is really simple, you'll have cases where the 81 00:04:03,340 --> 00:04:06,820 PDF cold be 0 in some ranges and non-zero in other ranges. 82 00:04:06,820 --> 00:04:09,710 And then what you really have to keep track of is where 83 00:04:09,710 --> 00:04:12,800 those ranges are and where you actually have non-zero 84 00:04:12,800 --> 00:04:14,040 probability. 85 00:04:14,040 --> 00:04:17,120 So in this case, we actually break things down into three 86 00:04:17,120 --> 00:04:21,370 different ranges because this PDF actually looks 87 00:04:21,370 --> 00:04:24,600 something like this. 88 00:04:24,600 --> 00:04:31,060 So it's non-zero between negative 2 and 1, and it's 0 89 00:04:31,060 --> 00:04:33,250 everywhere else. 90 00:04:33,250 --> 00:04:35,700 So then what that means is that our job is a little 91 00:04:35,700 --> 00:04:40,070 simpler because everything to the left of negative 2, the 92 00:04:40,070 --> 00:04:42,510 CDF will be 0 because there's no probability 93 00:04:42,510 --> 00:04:44,190 density to the left. 94 00:04:44,190 --> 00:04:49,710 And then everything to the right of 1, well we've 95 00:04:49,710 --> 00:04:52,780 accumulated all the probability in the PDF because 96 00:04:52,780 --> 00:04:55,640 we know that when you integrate from negative 2 to 97 00:04:55,640 --> 00:04:57,060 1, you capture everything. 98 00:04:57,060 --> 00:05:00,510 So anything to the right of 1, the CDF will be 1. 99 00:05:00,510 --> 00:05:05,370 So the only hard part is calculating what the CDF is in 100 00:05:05,370 --> 00:05:08,390 this intermediate range, between negative 2 and 1. 101 00:05:08,390 --> 00:05:10,300 So let's do that case first-- 102 00:05:10,300 --> 00:05:17,910 so the case of z is between negative 2 and 1. 103 00:05:17,910 --> 00:05:22,850 104 00:05:22,850 --> 00:05:24,980 So what is the CDF in that case? 105 00:05:24,980 --> 00:05:32,690 Well, the definition is to integrate from negative 106 00:05:32,690 --> 00:05:34,190 infinity to z. 107 00:05:34,190 --> 00:05:37,610 But we know that everything to the left of negative 2, 108 00:05:37,610 --> 00:05:39,010 there's no probably density. 109 00:05:39,010 --> 00:05:40,550 So we don't need to include that. 110 00:05:40,550 --> 00:05:43,340 So we can actually change this lower limit to negative 2. 111 00:05:43,340 --> 00:05:48,500 And the upper limit is wherever this z is. 112 00:05:48,500 --> 00:05:51,410 So that becomes our integral. 113 00:05:51,410 --> 00:05:53,560 And the inside is still the PDF. 114 00:05:53,560 --> 00:05:56,550 So let's just plug that in. 115 00:05:56,550 --> 00:06:00,680 We know that it's 1/6 1 plus-- 116 00:06:00,680 --> 00:06:04,620 we'll make this y squared-- 117 00:06:04,620 --> 00:06:07,130 by. 118 00:06:07,130 --> 00:06:09,910 And now it's just calculus again. 119 00:06:09,910 --> 00:06:12,800 And in fact, it's more or less the same integral, so what we 120 00:06:12,800 --> 00:06:22,370 get is y plus 1/3 y cubed from negative 2 to z. 121 00:06:22,370 --> 00:06:24,760 Notice the only thing that's different here is that we're 122 00:06:24,760 --> 00:06:30,180 integrating from negative 2 to z instead of negative 2 to 1. 123 00:06:30,180 --> 00:06:37,360 And when we calculate this out, what we get is z plus 1/3 124 00:06:37,360 --> 00:06:48,520 z cubed minus minus 2 plus 1/3 minus 2 cubed, which gives us 125 00:06:48,520 --> 00:07:01,976 1/6 z plus 1/3 z cubed plus plus 2 plus 8/3 gives us 14/3. 126 00:07:01,976 --> 00:07:06,470 127 00:07:06,470 --> 00:07:10,730 So that actually is our CDF between the range of 128 00:07:10,730 --> 00:07:12,660 negative 2 to 1. 129 00:07:12,660 --> 00:07:15,450 So for full completeness, let's actually write out the 130 00:07:15,450 --> 00:07:20,950 entire CDF, because there's two other parts in the CDF. 131 00:07:20,950 --> 00:07:26,380 So the first part is that it's 0 if z is less 132 00:07:26,380 --> 00:07:28,530 than negative 2. 133 00:07:28,530 --> 00:07:34,850 And it's 1 if z is greater than 1. 134 00:07:34,850 --> 00:07:37,190 And in between, it's this thing that we've just 135 00:07:37,190 --> 00:07:37,340 calculated. 136 00:07:37,340 --> 00:07:55,240 So it's 1/6 z plus 1/3 z cubed plus 14/3 if z is between 137 00:07:55,240 --> 00:07:58,410 minus 2 and 1. 138 00:07:58,410 --> 00:08:00,650 So that is our final answer. 139 00:08:00,650 --> 00:08:03,170 140 00:08:03,170 --> 00:08:07,400 So the main point of this problem was to drill a little 141 00:08:07,400 --> 00:08:10,400 bit more the concepts of PDFs and CDFs. 142 00:08:10,400 --> 00:08:13,320 So for the PDF, the important thing to remember is that in 143 00:08:13,320 --> 00:08:16,970 order to be a valid PDF, the PDF has to integrate to 1. 144 00:08:16,970 --> 00:08:19,790 And you can use that fact to help you calculate any unknown 145 00:08:19,790 --> 00:08:21,450 constants in the PDF. 146 00:08:21,450 --> 00:08:24,980 And then to calculate the CDF, it's just integrating the PDF 147 00:08:24,980 --> 00:08:27,490 from negative infinity to whatever point that you want 148 00:08:27,490 --> 00:08:28,290 to cut off at. 149 00:08:28,290 --> 00:08:31,270 And the tricky part, as I said earlier, was really just 150 00:08:31,270 --> 00:08:32,230 keeping track of the ranges. 151 00:08:32,230 --> 00:08:34,159 In this case, we've broke it down into three ranges. 152 00:08:34,159 --> 00:08:37,120 If we had a slightly more complicated PDF, then you 153 00:08:37,120 --> 00:08:40,710 would have to keep track of even more ranged. 154 00:08:40,710 --> 00:08:42,429 All right, so I hope that was helpful, and we'll 155 00:08:42,429 --> 00:08:43,679 see you next time. 156 00:08:43,679 --> 00:08:44,579