For more information, please see full course syllabus of Probability

For more information, please see full course syllabus of Probability

### Conditional Probability & Conditional Expectation

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

- Intro
- Review of Marginal Probability
- Conditional Probability, Discrete Case
- Conditional Probability, Continuous Case
- Conditional Density of Y₁ given that Y₂ = y₂
- Interpret This as a Density on Y₁ & Calculate Conditional Probability
- Conditional Expectation
- Example I: Conditional Probability
- Example II: Conditional Probability
- Example III: Conditional Probability
- Example IV: Conditional Expectation
- Example V: Conditional Expectation

- Intro 0:00
- Review of Marginal Probability 0:46
- Recall the Marginal Probability Functions & Marginal Density Functions
- Conditional Probability, Discrete Case 3:14
- Conditional Probability, Discrete Case
- Conditional Probability, Continuous Case 4:15
- Conditional Density of Y₁ given that Y₂ = y₂
- Interpret This as a Density on Y₁ & Calculate Conditional Probability
- Conditional Expectation 6:44
- Conditional Expectation: Continuous
- Conditional Expectation: Discrete
- Example I: Conditional Probability 8:29
- Example II: Conditional Probability 23:59
- Example III: Conditional Probability 34:28
- Example IV: Conditional Expectation 43:16
- Example V: Conditional Expectation 48:28

### Introduction to Probability Online Course

### Transcription: Conditional Probability & Conditional Expectation

*Hi, welcome back to the probability videos here on www.educator.com.*0000

*Today, we are going to talk about conditional probability and conditional expectation.*0006

*We are going to be using some of the concepts of marginal probability which I talked about in the previous video.*0011

*If you are not familiar with marginal probability, I’m going to give you a really quick review of that, *0018

*at the beginning of this video.*0022

*If you really have not worked through the previous video then, it is probably better if you go back*0025

*and look at that previous video on marginal probability.*0030

*Get yourself really solid on that, and then come back and *0033

*we will talk about condition probability and conditional expectation.*0036

*You will see how the marginal probability is used to calculate conditional probability and conditional expectation.*0040

*Let me just remind you what we learned in the last video about marginal probability.*0048

*Again, if you have not watched that video, you probably do want to watch that video from scratch*0053

*because there is a lot of information in there, and also, a lot of good practice in actually calculating marginal probability.*0058

*This is just a quick review so that you will see how these concepts go into conditional probability.*0063

*In all these ideas, we have an experiment with two random variables Y1 and Y2.*0070

*The marginal probability functions that we learned about in the last video, for discreet probability, *0076

*we have P1 of Y1 is the sum over Y2 of all the probabilities of all the combinations of Y1 and Y2.*0084

*Notice that, there is this variable change in the subscripts.*0093

*When you are finding the probability function for Y1, what you end up doing for Y1 is you sum over Y2.*0098

*And then, vice versa, when you find the marginal probability function from Y2, you sum over Y1.*0108

*Those are the marginal probability functions in the discreet case.*0118

*In the continuous case, you have a marginal density function for Y1.*0122

*And then, you integrate over all possible values of Y2.*0127

*Not always be for -infinity to infinity because sometimes the domain you are interested in, is much smaller than that.*0131

*But, I just wrote the most general one to introduce it here.*0139

*The important thing here is, when you are finding the function for Y1, you look at all the possible values for Y2,*0143

*and then you integrate the joint density function over Y2.*0151

*Conversely, when you are finding the marginal density function for Y2, you look at all the values for Y1 and you integrate over Y1.*0155

*We practiced in the previous lecture, we practice calculating some marginal probability functions and some marginal density functions.*0168

*If you do not remember how to calculate those, just jump back one video and check those out.*0177

*We are going to be using some of the answers to the examples in the previous lecture, *0182

*as part of the examples in this lecture.*0187

*You really want to be solid on that, before we move forward and learn some new stuff.*0190

*The big new idea for this video is conditional probability.*0196

*We will have a discreet case and a continuous case.*0200

*The probability of Y1 condition on Y2, what that really means is that, *0204

*if you know that Y2 has a particular value of y2, given that Y2 is y2, what is the probability that Y1 comes out to be y1.*0209

*The way you calculate it is, you use the probability function, the joint probability function of Y1 and Y2.*0224

*And then, you divide by the marginal probability function.*0231

*Remember, this, we figure out before is the sum over Y1 of the probability of Y1 and Y2.*0236

*Remember, you have that variable switch always.*0245

*That is the conditional probability formula in the discreet case.*0248

*The conditional probability in the continuous case is a little more complicated.*0252

*I can spell that out for you.*0259

*Given that Y2, given that we know the value for Y2, the way we find the conditional density function*0262

*is we write it as F of Y1 condition on Y2.*0269

*You take the joint density function and then you divide it by the marginal density function of Y2.*0274

*Just a reminder, since it is the conditional function, since it is the marginal density function of Y2, *0283

*it is the integral on Y1 of F of Y1 Y2 DY1.*0291

*We have a lot of variables to keep track here, it tend to get quite confusing.*0301

*What you want to do with this formula is, you want to interpret it as a density function on Y1.*0305

*And then, you can calculate conditional probability.*0314

*Suppose, you know you are given that Y2 has a particular value.*0317

