Chap4 Joint Prob Dist
Chap4 Joint Prob Dist
1
Chapter 4
Note: These lecture notes aim to present a clear and crisp presentation of some topics in Probability and
Statistics. Comments/suggestions are welcome via the e-mail: sukuyd@[Link] to Dr. Suresh Kumar.
Let X and Y be two discrete random variables. Then the ordered pair (X, Y ) is called a two dimen-
sional or bivariate discrete random variable.
X/Y y1 y2 ... yn
x1 f (x1 , y1 ) f (x2 , y2 ) ... f (xn , yn )
x2 f (x2 , y1 ) f (x2 , y2 ) ... f (x2 , yn )
... ... ... ... ...
xm f (xm , y1 ) f (xm , y2 ) ... f (xm , yn )
2
4.1.3 Marginal density functions
The marginal density of X, denoted by fX , is defined as
X
fX (x) = f (x, y).
Y =y
4.1.4 Expectation
The expectation or mean of X is defined as
X X X X X
µX = E(X) = xf (x, y) = x f (x, y) = xfX (x).
X=x Y =y X=x Y =y X=x
4.1.5 Covariance
If µX and µY are the means of X and Y respectively, then covariance of X and Y , denoted by Cov(X, Y )
is defined as
X X X X
Cov(X, Y ) = E[(X −µX )(Y −µY )] = E(XY )−E(X)E(Y ) = xf (x, y)− xfX (x) yfY (y).
X=x Y =y X=x X=y
Ex. Suppose in a random experiment of toss of two fair coins, X denotes the number of heads and Y
denotes the number of tails.
(i) Find the joint density f (x, y) of (X, Y ).
(ii) Find the cdf F (x, y).
(iii) Find the marginal densities fX (x) and fY (y).
(iv) Are the variables X and Y independent?
(v) Find Cov(X, Y ).
S = {HH, HT, T H, T T }.
Given that X denotes the number of heads and Y denotes the number of tails. So X = 0, 1, 2 and
Y = 0, 1, 2. The joint pmf f (x, y) is given by
f (0, 0) = P (X = 0, Y = 0) = 0,
f (0, 1) = P (X = 0, Y = 1) = 0,
f (0, 2) = P (X = 0, Y = 2) = 1/4,
3
f (1, 0) = P (X = 1, Y = 0) = 0,
f (1, 1) = P (X = 1, Y = 1) = 1/2,
f (1, 2) = P (X = 1, Y = 2) = 0,
f (2, 0) = P (X = 2, Y = 0) = 1/4,
f (2, 1) = P (X = 2, Y = 1) = 0,
f (2, 2) = P (X = 2, Y = 2) = 0.
X/Y 0 1 2
0 0 0 1/4
1 0 1/2 0
2 1/4 0 0
F (0, 0) = f (0, 0) = 0,
F (0, 1) = f (0, 0) + f (0, 1) = 0,
F (0, 2) = f (0, 0) + f (0, 1) + f (0, 2) = 1/4,
F (1, 0) = f (0, 0) + f (1, 0) = 0,
F (1, 1) = f (0, 0) + f (0, 1) + f (1, 0) + f (1, 1) = 1/2,
F (1, 2) = f (0, 0) + f (0, 1) + f (0, 2) + f (1, 0) + f (1, 1) + f (1, 2) = 3/4,
F (2, 0) = f (0, 0) + f (1, 0) + f (2, 0) = 1/4,
F (2, 1) = f (0, 0) + f (0, 1) + f (1, 0) + f (1, 1) + f (2, 0) + f (2, 1) = 3/4,
F (2, 2) = f (0, 0) + f (0, 1) + f (0, 2) + f (1, 0) + f (1, 1) + f (1, 2) + f (2, 0) + f (2, 1) + f (2, 2) = 1.
X/Y 0 1 2
0 0 0 1/4
1 0 1/2 3/4
2 1/4 3/4 1
X 0 1 2
fX (x) 1/4 1/2 1/4
4
Y 0 1 2
fY (y) 1/4 1/2 1/4
X/Y 0 1 2 fX (x)
0 0 0 1/4 1/4
1 0 1/2 0 1/2
2 1/4 0 0 1/4
fY (y) 1/4 1/2 1/4 1
(iv) From the table of joint and marginal densities, we find that f (0, 0) = 0, fX (0) = 1/4 and fY (0) = 1/4.
It follows that f (0, 0) ̸= fX (0)fY (0). So X and Y are not independent.
(v) We find
X 2
E[X] = xfX (x) = 1.
X=0
2
X
E[Y ] = yfY (y) = 1.
Y =0
X2 2
X
E[XY ] = xyf (x, y) = 1/2.
X=0 Y =0
For an easy calculation of E(XY ), write the table showing, all the XY product values as:
X/Y 0 1 2
0 0 0 0
1 0 1 2
2 0 2 4
Multiply these values in the Table with the corresponding values in the f (x, y) values and add to get
E(X, Y ).
Hence, Cov(X, Y ) = E(XY ) − E(X)E(Y ) = 1/2 − (1)(1) = −1/2.
Ex. Two ballpoint pens are selected at random from a box that contains 3 blue pens, 2 red pens, and 3
green pens. If X is the number of blue pens selected and Y is the number of red pens selected, find
(a) the joint probability mass function f (x, y),
(b) P (X + Y ≤ 1).
3 6 9 18 9
(b) P (X + Y ≤ 1) = f (0, 0) + f (0, 1) + f (1, 0) = 28 + 28 + 28 = 28 = 14 .
5
X/Y 0 1 2 fX (x)
3 6 1 10
0 28 28 28 28
9 6 15
1 28 28 0 28
3 3
2 28 0 0 28
15 12 1
fY (y) 28 28 28 1
Ex. In an automobile plant, two tasks are performed by robots, the welding of two joints and tightening
of three bolts. Let X denote the number of defective joints and Y denote the number of improperly
tightened bots produced per car. The probabilities of (X, Y ) are given in the following table.
X/Y 0 1 2 3 fX (x)
0 0.84 0.03 0.02 0.01 0.9
1 0.06 0.01 0.008 0.002 0.08
2 0.01 0.005 0.004 0.001 0.02
fY (y) 0.91 0.045 0.032 0.013 1
2 X
X 3
f (x, y) = f (0, 0) + f (0, 1) + f (0, 2) + f (0, 3) + f (1, 0) + f (1, 1)
X=0 Y =0
+f (1, 2) + f (1, 3) + f (2, 0) + f (2, 1) + f (2, 2) + f (2, 3)
= 0.84 + 0.03 + 0.02 + 0.01 + 0.06 + 0.01 + 0.008 + 0.002 + 0.01 + 0.005 + 0.004 + 0.001
= 1
(ii) The probability that there would be exactly one error made by the robots, is given by
(iii) The probability that there would be no improperly tightened bolts, reads as
2
X
P (Y = 0) = f (x, 0) = f (0, 0) + f (1, 0) + f (2, 0) = 0.84 + 0.06 + 0.01 = 0.91.
X=0
(iv) From the given Table, we notice that f (0, 0) = 0.84, fX (0) = 0.9 and fY (0) = 0.91. So we have
6
This shows that X and Y are not independent.
(v) We find
X2
E(X) = xfX (x) = 0.12,
X=0
3
X
E(Y ) = yfY (y) = 0.148,
Y =0
X2 3
X
E(XY ) = xyf (x, y) = 0.064.
X=0 Y =0
Hence, Cov(X, Y ) = E(XY ) − E(X)E(Y ) = 0.046.
Ex. Suppose X and Y are two discrete random variables taking only integer values. The joint density
function of (X, Y ) is
f (x, y) = c/[n(n + 1)], 1 ≤ y ≤ x ≤ n, where n is some positive integer.
(i) Find the value of c.
(ii) Find the marginal densities.
(iii) Given that n = 5, evaluate P (X ≤ 3, Y ≤ 2).
n X
X n
Sol. (i) Using f (x, y) = 1, we find
x=1 y=x
n X
x
X c
= 1.
n(n + 1)
x=1 y=1
n x
c XX
=⇒ 1 = 1.
n(n + 1)
x=1 y=1
n
c X
=⇒ x = 1.
n(n + 1)
x=1
c n(n + 1)
=⇒ = 1.
n(n + 1) 2
=⇒ c = 2.
(ii) We have
x x
X X 2 2x
fX (x) = f (x, y) = = , 1 ≤ x ≤ n.
n(n + 1) n(n + 1)
y=1 y=1
n n
X X 2 2(n − y + 1)
fY (y) = f (x, y) = = , 1 ≤ y ≤ n.
x=y x=y
n(n + 1) n(n + 1)
1
(iii) Given that n = 5, so f (x, y) = 15 , and therefore
2 X3 2
X 1 1 X 1 1
P (X ≤ 3, Y ≤ 2) = = (3 − y + 1) = (6 − 3 + 2) = .
x=y
15 15 15 3
y=1 y=1
7
4.2 Continuous Bivariate Random Variable
Let X and Y be two continuous random variables. Then the ordered pair (X, Y ) is called a two dimensional
or bivariate continuous random variable.
where R is any region in the domain of f , is called joint probability density function of (X, Y ).
4.2.5 Expectation
The expectation or mean of X is defined as
Z ∞Z ∞
E(X) = xf (x, y)dxdy = µX .
−∞ −∞
8
4.2.6 Covariance
If µX and µY are the means of X and Y respectively, then covariance of X and Y , denoted by Cov(X, Y )
is defined as
Ex. Let X denote a person’s blood calcium level and Y , the blood cholesterol level. The joint density
function of (X, Y ) is
(
k, 8.5 ≤ x ≤ 10.5, 120 ≤ y ≤ 240
f (x, y) =
0, elsewhere
(iii) The probability that a healthy person has a cholesterol level between 150 to 200, is
Z 200
5
P (150 ≤ Y ≤ 200) = fY (y)dy = .
150 12
(iv) We have
1 1 1
fX (x)fY (y) = × = = f (x, y).
2 120 240
This shows that X and Y are independent.
(v) We find
Z ∞ Z ∞ Z 240 Z 10.5
x
E(X) = xf (x, y)dxdy = dxdy = 9.5,
−∞ −∞ 120 8.5 240
Z ∞ Z ∞ Z 240 Z 10.5
y
E(Y ) = yf (x, y)dxdy = dxdy = 180,
−∞ −∞ 120 8.5 240
9
Z ∞ Z ∞ Z 240 Z 10.5
xy
E(XY ) = xyf (x, y)dxdy = dxdy = 1710.
−∞ −∞ 120 8.5 240
Hence, Cov(X, Y ) = E(XY ) − E(X)E(Y ) = 1710 − 9.5 × 180 = 0.
Sol. (i) Here the given range of (X, Y ) is the triangular region common to the three regions given by the
inequalities y ≥ 27, y ≤ x and x ≤ 33, as shown in Figure 4.1.
33
y=x
x = 33
y
27
y = 27
23
23 27 33
x
Figure 4.1: The shaded golden region is the triangular region given by the inequalities y ≥ 27, y ≤ x and
x ≤ 33. The vertical ray enters the given region through the line y = 27 and leaves at the line y = x.
The x-value at the leftmost point (27, 27) of the region is x = 27, and at the rightmost points (all points
on the line x = 33) is x = 33.
Considering vertical ray through the given region, we find that the x limits are from x = 27 to x = 33,
and y limits are from y = 27 to y = x. Therefore, to find c, we use
Z 33 Z x
f (x, y)dydx = 1
27 27
and we get
1
c= .
6 − 27 ln(33/27)
Z y=x
c
(ii) fX (x) = dy = c(1 − 27/x), 27 ≤ x ≤ 33
x
Z x=33y=27
c
fY (y) = dx = c(ln 33 − ln y), 27 ≤ y ≤ 33.
x=y x
We observe that f (x, y) = c/x ̸= fX (x)fY (y). So X and Y are not independent.
10
(iii) To calculate the probability P [X ≤ 32, Y ≤ 30], we need to integrate the joint density over the
shaded golden region shown in Figure 4.2. Considering the horizontal ray through this region, we find
that the x limits are from x = y to x = 32, and y limits are from y = 27 to y = 30.
Z 30 Z 32
c
∴ P [X ≤ 32, Y ≤ 30] = dxdy = c(3 ln 32 + 3 − 30 ln 30 + 27 ln 27).
27 y x
33
30 y=x
x = 33
y
27
y = 27
23
23 27 30 32 33
x
Figure 4.2: The shaded golden region is given by X ≤ 32, Y ≤ 30. The horizontal ray enters this region
through the line x = y and leaves at the line x = 32. The y-value at the bottomost points the region is
y = 27, and at the uppermost points is y = 30.
Theorem: If X and Y are two independent random variables with joint density f , then show that
E(XY ) = E(X)E(Y ), that is, Cov(X, Y ) = 0.
Proof. We have
Z ∞Z ∞
E[XY ] = xyf (x, y)dxdy
Z−∞∞ Z−∞
∞
= xyfX (x)fY (y)dxdy (∵ f (x, y) = fX (x)fY (y) as X and Y are given independent.)
−∞ −∞
Z ∞ Z ∞
= yfY (y) xfX (x)dx dy
Z−∞∞
−∞
= yfY (y)E(X)dy
−∞
Z ∞
= E(X) yfY (y)dy
−∞
= E(X)E(Y ).
Note. Converse of the above result need not be true, that is, if E(XY ) = E(X)E(Y ), then X and Y
need not be independent. For instance, see Table 4.1 for the joint density function of a two dimensional
discrete random variable (X, Y ).
We find that E(X) = 5/2, E(Y ) = 0 and E(XY ) = 0. So E(XY ) = E(X)E(Y ). Next, we see that
fX (1) = 1/2, fY (−2) = 1/4 and f (1, −2) = 0. So fX (1)fY (−2) ̸= f (1, −2), and hence X and Y are not
independent. We can easily observe the dependency X = Y 2 . Thus, covariance does not describe the
type or strength of the association between X and Y except the linear relationship via a measure known
as Pearson coefficient of correlation.
11
X/Y −2 −1 1 2 fX (x)
1 0 1/4 1/4 0 1/2
4 1/4 0 0 1/4 1/2
fY (y) 1/4 1/4 1/4 1/4 1
Table 4.1:
Figure 4.3: In case of large negative covariance, we have ρXY ≈ −1. In case of nearly zero covariance,
ρXY ≈ 0 while in case of very large positive covriance, ρXY ≈ 1.
Note that if ρXY = 0, we say that X and Y are uncorrelated (means no linear relationship). It does
not imply that X and Y are unrelated. Of course, the relationship, if exists, would not be linear.
Remarks: (i) Covariance tells us how the two variables vary together. It can vary from −∞ to ∞. On
the other hand, correlation tells about the degree of linear relationship between the two variables. It can
vary from −1 to 1.
(ii) Covariance matrix of X and Y is written as
2
σX σXY
σY X σY2
It is also symmetric since ρXY = ρY X . In addition, its diagonal elements are unity.
12
Practice Problems (with partial solution steps)
Q.1 Let X denote the number of times a photocopy machine will malfunction: 0, 1, 2 or 3 times, on any
given month. Let Y denote the number of times (0, 1 or 2) a technician is called on an emergency service.
The joint pmf is given as: f (0, 0) = 0.15, f (0, 1) = 0.05, f (0, 2) = 0, f (1, 0) = 0.30, f (1, 1) = 0.15, f (1, 2) =
0.05, f (2, 0) = 0.05, f (2, 1) = 0.05, f (2, 2) = 0.10, f (3, 0) = 0, f (3, 1) = 0.05, and f (3, 2) = 0.05. Find (i)
P (X < Y ), (ii) the marginal pmfs of X and Y , and (iii) Cov(X, Y ).
X/Y 0 1 2 fX (x)
0 0.15 0.05 0 0.20
1 0.30 0.15 0.05 0.50
2 0.05 0.05 0.10 0.20
3 0 0.05 0.05 0.10
fY (y) 0.50 0.30 0.20 1
(i) To find P (X < Y ), do the sum of probabilities of the pairs (X, Y ) where X < Y . Such pairs are
(0, 1), (0, 2), (1, 2). So we have
(iii) E(X) = 1.2, E(Y ) = 0.7, E(XY ) = 1.2 and Cov(X, Y ) = 0.36.
Find (i) k, (ii) P (X > 3Y ), (iii) P (X + Y > 3), and (iv) the marginal pdfs of X and Y . Are X and Y
independent?
Sol. (i) To find k, put the double integral of the joint pdf f (x, y) over the square region 0 < x < k, 0 <
y < k equal to 1, that is,
Z kZ k
2 2
x y = 1.
0 0 81
We find k = 3.
The joint pdf is therefore
(
2 2
x y, 0 < x < 3, 0 < y < 3
f (x, y) = 81
0, elsewhere
(ii) To find P (X > 3Y ), do the double integral of f (x, y) over the portion of the region: 0 < x < 3, 0 <
y < 3, where y < x/3. It is the shaded golden region in Figure 4.4. Any ray parallel to y-axis through
this region, enters the region at y = 0 and leaves the region at y = x/3. Also, the leftmost point of the
region corresponds to x = 0, while the rightmost points correspond to x = 3. So we have
Z 3 Z x/3
2 2 1
P (X > 3Y ) = x ydydx = .
0 0 81 15
13
Figure 4.4: Shaded golden region is portion of the region: 0 < x < 3, 0 < y < 3, where y < x/3.
(ii) To find P (X + Y > 3), do the double integral of f (x, y) over the portion of the region: 0 < x < 3, 0 <
y < 3, where y > 3 − x. It is the shaded golden region in Figure 4.4. Any ray parallel to y-axis through
this region, enters the region at y = 3 − x and leaves the region at y = 3. Also, the leftmost point of the
region corresponds to x = 0, while the rightmost points correspond to x = 3. So we have
Z 3Z 3
2 2
P (X + Y > 3) = x ydydx = 0.9
0 3−x 81
Figure 4.5: Shaded golden region is portion of the region: 0 < x < 3, 0 < y < 3, where y > 3 − x.
14
Q.3 Consider two continuous random variables X and Y with pdf
(
k(x + y), x > 0, y > 0, 3x + y < 3
f (x, y) =
0, elsewhere
Find (i) k, (ii) P (X < Y ), (iii) the marginal pdfs of X and Y , (iv) Cov(X + 2, Y − 3), (v) Corr(−2X +
3, 2Y + 7), and (vi) Cov(−2X + 3Y − 4, 4X + 7Y + 5).
Sol. (i) k = 2,
(ii) P (X < Y ) = 27/32,
(iii) the marginal pdfs of X and Y are
9 3
fX (x) = − 3x + x2 , 0 < x < 1
4 4
1 1 5
fY (y) = + y − y 2 , 0 < y < 3
4 3 36
For the remaining parts, we find E(X) = 5/16, E(Y ) = 21/16, E(XY ) = 3/10 and Cov(X, Y ) =
−0.11016. Also, find Cov(X, X), Cov(Y, Y ) and Corr(X, Y ). Then use the following results:
(1) Cov(aX + b, cY + d) = ac Cov(X, Y )
ac
(2) Corr(aX + b, cY + d) = |a||c| Corr(X, Y ), a ̸= 0, c ̸= 0
If you do not recall these rules, then do direct simplification using the simple rules of expectation and
variance. For example, let us solve part (iii).
Find (i) k, (ii) the marginal pdfs of X and Y , and (iii) the conditional pdfs of X and Y .
Sol. (i) k = 1/2
Q.5 Two persons A and B have agreed to meet for lunch between noon (0:00 pm) to 1:00 pm. Denote
A’s arrival time by X, B’s by Y , and suppose X and Y are independent with density functions:
(
3x2 , 0 < x < 1,
fX (x) =
0, elsewhere
(
2y, 0 < y < 1,
fY (y) = .
0, elsewhere
15
(i) Find the probability that A arrives before B, and hence compute the expected amount of time A
would have to wait for B to arrive.
(ii) If they have pre-decided on a condition that whoever comes first will only wait for 15 minutes for
the other, what is the probability that they will meet for lunch?
(ii) They will meet for lunch if waiting for the either is less than 15 minutes or 1/4 hours. So required
probability is the sum of P (Y − X < 1/4) and P (X − Y < 1/4).
Q.6 The following table shows the quality and meal price ratings (1 lowest to 3 highest) of 300 restaurants
in a metro city:
Develop a bivariate probability distribution for quality X and meal price Y of a randomly selected
restaurant in the metro city. Determine Cov(X, Y ) and Cor(X, Y ). Based on your results, do you suppose
it is likely to find a low cost restaurant with high meal quality.
Sol. Divining the number of restaurants by the total number 300, the probability distribution of (X, Y )
reads:
X/Y 1 2 3 fX (x)
1 0.14 0.13 0.01 0.28
2 0.11 0.21 0.18 0.50
3 0.01 0.05 0.05 0.22
fY (y) 0.26 0.29 0.35 1
E(X) = 1.94, E(Y ) = 2.09, V (X) = 0.4964, V (Y ) = 0.6019, Cov(X, Y ) = 0.2854 and Cor(X, Y ) =
0.5221. Because of the moderately positive correlation between X and Y , it is not very likely to find a
restaurant with least meal price and highest quality.
Q.7 Let T1 , T2 , ..., Tk be independent exponential random variables with mean values 1/λ1 , 1/λ2 , ..., 1/λk ,
respectively. Denote Tmin = min(T1 , T2 , ..., Tk ). Show that Tmin has an exponential distribution. What is
the mean of Tmin ?
16
It implies that P (Ti > t) = eλi t .
17