Example say X~U[0,1] and λ>0. What is the pdf (pmf?) of the random variable Y=-λlog(X)?
Solution: we first find the cdf and then the pdf as follows:
if y>0. For y<0 note that P(-logX<y) = 0 because 0<X<1, so logX<0, so -logX>0 always.
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:
and P(Y=0) = 1 - P(Y=1) = 5/11
Example say X is a continuous r.v with pdf fX(x) = ½exp(-|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) = ½exp(-|x|) x
. Let Y =X2. Then for y<0 we have P(Y≤y) = 0. So let y>0. Then
Example Let X~U[0,2], and let Y=sin(2πX). Find fY(y).
We have of course
P(Y≤y)=P(sin(2πX)≤y)
the hard part is solving the inequality sin(2πX)≤y. The R function sinfig shows what is needed. The points were we have sin(2πx)=y are of course y=asin(y)/2/π. Let a=asin(y)/2/pi and note that asin(-y)=-asin(y), then we have

if |y|<1
Notice that asin is a strictly increasing function, so its derivative is positive. Also
limy→-∞FY(y)=limy→-∞{asin(y)/pi+1/2}=0
limy→∞FY(y)=limy→∞{asin(y)/pi+1/2}=1
Next up some examples of functions of random vectors:
Example Say (X,Y) is a discrete rv with joint pmf fX,Y(x,y)=(1-p)2px, x,y
{0,1,..}, y≤x, and 0<p<1. Let U=X and V=X-Y. Find fU,V(u,v)
First what are the possible values of (U,V)? We have u=x
{0,1,..} and y≤x or 0 ≤x-y=v and so v
{0,1,..} Finally v=x-y=u-y≤u because y≥0
Now for any (u,v)
{0,1,..} with v≤u we have
fU,V(u,v) = P(U=u,V=v) = P(X=u,X-Y=v) = P(X=u,u-Y=v) = P(X=u,Y=u-v) = (1-p)2pu
So we see that fU,V(u,v)=fX,Y(u,v), or (X,Y) has the same distribution as (U,V)!
Before we go on let's revisit the first example above, where we had X~U[0,1], λ>0 and Y=-λlog(X). We found fY(y) =1/λ·exp(-y/λ) Now let g(x)=-λlog(x) and notice that g is strictly decreasing. Then

In one dimension this is rarely useful, it is usually easier to just do the problem directly as above. It does become useful in higher dimensions.
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 X1, .., Xn are iid U[0,1] Let Y1=X1, Y2=X2-X1,..,Yn=Xn-Xn-1. Now
so (Y1, .., Yn) is uniform. But careful, uniform on what set?
y2=x2-x1, 0≤xi≤1, therefore -1≤y2≤1. We have
0≤y1≤1
-y1≤y2≤1-y1
-(y1+y2)≤y3≤1-(y1+y2)
and so on
For n=2 the set is shown here:
Example A rv X is called a normal (or Gaussian) rv with mean μ and standard deviation σ if it had density

a special case is a standard normal rv, which has μ=0 and σ=1
Say X and Y are independent standard normal rv's. Let Z = X + Y. Find the pdf of Z.
Note: now we have a transformation from
2 →
.
Let's first assume that X and Y are standard normal rv's, that is μX=μY=0 and σX=σY=1. Then 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, using the law of total probability for rv's:
Example say X and Y are independent exponential rv's with rate λ. Find the pdf of Z=X+Y

Example Say (X,Y) is a discrete rv with joint pmf fX,Y(x,y)=(1-p)2px, x,y
{0,1,..}, y≤x, and 0<p<1. Let U=I(X=Y). Find fU(u)
Example : Say X1, .., Xn are iid U[0,1]. Let M=max{X1, .., Xn}. EM and VM.
First we find fM

Now