*If you are given or you know somehow that Y2 has a particular value,*0322

*you want to ask what is the probability that Y1 will be in a particular range?*0327

*The idea here is that you have a known value of Y2.*0333

*The question we are asking is, what is the probability that Y1 will be in this particular range?*0345

*The way you answer that is, you use this conditional density formula.*0355

*You do F of Y1 condition on Y2 and then, you integrate that with respect to Y1 from the two values that you are interested in.*0360

*That comes from this A and this B, give you the two limits on the integral.*0370

*Quite confusing actually, but we will practice this in the examples, and I hope it will start to make some sense.*0375

*There is one more thing that we need to learn which is conditional expectation.*0382

*You want to remember this formula when we jump to the next slide *0388

*because the conditional expectation is going to look very much like this formula.*0391

*It is going to have one extra factor and that extra factor is going to go in right there.*0396

*Keep an eye out for that, in the next slide.*0403

*The next topic that we are learning here is conditional expectation.*0406

*Let me go ahead and talk about skip with the discreet case, and talk about the continuous case*0413

*because I think it is a little easier to follow.*0418

*The idea here is that you have a known value of Y2.*0420

*Someone has told you the value of Y2 and you are trying to predict the value of Y1.*0424

*What is your expected value of Y1, based on a particular known value of Y2?*0431

*What you do is, you integrate the conditional density function except here is that extra term, *0439

*that extra factor that I warned you about on the previous side.*0447

*That was not there on the formula from the previous side, everything else looks the same.*0451

*But you stick in that extra Y1 and then, you integrate it over Y1, *0456

*just as we did in the previous slide, when we are calculating continuous probability.*0461

*This is kind of reflecting the fact that we are finding the expected value of Y1.*0467

*That is why we put that extra term in there, it is all based on knowing a value of Y2.*0472

*I hope that is starting to make some sense, if it does, let us go up and look at the discreet formula.*0480

*It essentially looks exactly the same except I just changed the continuous F to a discreet P*0486

*and the continuous integral, to a discreet sum.*0494

*It was just sort of the discreet analogue of that continuous formula.*0497

*I think a lot of these will make more sense, after we do some examples.*0502

*Come along with me and let us work out some examples together.*0505

*In the first example here, we are given the joint density function F of Y1 Y2 is 6 × 1 - Y2, *0511

*on the triangle with corner 0-0, 0-1, and 1-1.*0520

*I think right away, what am I going to do is graph that because that is the first challenge, *0524

*is just to visualize these things.*0531

*0-0 is right here, think of 0-1 as being Y2, this is Y1, there is 1 and there is 1 on the Y2 axis.*0534

*So, 0-1 is right there and 1-1 is the point right there.*0548

*We want the triangle with those 3 corners, I will connect those up and make myself a nice triangle.*0555

*We want to find the probability that Y1 is less than or equal to Y2, *0565

*given that Y2 is less than or equal ½, given that Y1 is less that or equal ¾.*0571

*This is kind of a trick question to be throwing it into this lecture,*0578

*because this is not a problem of conditional and marginal probability.*0583

*That is because there are less than or equal to, in both of these.*0591

*Let me describe what is going on with this and hopefully I can sort it out for you.*0596

*We are going to use the original conditional probability formula from several lectures ago.*0603

*This goes way back to the beginning of the course.*0610

*You have to scroll way up to find this conditional probability formula.*0612

*The probability of A given B is the probability of A intersect B divided by the probability of B.*0615

*That was our original conditional probability formula.*0625

*What we want here is, the probability of Y2 being less than or equal to ½ and*0628

*Y1 being less than or equal to ¾ divided by the probability of Y1, that is the B being less than or equal to ¾.*0641

*That is what we calculate here.*0655

*Both the numerator and denominator are describing regions inside this triangle.*0657

*Let me look at the numerator first.*0665

*Maybe, I will look at the denominator first.*0667

*I think that one is a little more challenging.*0669

*Let me fill in some values here.*0671

*There is ½, there is ½, and I know I'm going to look at Y1 = ¾, there is ¾ there.*0673

*Maybe, that is enough there.*0682

*Let us look at the denominator.*0686

*It is the probability that Y1 is less than or equal to ¾.*0688

*My Y1 looks a little bit messy here, let me see if I can write that a little cleaner.*0695

*Y1 being less than or equal to ¾ is, there is the Y1 = ¾.*0702

*The blue region right there, that is where Y1 is less than or equal of ¾.*0713

*That looks a little tricky to describe.*0724

*I think, what I want to do is describe that as Y1 goes from 0 to 3/4 and Y2,*0728

*if I can describe that in red, Y2 goes from Y1 up to 1.*0738

* Y2 goes from Y1 up to 1, this is really lots and lots of multivariable calculus.*0747

*If you have not watched these lectures on multivariable calculus recently, *0756

*it is a great time to review those, lots of review of that subject coming in.*0759

*This denominator region is the integral from Y1 = 0 to Y1 = ¾.*0765

*The integral from Y2 = Y1, Y2 = 1.*0777

*And then, we have our joint density function 6 × 1 - Y2 DY2 and DY1.*0784

*That is going to be a double integral, we can calculate it out.*0797

*It would not be a whole lot of fun but it is nothing too difficult either.*0800

