 We were discussing expectations on different spaces. I partially prove this theorem. So, we have omega x and y equals g of x. So, this theorem say is saying that you can either compute. So, this is the expectation of y. So, you can either integrate on this space that is that or you can integrate on this space. So, basically you can compute integral g d p x with the probability law here. So, you can either go ahead and find the probability of law of y and integrate this or you can just keep the probability law of x and integrate g. So, they are equal. So, this is something that you probably use without really I mean without really knowing why it is true. So, that is what we were trying to prove. So, we proved it for simple functions proved for simple functions last lecture simple g previous lecture. So, if g is a simple function we proved that integral g d p x is equal to integral y d p. So, that was proved and it was trivially equal to integral y d p y because it was only taking those finite values y 1 through y n and you could just write this as sum over y 1 probability y equal to y 1. So, in simple when g was simple it is very easy. Now, if you have to generalize to non negative g then you have to approximate g from below using simple functions. Suppose g is non negative un measurable let g n be a sequence of simple functions such that g n increases to g let us say for all x. Can I always do that because I have that construction we can take the g n which we wrote down by chopping down the vertical axis. So, you can always do that. So, now what happens is you will have. So, g n is a simple. So, you will have g n of x g n of capital X will be random variables simple random variables which monotonically increase to g of x. So, thus g of x g n of x let us say. So, g n is a sequence of simple functions. So, g n of x will be a sequence of simple random variables and since g n increases to g I can write g n of capital X increases to g of x. Now, what do we know? So, now I know that for simple functions my result is proven. So, I am going to exploit that. So, I want to write integral y d p. So, this is what I want integral y d p that is nothing but. So, this function. So, y is a. So, you should look at this as a function mapping omega to this r. So, that I can write this as integral g of big x d p. So, g of big x is the random variable. So, I am computing expectation of y which is nothing but the expectation of g of capital X correct. So, I have that right this is the LHS right left hand side this is equal to n tending to infinity integral g n of x d p. Why is that m c t monoton convergence theorem that is because g n of x is a sequence of random variables that increases to g of x. So, this is because of m c t. Now, I know. So, this guy I can deal with right. So, this guy is equal to limit n tending to infinity integral g n d p x correct. So, I am just looking at. So, if you just focus on this part of the statement right I am saying that integral g t d p x if g simple integral g d p x is equal to integral g of x. So, y is nothing but g of capital X right. So, integral g of capital X d p is equal to integral g d p x, but that is true for simple functions correct. So, I am just using that this is equal to that because we have already proven right. This is because g n is simple. We already proved that previous lecture fine that is the key step. Now, what happens do I know this limit is what is equal to integral g d p x again because of m c t because g n is increasing. So, here I am using the fact that g n of x is a sequence of increasing random variables. Here I am using the fact that g n of little x right is a sequence of increasing functions that is it right. So, when I write g of capital X I mean the random variable g of x of omega. When I just write little g n or little g I mean the function of x little x correct that is the notation I have been following. So, this is been proven. So, I have proved what I need to prove for. So, I have proven this for any non negative function g right. Then the next step will be to write if g is arbitrary we will write g is equal to g plus g minus then it will work out. So, the proof is over then. So, this is just saying that if g is my identity map right g is my identity map then integral y d p same as integral little y d p y right. So, I can either. So, for any random variable x or y let us say expectation of y can be computed by integrating y d p or integral little y d p y. If you look at that right. So, you can either integrate over the probability space or integrate over r. So, you can you can that is a trivial corollary right for any random variable x integral x d p is equal to integral little x d p x that is a simple corollary of this. So, by now you would have realized that practically I mean all basic results and integration are proved in exactly the same way. You start of with simple functions and then you generalize to non negative functions. Now, there are two ways of doing it you either use the supremum definition or now you use monotone convergence theory. There are two options right. So, one of the two what you keep using good. So, this proves the theorem. Next I want to expectation of continuous random variables expectation of discrete random variables we already covered right. Now, I am going to derive an explicit formula for the expectation of a continuous random variable. So, what the the main result the main formula is going to use integration over different spaces and in conjunction with radon Nicodem theorem. So, let us this is something I should have done earlier probably. So, radon Nicodem theorem I stated I sort of stated imprecisely because you did not really understand what a abstract integral was back then right. So, now let me just recall radon Nicodem theorem and stated properly. So, recall radon Nicodem theorem. So, p x is absolutely continuous with respect to lambda the Lebesgue measure if and only if there exists a measurable function f x from r to 0 infinity such that for all Borel sets b p x of b is equal to integral f x d lambda over b. So, this is an if and only if statement. So, I am stating this properly now for the case of absolutely continuous measures p x with respect to Lebesgue measure it holds more generally for any 2 sigma finite measures I mean fairly general spaces, but this is how this is only thing of concern to us. So, p x of. So, it says that there exists a radon Nicodem derivative f x or the density f x such that for every Borel set b p x of b is equal to integral over integral over that Borel set f x d lambda. So, this is exactly what I wrote down except now you completely understand what this means. I am integrating f x which is a measurable function non negative measurable function with respect to Lebesgue measure on a Borel set. So, now you understand this completely and then we went on to say that if the Borel set is minus infinity x then my c d f is equal to integral minus infinity x f x d x. So, from now on it does not really matter if you write f x d x or f x d lambda because as I mentioned if the Riemann integral exists the Lebesgue integral will always exist and the 2 values will be equal. So, even if I write integral f x d x you can just interpret it as a Lebesgue integral it is safer to interpret it as a Lebesgue integral because it is more general. So, I am going to use this theorem on different spaces this expectation on different spaces in conjunction with radon Nicodem theorem to derive an expression for the expectation of a continuous random variable. So, let me say this as a theorem let x be continuous random variable on omega f p and let p a measurable function which is either non negative or satisfies integral absolute g is a measurable function from R to R is not it. So, absolute g g p x is less than infinity then expectation of g of x. So, expectation of g of x is equal to integral g. So, integral g f x d lambda in particular expectation of x is equal to integral x f x d lambda this is the theorem. So, this is what you have been using for a continuous random variable x we ask you to find the expectation of x p actually more in elementary courses you define this as the expectation right. If x is a continuous random variable you say the expectation is integral x f x d x correct and for a discrete random variable you define it as sum over a i p of a i right. So, expectation was defined very disparately for continuous random variables and discrete random variables in more elementary courses. And if the random variable is some mixture or something you have to invent another formula and now we know that actually there are singular random variables mixtures there of right and for those none of your elementary formula will work right. But, so we what we have so the mathematically sound way of defining it is to just give one uniform definition integral x d p and particularize it for discrete continuous whatever you have. So, the definition is the same expectation of x is integral x d p we integrate the random variable with respect to measure p that is the definition and that gives you different formulae. So, the discrete formulae that you are familiar with comes out of that and so does the formula for continuous random variables. So, in some sense of this is not a definition this is something you are going to prove right we define the expectation as integral x d p and prove that this is the formula for expectation of x for a continuous random variable. So, this works for actually so there are some technical condition. So, this definitely works for non negative functions g in which case the integral is always well defined. And it also works when the g is absolutely integrable meaning that g plus and g minus if you write down g plus and g minus you do not have the infinity minus infinity kind of problems you have a very well defined real number right in both these cases this works. So, any questions on the statement so integral x f x. So, this is x f capital x d lambda f x is the density right. So, we expand on f p so with p d f f x x is the continuous random variable. So, it has a density and the expectation is given by the integral of x f x d lambda this is over the whole real line when I do not say anything it is over the whole real line right. In more elementary notation you will write this as integral minus infinity to infinity x f x of x d x right except now I am writing it as a Lebesgue integral. So, you already know this formula this is nothing new how do you prove it assume g is simple right. So, every theorem integration you can start off by the statement right I think every you can ever go wrong by starting off with single simple functions assume g is simple with g of omega is equal to sum over a i i of omega i equals 1 through n. Then expectation of g of x see now I am going to use the expectations over different spaces the previous theorem. So, I am going to write this as integral g d p x this was the equality you proved in the earlier theorem and actually g is simple. So, this is certainly holds and now this is equal to. So, you are integrating a simple function g is now simple with this form with respect to some measure p x. So, this should be equal to by definition right this is equal to sum i equals 1 through n a i p x of. So, I am integrating with respect to measure p x. So, p x of a i is not it big a i, but p x of a i i is already know what is p x of a i integral over a i f x d lambda. So, they let me do that a i integral over big a i f x d lambda. So, this is because of radoniquadon. So, this is because of integration over different spaces this is because g is simple and that is because of radoniquadon. Now, you can see there is a scaling law for integrals right. So, I can bring the a i inside here fine and I can then I will have a summation integral correct that is equal to sum over i equals 1 through n integral capital a i a i f x d lambda. This is because of the scaling property of integral right you can always bring constant inside and outside. So, I am going to write this. So, now what is the integral of a function over a measurable set defined as in terms of the indicator right. So, you can I can write this in terms of the let me do this properly sum over i equals 1 through n integral. I am not going to write a i now I am simply going to write a i. So, little a i indicator a i and f x d lambda that is by definition of the integral over a measurable set. So, now I have a summation and an integration right. So, this is a finite summation correct. So, this is a finite summation. So, sum of finite number of integrals is equal to integral of the sum again by the linearity of integrals right. So, integral g plus h is always integral g plus integral h you have n such terms here right. So, the by linearity. So, that is equal to sum over i equals 1 through n. So, integral I put the integral out a i i a i I can bring the f x out and then put a d lambda correct. Now, what is that what is inside the parenthesis here g correct. So, that is equal to integral g f x d lambda. So, the proof is complete for g simple good. Now, I will have to approximate for any non negative g I will have to approximate using simple functions from below right. Now, next let g be non negative non negative and measurable let g n be a sequence of simple functions such that g n increases to g. I know I can always do that right. I can always write any non negative function as a monotone limit of simple functions that is always allowed. So, now, I have to write. So, again I have to try and do this right. So, now I have to use monotone convergence theorem right. So, I will write expectation of g of x is equal to right. We will agree with that because of m c t this is equal to. So, expectation of g n of x we have already sorted out g n is simple right. We already know what that is. So, this is equal to limit n tending to infinity I am just keeping the limit and then I can write integral g n f x d lambda correct. Now, what can you say about this integrand? So, the integrand converges to g f x certainly right. Does it converge monotonically why? Because, f x is non negative function. So, this guy increases to g f x. So, this is a monotonic convergence right because f x is non negative. So, again monotone convergence theorem will help you right. So, you can take the limit inside. So, again by m c t m c t you have integral g f x d lambda. So, you can see how powerful m c t is right. So, combined with the fact that there is always some sequence of simple functions that you can approximate from below right. Some you can use you can prove properties very explicitly for simple functions and use monotone convergence theorem is very powerful. It is a very powerful result and it gives you for a all measurable positive measurable non negative measurable functions. Next of course, if g is possibly negative you have to write it as g plus and g minus g plus minus g minus. And in that case this will help you that the fact that this integral is the absolute integral is bounded means that the positive part and the negative part of finite. And so, you will not have any problems of blowing up and so on right. So, then this everything will go through is the same. So, that is the formula to remember right. So, this is what you would normally write as. So, in more elementary courses you would write expectation of g of x is equal to integral minus infinity infinity g of little x f x of little x d x right. This is what you have been using right. That is exactly what you have proved except this looks a little different or it is the same thing I have written it as a big integral that is all. And in particular if you are computing expectation of x you will simply integrate x times the density over the whole space. Now, you can take all your favorite continuous random variables right. We listed exponential Gaussian one sided Cauchy two sided Cauchy right integrate happily and find out their means right. So, if you have an exponential p d f mu e power minus mu x you can you can prove that the mean is 1 over mu. And for the for the n mu sigma square the Gaussian mu will turn out to be the mean. So, you have an exponential random variable. And if you want to compute expectation of x is equal to integral x f x d lambda which is equal to nothing but x mu e power minus mu x from 0 to infinity right. This will turn out to be 1 over mu. If I give you some other function let us say x power n or something you can still compute it right. Because, we know that integral you will just integrate x power n f x d lambda if you want expectation of x power n right. So, for example, if you take expectation of x square you will simply integrate x square f x d lambda right which is x square mu e power minus mu x d x. And this will be equal to 2 over mu square if I remember correctly you can calculate it right these are integrals you can do by integrating by parts or there are standard integrals basically. So, on if you have a Gaussian if you have a Gaussian your expectation of x all this right e power minus x minus mu square over 2 sigma square over sigma root 2 pi d x. So, if in order to do this integral you can make a substitution x minus mu over sigma equal to t. If you make the substitution you will get a you can do it much more easily all right. So, in this basically this will simplify to just mu. So, in order to do you can put. So, in order to do this integral you can put x minus mu over sigma equal to t then you can do this integral easily. If you have to give you another example if you have f x of x is equal to 2 over pi 1 over 1 plus x square x is greater than or equal to 0. So, this is a one sided Cauchy distribution right. In this case expectation of x be equal to integral 0 infinity 2 over pi x over 1 plus x square d x. Now, if you put 1 plus if you put x square equal to t 2 x d x would be d t right. So, this will become log. So, it will become 1 over pi log 1 plus x square I think evaluated from 0 to infinity right and this will be equal to infinity plus infinity. So, the one sided Cauchy has a infinite mean. What if you take a 2 sided Cauchy if I have f x of x is equal to 1 over pi 1 over 1 plus x square over all real numbers x. Then you will have the x the x plus component will have an infinite mean x minus component will have an infinite mean. So, the expectation is. So, is 0 or not defined not defined when you have infinity minus infinity form it is not defined. So, let me just write down if you have f x of x is equal to 1 over pi 1 plus x square for all x in r. Then expectation of x is undefined. So, the 2 sided Cauchy or what is normally normally what is normally 1 over pi x is talked about as the Cauchy p d f Cauchy distribution expectation of x is undefined it does not have a mean right does not have an expected value. Whereas, the 1 sided Cauchy is has a well defined expected value of plus infinity. So, this is pi times 1 plus x square for all x both. So, it is both over positive and negative x. So, here expectation of x is undefined. So, when you are given a random variable which takes both positive and negative values ideally you should integrate. So, is split it as x plus and x minus evaluate them separately. So, here I have generally taken the liberty of integrating from minus infinity to infinity ideally. So, this is Gaussian takes both positive and negative values. So, is split it as positive and negative and make sure they are both finite in this case. So, I could take the liberty of integrating from minus infinity to infinity. In this case you cannot integrate from minus infinity to infinity. In fact, so if you try and do that you will get some function like this right. You will get if you just blindly apply the formula x f x you will get an integral like that right 1 over. So, you will get x over pi 1 plus x square d x right. If you blindly apply the formula this is what you will get and this integral well this integral does not really see the problem is this integral does not exist. It is not really 0 integral is not 0. The reason this integral is not 0 is because remember when you even in Riemann integral when you define integral minus infinity to infinity you define it as limit m 1 tending to infinity m 2 tending to infinity minus m 1 to m 2 correct and that limit does not exist. So, even if you were to. So, this is by definition limit m 1 to infinity m 2 to infinity integral minus m 1 to m 2 all that d x right and this limit does not exist right. In particular it is not defined as limit m tending to infinity minus m 2 m all that that is not what it is. So, if it were defined as limit m tending to infinity minus m 2 m of this odd function then you will say integral minus m 2 m of an odd function is 0 and then the limit is it is not it is not true right. So, that limit m tending to infinity minus m 2 m is called the Cauchy principle value it is not the value of the integral right you might have studied this in calculus right. So, this is the this integral does not exist it is not 0 it is undefined this is undefined right this limit does not exist and it is not 0 in particular, but in this case there is no such problem except of Cauchy over the random variables the V is inside the range of the random it is between minus 0.8 what is the Cauchy is infinite even though the random it would not take the value infinite. Yes correct. So, what this says is that a random see after all a Cauchy random variable or even the random variable the discrete random variable right 6 over pi square 1 over k square we looked at that. So, those are see obviously these random variables are finite with probability 1 right they have to take only real values with probability 1, but the expectation can be plus infinity right that is what it means. So, there are random variables whose expectation is in fact plus infinity, but they are finite they never take the value infinity right they are finite with probability 1 they only take values in the positive real number they never take the value plus infinity, but the expectation can be plus infinity no problem. Are there any questions this is very clear. So, we have dominated convergence theorem remaining dominated convergence theorem and Fatou Slema. So, it is probably too little time to start it now. So, we will I will stop the lecture here.