This is an Example of a function (or transformation) of a random variable. These transformations play a major role in probability and statistics. We will see how to find their pdf's (pmf's) on a few examples.
Example : Say X is the number of roles of a fair die until the first six. We have already seen that P(X=x) = 1/6*(5/6)x-1, x=1,2,.. Let Y be 1 if X is even, 0 otherwise. Find the pmf of Y.
Note: here both X and Y are discrete.
Solution: let's do this a little more general, with p instead of 1/6. Also let q=1-p=5/6. Then
and P(Y=0) = 1 - P(Y=1) = 6/11
Example Say we have a fair coin. We flip the coin until the first "Heads". What is the probability this will happen on an even-numbered flip?
Now we have the same as above, with p=0.5, so P(Y=1)=0.5/(1+0.5)=1/3.
Is there a loaded coin with probability of heads p so that the probability of "first heads on even-numbered flip" is 1/2?
Now P(Y=1)=q/(1+q)=1/2, so 2q=1+q or q=1 or p=0, but if p=0 we never get "heads", so no such coin exists!
Example : say X is a continuous r.v with pdf fX(x) = 1/2exp(-|x|) x
(this is called a double exponential) Let Y=I[-1,1](X). Find the pmf of Y.
Note: here X is continuous and Y is discrete.
Example : again let X have pdf fX(x) = 1/2exp(-|x|) x
. Let Y =X2. Then for y<0 we have P(Y≤y) = 0. So let y>0. Then
Next up some examples of functions of random vectors:
Example : say (X,Y) is a bivariate standard normal r.v, that is it has joint density given by
for (x,y)
2
Let the r.v. (U,V) be defined by U = X+Y and V = X-Y. Find the joint pdf of (U,V)
To start let's define the functions g1(x,y) = x+y and g2(x,y) = x-y, so that U=g1(X,Y) and V = g2(X,Y).
For what values of u and v is f((U,V)(u,v) positive? Well, for any values for which the system of 2 linear equations in two unknowns u=x+y and u=x-y has a solution. These solutions are
x = h1(u,v) = (u + v)/2
y = h2(u,v) = (u - v)/2
From this we find that for any (u,v)
2 there is a unique (x,y)
2 such that u=x+y and v=x-y. So the transformation (x,y)
(u,v) is one-to-one and therefore has a Jacobian given by
Now from multivariable calculus we have the following:
Note that the density factors into a function of u and a function of v. This is not only a necessary but also a sufficient condition for U and V to be independent.
Example : say X and Y are independent standard normal r.v.'s. Let Z = X + Y. Find the pdf of Z.
Note: now we have a transformation from
2
.
Note: Z = X + Y = U in the Example above, so the pdf of Z is just the marginal of U and we find
Say X and Y are two continuous independent r.v with pdf f's fX and fY, and let Z = X+Y. If we repeat the above calculations we can show that in general the pdf of Z is given by
This is called the convolution formula.
There is a second method for deriving the convolution formula which is useful. It uses a continuous analog to the law of total probability:
In the setup from above we have
The tricky part of this is the interchange of the derivative and the integral. Working with densities and cdfs usually means they are ok.
Example : Say X1, .., Xn are iid U[0,1]. Let M=max{X1, .., Xn}. Find fM