*The numerator region, Y2 is less than ½ and Y1 is less than or equal to ¾.*0805

*Let me just graph Y2 less than ½, that is everything below that line.*0812

*Let me make that a dotted line and make that a little easier to separate out there.*0821

*Y2 = ½, there it is.*0829

*I want everything below that line and to the left of the other dotted line.*0834

*That really just means below the dotted line for ½.*0839

*If I describe that region, this was the denominator region here.*0846

*The numerator region is, I think it will be easier if I describe Y2 first.*0850

*And then, I can describe Y1 going that way.*0857

*That will give you 0 for Y1, it will be a nicer there.*0861

*If I say Y2 goes from 0 to ½ and then Y1 goes from 0 to the diagonal line Y2.*0864

*What we will be integrating is Y2 = 0 to Y2 = ½.*0878

*And then, the integral of Y1 = 0 to Y1 = Y2.*0887

*The same density function 6 × 1 - Y2 DY1 DY2.*0894

*I have given myself a nice pile of double integrals to solve.*0903

*You would be forgiven, if you did not want to plow through the multivariable calculus with me,*0908

*because it is all just multivariable calculus from here.*0912

*There is really not too much more probability to be learned from this.*0915

*I do want to go ahead and solve them.*0920

*If you do not want to solve the integrals with me, feel free to skip to the end and just check out the numbers.*0922

*Maybe solve one on your own and see if you agree.*0927

*Or you can take these double integrals and plug them into your favorite online double integral solver.*0929

*This integral 6 × 1 - Y2 in the numerator, we are integrating that with respect to Y1.*0937

*That is 6 × 1 - Y2 × Y1 integrated Y1 = 01, Y1 = Y2.*0945

*That is going to give me, we are still working in the numerator.*0958

*6 × 1 - Y2 × Y2, 6Y2 - 6Y2².*0963

*And then, we are still integrating that from Y2 = 0 to Y2 = ½ DY2.*0981

*That was my numerator and let me go ahead and keep solving that.*0991

*6Y2 integrates to 3Y2², 6Y2² integrates to 2Y2³.*0997

*-2Y2³ integrate that from 0 to ½, Y2 = 0 to Y2 = ½.*1010

*We get 3 × ½² is ¾ - 2 × ½³, that is 2 × 1/8 is ¼, that is ½ for my numerator.*1021

*Now, that was the easy one.*1040

*I think the denominator actually turned out to be a bit worse, unfortunately.*1042

*Let me go ahead and see what we get in the denominator here.*1046

*6 × 1 - Y2 integrate it with respect to Y2, that is 6Y2 - 6Y2 integrated is 3Y2².*1050

*We want to integrate that from Y2 = Y1 to Y2 = 1.*1067

*That is going to give me 6 -3 - 6Y1 + 3Y1².*1077

*We still have to integrate that.*1096

*That is in the numerator, that should have been a DY2.*1100

*We are still integrating the denominator DY1.*1103

*That is the integral of 3Y1² is Y1³ -6Y1 integrates to 3Y1² -3Y1².*1109

*6 -3 is 3 that integrates to 3Y1, and we want to integrate that.*1126

*What are my bounds, Y1 goes from 0 to ¾, Y1 = 0 to Y1 = ¾.*1134

*I still have ½ in my numerator, it is waiting for denominator.*1145

*If I plug in ¾ for the denominator, this is pretty nasty.*1150

*Y1³ will be 27/64, 3Y1² is 3 × 9/16 so 27/16, and 3Y1 is 9/4.*1154

*Let us see, my common denominator there is /64 so I get 27 -27/16 is 108.*1173

*9/4, I have to multiply that by 16 because I got 64 in the denominator.*1190

*That is a 144, 9 × 16, and this all simplifies down to ½/27 -108 + 144 is 63.*1196

*63/64, I got 64, do the flip there, 64/63 × ½.*1211

*And, I finally come up with 32/63.*1221

*What an unpleasant stage of integration.*1226

*Let me show you the key steps in setting up those integrals because that is really what I want you to understand.*1231

*Solving the integrals is just kind of a tedious exercise in multivariable calculus.*1238

*Setting up the integrals is where it is really vital here.*1242

*The first thing I did was, to graph the triangle with these corners 0-0, 0-1, and 1-1.*1247

*And then, I wanted to find conditional probability, since, these are both describing regions and not constants.*1256

*If they were describing constants, I’m going to jump to my conditional probability formulas*1264

*that I learned in this lecture.*1268

*But since, they are describing regions, I’m just going to use my old conditional probability formula, right here.*1270

*The probability that they are both true divided by the probability of B.*1277

*Let me show you that, that gives us that formula right here.*1285

*And then, I had to translate each one of these regions into regions on the graph, that I can use to set up integrals.*1293

*Y2 less than ½ and Y1 less than ¾ means that, Y2 less than ½ is that region right there.*1302

*Everything south of that region Y1 less than ¾ is everything to the left of that line, right there.*1316

*If they are both true, it just means you are talking about this triangular region.*1324

*My numerator is that region right there.*1329

*Y2 goes from 0 to ½, Y1 goes from 0 to Y2.*1335

*That is where I got my bounds for the integral here.*1339

*My denominator is just Y1 less than ¾, that is everything to the left of this line.*1343

