Professional Documents
Culture Documents
!!
fX,Y (x,y) = 1 (3.1.2)
all x all y
For discrete random variables, fX,Y (x,y) refers to the probability that X = x and Y = y,
i.e. Pr(X = x ∩ Y = y). From the first condition, we see that fX,Y (x,y) has to be between 0
and 1. The second condition states that the sum of fX,Y (x,y) over all values of x and y has
to be 1. These two conditions go hand in hand because in order for the sum of all probabili-
ties to equal 1, each individual probability has to be non-negative and less than or equal to 1.
If X and Y are continuous random variables, and fX,Y (x,y) is the joint density function of
(X, Y ), then
0 ≤ fX,Y (x,y) (3.1.3)
" ∞ " ∞
fX,Y (x,y) dy dx = 1 (3.1.4)
−∞ −∞
For continuous random variables, fX,Y (x,y) is not required to be less than 1; we only require
that it be non-negative. The double integral of fX,Y (x,y) over its domain has to equal 1.
This is analogous to the double summation in the discrete case.
Note that fX,Y (x,y) is not a probability; it is only the joint density function evaluated at
x and y used to find probability. So, it is okay for fX,Y (x,y) to be greater than 1 at some
points as long as condition 3.1.4 is met.
Example 3.1.1
Let X and Y be discrete random variables with the joint probability function given by the
following table:
X
1 2 3
0 0 0.30 0.20
Y
1 0.10 0.15 0.25
Find
(i) Pr(X + Y = 2)
(ii) Pr(X + Y > 2)
Solution:
Note that the probabilities given in the table are joint probabilities, fX,Y (x,y). To answer
the first question, go through the six probabilities in the table and choose the ones where
X + Y = 2. There are two of them: fX,Y (2,0) and fX,Y (1,1). Thus,
For the second question, use the same technique, but choose the probabilities where X +Y >
2. There are three of them: fX,Y (2,1), fX,Y (3,0), and fX,Y (3,1). So,
Pr(X + Y > 2) = fX,Y (2,1) + fX,Y (3,0) + fX,Y (3,1) = 0.15 + 0.20 + 0.25 = 0.60
Example 3.1.2
Solution:
For this kind of question, it is a good idea to sketch the region that satisfies all the constraints.
In this case, the constraints would be x > 0, y > 0, and x + y < 2. Figure 3.1.1 shows this
region.
"
!#
#"#
" % $#
$$$
! " # !
Figure 3.1.1
Step 2: Choose one variable for the outer integral.
To calculate the desired probability, double-integrate over this region. Then, choose one
variable for the outer integral.
If we choose x, then the limits of the outer integration would be the minimum and maximum
value of x in the region. From the diagram, the minimum value of x is 0 and the maximum
value of x is 2. Thus, the lower limit is 0 and the upper limit is 2.
! 2"! #
Pr(X + Y < 2) = fX,Y (x,y) dy dx
0
Likewise, if we choose y, then the limits of the outer integration would be the minimum and
maximum value of y in the region, which are 0 and 2, respectively.
! 2"! #
Pr(X + Y < 2) = fX,Y (x,y) dx dy
0
Both integrals will produce the same answer, but the variable chosen for the outer inte-
gration will determine the order of integration; so choose the variable that will not require
separating the region of integration, if possible.
The third step is to define the rest of the integral. The variable for the inner integral will
automatically be the variable not chosen for the outer integral. For example, if we chose X
for the outer integral, then the inner integral will be with respect to y.
To determine the limits of integration when the integration is on y, draw a line parallel to
the y-axis that cuts across the region of integration, as shown in Figure 3.1.2. The limits are
the y-coordinates of the intersection points of the vertical line that was just drawn and the
top and bottom bounds of the region.
"
#
"$%$#$− !
!#
#"#
" %$#
$$$
! "$%$! " # !
Figure 3.1.2
In this example, the lower limit is y = 0 because the vertical line intersects the lower bound
at 0. Similarly, the upper limit is y = 2 − x because the vertical line intersects the upper
bound at 2 − x. Since the vertical line can be drawn at any arbitrary location within the
range of values of x, always express the y-coordinates in terms of x, or the variable chosen
for the outer integral.
! 2"! # ! 2"! 2−x #
Pr(X + Y < 2) = fX,Y (x,y) dy dx = fX,Y (x,y) dy dx
0 0 0
On the other hand, if we chose y for the outer integral, then the inner integral will be for
the variable x. In this case, draw a line parallel to the x-axis that cuts across the region,
shown below in Figure 3.1.3.
"
!#
#"#
" %$#
!$%$! !$%$#$−$"
$$$
! " # !
Figure 3.1.3
Determine the limits of integration in the exact same way as before except the limits are
now the x-coordinates of the intersection points of the horizontal line and the left and right
bounds of the region, expressed in terms of y. In this example, the horizontal line intersects
the left bound at x = 0 and the right bound at x = 2 − y.
! 2"! # ! 2"! 2−y #
Pr(X + Y < 2) = fX,Y (x,y) dx dy = fX,Y (x,y) dx dy
0 0 0
The last step is to evaluate the double integral. There are 2 possible orders of integration,
dy dx or dx dy. Regardless, always start with the inner integral and work outwards. We will
start with the dy dx case.
! 2"! 2−x #
Pr(X + Y < 2) = fX,Y (x,y) dy dx
0 0
! 2"! 2−x #
−(x+y)
= e dy dx
0 0
! 2
$ −(x+y) %y=2−x
= −e y=0
dx
0
! 2
$ −(x+2−x)
+ e−(x+0) dx
%
= −e
!0 2
& −2
−e + e−x dx
'
=
0
%x=2
= −e x − e−x x=0
$ −2
= 1 − 3e−2
= 1 − 3e−2
In general, regardless of the nature of the probability or density function, the joint cumulative
distribution function (CDF) of random variables X and Y is defined as
x y
! !
FX,Y (x,y) = fX,Y (s,t) (3.1.6)
s=−∞ t=−∞
In words, the joint CDF is the double summation of the joint density function over all pairs
of values of s and t that are less than or equal to x and y. If X and Y are continuous random
variables, then:
" x " y
FX,Y (x,y) = fX,Y (s,t) dt ds (3.1.7)
−∞ −∞
In the continuous case, the double integral is analogous to the double summation. We in-
tegrate over all values of s and t below x and y, respectively. Note that we can switch the
order of integration and integrate with respect to s first.
There are a few properties that joint CDFs have to satisfy. Some are similar to those for
single-variable CDFs, while others are specific to joint CDFs.
1. The joint CDF evaluated at any point (x,y) is a probability that has to be between 0
and 1
0 ≤ FX,Y (x,y) ≤ 1 (3.1.8)
2. The joint CDF evaluated at negative infinity for both variables is 0, because it is the
probability of X and Y both being less than negative infinity, which is impossible. On
the other hand, the joint CDF evaluated at positive infinity for both variables is 1,
because it is the probability of X and Y both being less than positive infinity, which
is always true.
FX,Y (−∞, − ∞) = 0 (3.1.9)
3. When the value of one of the variables of the joint CDF is positive infinity, the proba-
bility of that variable is 1 and the joint CDF simplifies to a single-variable CDF of the
other variable.
FX,Y (x,∞) = Pr [(X ≤ x) ∩ (Y ≤ ∞)]
= Pr(X ≤ x)
= FX (x) (3.1.11)
Let X and Y be discrete random variables with the joint CDF, FX,Y (x,y), given by the
following table:
X
1 2 3
0 0.10 0.15 0.23
Y 1 0.25 0.32 0.52
2 0.45 0.56 1
Solution:
Remember the probabilities given are cumulative, so we cannot simply choose probabilities
and add them like if we were given the joint probability function.
For this kind of question, it is a good idea to sketch a diagram, as shown in Figure 3.1.4.
The desired probability is represented by the shaded square.
"
#
"
###
! " # $ !
Figure 3.1.4
To determine this probability, begin with FX,Y (3,2) as shown in Figure 3.1.5.
"
#
"
###
! " # $ !
Figure 3.1.5
Then, subtract FX,Y (2,2) and FX,Y (3,1) from FX,Y (3,2) (see Figure 3.1.6 and Figure 3.1.7).
" "
# #
" "
### ###
! " # $ ! ! " # $ !
At this point, we have subtracted the region defined by FX,Y (2,1) (shown in pale gray in
Figure 3.1.8) twice. So we need to add it back.
"
#
"
###
! " # $ !
Figure 3.1.8
FX,Y (3,2) − FX,Y (2,2) − FX,Y (3,1) + FX,Y (2,1) = 1 − 0.56 − 0.52 + 0.32 = 0.24
Example 3.1.4
4 1 4
FX,Y (x,y) = 1 − 2
− 3 + 2 3, x > 2, y > 1
x y xy
Solution:
The first method is longer and it involves determining the joint density function using a
second-order partial derivative (Equation 3.1.15). The order in which we differentiate the
joint CDF does not matter because we will end up with the same joint density function.
∂2
! "
∂ 3 12 24
fX,Y (x,y) = FX,Y (x,y) = − = , x > 2, y > 1
∂x∂y ∂x y 4 x2 y 4 x3 y 4
The desired probability is the integral of the joint density function over the region of inte-
gration, which is the shaded rectangular region shown in Figure 3.1.9.
# 5# 6
Pr [(4 < X ≤ 5) ∩ (3 < Y ≤ 6)] = fX,Y (x,y) dy dx
4 3
# 5# 6
24
= 3 4
dy dx
4 3 x y
# 5$ %y=6
8
= − 3 3 dx
4 x y y=3
# 5! "
8 8
= − 3 3 + 3 3 dx
4 x (6 ) x (3 )
$ %5
4 4
= −
216x2 27x2 4
! " ! "
4 4 4 4
= − − −
216(25) 27(25) 216(16) 27(16)
≈ 0.0029
"
%
! " # !
Figure 3.1.9
The second method involves using the same technique as in Example 3.1.3. The probability
we are calculating is represented by the shaded region in Figure 3.1.9.
Begin with FX,Y (5,6), then subtract FX,Y (4,6) and FX,Y (5,3), then add back FX,Y (4,3) be-
cause it was subtracted twice.
These steps are shown in Figure 3.1.10, Figure 3.1.11, Figure 3.1.12, and Figure 3.1.13.
" "
& &
% %
""" """
! """ """ """ # $ ! ! """ """ """ # $ !
% %
""" """
! """ """ """ # $ ! ! """ """ """ # $ !
Specifically, for two random variables X and Y , the marginal distribution of X is the proba-
bility density function of X, while the marginal distribution of Y is the density function of Y .
The joint density function of X and Y contains information on the probabilities of x and
y jointly occurring. So, if we want the density function of just one of the variables, say X,
then combine fX,Y (x, y) over all y, for each value of x. If we want the density function of Y ,
combine fX,Y (x, y) over all x, for each value of y.
If X and Y are discrete random variables, then the marginal distributions of X and Y are:
#
fX (x) = fX,Y (x,y) (3.1.16)
all y
#
fY (y) = fX,Y (x, y) (3.1.17)
all x
In the discrete case, combine fX,Y (x, y) by taking the sum over the variable for which we are
not determining the marginal distribution.
If X and Y are continuous random variables, then the marginal distributions of X and Y
are: $ ∞
fX (x) = fX,Y (x,y) dy (3.1.18)
−∞
! ∞
fY (y) = fX,Y (x,y) dx (3.1.19)
−∞
In continuous case, combine fX,Y (x,y) by taking the integral over the variable for which we
are not determining marginal distribution
The important thing to remember is to always combine the other variable: in the discrete
case, take the sum, in the continuous case, integrate.
Example 3.1.5
Let X and Y be discrete random variables with the joint probability function given by the
following table:
X
1 2 3
0 0 0.30 0.20
Y
1 0.10 0.15 0.25
Solution:
There are three possible values of x; so we need to calculate Pr(X = 1), Pr(X = 2), and
Pr(X = 3) by adding fX,Y (x,y) over the two possible values of y, for each of the three values
of x.
"
Pr(X = 1) = fX (1) = fX,Y (1,y) = fX,Y (1,0) + fX,Y (1,1) = 0 + 0.10 = 0.10
all y
"
Pr(X = 2) = fX (2) = fX,Y (2,y) = fX,Y (2,0) + fX,Y (2,1) = 0.30 + 0.15 = 0.45
all y
"
Pr(X = 3) = fX (3) = fX,Y (3,y) = fX,Y (3,0) + fX,Y (3,1) = 0.20 + 0.25 = 0.45
all y
Therefore, ⎧
⎪
⎪
⎪ 0.10, x = 1
⎨
fX (x) = 0.45, x = 2
⎪
⎪
⎩0.45, x = 3
⎪
Notice that we are essentially summing the columns in the table. Normally, we would sum
the columns or rows depending on how the variables are presented. If we wanted the marginal
probability function of Y , then we would sum the rows.
It is a good idea to perform a check by adding all the probabilities in the marginal probability
function to see if they add to 1. If they do not, then there is a mistake in the calculations.
!
Check: fX (x) = fX (1) + fX (2) + fX (3) = 1
all x
Example 3.1.6
Let X and Y be continuous random variables with the joint density function
⎧
⎨3(1 − x + y), 0 ≤ x ≤ y ≤ 1 − x
fX,Y (x,y) =
⎩ 0, otherwise
Solution:
When dealing with joint density functions of continuous random variable, it is worth taking
time to sketch the region defined by the domain of the joint density, because it is the basis
for the integration that often follows. The region of interest is bounded by x ≥ 0, y ≥ x and
y ≤ 1 − x, as shown in Figure 3.1.14.
"
$
%!
"%&
!"#
"%&
%$
%−
%!
! !"# $ !
Figure 3.1.14
Determine the marginal density of X, fX (x), which we integrate over all possible values of
y. To determine the limits of integration, draw a line parallel to the y-axis across the region
(see Figure 3.1.15).
"
$
"#&%$%'#! #!
" #&
!"#
"%&
%$
%−
%!
"#&#!
! !"# $ !
Figure 3.1.15
The point where the vertical line intersects the lower bound (y = x) is the lower limit of the
integral, while the point where the vertical line intersects the upper bound (y = 1 − x) is
the upper limit.
! 1−x
fX (x) = 3(1 − x + y) dy
x
When calculating the marginal density of x, we substitute the limits into y, not x, after
evaluating the integral because we integrate with respect to y.
#y=1−x
y2 9
"
fX (x) = 3 y − xy + = 6x2 − 12x + , 0 ≤ x ≤ 0.5
2 y=x 2
Notice that the marginal density can only involve the variable x. It cannot involve any
other variables. Notice from Figure 3.1.15 that x ranges from 0 to 0.5 within the region of
domain, which is why the domain of X is from 0 to 0.5. As a check, integrate the marginal
distribution over its domain to see if we get 1.
0.5 $ %
9
! !
2
fX (x) dx = 6x − 12x + dx = 1
0 2
Go through the same sequence of steps to calculate the marginal density of Y . First, draw
a line parallel to the x-axis cutting across the region. However, there are two possible lines
because the function defining the right bound of the region changes at x = 0.5, as shown in
Figure 3.1.16.
"
$
%!
!%&%$%− " "%&
!%&%!
!"#
"%&
%$
!%&%! !%&%" %−
%!
%%%
! !"# $ !
Figure 3.1.16
This is an indication to split the integration into two. The first integral is valid from y = 0
to y = 0.5, and the second is valid from y = 0.5 to y = 1.
Second, for the first integral, the horizontal line intersects the left bound at x = 0 which
becomes the lower limit, and intersects the right bound at x = y which becomes the upper
limit. Do the same for the second integral, except the upper limit is x = 1 − y.
⎧ % y
3(1 − x + y) dx, 0 ≤ y ≤ 0.5
⎪
⎪
⎨
fY (y) = 0
% 1−y
3(1 − x + y) dx, 0.5 < y ≤ 1
⎪
⎪
⎩
0
Third, after integrating, substitute the limits of integration into x instead.
'x=y
x2
⎧ & ⎧
y2
( )
⎪
⎪ 3 x − + xy , 0 ≤ y ≤ 0.5 ⎪
⎨ 3 y+
⎪ , 0 ≤ y ≤ 0.5
2
⎨
fY (y) = x=0
x=1−y = 2
x2 3
& '
⎩3 x − + xy , 0.5 < y ≤ 1 ⎩ (1 − y)(1 + 3y), 0.5 < y ≤ 1
⎪
⎪ ⎪
⎪
2 x=0 2
Again, notice that the marginal density of Y only involves y. To check for mistakes integrate
both parts of the marginal density over their respective domain and see if they add to 1.
! ∞
Continuous case: E[g(X)] = g(x) · fX (x) dx (3.1.21)
−∞
Then, sum or integrate over all x and all y, depending on whether the variables are discrete
or continuous.
""
Discrete case: E[g(X,Y )] = g(x,y) · fX,Y (x,y) (3.1.22)
all x all y
! ∞ ! ∞
Continuous case: E[g(X,Y )] = g(x,y) · fX,Y (x,y) dy dx (3.1.23)
−∞ −∞
Example 3.1.7
Let X and Y be discrete random variables with the joint probability function given by the
following table:
X
1 2 3
0 0 0.30 0.20
Y
1 0.10 0.15 0.25
Find E[X].
Solution:
One way to calculate the expected value is to determine the marginal probability function of
X using techniques from Section 3.1.3, and then calculate the moment like in the one-variable
case.
⎧
⎪
⎪
⎪ 0.10, x = 1
⎨
fX (x) = 0.45, x = 2
⎪
⎪
⎩0.45, x = 3
⎪
!
E[X] = x · Pr(X = x)
all x
= 1 · Pr(X = 1) + 2 · Pr(X = 2) + 3 · Pr(X = 3)
= 1(0.10) + 2(0.45) + 3(0.45)
= 2.35
Another way to calculate the expected value is to use double summation directly without
finding the marginal probability function first. In other words, we are using Equation 3.1.22,
where g(X) = X. Multiply g(X) with fX,Y (x,y) and add all six possibilities.
!!
E[X] = x · fX,Y (x,y)
all x all y
Notice that the values of x are repeated in multiple factors to account for the different values
of y for each value of x.
Essentially, the marginal probability function calculations are embedded in the expected
value calculations. Thus, the two methods to solve this problem are equivalent.
Example 3.1.8
Let X and Y be discrete random variables with the joint probability function given by the
following table:
X
1 2 3
0 0 0.30 0.20
Y
1 0.10 0.15 0.25
Y
Find E[ X ].
Solution:
The same two methods used in Example 3.1.7 can be applied in this example. However, the
Y
probability function for X is more difficult to determine because there are more values to
consider. It is easier to use the double summation method.
Y
In this example, gX,Y (X,Y ) = X
. Logically, we multiply gX,Y (x,y) times fX,Y (x,y) and sum
all six possibilities.
! " ##
Y y
E = · fX,Y (x,y)
X all x all y
x
$ % $ % $ % $ % $ % $ %
0 0 0 1 1 1
= f (1,0) + f (2,0) + f (3,0) + f (1,1) + f (2,1) + f (3,1)
1 2 3 1 2 3
1 1
= 0 + 0 + 0 + 1(0.10) + (0.15) + (0.25)
2 3
≈ 0.2583
Example 3.1.9
Find E[Y ].
Solution:
The first method to calculate E[Y ] is to find the marginal density of Y , and then determine
the expected value in a similar process that was performed for one-variable density functions.
Remember from Section 3.1.3 that we integrate over all possible values of x to determine the
marginal density of Y .
In this case, x is defined between y and 1; so integrate the joint density function from y to
1, and substitute the limits into x.
! 1
fY (y) = 2(x + y) dx
y
#x=1
x2
"
=2 + xy
2 x=y
2
= 1 + 2y − 3y , 0≤y≤1
The domain of fY (y) is 0 ≤ y ≤ 1 rather than 0 ≤ y ≤ x because the variable x has been
evaluated and removed from the joint density function. Thus, the only variable remaining
is y.
Another way to determine the limits of integration is to sketch a diagram of the domain by
combining the inequalities y ≥ 0, y ≤ x, and x ≤ 1, as shown in Figure 3.1.17.
"
"
"!$!!
!!
" #$
#
!!! "!$!# " !
Figure 3.1.17
To calculate E[Y ], integrate y · fY (y) with respect to y over the domain of fY (y).
! 1
E[Y ] = y · fY (y) dy
0
! 1
= y(1 + 2y − 3y 2 ) dy
!0 1
= (y + 2y 2 − 3y 3 ) dy
0
" 2 #1
y 2y 3 3y 4
= + −
2 3 4 0
1 2 3
= + −
2 3 4
5
=
12
The second method is to evaluate the expected value directly using Equation 3.1.23, where
g(X,Y ) = Y . Evaluate the double integral in any order. In this example, we integrate with
respect to x first, then y. Figure 3.1.18 shows a horizontal line cutting through the region
of integration.
"
"
!!
" #$
!!$!"
!!$!"
#
!!! " !
Figure 3.1.18
The lower and upper limits of the inner integration are the intersection points of the horizon-
tal line with the left and right bounds of the region. After evaluating the inner integration,
we substitute the limits into x and not y, because the inner integration is with respect to x.
! 1! 1
E[Y ] = y · fX,Y (x,y) dx dy
0 y
! 1! 1
= y · 2(x + y) dx dy
0 y
! 1 #x=1
x2 y + 2xy 2
"
= x=y
dy
0
! 1
= (y + 2y 2 − 3y 3 ) dy
0
$ 2 %1
y 2y 3 3y 4
= + −
2 3 4 0
1 2 3
= + −
2 3 4
5
=
12
To show that both methods are equivalent, factor y from the inner integration because y
is treated as a constant when integrating with respect to x. Then, the inner integration
becomes the marginal density of Y , fY (y). The integral of y · fY (y) is the definition of E[Y ].
Therefore, Method 2 is equivalent to Method 1 but with the integral calculating the marginal
! 1! 1
E[Y ] = = y · fX,Y (x,y) dx dy
0 y
! 1 ! 1
= y fX,Y (x,y) dx dy
0 y
! 1
= y · fY (y) dy
0
Discrete Continuous
Joint PMF Properties: Properties:
(discrete) 0 ≤ fX,Y (x,y) ≤ 1
"" ! ∞ ! ∞0 ≤ fX,Y (x,y)
Joint PDF fX,Y (x,y) = 1 fX,Y (x,y) dy dx = 1
all x all y −∞ −∞
(continuous)
x y ! x ! y
" "
Joint CDF FX,Y (x,y) = fX,Y (s,t) FX,Y (x,y) = fX,Y (s,t) dt ds
s=−∞ t=−∞ −∞ −∞
Properties:
0 ≤ FX,Y (x,y) ≤ 1
FX,Y (∞,∞) = 1
FX,Y (−∞, − ∞) = 0
FX,Y (−∞,y) = 0
FX,Y (x, − ∞) = 0
Marginal Distributions
Discrete Continuous
! " ∞
fX (x) = fX,Y (x,y) fX (x) = fX,Y (x,y) dy
all y −∞
" ∞
!
fY (y) = fX,Y (x,y) fY (y) = fX,Y (x,y) dx
all x −∞
Joint Moments
Discrete Continuous
!! " ∞" ∞
E[g(X,Y )] = g(x,y) · fX,Y (x,y) E[g(X,Y )] = g(x,y) · fX,Y (x,y) dy dx
all x all y −∞ −∞