00:01
So in this question, we're told that the covariance of x and y given z is defined by the expectation value of x minus the expectation value of x given z times y minus the expectation value of y given z.
00:20
So first of all, we want to show a formula.
00:24
So the covariance of x and y given z is going to be, let's simplify it.
00:28
So let's expand this out.
00:30
The expectation of x, y, minus x times the expectation of y given z minus y times the expectation of x given z plus the expectation of x given z times the expectation of y given z so now this is going to give us the expectation of x y minus the expectation of expectation of x times the expectation of y given z minus y the expectation of y times the expectation of x given z and then at the end here this is the oh sorry this is all meant to be given z at the end so that's going to be given z.
02:00
This is going to be given z.
02:01
So they're all going to be given z.
02:03
So let's just kind of put that in at the end.
02:13
So now we have inside here.
02:18
All of these expectations are going to be given z, and that means that they're all going to be functions of z.
02:24
So we're not taking the expectation over z.
02:27
And that means that we can take out other things which are expectations given z.
02:31
So we can take that out of the expectation value.
02:35
And similarly over here, we can take this expectation out of the expectation value.
02:48
And then at the end here, these expectations are already taken with respect to z, which means that they're constants with respect to an expectation conditional on z.
02:58
So they just get left as they are.
03:04
So now this cancels that, and we get that the covariance of x and y given z is equal to the expectation of x, y, given z, minus the expectation of x given z, the expectation of y given z, which is exactly what we wanted to show.
03:24
So that's it for part a.
03:28
Now part b, we want to find the covariance of x and y.
03:36
So what we're going to do is let's take the expected value of the covariance of x and y given z, and that's going to be the expected value of x, y, given z, with another expectation now over z.
03:58
And then down here we have minus the expectation value of x given z, sorry, the expectation of the expectation value of x given z, expectation of y given z.
04:20
So now this here, by the law of total probability, it's just the expectation value of xy.
04:29
And here, what i'm going to do is i'm going to write this as minus the expectation value of the expectation value of x given z, expectation value of y given z, plus the expectation value of x and y, x, and y, and then minus the expectation value of the expectation value of x, y, given z.
05:12
And then what i can do is i can put these two things together.
05:21
Sorry, no, that's not what i want to add and take away.
05:24
What i want to add and take away is the expectation value of the expectation value of x given z times the expectation value of the expectation value of y given z...