*That is the line Y1 = ¾.*1351

*I got to describe that region that kind of looks like a backwards state of Nevada.*1354

*That is my denominator region, I described as Y1 goes from 0 to 3/4 and Y2 goes from Y1 up to 1.*1361

*That is where I got these limits for this denominator integral.*1372

*That is all kind of messy but from there, it just turns into a multivariable calculus exercise.*1379

*The key thing here is that, you have to keep straight which variable you are integrating with respect to.*1386

*In this numerator integral, we are integrating with respect to Y1*1395

*which means that 6 × 1 - Y2 was a constant, that is why I integrated to 6 × 1 - Y2 × Y1.*1399

*In the denominator, we are integrating first with respect to Y2 which is why when we integrate 6 × 1 – Y2, *1407

*we get something very different 6Y2 -3Y².*1414

*I do not think I’m going to continue to pursue all the details of the integration.*1420

*I just kind of work through all these integrals, plug in all the fractions, it got fairly hairy here,*1427

*but then it simplify down to 32/63.*1433

*In example 2, we are starting out with the same joint density function on the same region.*1441

*We are also finding a conditional probability but now, *1448

*we are finding a conditional probability over condition on a constant value of Y1.*1452

*The big difference here was, in example 1, we had a less than or equal to here.*1457

*In example 2, we have an equal to here, which means we are going to use our new conditional expectation formulas.*1463

*I'm going to go ahead and draw the region that we are talking about.*1472

*But, we are going to be using our conditional expectation formulas that we learn in this lecture.*1476

*I’m trying to make my axis a little bit straighter.*1483

*This is the same region we had before.*1486

*I know the general shape of the region is this triangle here at 0-0, 0-1, and 1-1, there is my region.*1488

*What we are given now is that, Y1 is equal to ½.*1500

*There is Y1 is the horizontal axis, Y2 is the vertical axis.*1509

*We are given that Y1 is equal to ½.*1513

*We are given that we are sort of living on this red vertical line, right here.*1519

*We want to find the probability that Y2 is bigger than ¾.*1528

*Let me draw that, there is ½ and there is ¾.*1534

*We want to find the probability that we are on this part of the line, that upper half of that line.*1539

*What we are going to do is, solve this using our conditional expectation formula.*1549

*Let me remind you what that was, this is coming straight from one of the early slides in this lecture.*1555

*I think it was the third slide in this lecture.*1562

*Remember, what we want to use there is our conditional probability formula.*1566

*We are going to use the integral from Y2 = ¾.*1573

*Our biggest value of Y2 it could be is 1.*1579

*Y2 = 1 of the conditional density formula F of Y2 condition on Y1.*1583

*And then, we are going to integrate that with respect to Y2.*1595

*Let me remind you what this conditional density formula was.*1600

*The conditional density formula is F of Y2 condition on Y1.*1605

*I think this is the opposite way, from the way I had it in the first slide or the third slide of the lecture.*1612

*I think I had Y1 condition on Y2, you have to be very careful here.*1620

*This is F of Y1, Y2 divided by F1 of Y1.*1626

*We also have to figure out F of Y1,Y2, that is just the joint density function here.*1638

*But, we also need to know this marginal density function F1 of Y1.*1646

*F1 of Y1, I will remind you, is the integral on Y2 of F of Y1 Y2 DY2.*1652

*Now, we actually worked this one out in one of the examples in the previous lecture.*1667

*It was example 3, in the previous lecture.*1673

*There was in the previous lecture, that lecture was called marginal probability.*1685

*If you just look back, you will see this one worked out, at least the marginal probability function.*1689

*I'm not going to work that out again, but I'm just going to quote the answer there and where was it.*1697

*I have it written down here, it is 3Y1² - 6Y1 + 3, we work that out in example 3.*1703

*If you do not remember how that went, you can you try to redo the integral yourself right now and *1717

*just check that you get the right answer.*1722

*If that is still not making sense, just go back and look in example 3, in the marginal probability lecture,*1724

*you will see it all worked out.*1729

*Remember that, we are given that Y1 is equal to ½.*1733

*Let me go ahead and plug in F1 of ½ is 3 × ½², that is 3 × ¼ -6 × ½ which is 3 + 3.*1737

*That is just ¾ -3 + 3 is ¾.*1754

*I’m going to use that in here, as my denominator over on the left.*1759

*F1 of Y1 is ¾ and F of Y1 Y2 is 6 × 1 - Y2, that is the joint density function that is given to us.*1764

*6 divided by ¾, do the flip on the denominator and you get 6 × 4/3 which is 8 × 1 – Y2.*1777

*That is our conditional density function where Y1 is ½.*1789

*What we want to do is we want to integrate that, the probability that we are looking for*1796

*is the integral from Y2 = ¾ to Y2 = 1 of 8 × 1 - Y2 DY2.*1802

*Notice that, there is no Y1’s left in here anywhere because we I plug in Y1 = ½.*1815

*That is a pretty easy integral now.*1820

*8Y2 - the integral of 8Y2 is 4Y2².*1822

*We want to integrate that from Y2 = ¾ to Y2 = 1.*1834

*My 3, kind of disappeared, trying to do nothing here.*1842

*Let me write that a little bigger, there we go.*1845

