1 00:00:03,240 --> 00:00:07,040 All of our examples so far have involved functions, g of 2 00:00:07,040 --> 00:00:11,050 x, that are monotonic in X, at least over the 3 00:00:11,050 --> 00:00:13,690 range of x's of interest. 4 00:00:13,690 --> 00:00:16,320 Let us now look at an example that involves a 5 00:00:16,320 --> 00:00:18,760 non-monotonic function. 6 00:00:18,760 --> 00:00:23,800 We're going to consider the square function, which has the 7 00:00:23,800 --> 00:00:25,980 shape shown in this diagram. 8 00:00:29,530 --> 00:00:33,610 And we'll assume that X has a general distribution so that 9 00:00:33,610 --> 00:00:37,760 it can take both positive and negative values. 10 00:00:37,760 --> 00:00:41,280 And so over the range of values of X, the function that 11 00:00:41,280 --> 00:00:44,970 we're dealing with is decreasing and then 12 00:00:44,970 --> 00:00:46,030 increasing. 13 00:00:46,030 --> 00:00:48,000 So it is not monotonic. 14 00:00:48,000 --> 00:00:51,040 How can we find the distribution of Y? 15 00:00:51,040 --> 00:00:54,600 As a warm-up, let's look at the discrete case. 16 00:00:54,600 --> 00:00:58,100 And as an example of the calculation, let us find the 17 00:00:58,100 --> 00:01:01,670 formula for the probability that the random variable Y 18 00:01:01,670 --> 00:01:03,550 takes a value of 9. 19 00:01:03,550 --> 00:01:06,070 This event can happen in two ways. 20 00:01:06,070 --> 00:01:10,530 It can happen if X is equal to 3. 21 00:01:10,530 --> 00:01:16,210 But it can also happen if x is equal to negative 3. 22 00:01:16,210 --> 00:01:21,150 And these are the two and only two ways that y can take a 23 00:01:21,150 --> 00:01:22,680 value of 9. 24 00:01:22,680 --> 00:01:24,900 We can generalize this calculation. 25 00:01:24,900 --> 00:01:28,060 The probability that the random variable y takes on a 26 00:01:28,060 --> 00:01:32,720 specific value little y, this probability can be found by 27 00:01:32,720 --> 00:01:36,539 adding the probabilities of all of the different x's that 28 00:01:36,539 --> 00:01:38,729 lead to this particular value. 29 00:01:38,729 --> 00:01:44,150 Now, for X squared to be equal to little y, we need to have X 30 00:01:44,150 --> 00:01:49,610 to be equal either to the positive square root of y or 31 00:01:49,610 --> 00:01:53,039 to be equal to the negative square root of y. 32 00:01:55,560 --> 00:01:59,750 And this is the general formula for the PMF of the 33 00:01:59,750 --> 00:02:04,900 random variable Y. And it involves two terms, because 34 00:02:04,900 --> 00:02:11,790 any given value of little y can happen in two ways, either 35 00:02:11,790 --> 00:02:18,270 by having X equal to the negative square root of y or 36 00:02:18,270 --> 00:02:25,020 by having X be equal to the positive square root of y. 37 00:02:25,020 --> 00:02:27,920 We have here a situation where the function that we're 38 00:02:27,920 --> 00:02:31,100 dealing with is not invertible. 39 00:02:31,100 --> 00:02:37,510 For a given value of y, we cannot find a single value of 40 00:02:37,510 --> 00:02:39,829 x that will lead to that y. 41 00:02:39,829 --> 00:02:44,910 But instead, we typically have two values of x that lead to 42 00:02:44,910 --> 00:02:48,350 that particular y, namely the positive and the negative 43 00:02:48,350 --> 00:02:51,430 square roots of y. 44 00:02:51,430 --> 00:02:55,000 So we cannot use the tools that we used before in the 45 00:02:55,000 --> 00:02:58,870 monotonic case, where we dealt with the inverse function. 46 00:02:58,870 --> 00:03:03,330 What we can do instead is to proceed from first principles 47 00:03:03,330 --> 00:03:11,860 and calculate the CDF of the random variable Y. The CDF of 48 00:03:11,860 --> 00:03:15,320 Y is the probability that the random variable is less than 49 00:03:15,320 --> 00:03:18,050 or equal to a certain number. 50 00:03:18,050 --> 00:03:21,690 And we're going to focus only on the case where that certain 51 00:03:21,690 --> 00:03:24,079 number is non-negative. 52 00:03:24,079 --> 00:03:27,900 If little y is negative, then we know that this probability 53 00:03:27,900 --> 00:03:32,170 is going to be 0, because the random variable Y cannot take 54 00:03:32,170 --> 00:03:34,840 negative values. 55 00:03:34,840 --> 00:03:38,790 Now, this is the probability that the random variable X 56 00:03:38,790 --> 00:03:41,980 squared is less than or equal to y. 57 00:03:41,980 --> 00:03:45,960 So what we did here is to express this event in terms of 58 00:03:45,960 --> 00:03:49,900 the original random variable, capital X, whose PDF is 59 00:03:49,900 --> 00:03:52,050 presumably available. 60 00:03:52,050 --> 00:03:57,190 Now, this event is the same as requiring the absolute value 61 00:03:57,190 --> 00:04:02,160 of X to be less than or equal to the square root of y. 62 00:04:02,160 --> 00:04:06,950 And this event, again, is the same as having the random 63 00:04:06,950 --> 00:04:12,620 variable X be between the negative and the positive 64 00:04:12,620 --> 00:04:15,980 square root of y. 65 00:04:15,980 --> 00:04:21,100 In terms of a picture, the random variable capital Y 66 00:04:21,100 --> 00:04:25,130 takes a value less than or equal to this particular 67 00:04:25,130 --> 00:04:30,990 little y if and only if the random variable x falls inside 68 00:04:30,990 --> 00:04:33,580 this range. 69 00:04:33,580 --> 00:04:36,770 Now, we want to express this probability in terms of the 70 00:04:36,770 --> 00:04:41,890 CDF of X. The probability that we're looking at, the 71 00:04:41,890 --> 00:04:47,690 probability of this interval, is equal to the probability 72 00:04:47,690 --> 00:04:53,659 that x is less than or equal to the square root of y. 73 00:04:53,659 --> 00:04:57,000 This is the probability from minus infinity up to the 74 00:04:57,000 --> 00:04:58,480 square root of y. 75 00:04:58,480 --> 00:05:01,540 But from this, we need to subtract the probability of 76 00:05:01,540 --> 00:05:03,690 this interval. 77 00:05:03,690 --> 00:05:09,910 And that would be the CDF of the random variable x up to 78 00:05:09,910 --> 00:05:10,770 the point [negative] 79 00:05:10,770 --> 00:05:13,040 square root of y. 80 00:05:13,040 --> 00:05:17,010 So we now have an expression for the CDF of Y in terms of 81 00:05:17,010 --> 00:05:22,650 the CDF of X. At this point, now we can take derivatives 82 00:05:22,650 --> 00:05:25,300 and use the chain rule. 83 00:05:25,300 --> 00:05:30,570 The PDF of Y is going to be equal to the derivative of 84 00:05:30,570 --> 00:05:32,480 this expression. 85 00:05:32,480 --> 00:05:36,550 The derivative of the first term, by the chain rule, is 86 00:05:36,550 --> 00:05:43,080 the PDF of X, evaluated at the square root of y times the 87 00:05:43,080 --> 00:05:48,120 derivative of this argument with respect to y, which is 1 88 00:05:48,120 --> 00:05:52,280 over 2 square root of y. 89 00:05:52,280 --> 00:05:55,770 And then we need the derivative of the second term. 90 00:05:55,770 --> 00:06:02,230 We have a minus sign, then the derivative of the CDF 91 00:06:02,230 --> 00:06:04,070 which is the PDF. 92 00:06:04,070 --> 00:06:07,150 Evaluate it at minus square root of y. 93 00:06:07,150 --> 00:06:11,230 And then the derivative of this term with respect to y, 94 00:06:11,230 --> 00:06:18,450 which is minus 1 over two square root of y. 95 00:06:22,340 --> 00:06:26,030 Now, we have a minus sign here and a minus sign there. 96 00:06:26,030 --> 00:06:28,880 So the two cancel out. 97 00:06:28,880 --> 00:06:33,720 We can get rid of this minus 1 term and change this minus 98 00:06:33,720 --> 00:06:35,020 into a plus. 99 00:06:35,020 --> 00:06:38,390 And this is the final form of the answer. 100 00:06:38,390 --> 00:06:42,730 So we see that the PDF of Y evaluated at a particular 101 00:06:42,730 --> 00:06:44,520 point, which tells us something about the 102 00:06:44,520 --> 00:06:48,620 probability that the random variable takes values around 103 00:06:48,620 --> 00:06:52,490 this point, has to do with the probabilities that the random 104 00:06:52,490 --> 00:06:58,796 variable X takes values around here or around there. 105 00:06:58,796 --> 00:07:03,080 There are two contributions, and this is because there are 106 00:07:03,080 --> 00:07:09,340 two different ways that a value of y may occur, either X 107 00:07:09,340 --> 00:07:12,160 falling here or X falling there.