Chapter 7
Chapter 7
The total rain fall R and the average temperature T of a locality during a specified period(R,T)
The hardness H and tensile strength T of copper, resulting in the outcomes (h, t).
(X, Y) are finite or countably infinite, i.e., if the possible values of (X, Y) can be
written as (x1, y1), (x2, y2), (x3, y3), . . .
If X and Y are two discrete random variables, the probability distribution for their
and Y.
Definition: The function P(x, y) is a joint probability distribution or probability
mass function of the discrete random variables X and Y with ranges RX and RY if
• The set of triplets (x, y, f(x,y)) is called the joint probability distribution of (X,
Y).
4 xy, if 0 x 1, 0 y 1
f x
0, Otherwise
Solution
p(x<0.5, 0.25<y<1)=
f x, y dxdy
1 0.5
4 xydxdy
0.25 0
11
Solution…
0.5
1 0.5 1
x 2
4 xydxdy 4 y dy
0.25 0 0.25 2 0
1
y
dy
0.25
2
2 1
y
4 0.25
15 0.2344
64
12
Example 2: Suppose (X, Y) has a joint pdf given by
b) Find P(X<1,Y<3)
c) Find P(X>Y)
13
Solution:
f x, y dxdy 1
4 2
cdxdy 1
0 0
4
c x 0 dy 1
2
4
2cdy 1
0
2cy 0 1 c 1
4
8
14
Solution: 1 , if 0 x 2, 0 y 4
f x, y 8
0, Otherwise
3 1
p x 1, y 3 8
1 dxdy
3 1
1 dxdy
8
0 0
3
1
8
x 0 dy
1
0
3
1 dy
8
0
1
8
y 0 p x 1, y 3 3
3
8
15
Solution: Find P(X>Y)
2 x
p x y dydx
Plot the region
1
0 0
8
2 x
px y
1
0 0 8 dydx
x
1
2
0 8 y dx
0
2
1
0 8 xdx
2
1 2
x
16 0
1
4
16
Marginal and conditional distributions
Marginal probability distributions (Discrete case)
Let (X, Y) be a discrete bivariate random variable with joint pmf PX,Y(X, Y). Then the
17
Example1. Let (X,Y)have a joint pmf given by:
X 0 1 2 Y 0 1 2
P(X) 0.40 0.30 0.30 P(Y) 0.50 0.28 0.22
18
Example 2. Consider an experiment of tossing two fair dice and noting the outcome on
each die. The whole sample space consists of 36 elements. Now, with each of these 36
elements associate values of two random variables, X and Y, such that X≡ sum of the
outcomes on the two dice, Y ≡ | difference of the outcomes on the two dice |. Joint pmf is
Y 2 3 4 5 6 7 8 9 10 11 12
0 1/36 1/36 1/36 1/36 1/36 1/36
1 2/36 2/36 2/36 2/36 2/36
2 2/36 2/36 2/36 2/36
3 2/36 2/36 2/36
4 2/36 2/36
5 2/36
Find the marginal distribution of X and Y
19
Solution. The marginal pdf of X is
X 2 3 4 5 6 7 8 9 10 11 12
P(X=x) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36
Y 0 1 2 3 4 5
P(Y=y) 6/36 10/36 8/36 6/36 4/36 2/36
20
Marginal and conditional distributions
Marginal probability distributions (Continuous case)
Let (X, Y) be a continuous bivariate random variable with joint pdf fX,Y(X, Y). Then the
f X x f x, y dy
X ,Y and
RY
fY y f x, y dx
X ,Y
RX
21
Example 1: Let X and Y have joint probability density function:
Solution
f X x f x, y dy
X ,Y and
RY
1
f X x 4 xydy
0
2 x, if 0 x 1
2 xy
2 1
f x
0
0, Otherwise
22
Solution
fY y f x, y dx
X ,Y and
RX
1
fY y 4 xydx
0
2 y, if 0 y 1
2 y x
2 1
f y
0
0, Otherwise
23
Example 2: Let X and Y be two jointly continuous random variables with joint PDF :
cx 2 y, if 0 y x 1
f X ,Y x, y
0, otherwise
Find marginal distributions of X and Y
f x, y dydx 1
24
Solution…
1 x
cx ydydx 1
2
0 0
x
1
y 2
0 cx 2 dx 1
2
0
1
1 4
0 2 cx dx 1
1
cx 5
1 c 10
10 0
25
Solution…
10 x 2
y, if 0 y x 1
f X ,Y x, y
0, otherwise
The marginal distribution of X is
x
f X x 10 x 2 ydy
0
x
y 2
10 x
2
2 0
5x 4
5 x 4 , if 0 x 1
f X x
o, Otherwise
26
The marginal distribution of Y is
1
f Y y 10 x 2 ydx
y
1
x 3
10 y
3 y
10
3
y y4
10
y y 4
, if 0 y 1
fY y 3
0, Otherwise
27
Class Activity: Let X and Y be two jointly continuous random variables with
joint PDF :
12x, if 0 y x 1, 0 x 2 1
f X ,Y x, y
0, otherwise
28
Conditional probability distributions (Discrete case)
Definition. Suppose X and Y are discrete random variables with joint probability
mass function p(x,y) and marginal probability mass functions pX(x) and pY(y),
respectively. Then,
a) the conditional probability mass function of Y given X = x is defined as:
p X ,Y y, x
pY / X y / x
p X x
p X ,Y y, x
p X / Y x / y
pY y
29
Example: Suppose (X,Y) is a discrete random variable and
30
Conditional probability distributions (Continuous case)
Definition. Suppose X and Y are continuous random variables with joint
f X ,Y y, x
fY / X y / x
f X x
b.the conditional probability density function of X given Y = y is defined as:
f X ,Y y, x
f X / Y x / y
fY y
31
Example: Suppose the continuous random variables X and Y have the following
f X ,Y y, x , for 0 x 1 and x 2 y 1
3
2
Solution
f X ,Y y, x
fY / X y / x
f X x
32
Solution …
1
f X x dy
3
x2
2
1
3
y
2 x2
3
1 x2
2
3
1
x 2
, if 0 x 1
f X x 2
0, Otherwise
33
Solution …
f X ,Y y, x
fY / X y / x
f X x
3
2
3
2
1 x2
1
2
1 x
34
Class Activity: Suppose the continuous random variables X and Y have the following
3
2 , for x 0, y 0, and and x y 1
f X ,Y y, x
0, otherwise
a) What is the conditional distribution of Y given X = x?
35
Cumulative Distribution Function (CDF ) of Two Dimensional
Random Variable
• Definition: CDF: Let (X, Y) be a two-dimensional random variable. The
cumulative distribution function F of (X, Y) is defined as F(x, y) = P(X ≤ x,
Y ≤ y)
• Case 1: If (X, Y) is discrete, then
F ( x, y) P( X x, Y y) P( X xi , Y y j ) xi x, y j y
x y , 0 x 1, 0 y 1
f ( x, y )
0, otherwise
a) Find the corresponding joint cdf of (X, Y)
b) P(X<1/2, Y<1/2)
• Solution:
a)
b) 1 / 2 * (1 / 2)2 1 / 2 * (1 / 2)2
P( X 1 / 2, Y 1 / 2) F (1 / 2,1 / 2) 1/ 8
2 2
Independent random variables
Recall that events A and B are independent if
P(A ∩ B) = P(A)P(B)
40
Definition: Jointly-distributed random variables X and Y are independent if their joint
density function is the product of the marginal densities:
For discrete variables this is equivalent to the joint pmf being the product of the marginal pmf’s:
For continuous variables this is equivalent to the joint pdf being the product of the marginal
pdf’s:
Once you have the joint distribution, checking for independence is usually straightforward
41
Remark: For discrete variables independence means the probability in a cell must be the
product of the marginal probabilities of its row and column.
Example:
42
Example 1 (Continuous): Suppose the joint distribution of X and Y is given as follows. Are
X and Y independent?
f X x f x, y dy
X ,Y and fY y f x, y dx
X ,Y and
RY RY
1 1
f X x 4 xydy fY y 4 xydx
0
0
2 x, if 0 x 1
2 xy f x 2 y, if 0 y 1
2 y x f y
2 1
2 1
0
0, Otherwise 0
0, Otherwise
fX,Y(x,y)= fX,(x) fY(y) X and Y are independent
43
Example 2 (Continuous): Suppose the joint distribution of X and Y is given as follows. Are
X and Y independent?
1.5 x 2 y 2 , for 0 x 1, 0 y 1
f X ,Y y, x
0, otherwise
f X x f x, y dy
X ,Y and
RY
1
f X x 1.5 x 2 y 2 dy
0
1
3 x 1, if 0 x 1
1
2 1 3
1.5 x y y f x 2
3 0 0, Otherwise
44
Solution: Determine marginal of Y
fY y f x, y dx
X ,Y and
Rx
1
fY y 1.5 x 2 y 2 dx
0
1
3 y 1, if 0 y 1
1
1 3 2
1.5 x y x f y 2
3 0 0, Otherwise
f X ,Y x, y f X x fY y
X and Y are not
1
1
1.5 x 2 y 2 3 x 1 3 y 1 independent
2 2
45
Independent random variables
Class Activity: Suppose the joint distribution of X and Y is given as follows.
Are X and Y independent?
6 xy 2 , for 0 x 1, 0 y 1
f X ,Y y, x
0, otherwise
46
Functions of Two Dimensional Discrete Random Variable
• Let us now consider Z = H(x, y), a function of two random
variables X and Y. It should be clear that Z is again a random
variable.
• Consider the following sequence of steps:
a. Perform the experiment E and obtain the outcomes.
b. Evaluate random numbers X(s) and Y(s)
c. Evaluate the numbers Z = H(X(s), Y(s))
• The value of Z clearly depends on s, the original outcome of the
experiment. Given the distribution of (X, Y), what is the
probability distribution of Z = H(x, y)?
Functions of Two Dimensional Discrete Random Variable
• If (X, Y) is a two-dimensional discrete random variable, the following one
dimensional discrete random variables might of interest
U = min(X, Y) ; V = max(X, Y) ; W = X + Y
Example 1: The joint probability function ( X , Y) is given by
P(x, y) = K(2x + 3y); x = 0,1,2; y = 1,2,3
a) Compute the value of K
b) Find the probability distribution of
i. W = X + Y
ii. U = min(X, Y)
iii. V = max(X, Y)
• Solution:
a) To determine the constant K we make use one of the properties of a p.m.f
namely
b) i. Rw = {1, 2, 3, 4, 5}
P(W=1)=P(0,1)=3/72
P(W=2)=P(0,2)+P(1,1)=6/72 + 5/72 = 11/72
P(W=3)=P(0,3)+P(1,2)+P(2,1)=9/72 + 8/72 + 7/72 = 24/72
P(W=4)=P(1,3)+P(2,2)=11/72 + 10/72 = 21/72
P(W=5)=P(2,3)=13/72
ii. RU= {0, 1, 2}
P(U=0)=P(0,1) + P(0,2) + P(0,3)=3/72 + 6/72 + 9/72 = 18/72
P(U=1)=P(1,1)+P(1,2)+ P(1,3) + P(2,1)=5/72 + 8/72 + 11/72 + 7/72= 31/72
P(U=2)=P(2,2) +P(2,3)=10/72 + 13/72 = 23/72
U 0 1 2
P(U=u) 18/72 31/72 23/72
V 1 2 3
P(V=v) 8/72 31/72 33/72
Functions of Two Dimensional Continuous Random Variable
• In finding the pdf of Z = H1(x, y) it is often simplest to consider a second
random variable , say W= H2(x, y), and first obtain the joint pdf Z and W,
say fzw(z,w).
• From a knowledge of fzw(z,w) we can then obtain the desired pdf of Z, say
fZ(z), by simply integrating fzw(z,w) with respect to w. That is
f Z ( z ) f ( z , w)w
Then the joint pdf of (Z, W), say fzw(z,w), is given by the following
expression:
f ZW ( z, w) f XY (G1 ( z, w), G2 ( z, w)) J ( Z ,W )
where J(Z, W) is the following 2x2 determinant:
x x
J z w
y y
z w
This determinant is called the Jacobian of the transformation (x, y) → (z, w)
• Example
1 , 0 x 1, 0 y 1
Let f ( x, y )
0 , otherwise
1
, 0 u v 2, 0 u v 2
fUV (u , v) 2
0 , otherwise