*This is 8 – 4, -8 × Y2, that is 8 × ¾, -6.*1849

*+ 4 × Y2², 4 × ¾² is 4 × 9/16 which is, let me go ahead and write this down.*1861

*4 × 9/16 which is 9/4.*1876

*-4 -6 is 8 -10 is -2 + 9/4 is + 2 and ¼, that gives me ¼.*1884

*That is my answer, that is my probability.*1896

*If Y1 is ½ then the probability that Y2 is bigger than ¾ is exactly ¼.*1899

*A lot of steps involved there and some of it may be rather confusing.*1910

*Let me go back and go over those again, just quickly, so that everybody is on board here.*1915

*The first thing I did was, I graphed the triangle.*1921

*There is my triangle right there, we are describing this triangle.*1923

*We are given that Y1 is ½ which means we are kind of stuck at that red line where Y1 is equal to ½.*1930

*We are trying to find the probability that Y2 is bigger than ¾ .*1940

*What I'm going to use, since that is not inequality there, that is equality, that is different from example 1.*1946

*In example 1, we had an inequality there which that we are looking at these*1953

*two dimensional regions and setting up double integrals.*1957

*This is really quite different, even it looks very similar to example 1.*1959

*Because it is an inequality, we want to use our conditional density formula F of Y2 given a value of Y1.*1966

*And then, we want to find the probability that Y2 is bigger than ¾.*1982

*And that is why I integrated from 3/4 to 1.*1986

*Now, I need to figure out this formula F of Y2 given Y1.*1989

*By definition, I gave you this earlier on in this lecture, it is the joint density formula divided by the marginal density formula.*1995

*The marginal density formula is something we learn about in the previous lecture.*2004

*We actually worked out this example in the previous lecture, the marginal probability lecture.*2009

*Just check back and look at example 3 in that lecture.*2015

*You will see that we worked it out to be this expression in terms of Y1.*2019

*Or you can just work out the integral yourself right now and make sure that checks.*2025

*Given that Y1 is ½, that is why I plug in that value of ½, worked it through and got ¾.*2029

*That is my ¾ there, and the joint density formula comes from the stem of the problem.*2039

*That is where that comes from, the ¾ comes in there, and that simplifies down to 8 × 1 - Y2.*2046

*I just plug that into my integral, plug that into this formula right here.*2053

*Solve out the integral, simplify the fractions, and I get my probability of ¼.*2061

*In example 3, we are given a joint density function.*2070

*It is on a square, a little bit easier than what we had to deal with in examples 1 and 2.*2074

*We got to graph that out.*2082

*There is Y2, here is Y1, and we have a square.*2084

*Y1 and Y2 are both trapped between 0 and 1, there is my region.*2091

*What we want to do is, find the probability that Y1 is greater than ¾ given that Y2 is equal to ½.*2102

*Let me graph what we are really calculating here.*2112

*We are given that Y2 is equal to ½.*2115

*There is Y2 equal to ½, let me draw a nice, thick red line.*2120

*We are just looking at that red line region, right there.*2125

*We want to find the probability that Y1 is bigger than ¾.*2131

*There is ½, there is ¾, and we want to find the probability of being in that black dotted region, if we are on the red line.*2137

*That is what we are really calculating.*2150

*If we know we are on the red line, sum these totals that Y2 is ½, what is the probability that Y1 is bigger than ¾? *2152

*I mislabel my axis, my mistake there.*2161

*That should have been a Y1 and that should have been a Y2.*2165

*I always put Y1 on the horizontal axis, but for some reason, I just wrote them down this time.*2170

*Since, we have an inequality here and not an equality, *2177

*we are going to use the marginal density function here and the conditional density function.*2183

*We want the integral from Y1 = ¾ to Y1 = 1 of the conditional density function F of Y1 given Y2, given a value of Y2.*2193

*We want to integrate that DY1.*2214

*I got to figure out what that conditional density function is.*2218

*F of Y1 condition on Y2 is equal to the joint density function F of Y1 Y2 divided by F2 of Y2.*2223

*A lot of ingredients that I have to put in here.*2238

*I need to figure out what F2 of Y2 is.*2241

*That is the marginal density function, that we learn about in the previous lecture.*2244

*One thing you learned in the previous lecture is that, you always switch the variables.*2251

*F2 of Y2 is the integral on Y1 of F of Y1, Y2.*2255

*And then, you integrate that with respect to Y1.*2264

*In this case, the range on Y1 is from 0 to 1, Y1 = 0 to Y1 = 1.*2268

*The joint density function that we are given is 4Y1 Y2 DY1.*2277

*Now, that is an easy integral.*2286

*Remember, we are integrating with respect to Y1.*2288

*Y2 just comes along for the Y as a constant.*2292

*The integral of 4Y1 is 2Y1².*2296

*And then, we still have that Y2, integrate from Y1 = 0 to Y1 = 1.*2303

*We just get 2Y2 as the marginal density function.*2311

*Remember that, that should always be a function of Y2, if we are looking for the marginal density function of Y2.*2318

*2Y2 is a function of Y2, that is reassuring.*2326

*F of Y1 condition on Y2 is our joint density function 2Y1, Y2.*2332

*I’m sorry, 4Y1 Y2, that was our joint density function divided by 2Y2 and that simplifies down to 2Y1.*2346

