[Music] so next we move on to one more type of pmf that you can have once you have ah random variables and events ah this is called conditional distributions okay so first we look at just one random variable okay so this is a very simple case where if you supposing you have a random variable x that is defined in a probability space and let us say there is an event that is defined a okay one can define something called conditional pmf of x given a okay so this is just a pmf which is q of t you can denote it q of t anything else if you want you can denote it basically it is the probability that x equals t given a okay so previously the pmf of x without any conditioning is simply the probability that x equals t now if there is an event a with which you want a condition then probability that x equals t given a becomes a conditional pmf conditioned on an occurrence of an event okay so this is this makes sense you can see why ah this makes sense ah we will use this notation x given a for denoting the conditional random variable you have an unconditioned random variable x if you want a condition on event a i will simply say x given a x bar a that is the conditional random variable and that would have a distribution which is different from the original random variable okay so how do you compute this f x given a of t its its basically probability of x equals t given a thats just probability of intersection of those two events divided by probability of a okay so standard conditioning nothing changes in the actual equation except that the conditioning is coming okay so this is a general conditioning in terms of an event but even here pay attention to the fact that the range of x given a can be different from range of x okay because once you condition on a x may not be able to take many values outside of a right so the range can change so this conditioning makes sense sometimes it is used people do condition on events but it is most popular to condition on events defined by another random variable okay and that is where the conditional distribution of one random variable given another random variables value enters the picture okay so it's sort of very similar to the previous picture except that this event a is now defined using another random variable okay so let us say you have two random variables x and y these are jointly distributed they have a join pm of xy the table is given to you okay so remember the table is given to you i am going to define something called the conditional pmf of y given x equals t okay so x equals t has occurred the random variable x has taken a value t so the event x equals t has occurred now i cross course i can define now the conditional random variable y which is conditioned on x equals t and that is exactly the conditional pm of pmf of that gate okay so basically it is the probability that y equals t prime given x equals t ok so you can just ah do this calculation again this is this is just a ordinary condition probability now right y equals t prime given x equals t its probability of y equals t prime comma x equals t remember comma is and right so it is the intersection y equals t prime and x equals t divided by probability that x equals t and notice now what is the numerator numerator is the joint pmf f x y of t comma t cry t prime and what is the denominator denominator is the marginal pmf fx of t okay now we'll use this little notation here hopefully this notation is clear enough i will say y given x equals t is the conditional random variable okay i will think of that as the conditional random variable itself y given x equals t okay so what is this q of t prime its nothing but the distribution of this conditional random variable right so we will write it as f y given x equals t of t prime ok so that is a very common notation for the conditional random variable okay so what is most important about the conditional random variable is this equation okay so this equation is something that we will use quite a bit when we write down joint pmfs and all that okay so the joint pmf is the same thing is the same equation that is used in the definition i have written it a bit differently okay so the joint pmf evaluated at t comma t prime x equals t y equals t prime is simply the product of the conditional pmf of y given x equals t of t prime times f x of t okay do you see that the same equation f x of t comes in okay so this is the same product rule that we used when we defined probability of a and b right what is probability of a and b its probability of a given b times probability of b the same thing except it is written in the language of conditional pmfs and joint bmfs that's it ok so this equation is very useful quite often the some of the objects here may be easier to find ok so quite often it is very common that the marginal is easy to find and the conditional is easy to find okay and then you can multiply the two to get the joint or maybe the other way around but usually the marginal and the conditional are easy easier slightly to define than the joint directly okay so this is a very common trick that is used to get to the joint pmf okay so hopefully the definition was clear now lets check our understanding with some examples so here is a very simple example ok so here is a join pmf ok so notice how the join pmf and the marginal are given to us okay so notice how what this joint pm is from the joint pmf you can identify that the range of x is 0 1 2 ok so better way to write range of x is this you know i mean x belongs to 0 1 2 y belongs to 0 1 okay and the joint pmf is given you can quickly check that it is all valid you know 1 by 8 appears 4 times that is half 1 by 4 appears twice that's another half it all adds up to one and you can do the marginal here you just add up everything in the row you get half you add up everything here you get one by two you get here three by eight one by four three by eight all of these are are valid as well okay so everything is fine so now ah supposing i want to do the pmf let's say for y given x equals 1 x equals 0 let's take that okay so y takes value 0 1 i want to do y given x equals 0 ok so this random variable it takes value 0 comma 1 okay and what is f y given x equals 0 of zero ok its f x y of zero comma zero divided by f x of zero ok what is f x y of zero comma zero its one by four and what is f x of zero thats three by eight so you get two by three ok what is f y given x equals zero of one its f x y of 0 comma 1 divided by f x of 0 its basically 1 by 8 right 0 comma 1 is 1 by 8 here ok divided by 3 by 8 you get 1 by three ok so notice what has happened here to get the conditional pmf you simply divide this column by this number ok so you divide the column one by four one by eight by three by eight to get the conditional pmf two by three one by three ok so you divide divide one by four 1 by 8 by 3 by 8 you get that so now if you want to look at the conditional pmf of y ah f x let me let me go to x given y equals 1 ok y is 1 so you have to look at and so once y is one you you look at so maybe i should write it in another color let me become the color for you i'll pick this dark green ok so this is y equals 1 for you and this is the probability that y equals 1 you divide this by this you are going to get the distribution here right so y equals x given this is going to be 0 1 2 and the probability is going to be let me just do green the probability is going to be one by eight divided by one by two right i will write it like that ah one by eight divided by one by two and then one by four divided by one by two and that is just one by four one by four and one by two ok you do not have to write it in such ah great detail you can just directly write if you like one by four one by four and by two i got that so so this way you can quickly see how to find the conditional distribution any conditional distribution i give you you identify the row or the column and simply take that divided by the marginal that comes below it that's it that gives you the conditional pmf okay very very easy and straightforward way to find conditional pmf okay so let us do one more example to convince ourselves that we have understood this here is the example i want to do so here is a joint pmf that has been given to us okay you can check that this is a valid pmf very quickly you can just add one plus three four seven five twelve yeah so this is a valid pmf it adds up to one okay so here the marginals have not been given and you have to just keep computing some of the conditionals so let us look at this so here first step is to compute the marginal right so if you add up these two you get four by twelve which is one by three here you get three by twelve which is one by four here you get five by twelve ok so here again if you add you get one by two one by six one by three ok so those are the marginals that is ok so now if i want to find ah y is so the range of y so remember x takes value 0 1 2 and y takes value 0 1 2 okay now if i want to find x given y equals or let me start with y given ok y given let say we do y given x equals 0 okay so this guy ok so this is this divided by this guy right this is going to be 0 1 2 and the probability is going to be 1 by 6 one by three and one by two isn't it do you see that okay so you take see x is zero so i know i have to focus on this column alone if i take this vector and the joint pmf divide by the marginal i am going to get the distribution so notice how y given x equals 1 is going to change ok so if you say y given x equal to 1 you see there is a 0 there the moment there is a 0 there you do not want to include it in the range and put a probability 0. so you drop it so you just say 1 comma 2 okay 1 by 12 and 1 by 12 and probabilities total is 1 by 6 notice the total does not matter when these two are equal i know ahead of time that this is going to be half this is going to be half right anyway but you can also divide and check that that works out ah similarly you can do y given x equals 2 and that is going to be so notice the way i am writing it i write the values taken below and the probability above ok so this you can use any such simple notation so so given x is 2 ah maybe i should do a different color here so let me just do a different color to be very clear on what's going on so supposing you look at y given x equals 2 okay so i am looking at this column then i am going to divide by this quantity here that is going to be 0 comma 2 i do not have to write the 0 explicitly right because that is going to take a probability 0 that why do that ok so you will get a 3 by 4 and a 1 by 4. ok so notice how you are getting different different marginals you know i mean joint pmf for something and then depending on how the matrix is you will get different different marginals all of it is interesting so let's also do a couple of cases row wise so let me just do x given i will do a different color maybe blue ok ah so let us look at x given y equals 1 so y is 1 so you are focusing on this row here and this guy here this is going to be 0 and 1 okay it doesn't take the value 2 because that's already 0 and then if you do 4 you're going to get two by three one by three ok so notice all the different probabilities that you are getting between all sorts of distributions one two zero two zero one two by three one by three three by four and before half half all of these end up happening once you go to the conditionals ok and in every case you can check the equality okay remember to check this equality it is always true that f x y of t 1 t 2 equals f ah maybe i should start from the left side and right this is an important little equality for you to know f x y of t 1 t 2 is always equal to f y given x equals t 1 of t 2 times f x of t 1 and its also equal to f x given y equals t 2 t1 times fy of t2 so this is always satisfied okay so you should remember this identity is very very very important you can check in all our calculations you can check that that holds i mean this is how we just calculate it so it's sort of trivial in some sense but it's important to note all these these identities will be very very useful so somebody gives you a table some partial information about you know conditional pdm is given this is given some conditional pms are given some marginals are given some actual joint premiums are given you should be able to calculate all the missing values using these identities okay uh one more thing i want to point out which i think maybe is was not very very clear so notice here the y given x equals 0 is actually sort of a random variable and it has a pmf so if you keep x fixed and vary the values of y right you will get one okay so if you add up all these guys you will get one one by six plus one by three plus one by two is one one by two plus one by two is one three by four plus three one by four is one one right so every conditional random variable is actually a full blown random variable so it is a valid pmf so if you do this right if you take sum over f y given x equals p of t prime and add it over all y ok you will get one ok so this is also an important identity to remember ok so the conditional pmf is a valid pmf on its own so you add up over all the range in fact it may not be the entire range it may be something smaller than y also but anyway let us add it over the entire edge maybe some of the values will be zero it does not matter you add up the conditional pmf over the entire range of y you will get one so this property is also very important when you solve problems okay so so the conditional pmf is a valid pmf on its own it will take probabilities and you add up all the probabilities you'll get 0 you'll get 1. sorry add up all the probabilities you'll get 1. remember x equals t is fixed here okay so you cannot keep changing x okay so x x equal to t has to be fixed it has to be one conditional random variable then it is pmf when you vary y alone y given x when you keep x fixed and vary y and you look at y given x that will give you 1 okay so that is an important identity to remember okay so i think you have covered most of the things you can check all these things it is useful to know okay so i have a few examples to show you may be this is a good point in the lecture to break then come back and see the next lecture thank you very much