In this video, we're going to do an example in which we
derive the probability density function of the sum of two
random variables.
The problem tells us the following.
We're given that X and Y are independent random variables.
X is a discrete random variable with PMF Px.
Y is continuous with PDF Fy.
And we'd like to compute the PDF of Z which is equal to X
plus Y. We're going to use the standard approach here--
compute the CDF of Z and then take the
derivative to get the PDF.
So in this case, the CDF, which is Fz, by definition is
the random variable Z being less than little z.
But Z is just X plus Y. So now, we'd actually like to,
instead of having to deal with two random variables, X and Y,
we'd like to deal with one at a time.
And the total probability theorem allows us to do this
by conditioning on one of the two random variables.
Conditioning on Y here is a bit tricky, because Y is
continuous, and you have to be careful with your definitions.
So conditioning on X seems like the way to go.
So let's do that.
This is just the probability that X equals little x, which
is exactly equal to the PMF of X evaluated at x.
Now we're given we're fixing X equal to little x.
So we can actually replace every instance of the random
variable with little x.
And now I'm going to just rearrange this so that it
looks a little nicer.
So I'm going to have Y on the left and say Y is less than z
minus x, where z minus x is just a constant.
Now, remember that X and Y are independent.
So telling us something about X shouldn't change our beliefs
about Y. So in this case, we can actually drop the
conditioning.
And this is exactly the CDF of Y evaluated at z minus x.
So now we've simplified as far as we could.
So let's take the derivative and see where that takes us.
So the PDF of Z is, by definition, the derivative of
the CDF, which we just computed here.
This is sum over x Fy z minus x Px.
What next?
Interchange the derivative and the summation.
And a note of caution here.
So if x took on a finite number of values, you'd have a
finite number of terms here.
And this would be completely valid.
You can just do this.
But if x took on, for example, a countably
infinite number of values--
a geometric random variable, for example--
this would actually require some formal justification.
But I'm not going to get into that.
So here, the derivative with respect to z-- this is
actually z--
is you use chain rule here.
Px doesn't matter, because it's not a function of z.
So we have Fy evaluated at z minus x according to the chain
rule, and then the derivative of the inner quantity, z minus
x, which is just 1.
So we don't need to put anything there.
And we get Px of x.
So there we go.
We've derived the PDF of z.
Notice that this looks quite similar to the convolution
formula when you assume that both X and Y are either
continuous or discrete.
And so that tells us that this looks right.
So in summary, we've basically computed the PDF of X plus Y
where X is discrete and Y is continuous.
And we've used the standard two-step approach--
compute the CDF and then take the derivative to get the PDF.