*By the way, notice that the Y2 was canceled out.*2358

*That is kind of a freak of nature for this problem.*2361

*If the Y2’s had not cancel out, if we still had a Y2 in there,*2364

*then we would have plugged in the value of Y2 that we are given, Y2 = ½.*2368

*Let me say, we plugged in Y2 = ½, if necessary.*2381

*We did not have to do that because it just cancel each other out, in this particular problem.*2391

*But that would not always happen.*2395

*We really want to get a function of Y1 here.*2397

*The reason is, because we are going to take that and plug that back into our original integral, and integrate over Y1.*2401

*Y1 = ¾ to Y1 = 1 of 2Y1 DY1.*2409

*Now, that is an easy integral, it is just Y1².*2419

*We want to integrate that from Y1 = ¾ to 1.*2424

*That is just 1 – 3/4² is 9/16.*2431

*What we will get here is 7/16, that is our probability.*2437

*What that really means is that, if we are choosing a value according to this joint density function,*2443

*and somebody tells us that Y2 is definitely equal to ½, then our probability of Y1 being bigger than ¾ is exactly 7/16.*2450

*Let me recap the steps involved there.*2464

*First, I graphed the region Y1 goes from 0 to 1, Y2 goes from 0 to 1, that just gives me the square right here.*2467

*And then, I tried to look at the region we are interested in which is where Y2 is equal to ½.*2475

*That is where I got this horizontal line, at Y2 is ½.*2480

*And then, in particular, we are wondering whether Y1 is bigger than ¾.*2485

*That is why I graphed this, it is a little hard to see here but this dotted, black line at ¾.*2490

*We are asking, if we are on the red horizontal line, what is our chance of being in the black part of the red line?*2499

*In order to calculate that, we set up the integral on Y1 of the conditional density function.*2509

*I had to figure out what the conditional density function was.*2519

*I started out with the joint density function divided by the marginal density function, *2522

*which means I had to figure out what the marginal density function was.*2527

*F2 of Y2, remember the variables switch, that is the integral over Y1 of the joint density function.*2530

*I integrate the joint density function over my range of Y1.*2537

*It turns out to be 2Y2, which is reassuring that it is a function of Y2.*2543

*I take that and I plug it back in for F2 of Y2.*2553

*I plug in the joint density function for my numerator and it simplifies down to 2Y1, that is already a function of Y1.*2562

*But, if there had been a Y2, I would have plugged in the given value of Y2 in there, if I needed to.*2571

*I take that to Y1, I plug it back in here because I have now figure out the conditional density function.*2580

*Now, I just have an easy integral in terms of Y1 and I just calculated that integral, I got my 7/16.*2588

*In example 4, we are going to keep looking at that same setup from example 3.*2598

*Let me go ahead and graph that, as I talk about it.*2603

*We have Y1 and Y2, they are both between 0 and 1.*2606

*There is my Y1 on the horizontal axis, as always.*2614

*Y2 on the vertical axis, there is 1.*2617

*We are in this square and we want to find the conditional expectation of Y1 given that Y2 is equal to ½.*2622

*We know that Y2 is equal to ½ and we know that we are on this red line, right here, that is where Y2 is equal to ½.*2631

*I should have labeled that as ½, right there.*2643

*Y2 is ½, I know I’m on that red line.*2648

*I want to find the conditional expectation of Y1.*2650

*I’m going to use my formula for conditional expectation.*2655

*I gave you this formula back on the third slide of this lecture.*2659

*Just scroll back a few slides in the video and you will see the formula for conditional expectation.*2663

*It is the integral on Y1 of Y1 × the conditional density formula F of Y1 condition on Y2.*2670

*And then, we integrate that with respect to Y1.*2686

*This looks just like the formula for calculating conditional probability, except, the difference is this extra factor of Y1,*2689

*because we are trying to find an expected value right there.*2699

*It is just like back in the single variable case, the expected value of Y was the integral of Y × F of Y DY.*2702

*We have this extra factor of Y in there.*2713

*Here, we are trying to find the expected value of Y1, so we put in that extra factor of Y1.*2719

*This is the same setup that we had for example 3.*2728

*I’m do not want to use a marker there, I want to use a thin pen.*2731

*We already calculated the conditional density function which was 2Y1, by example 3.*2741

*If you did not just watched example 3 in this lecture, just scroll back one slide and take a peek at example 3,*2753

*where we went through some work to calculate the conditional density formula.*2767

*We figure out that it was 2Y1.*2772

*We can now integrate it, we are supposed to integrate it on the whole range of Y1 which is from 0 to 1.*2777

*Y1 = 0 to Y1 = 1, Y1 × 2Y1 is 2Y1² DY1.*2783

*The integral of 2Y1² is 2 × 1/3 Y1³, 2/3 Y1³.*2796

*We want to integrate that from Y1 = 0 to Y1 = 1.*2804

*Not integrate that but evaluate that from Y1 = 0 to Y1 = 1, and that is just 2/3.*2811

*And that is our answer.*2819

*What that means is that, if you are leaving in this joint density function and you have been told that*2820

*Y2 is equal to ½, you are given that Y2 is equal ½.*2829

*Your expected value for Y1 then is 2/3.*2835

*Let me recap the steps here.*2841

