Lect6 PDF
Lect6 PDF
Lect6 PDF
So far we have been only dealing with the probability distributions of single random variables.
However, we are often interested in probability statements concerning two or random variables. In
order to do this, we define the joint (cumulative) distribution functions of these random variables.
Definition 1 Suppose that X and Y are two random variables. The joint (cumulative) distribution
function of X and Y is the function on R2 defined by
We can get the distribution function of X easily from the joint distribution function of X and Y :
Similarly we can get the distribution function of Y easily from the joint distribution function of X
and Y :
FY (y) = lim F (x, y) = F (, y).
x
The distribution functions FX and FY are sometimes called the marginal distribution functions of
X and Y respectively.
The joint distribution function F of X and Y contains all the statistical information about X
and Y . In particular, given the joint distribution function F of X and Y , we can calculate the
probability of any event defined in terms of X and Y . For instance, for any real numbers a b
and c d, we have
In the case when X and Y are both discrete random variables, it is more convenient to use the
joint probability mass function of X and Y .
Definition 2 Suppose that X and Y are two discrete random variables. The joint probability mass
function of X and Y is the function on R2 defined by
The mass function pX of X can be easily obtained from the joint mass function of X and Y :
X
pX (x) = P(X = x) = p(x, y), x R.
y:p(x,y)>0
1
Similarly, X
pY (y) = P(Y = y) = p(x, y), y R.
x:p(x,y)>0
The mass functions pX and pY are sometimes called the marginal mass functions of X and Y
respectively.
Example 3 A box contains 3 balls labeled 1, 2 and 3. 2 balls are randomly drawn from the box
without replacement. Let X be the number on the first ball and Y the number on the second ball.
Then the joint mass function of X and Y is given by p(1, 2) = p(1, 3) = p(2, 1) = p(2, 3) = p(3, 1) =
p(3, 2) = 61 and p(x, y) = 0 elsewhere.
This joint mass function can be expressed by the following table
y
1 2 3
x
1 0 1/6 1/6
2 1/6 0 1/6
3 1/6 1/6 1/6
Example 4 Suppose that X and Y are two discrete random variables with joint mass function
given by the following table
y
1 2 3 4
x
1 1/4 1/8 1/16 1/16
2 1/16 1/16 1/4 1/8
Then pX (1) = 41 + 18 + 16
1 1
+ 16 = 12 , and pX (2) = 1 pX (1) = 12 . Similarly, pY (1) = 1
4
1
+ 16 = 5
16 ,
3 5 3
pY (2) = 16 , pY (3) = 16 , pY (4) = 16 .
Example 5 Suppose that X and Y are two discrete random variables with joint mass function
given by the following table
y
-1 0 2 6
x
-2 1/9 1/27 1/27 1/9
1 2/9 0 1/9 1/9
3 0 0 1/9 4/27
Find (a) P(Y is even); (b) P(XY is odd).
8
Solution (a) P(Y is even) = P(Y = 2) = 27 . (b) P(XY is odd) = P(X = 1, Y = 1) +
P(X = 1, Y = 3) = 29 .
Suppose that X and Y are two random variables. We say that X and Y are jointly absolutely
continuous if there is a nonnegative function f (x, y) on R2 such that for any region C in R2 ,
ZZ
P((X, Y ) C) = f (x, y)dxdy.
(x,y)C
2
The function f (x, y) is called the joint probability density function of X and Y .
If A and B are subset of R, then as a special case of the display above, we have
Z Z
P(X A, Y B) = f (x, y)dxdy.
B A
Because Z y Z x
F (x, y) = P(X x, Y y) = f (u, v)dudv,
it follows, upon differentiation, that
2F
f (x, y) = (x, y).
xy
If X and Y are jointly absolutely continuous, then both X and Y are absolutely continuous
and their density functions can be obtained as follows:
Z Z
fX (x) = f (x, y)dy, fY (y) = f (x, y)dx.
The proofs of these two formulae are exactly the same, we give give the proof of the first one: for
any subset A of R,
Z Z
P(X A) = P(X A, Y (, )) = f (x, y)dydx.
A
The densities fX and fY are sometimes called the marginal densities of X and Y respectively.
Example 6 Suppose that X and Y are jointly absolutely continuous with density function given
by (
2ex e2y , 0 < x < , 0 < y <
f (x, y) =
0, otherwise.
Find (a) P(X > 1, Y < 1) (b) P(X < Y ).
Solution. (a)
Z Z 1 Z Z 1
x 2y x
P(X > 1, Y < 1) = ( 2e e dy)dx = e dx 2e2y dy
1 0 1 0
1
= e (1 e2 ).
(b)
Z Z Z Z
P(X < Y ) = 2ex e2y dy)dx =
( ex ( 2e2y dy)dx
Z0 x Z 0 x
1
= ex e2x dx = e3x dx = .
0 0 3
Example 7 A point (X, Y ) is randomly chosen from a disk of radius R centered at the origin so
that each point in the disk is equally likely. Then X and Y are jointly absolutely continuous with
joint density given by (
1
2 x2 + y 2 < R2
f (x, y) = R
0 otherwise.
Find the marginal densities of X and Y . Find the density of Z = X 2 + Y 2 .
Solution.
3
We can also define the joint distributions for n random variables in exactly the same way as
for we did for n = 2. For instance, the joint distribution function F of the n random variables
X1 , . . . , Xn is defined by
Further, the n random variables are said to be jointly absolutely continuous if there is a nonnegative
function f on Rn such that for any region C is Rn ,
Z Z
P((X1 , . . . , Xn ) C) = . . . f (x1 , . . . , xn )dx1 . . . dxn .
{x1 ,...,xn )C}
One can similarly define the joint mass function of n discrete random variables.
Theorem 9 Two discrete random variables X and Y are independent if and only if
Theorem 10 Suppose that X and Y are jointly absolutely continuous. Then X and Y are inde-
pendent if and only if
f (x, y) = fX (x)fY (y), (x, y) R2 .
It is easy to see that the random variables X and Y in Example 3, in Example 4 and in Example
5 are dependent, the random variables in Example 6 are independent, and the random variables in
Example 7 are dependent.
One can define the independence of n > 2 random variables similar to the case n = 2. Similarly
we have the following
n random variables X1 , . . . , Xn are independent if
4
Example 11 Suppose that n + m independent trials, having a common success probability p, are
performed. If X is the number of successes in the first n trials, Y is the number of successes in the
last m trials and Z is the total number of successes, then X and Y are independent, but X and Z
are dependent.
Example 12 Suppose that the number of people entering a post office on a given day is a Poisson
random variables with parameter . Suppose that each person entering the post office is a male
with probability p and a female with probability 1 p. Let X be the number of males entering the
post office on that day and Y the number of females entering the post office on that day. Find the
joint mass function of X and Y .
Example 13 A man and a woman decides to meet at a certain location. If each person arrives
independently at a time uniformly distributed between noon and 1 pm, find the probability that the
first to arrive has to wait longer than 10 minutes.
Solution Using geometric considerations, we can easily find the answer is 25
36 .
Example 14 Suppose that X and Y are independent geometric random variables with parameter
p. (a) Find the distribution of min(X, Y ). (b) Find P(Y X). (c) Find the distribution of X + Y .
(d) Find P(Y = y|X + Y = z) for z 2 and y = 1, . . . , z 1.
Solution. (a) For any positive integer z, we have
1 (1 p)2 = 2p p2 .
(b)
X
X
P(Y X) = P(X = x, Y X) = P(X = x, Y x)
x=1 x=1
X X
= P(X = x)P(Y x) = p(1 p)x1 (1 p)x1
x=1 x=1
X
p
= p (1 p)2(x1) = .
2p p2
x=1
(d)
5
P(Y = y, X + Y = z) P(X = z y, Y = y)
P(Y = y|X + Y = z) = =
P(X + Y = z) P(X + Y = z)
P(X = z y)P(Y = y) p(1 p)zy1 p(1 p)y 1
= =
P(X + Y = z) (z 1)p2 (1 p)z2
1
= .
z1
Sums of Independent Random Variables
We often have to compute the distribution of X + Y from teh distributions of X and Y when
X and Y are independent. We start with the case when both X and Y are absolutely continuous.
Suppose that X and Y are independent absolutely continuous random variables with densities
fX and fY respectively. Then the distribution of X + Y is
Z Z zy
FX+Y (z) = P(X + Y z) = fX (x)fY (y)dxdy
Z Z z
= fX (u y)fY (y)dudy
Z
z Z
= fX (u y)fY (y)dydu.
Thus X + Y is also an absolutely continuous random variable and its density is given by
Z Z
fX+Y (z) = fX (z y)fY (y)dy = fX (x)fY (z x)dx.
Example 15 Suppose that X and Y are independent random variables and both are uniformly
distributed on (0, 1). Find the density of X + Y .
Solution We could solve this problem by the formula above. Here I give a direct solution. By
geometric considerations, we can easily find that for z (0, 1],
z2
P(X + Y z) = ,
2
and for z (1, 2),
(2 z)2
P(X + Y z) = 1 .
2
Thus
z,
0 < z 1,
fX+Y (z) = 2 z, 1 < z < 2,
0, otherwise.
6
Theorem 16 Suppose that X and Y are independent random variables, X is a Gamma random
variable with parameters (1 , ) and Y is a Gamma random variable with parameters (2 , ). Then
X + Y is a Gamma random variable with parameters (1 + 2 , ).
where R1
0 u1 1 (1 u)2 1 du
c= .
(1 )(2 )
The proof is now finished.
Theorem 17 Suppose that X and Y are independent random variables, X is a normal random
variable with parameters (1 , 12 ) and Y is a normal random variable with parameters (2 , 22 ).
Then X + Y is a normal random variable with parameters (1 + 2 , 12 + 22 ).
Example 18 Suppose that X and Y are independent random variables and both of them are normal
random variables with parameters (0, 2 ). Find the density of X 2 + Y 2 .
Solution X 2 and Y 2 are independent random variables and each is a Gamma random variable
with parameters ( 12 , 21 2 ). Thus by Theorem 16, we know that X 2 +Y 2 is a Gamma random variable
with parameters (1, 21 2 ), which is the same as an exponential random variable with parameter 21 2 .
Now we deal with the case when X and Y are both discrete random variables.
Suppose that X and Y are independent discrete random variables with mass functions pX and
pY respectively. Let x1 , x2 , . . . be the possible values of X. For any real number z,
X X
P(X + Y = z) = P(X = xi , X + Y = z) = P(X = xi , Y = z xi )
I i
X X
= P(X = xi )P(Y = z xi ) = pX (xi )pY (z xi ).
i i
7
If, furthermore, X and Y are integer valued random variables, then the mass function of X + Y is
given by (P
x= pX (x)pY (z x), when z is an integer
pX+Y (z) =
0, otherwise.
And if X and Y are nonnegative integer valued random variables, then the mass function of X + Y
is given by (P
z
x=0 pX (x)pY (z x), z = 0, 1, . . .
pX+Y (z) =
0, otherwise.
Theorem 19 Suppose that X and Y are independent random variables, X is a binomial random
variable with parameters (n, p) and Y is a binomial random variable with parameters (m, p). Then
X + Y is a binomial random variable with parameters (n + m, p).
Theorem 20 Suppose that X and Y are independent random variables, X is a Poisson random
variable with parameter 1 and Y is a Poisson random variable with parameter 2 . Then X + Y
is a Poisson random variable with parameter 1 + 2 .
Theorem 21 If X and Y are discrete random variables with joint mass function p(x, y), then for
any function on R2 , XX
E[(X, Y )] = (x, y)p(x, y).
x y
If X and Y are jointly absolutely continuous with joint density f (x, y), then then for any function
on R2 , Z Z
E[(X, Y )] = (x, y)f (x, y)dxdy.
Xn n
X
E[ Xi ] = E[Xi ].
i=1 i=1
8
More generally, we have the following:
Theorem 23 If X and Y are independent random variables, then for any functions and on
R,
E[(X)(Y )] = E[(X)] E[(Y )].
Just as the expectation and variance of a single random variable give us information about the
random variable, so does the covariance of two random variables give us information about the
relationship between the two random variables.
Definition 24 The covariance of two random variables X and Y , denoted by Cov(X, Y ), is defined
as
Cov(X, Y ) = E[(X E[X])(Y E[Y ])].
Expanding the right hand side of the above definition, we see that
Note that if X and Y are independent, then Cov(X, Y ) = 0. However, the converse is not true.
A simple example is as follows. Let X be a random variable such that
1
P(X = 0) = P(X = 1) = P(X = 1) =
3
and let Y be a random variable defined by
(
0, if X 6= 0
Y =
1, if X = 0.
9
As a particular case of the last theorem we get
Xn n X
X n n
X X
Var( Xi ) = Cov(Xi , Xj ) = Var(Xi ) + Cov(Xi , Xj ).
i=1 i=1 j=1 i=1 i6=j
Example 27 A box contains 3 balls labeled 1, 2, and 3. 2 balls are randomly selected from the box
without replacement. Let X be the number on the first ball and let Y be the number on the second
ball. Find Cov(X, Y ).
Find Cov(X, Y ).
Example 29 Suppose that X is a binomial random variable with parameters (n, p).
For i = 1, . . . , n, let Xi = 1 if the i-th trial is a success and X0 = 0 otherwise. Then X1 , . . . , Xn
are independent Bernoulli random variables with parameter p, and X = X1 + + Xn . Thus
E[X] = np and Var(X) = np(1 p).
Example 30 Independent trials, each results in a success with probability p, are performed. Let
X be the number trials needed to get a total of n successes.
Let X1 be the number of trials needed to get the first success. For i > 1, let Xi be the number
of additional trials, after the (i 1)-th success, needed to get the i-th success. Then X1 , . . . , Xn
are independent geometric random variables with parameter p. It follows from the definition that
X = X1 + + Xn . Thus E[X] = np and Var(X) = n(1p) p2
.
Example 31 Suppose that N people throw their hats into the center of the room. The hats are
mixed up, and each person randomly selects. Let X be the number of people that get their own hat.
Find E[X] and Var(X).
Solution For i = 1, . . . , N , let Xi = 1 if the i-th person gets his own hat and Xi = 0 otherwise.
Then X = X1 + + XN . For each i = 1, . . . , N , P(Xi = 1) = N1 . Thus E[X] = 1. For i 6= j,
P(Xi = 1, Xj = 1) = N (N11) . Thus
1 1 1 1
Cov(Xi , Xj ) = 2 = .
N (N 1) N N N (N 1)
10
Hence
N
X X
Var(X) = Var(Xi ) + Cov(Xi , Xj )
i=1 i6=j
1 1 1 1
= N (1 ) + (N 2 N ) =1
N N N N (N 1)
Example 32 If n balls are randomly selected (without replacement) from a box containing N balls
of which m are white. Let X be the number of white balls selected. Find E[X] and Var(X).
Solution For i = 1, . . . , m, let Xi = 1 if the i-th white ball is among the selected and Xi = 0
otherwise. Then X = X1 + + Xm .
n
Now E[Xi ] = P(Xi = 1) = N . Thus E[X] = mnN . For i 6= j,
!
N 2
n2 n(n 1)
E[Xi Xj ] = P(Xi = 1, Xj = 1) = ! =
N N (N 1)
n
and
n(n 1) n2
Cov(Xi , Xj ) = 2.
N (N 1) N
Therefore
m
X X
Var(X) = Var(Xi ) + Cov(Xi , Xj )
i=1 i6=j
n n 2 n(n 1) n2
= m (1 ) + (m m)
N N N (N 1) N 2
m
m n1
= n 1 1 .
N N N 1
Example 33 Suppose that there are N different types of coupons, and each time one obtains a
coupon, it is equally likely to be any one of the N types. Find the expected number of coupons one
need to amass in order to get a complete set of at least one of each type.
Solution Let X be the number of coupons one need to amass in order to get a complete set of
at least one of each type. For i = 0, 1, . . . , N 1, let Xi be the number of additional coupons that
need to be obtained after i distinct types have been collected in order to obtain another distinct type.
Then
X = X0 + X1 + + XN 1 .
Obviously X0 = 1, and for i = 1, . . . , N1 , Xi is a geometric random variable with parameter
(N i)/N and thus
N
E[Xi ] = .
N i
Therefore
N N 1 1
E[X] = 1 + + + = N 1 + + + .
N 1 1 N 1 N
Remark on Notations
11