 Good morning, we will discuss now functions of random variables or transformations of random variables. So, this is a topic that is motivated as follows. So, you may have a random variable which maps the sample space to the real line. However, you may be interested not the exact value of the random variable itself, but some function of it. So, you may measure x directly, but you may be interested in the distribution and statistical properties of let us say x square or log x or something like that, because your application may demand that log x is of more importance to you than x itself for example, that very often happens in applications in engineering and statistics. So, this is the motivation for studying functions of random variables. See you should recall that random variables are themselves functions. So, when we talk of functions of random variables, we are talking about composition of two functions. So, if you have some probability space omega f p and a random variable x is mapping omega 2 real line, such that pre images of Borel sets are f measurable. Now, you may be interested in some function of x. So, let us say that f is some function that takes values from r to r to begin with. So, what f does is it maps. So, this is another real line and this guy maps. So, this is x of omega and f will simply map. So, this is f. So, once omega realises x of omega is a fixed number and f will map that further to another point here, which is f of x of omega. Now, if you look at the overall mapping. So, if you do not look at this real line at all, this overall map will be f composition x. It looks as though you are mapping it twice. So, essentially when you are talking about function of a random variable, you are talking about composition of two functions from omega to r. So, the problem is. So, if you are given the probability law or the CDF of x, I want to determine the probability law or the CDF of f of x, f of capital x. Now, before that we must address whether this composed mapping f composition x, whether that is a random variable at all. So, if you want to speak about the distribution of x, we know how to do that. But, if you want to talk about the probability or CDF of f of x, we have to first establish that f of x is a random variable. What does that mean? It means that if I take Borel sets here, its pre image must be f measurable here. Only then this f of x a random variable by definition. If I just look at it as one mapping f composition x, under that composed mapping I must have pre images of Borel sets are image. Now, one see one sufficient condition for that to happen is that if f were to be a Borel measurable function, which means that if I have Borel sets here, its pre images here are Borel sets. Suppose that is the case, then the pre image of that will be an f measurable set. So, whenever f is a Borel measurable function, I will necessarily have f composition x is a it is a legitimate random variable. Is that clear to everyone? So, what I am saying is if f is Borel measurable, which means I e pre images of Borel sets are Borel sets. Then f composition x is a random variable on omega f p, agreed with that. What I am saying is f is a Borel measurable function or simply a Borel function. It is that is like saying that if you take any Borel set here, its pre image under f must be a Borel set on r. And of course, if you have a Borel set here, its pre image must be f measurable, because x is a random variable. So, is this statement with everyone? So, the problem is more precisely stated problem is if you have a Borel function f, f x is a random variable and I want to determine the probability law of f of x given the probability law of x. That is the problem confronting us. And now I mean this is you can even speak about now functions mapping r n through r m in general. You may for example, have n random variables x 1 through x n defined on omega f p and you may want to talk about f of x 1 x 2 x n. So, you may have let us say f is from let us say f is r n to r, it could just as well be r m. Then you have sample space then you have some r n here. So, you have some x 1 x 2 dot x n. So, you have a map from omega f p the same underline probability space is being mapped to some vector in r n. These guys are all random variables living in omega f p, which means that if you take Borel sets on r n their pre images are events f measurable. And now you have some function this could also be r m let me just draw f. So, this will be f of dot dot dot this will be f of x 1 x 2 x n of omega. So, here to you want to take any Borel set it is pre image must be a Borel set in r n. And of course, every Borel set in r n pre images event is an event. So, here to the same thing holds if f is Borel measurable then f of x 1 x 2 f f is Borel measurable then f of x 1 x 2 dot dot x n is a random variable on omega f p. Again here the question will be given the joint law of x 1 through x n what is the CDF of f of x 1 x 2 x n. So, that is that is what we are going to discuss. So, are there any questions on the setup everything so far. So, our agenda will be as follows first we will consider some special case of special cases of these functions. So, first you will consider maximum and minimum maximum and minimum of random variables which is actually fairly easy. Then we will consider sums of random variables because they are the maximum and some are like of great importance. And then we will consider general transformations some f some generic f. So, our agenda will be first we will discuss maximum and minimum then we will discuss sums of random variables. And finally, we will address more general transformations or more general functions. So, we will discuss maximum and minimum first let x 1 x 2 dot dot dot x n be random variables on omega f p with joint CDF capital F x 1 x 2 x n of little x 1 little x 2 little x n. Let y n is equal to min of z n is equal to max of. So, you are considering n random variables. So, a finite set of random variables x 1 through x n whose joint CDF is given to you. And you are looking at the min of this x 2 x 1 through x n and max of x 1 through x n. So, what does this mean for every omega. So, whenever omega realizes I have x 1 omega x 2 omega x n omega realizing as real numbers. For each such omega y n of omega will be the smallest of those numbers and z n of omega will be the largest of those numbers. So, for some particular omega x 3 may be the smallest, but for some other omega x 1 may be the smallest and similarly for z n. So, you are looking at the distribution of the smallest of these x i's and the largest of these x i's. So, now are these even random variables we have to see this is some function this is like that f of x 1 x 2 x n max is max of x 1 x 2 x n a measurable function or for that matter is min of x 1 x 2 x n a measurable function that is the question. Once we say yes it is a random variable then we can go ahead and talk about its CDF or probability law. So, we have to first establish that note that y n and z n are indeed random variables since. So, what do I have to show I have to show that pre images of Borel sets here but, here actually because this is such a simple function there is a easier way of doing this. So, for example, if I take let us say y n. So, the event if I take the event that y n of omega is less than or equal to little y. Well maybe I should do it for z n first little bit easier with the maximum let me do it with z n little z n little z. So, I want to show that that is z n is a random variable. So, if I show that this is an f measurable set I am done because this means that the pre image of the semi infinite interval here is impact an event any questions. So, if I show this is a valid event I am done, but z n is the. So, this is the event that this is the event that maximum of x 1 omega dot dot x n omega is less than or equal to little z. Next note that the maximum is less than or equal to little z is equal into saying that each 1 of them is less than or equal to z that is the key step. So, this is equal to the set of all omega's for which x 1 of omega is less than or equal to z and x 2 of omega less than or equal to z dot dot dot x n of omega less than or equal to z. So, when I write comma again I mean intersection what actually mean is intersection i equal to 1 to n omega such that x 1 of omega less than or equal to z and so on. So, what kind of a set is that. So, this is some semi infinite cuboid in r n and x 1 to x n are random variables and in r n if you take any semi infinite cuboid in r n it is pre image has to be f measurable y x 1 through x n are random variables correct. So, if x 1 through x n are random variables pre image of borel sets are f measurable in particular the semi infinite recta cuboids on r n are the generating class. So, their pre images are certainly. So, these are this is an f measurable set for sure right because x 1 through x n are random variables. So, this is an f measurable set correct are there any questions. So, max was very easy that is true, but every time. So, what you are saying is that z n is always one of the x i's, but it is the i will be different from different realization. So, what I am saying is that. So, if for some omega. So, for some particular omega it may be x 3, but for some other omega it may be x 5 right. So, the index of the maximum itself is a something random correct you cannot fix that index it is not as though a particular x i is always the maximum right correct. So, it is now you cannot claim that z n is always one of the x i's and x i is a random variable. So, z is a random variable that is not correct because it is true that z is always one of the x i's, but that i itself is random it becomes depends on omega correct. Yes, but it is enough to prove for the generating class they have pre images of semi infinite intervals are f measurable. Then you can show that pre measures of all Borel sets are f measurable. Now, similarly how will you show that y n is a random variable let us do this here how do you show f. So, y n. So, let us look at now I am going to look at y n of omega greater than z little y let us say. If this is an f measurable set then necessarily y n of omega less than or equal to y will be a measurable set because it is only the compliment right. And why am I taking greater here because I am dealing with the minimum right eventually I am going to write. So, I am going to write omega this is omega such that x 1 of omega greater than. So, well first I should write minimum x 1 omega dot x n omega greater than y right. And if you are saying that the minimum of all these guys is itself greater than y then each of them must be greater than y right the equivalent right. This is equivalent to saying that omega this is omega such that x 1 of omega greater than y comma x 2 of omega greater than y that dot x n of omega greater than y all right. So, again commas mean intersection. So, is this step clear this is the key step now. So, this is now this is an f measurable set right you are just this you can show us an f measurable set because this is like. So, this is like a semi infinite the cuboid, but it is pointing the other way right you can show this is a f measurable set. So, this is an event all right this is f measurable and again this is f measurable. So, we have proved that both y n and z n are valid random variables right. So, now our task is to determine the c d f of this z n y all right. So, let us. So, actually these expressions themselves provide a very easy way to calculate the c d f in fact. So, I know this is the event whose probability I am after all right my c d f is after all the p of this event correct. So, next f z n of z will be equal to probability that omega for which z n of omega less than or equal to little z that is equal to probability of omega for which x 1 of omega less than or equal to z dot dot dot x n of omega less than or equal to z right. So, I am just putting p here and p here right. Now, what is this do I know this I want this right do I know this this is the joint c d f evaluated at z z z z z right. So, this is equal to f x 1 x 2 dot x n of little z little z little z dot dot dot understand what I mean. So, you are given the joint c d f of x 1 through x n if you replace each of the arguments with z you will get the c d f of your maximum that clear. And similarly, I want to talk about the c d f of y what would I do I will do 1 minus this right or rather if I just take the probability of this event I will get 1 minus the c d f correct with the complementary c d f as it is called right. And so, I say f y n bar of y right this is complementary c d f right that is equal to 1 minus f n of y f y n of y rather that is equal to probability omega for which x 1 greater than y dot dot dot x n greater than y. Now, what is that it is not really 1 minus this is the right this is I mean this is really that. So, this is like the complementary joint c d f right which you can calculate from the joint c d f right. So, in the max you directly get c d f in terms of c d f here you get complementary c d f in terms of joint complementary c d f correct. So, maybe I should just write this as f bar x 1 through x n of y y y this is the joint complementary c d f. So, if you give me the c d f I can find the c d f of the maximum and minimum right. So, this is this assumes nothing further right this does not assume that x i's are when x i's can be any random variables they can be some of them could be discrete some of them you know it anything is possible you are just given some joint c d f right. I am not assuming anything further about what the whether they are discrete or continuous or otherwise or I am not even assuming anything about the joint distribution I am not assuming independence in particular right this is some arbitrary joint distribution. So, this is a completely general expression. However, if you consider the special case where x i's are independent x 1 x 2 x n are independent then these formula these all this formula will simplify right. So, in particular for example, for the maximum what would you get you have the joint c d f evaluated at z z z, but the joint c d f will factorize product out correct. So, this will become f x of z power n right. So, here again you will have the complimentary c d f to the nth power right in particular if x 1 x 2 dot x n are independent. So, first of all first let me do the case when they are independent. So, I will have f z n of z will be equal to product f x i of z z is equal to i is equal to 1 through n that correct. Because my joint c d f will factorize right further if x 1 to x n are independent and identically distributed i i d means this is the first time we are encountering this I think independent and identically distributed. It is just as the word says right if they are independent and they have the same c d f's which means all this f x is of z are the same function f x right with c d f f x then the maximum will be distributed as this will be simply the. So, all these are the same function now. So, now it will be nth power right. So, if they are independent you will multiply the c d f's if they are independent and identically distributed you will take nth power of the common c d f well I should say z here right. Similarly, you can do the same thing for the minimum. So, in this case what would you get you will get you will get f. So, the complementary c d f of y as the product of the complementary c d f of each of these x's and in the case when they are identically distributed you will have the nth power of the complementary c d f right. Next we have for the minimum we have f y n of y is the bar is equal to product. So, I am still with the independent case product i equals 1 through n it will be f x bar of f l f x i bar of y correct. So, because of this formula I had here and this f y f y f bar will product out the complementary c d f also product out right when x 1 to x n are independent f y n bar of y is equal to f x bar of y to the nth when x 1 to x n are independent and identically distribute i i d. So, far. So, let us consider one or two examples. So, that completes the theory bit. So, far any questions on this? . .Yes, that is what we need to prove, but here there was an easier way out. So, you directly prove that pre measures of semi infinite intervals are events you exploited the fact that is x 1 x n x 1 through x n are random variables. Yes, it is it is it is. So, no it is a random variable with respect to I mean there is random variable just means the measurable function finally, it should be a measurable function of omega right. You can prove it with here where you want whether you want to prove that f s borl from r to r that is fine or if you want to prove that pre measures of all borl sets are f measurable that is also fine. Here we proved that pre measures of semi infinite measure events are semi infinite intervals are f measurable that is enough. See usually definitions of measurable function we make in terms of pre measures of borl sets, but it is very difficult to verify that right, because borl sets can be so complicated and their pre measures can also be quite complicated and you have to do this for all borl sets. So, what you do is just verify for the generating class and it then follows that it holds for all borl sets right it is something you need to prove examples. Let x 1 and x 2 be independent identically distributed let us say uniformly distributed random variables. So, you remember uniformly distributed random variables right in 0 1 let us say let z is equal to max x 1 x 2 and y is equal to min x 1 x 2. So, you have x 1 and x 2 inducing a uniform measure on 0 1 and they are independent. So, they are independent and identically distributed random variables and you are looking at the maximum of the 2 and minimum of the 2. The question is how are they distributed. So, are there any guesses on how qualitatively they may look. So, you are taking 2 identically distributed random variables on 0 1 independent and you are taking the larger of the 2 and the smaller of the 2 sorry qualitatively. See it is clear that both z and y have to take only values in 0 1 right. We are talking about 2 values 2 random variables which are both taking values in 0 1 right. We know that z and y have to be dependent because that is bigger than y right fine. And if you look at the distributions of distribution of z what do you think it will look like it will be. So, it will be more towards 0 or more towards 1. So, z will have more mass towards 1 and y will have more mass towards 0 that what that is what you would expect right. So, let us actually verify this with our formula that we just derived here. So, we have f so what is f x. So, f x 1 and f x 2 are both. So, f x 1 of x will be x is not it. So, will be 0 x and 1 depending on whether x is less than 0 or x is in 0 1 or x is greater than 1 right this is our CDF. So, from our formula there you can immediately see that f z of x f z of z if you like f z of little z will be equal to f x of little z to the square right f x well by f x I mean either f x 1 or f x 2 they both the same right. So, this will be equal to 0 z square or 1 depending on whether z is less than 0 z is in 0 1 or z is bigger than 1 correct. So, that looks like if I plot capital F z of z will look like a parabola right and you can see clearly that this function is differentiable except these two points right and you can actually get a density as well right after all x 1 and x 2 are continuous random variables and z also turns out to be a continuous random variable. So, your density pdf f z of little z will be what be 2 z is not it 2 z if z is in 0 1 0 otherwise right. So, your little f z will be like this little f z will be 0 outside this and here and here. So, at 0 and 1 there is no derivative, but you can define it as whatever you want does not matter and in between it is equal to 2 z right. So, it will look like that right is equal to 2 right. So, the pdf looks like and that is a valid pdf obviously. So, you see that. So, more of the mass is towards 1 right it is likely to be closer to 1 the maximum is likely to be closer to 1 and similarly you can prove that f y y is the minimum right. So, f y of little y will be equal to. So, f y bar of little y will be equal to 1 minus y square is not it will be 0 sorry will be 1 1 minus y whole square or 0 depending on whether y is less than 0 y is in 0 1 or y greater than 1 and from here you can get the density again is this correct or missing something. So, I am just taking the complementary cdf of x which is yeah which is 1 minus y and I am squaring that I think this is correct right. So, the pdf will be now the if you plot the pdf it will be the derivative of this that will look like look like that right be twice 1 minus y it will look like that. So, the minimum is has more mass towards 0 as you would expect is that clear any questions yes. So, this is complementary cdf. So, 1 minus that will be your cdf right and you differentiate that you get a pdf ok. Let me just do 1 more example in the 5 minutes that remain. So, example number 2 let x 1 x 2 dot x n be independent random variables which are exponentially distributed with parameters. So, exponential the parameters by 1 positive parameter lambda right. So, I am going to give you the parameters lambda 1 lambda 2 dot dot dot lambda n greater than 0. So, I am telling you that these are exponential random variables they are independent, but they are not identically distributed they have different parameters. So, in this case what say f. So, if you have f x i of x will be equal to 1 minus e power minus lambda i x for x greater than or equal to 0 correct. Remember this cdf exponential right. So, this is the cdf right and for x less than 0 this is 0 it looks like that. Now, if you look at y is equal to minimum of x 1 dot dot x n I am looking at the minimum of this independent exponentials. So, now what happens. So, I will have f y of y will be equal to product well I should say f y bar is not it f y bar is equal to product i equals 1 through n f x i bar of y correct because now x i's are independent they are not identically distributed. So, I cannot take nth power correct. So, this will be equal to what say f x i bar will be e power minus lambda i x. So, I am multiplying. So, I am multiplying product i equals 1 through n e power minus lambda i y correct. So, now and this will be equal to what e power minus sum over i equals 1 through n lambda i times y. Now, what does this mean it means that y is also an exponential right y is an exponential with parameter sum of the lambda i's. So, if you take. So, what does it mean. So, if you take n independent exponentials with parameter lambda 1 lambda 2 lambda n then the minimum is distributed as also an exponential with parameter sum of the lambda's right. So, y is I can write exponential with parameter sum over i lambda i's you can also compute the distribution of the maximum. What would you do you will just multiply now the complimentary c d f the c d f themselves you will multiply all these guys. But, that you will not get anything nice you will get some distribution you will get the product of all these guys right. So, the maximum will be some distribution the minimum is an exponential. So, the minimum of independent exponentials is always an exponential and the parameter is the sum of the parameters of the individual ones. So, this has a very nice practical interpretations I remember that I mentioned exponential is this memory less distribution that arises frequently in let us say radioactive decay right. So, each let us say that each of these corresponds to the i th sample they may be there all different radioactive elements or something. So, they emit alpha particles at different rates right. So, and the each sample i th sample let us say has inter emission duration is exponential with parameter lambda i. And you let us say that they all are emitting at one point at in some place and the minimum of these is the time to the first emission correct. You have all these independent samples emitting. So, the if they are all in independent exponential times the time duration for your first the time for you to see the first emission coming out is also an exponential right that understood. So, yeah. So, this has lots of nice properties right. So, this is this these inter emission times being independent exponentials is a very well known process called the Poisson process. So, it has lots of nice properties we will not study it in this course in any great detail, but there is another course called stochastic modeling right which will be offered next semester that is half the course is about these Poisson processes. So, that is just f y i, but all you need to know now is that the minimum of exponential is also an exponential independent exponential is also an exponential ok I will stop here.