*We are working on a square region because that is what is given in the stem of the problem, *2844

*Y1 and Y2 are both between 0 and 1.*2850

*We are going to use the conditional expectations.*2855

*Since we know that Y2 is ½, the formula for conditional expectation that I gave you in the third slide of the same video is,*2858

*the integral of Y1 that is kind of the new factor there because*2868

*we are looking for expected value of the conditional density formula.*2872

*The conditional density formula is what we worked out back in example 3.*2880

*Example 3 was the same setup and we did work out the conditional density formula *2884

*sort of a route to finding the probability.*2888

*That part, the 2Y1 was the same as in examples 3.*2892

*This Y1 was new and we combine them, we get 2Y1².*2896

*And then, we get a very easy integral that just solves out to 2/3.*2900

*In example 5, we are given the joint density function F of Y1 Y2 is E ⁻Y2.*2911

*We are given that on a particular region, I think I better start by graphing that region *2924

*because otherwise, there will be some confusion.*2928

*There is Y1 on my horizontal axis, always, there is Y2.*2933

*I think that might run slightly off to the side, let us move that a little bit.*2939

*We are told that they both go from 0 to infinity but Y2 was always bigger than Y1.*2944

*Let me graph the line Y2 = Y1.*2953

*We are looking at this region sort of above that line.*2958

*This is the same setup that we had in one of the examples on the previous lecture.*2965

*Let me give you a reference for that.*2974

*This was in the lecture on marginal probability and it was example 5, in the previous lecture.*2976

*You might want to go back and look at our solution to example 5, in the lecture on marginal probability, the previous video.*2993

*If you just scroll up here, you will see it.*3002

*It is the same example but we are calculating something different.*3005

*What we did there was we calculated the marginal density function.*3008

*We calculated F1 of Y1.*3016

*The way we calculate it was, by doing the integral on Y2 of the joint density function F Y1 Y2 DY2.*3020

*The answer we got there was E ^- Y1.*3030

*It was a little bit of work to getting it.*3034

*I'm skipping over some of those details, when I talk about it now.*3036

*If you want to go back and check that out, or if you want to redo the integral then you will see where that comes from.*3043

*In today's example, what we are going to figure out is the expected value of Y2 given that Y1 is equal to 5.*3049

*Let me show you, how we are going to calculate that.*3062

*I’m going to use our formula for conditional expectation.*3064

*Let me see if I can graph this quickly.*3069

*Y1 is equal to 5 and that means we are on the line Y1 is equal to 5.*3073

*There is the line Y1 is equal to 5 and that is the line that I'm looking at.*3085

*I want to figure out what the expected value of Y2 will be, if I know that I'm fixed on that red line.*3096

*I’m going to use the formula for conditional expectation.*3103

*That is the integral on Y2 of, here is the new part, the new element is Y2 × F of Y2 given Y1, Y2 condition on Y1 DY2.*3107

*The new element there is that Y2, in order to calculate the conditional expectation.*3127

*That means, I have to figure out what F of Y2 condition on Y1 is.*3136

*Let me calculate that over on the side here.*3143

*F of Y2 condition on Y1, by definition, it is F of Y1, Y2 divided by the marginal density function F1 of Y1.*3146

*In turn, F of Y1 Y2, that is E ⁻Y2, that was given in the stem the problem.*3162

*F1 of Y1, that was what we figured out in example 5 of the previous lecture, *3172

*of the marginal probability lecture, that is E ⁻Y1.*3179

*If we put those together, E ^- Y1, if we flip it up to the numerator, that would be E ⁺Y1.*3185

*E ⁺Y1 - Y2, that is what I'm going to plug in there.*3193

*What is my range on Y2?*3203

*If you look at the range on Y2, it is all the range of this red line.*3206

*That red line starts at Y2 is equal to 5 and it goes on up to infinity.*3212

*My range on Y2 is going to be Y2 = 5 2Y2, I will take the limit as it goes to infinity.*3219

*I'm integrating Y2 × E ⁺Y1 - Y2 DY2.*3230

*I do not want to see a Y1 in here, I want to be integrating with respect to Y2 because I need to get an answer,*3242

*in terms of a numerical answer.*3249

*I’m integrating only with respect to Y2.*3252

*I'm not comfortable with that Y1 in there.*3255

*But, I'm given that Y1 is equal to 5.*3258

*I’m going to plug in Y1 is equal to 5.*3261

*I get the integral, I will write the bounds right now, Y2 × E⁵ - Y2 DY2.*3267

*That is much more reassuring now because I have only Y2 in there.*3277

*I know that, if I integrate this with respect to Y2, I will get a numerical answer.*3283

*Something I can do here is, I could pull E⁵.*3289

*That is E⁵ × Y2 × E ^- Y2 DY2.*3293

*That is a slightly unpleasant integral, I’m going to have to use integration by parts on that.*3302

*Let me do a quick integration by parts, I’m going to use tabular integration.*3307

*It is the cheater’s way of doing integration by parts quickly.*3311

*Y2 E ⁻Y2, if I take derivatives on the left, the derivative of Y2 is 1.*3315

*The derivative of 1 is 0, and the integral of E ⁻Y2 is –E ⁻Y2.*3323

*The integral of that is E ⁻Y2.*3330

*Draw my little diagonal lines and put a + and – there.*3335

*This is E⁵ × - Y2, E ⁻Y2 multiplying down the diagonal lines, - E ^- Y2.*3340

*That was integration by parts, borrowing some techniques from calculus 2.*3354

*If you are a little rusty on your integration by parts, guess what, *3360

*we have a video lecture series on college calculus level 2.*3363

*It is hosted by, non other than Will Murray, it is right here on www.educator.com.*3369

*You can figure out, you can review your integration by parts, if you are a little rusty on that.*3374

*In the meantime, we are going to plough forward with the probability.*3381

*We are trying to integrate this from Y2 = 5 to the limit as Y2 goes to infinity.*3385

*This is E⁵, I see I had E ⁻Y2 here.*3396

*If I plug in infinity, that is E ⁻infinity.*3402

*Even though, that is multiplied by infinity, if I did a little Patel’s rule on that, it would still go to 0.*3406

*E ⁻Y2 is still 0, when I have Y2 going to infinity, both of those terms dropout.*3413

*I have a term for Y2 is equal to 5, + 5 E⁻⁵ + ,*3422

*I’m putting + in here because I’m subtracting -.*3431

*E⁻⁵, and I see I got E⁵ × E⁻⁵, those cancel out.*3434

*This is 6 E⁻⁵ × E⁻⁵ cancels out, gives me a very nice answer here.*3443

*It is just 6 is my answer, that is my expected value of Y2 given that Y1 is equal to 5.*3451

*That is what I just calculated, the expected value of Y2 given that Y1 is equal to 5.*3461

*If somebody tells me that Y1 is equal to 5, that is going to be my guess for what Y2 is.*3469

*That is really the end of the problem but let me recap the steps here.*3479

*First, I looked at the region here, Y1 and Y2 go from 0 to infinity, and I just graph it.*3483

*I graphed that up here, it is this blue triangular region here.*3490

*The important thing to notice there is that, Y2 is bigger than Y1 which is why I have the region north of the line Y = X.*3494

*And then, I also noticed that we are told that Y1 is equal to 5.*3504

*I went ahead and graphed Y1 is equal to 5, it is this vertical red line here.*3509

*Since, we are calculating conditional expectation, I'm going to use the conditional expectation formula *3514

*which we learned about on the third slide of this lecture, the preamble to this lecture.*3522

*You integrate the conditional density formula which you put this extra factor Y2 in there, because it is the conditional expectations.*3530

*That comes from this term, right here, that is where we get that Y2 from there.*3538

*What about this F of Y2 condition on Y1.*3545

*That is something we have to calculate as the joint density function divided by the marginal density function.*3548

*The marginal density function was something that we figure out back in the lecture on marginal probability.*3557

*We did this problem or at least that part of this problem, back in example 5 of the previous videos.*3564

*Just go back, scroll back, and look in example 5, if you do not know where that comes from.*3571

*The answer for the marginal density function was F1 of Y1 is E ⁻Y1.*3577

*Drop that in right here, for F1 of Y1, the numerator here F of Y1 Y2, that comes from this given function here.*3586

*That is where that comes from.*3598

*And then, I simplified that to E ⁺Y1 - Y2.*3599

*And then, I plugged that whole thing back in here, back into this integral.*3604

*I did not like the fact that there was a Y1 in there.*3611

*The reason I did not like it was because I’m integrating with respect to Y2.*3614

*I want to get a number at the end.*3620

*I do not have any way to get rid of that Y1, except to remember that I was told that Y1 is equal to 5.*3622

*That is where I plugged in 5 for Y1, which is kind of nice because it made it into E⁵ × E ⁻Y2.*3632

*I can pull it right out of the integral and now I have a nice little integral, in terms of Y2.*3644

*Fairly nice integral, it is something that I have to use integration by parts for.*3651

*If you are rusty on integration by parts, here is the quick and dirty way to do integration by parts, for this kind of problem.*3655

*If you really want to practice integration by parts, check the calculus level 2 lectures*3662

*here on www.educator.com, you will see a whole lecture on integration by parts.*3666

*You can get up to speed on that.*3676

*Here is what the answer gives me from integration by parts.*3681

*When I plug in Y2 going to infinity, but that kind of kills both terms, if you do a little Patel’s rule*3684

*you will see why that term gives you 0.*3691

*And then, I plugged in Y2 = 5 to both terms, that simplify down to 6 E⁻⁵ which very nice.*3694

*It cancel with E⁵ and gave me just 6 as my expected value.*3702

*That wraps up this lecture on conditional probability and conditional expectation.*3711

*I want to keep using some of the same concepts in the next lecture, which is on independent random variables.*3716

*We will see how that is connected to some of this.*3722

*This is part of the chapter on Bivariate density functions and Bivariate distribution, functions of two variables.*3724

*That in turn, is part of a larger lecture series on probability here on www.educator.com.*3732

*Your host, all the way, is Will Murray, thank you very much for joining me today.*3739

*We will see you next time, bye.*3743

## Start Learning Now

Our free lessons will get you started (Adobe Flash

Sign up for Educator.com^{®}required).Get immediate access to our entire library.

## Membership Overview

Unlimited access to our entire library of courses.Learn at your own pace... anytime, anywhere!