Example: Toss a coin thrice
A fair coin is tossed thrice. Naturally, there can be three random variables.
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2, 3.
Week 3: Multiple Random Variables 2 / 29
Example: Toss a coin thrice
A fair coin is tossed thrice. Naturally, there can be three random variables.
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2, 3.
Together, the 3 random variables completely describe the outcome of the
experiment.
The event X1 = 1 is independent of X2 = 1 and X3 = 1.
Week 3: Multiple Random Variables 2 / 29
Example: Random 2-digit number
A 2-digit number from 00 to 99 is selected at random. Partial information is
available about the number as two random variables. Let X be the digit in
units place. Let Y be the reminder obtained when the number is divided by
4.
X ∈ Uniform({0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
Y ∈ Uniform({0, 1, 2, 3})
Week 3: Multiple Random Variables 3 / 29
Example: Random 2-digit number
A 2-digit number from 00 to 99 is selected at random. Partial information is
available about the number as two random variables. Let X be the digit in
units place. Let Y be the reminder obtained when the number is divided by
4.
X ∈ Uniform({0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
Y ∈ Uniform({0, 1, 2, 3})
Suppose the event X = 1 has occurred. What about the event Y = 0?
Week 3: Multiple Random Variables 3 / 29
Example: Random 2-digit number
A 2-digit number from 00 to 99 is selected at random. Partial information is
available about the number as two random variables. Let X be the digit in
units place. Let Y be the reminder obtained when the number is divided by
4.
X ∈ Uniform({0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
Y ∈ Uniform({0, 1, 2, 3})
Suppose the event X = 1 has occurred. What about the event Y = 0?
When two random variables are defined in the same probability space, the
value of one can influence the value of the other.
Week 3: Multiple Random Variables 3 / 29
Example: IPL powerplay over
Let X = number of runs in the over. Let Y = number of wickets in the
over.
Consider the events: Y = 0, Y = 1, Y = 2
Week 3: Multiple Random Variables 4 / 29
Example: IPL powerplay over
Let X = number of runs in the over. Let Y = number of wickets in the
over.
Consider the events: Y = 0, Y = 1, Y = 2
Given Y = 0, we expect X to take larger values than when Y = 1.
Given Y = 2, we expect X to take significantly lower values.
Week 3: Multiple Random Variables 4 / 29
Example: IPL powerplay over
Let X = number of runs in the over. Let Y = number of wickets in the
over.
Consider the events: Y = 0, Y = 1, Y = 2
Given Y = 0, we expect X to take larger values than when Y = 1.
Given Y = 2, we expect X to take significantly lower values.
In complex experiments, such relationships between random variables are
useful in modeling.
Week 3: Multiple Random Variables 4 / 29
Section 1
Two random variables: Joint, marginal, conditional
PMFs
Week 3: Multiple Random Variables 5 / 29
Two discrete random variables: Joint PMF
Definition (Joint PMF)
Suppose X and Y are discrete random variables defined in the same
probability space. Let the range of X and Y be TX and TY , respectively.
The joint PMF of X and Y , denoted fXY , is a function from TX × TY to
[0, 1] defined as
fXY (t1 , t2 ) = P(X = t1 and Y = t1 ), t1 ∈ TX , t2 ∈ TY .
Joint PMF is usually written as a table or a matrix
P(X = t1 and Y = t1 ) is denoted P(X = t1 , Y = t1 )
Week 3: Multiple Random Variables 6 / 29
Example: Toss a fair coin twice
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2.
1 1 1
fX1 X2 (0, 0) = P(X1 = 0 and X2 = 0) = 2 · 2 = 4
1 1 1
fX1 X2 (0, 1) = P(X1 = 0 and X2 = 1) = 2 · 2 = 4
Week 3: Multiple Random Variables 7 / 29
Example: Toss a fair coin twice
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2.
1 1 1
fX1 X2 (0, 0) = P(X1 = 0 and X2 = 0) = 2 · 2 = 4
1 1 1
fX1 X2 (0, 1) = P(X1 = 0 and X2 = 1) = 2 · 2 = 4
Table 1: fX1 X2 (t1 , t2 )
t2 \ t1 0 1
0 1/4 1/4
1 1/4 1/4
Week 3: Multiple Random Variables 7 / 29
Example: Random 2-digit number
X = units place, Y = number modulo 4
fXY (0, 0) = P(X = 0 and Y = 0)
= P(number ends in 0 and multiple of 4)
= P({00, 20, 40, 60, 80}) = 5/100 = 1/20
fXY (1, 0) = P(number ends in 1 and multiple of 4) = 0
fXY (4, 2) = P(number ends in 2 and 2 mod 4)
= P({14, 34, 54, 74, 94}) = 5/100 = 1/20
Week 3: Multiple Random Variables 8 / 29
Example: Random 2-digit number
X = units place, Y = number modulo 4
fXY (0, 0) = P(X = 0 and Y = 0)
= P(number ends in 0 and multiple of 4)
= P({00, 20, 40, 60, 80}) = 5/100 = 1/20
fXY (1, 0) = P(number ends in 1 and multiple of 4) = 0
fXY (4, 2) = P(number ends in 2 and 2 mod 4)
= P({14, 34, 54, 74, 94}) = 5/100 = 1/20
Table of fXY (t1 , t2 )
t2 \ t1 0 1 2 3 4 5 6 7 8 9
1 1 1 1 1
0 20 0 20 0 20 0 20 0 20 0
1 1 1 1 1
1 0 20 0 20 0 20 0 20 0 20
1 1 1 1 1
2 20 0 20 0 20 0 20 0 20 0
1 1 1 1 1
3 0 20 0 20 0 20 0 20 0 20
Week 3: Multiple Random Variables 8 / 29
Two random variables: Marginal PMF
Definition (Marginal PMF)
Suppose X and Y are jointly distributed discrete random variables with
joint PMF fXY . The PMF of the individual random variables X and Y are
called as marginal PMFs. It can be shown that
fXY (t, t 0 ),
X
fX (t) = P(X = t) =
t 0 ∈TY
fXY (t 0 , t),
X
fY (t) = P(Y = t) =
t 0 ∈TX
where TX and TY are the ranges of X and Y , repectively.
Proof
I Suppose TY = {y1 , . . . , yK }
I (X = t) = (X = t and Y = y1 ) or · · · or (X = t and Y = yK )
I P(X = t) = P(X = t, Y = y1 ) + · · · + P(X = t, Y = yK )
Note that the marginal PMF is simply a PMF
Week 3: Multiple Random Variables 9 / 29
Example: Toss a fair coin twice
Table of fX1 X2 (t1 , t2 )
t2 \ t1 0 1 fX2 (t2 )
0 1/4 1/4 1/2
1 1/4 1/4 1/2
fX1 (t1 ) 1/2 1/2
Marginal PMF of X1 : add over the columns of joint PMF table
I fX1 (0) = fX1 X2 (0, 0) + fX1 X2 (0, 1)
I fX1 (1) = fX1 X2 (1, 0) + fX1 X2 (1, 1)
Marginal PMF of X2 : add over the rows of joint PMF table
I fX2 (0) = fX1 X2 (0, 0) + fX1 X2 (1, 0)
I fX2 (1) = fX1 X2 (0, 1) + fX1 X2 (1, 1)
Week 3: Multiple Random Variables 10 / 29
Example: Marginal from joint PMF
Table of fX1 X2 (t1 , t2 )
t2 \ t1 0 1 fX2 (t2 )
0 0.05 0.35
1 0.25 0.35
fX1 (t1 )
Week 3: Multiple Random Variables 11 / 29
Example: Same marginal PMF from different joint PMFs
Case 1
t2 \ t1 0 1 fX2 (t2 )
0 1/4 1/4 1/2
1 1/4 1/4 1/2
fX1 (t1 ) 1/2 1/2
Case 2
t2 \ t1 0 1 fX2 (t2 )
0 x 1/2 − x 1/2
1 1/2 − x x 1/2
fX1 (t1 ) 1/2 1/2
For every x between 0 and 1/2, we get a joint PMF that results in the
same marginal.
Week 3: Multiple Random Variables 12 / 29
Example: Random 2-digit number
Table of fXY (t1 , t2 )
t2 \ t1 0 1 2 3 4 5 6 7 8 9 fY (t2 )
1 1 1 1 1
0 20 0 20 0 20 0 20 0 20 0 1/4
1 1 1 1 1
1 0 20 0 20 0 20 0 20 0 20 1/4
1 1 1 1 1
2 20 0 20 0 20 0 20 0 20 0 1/4
1 1 1 1 1
3 0 20 0 20 0 20 0 20 0 20 1/4
1 1 1 1 1 1 1 1 1 1
fX (t1 ) 10 10 10 10 10 10 10 10 10 10
Week 3: Multiple Random Variables 13 / 29
Conditional distribution of a random variable given an
event
Definition (Conditional distribution given an event)
Suppose X is a discrete random variable with range TX , and A is an event
in the same probability space. The conditional PMF of X given A is defined
as the PMF
Q(t) = P(X = t|A), t ∈ TX .
We will use the notation fX |A (t) for the above conditional PMF, and (X |A)
to denote the "conditional" random variable.
Week 3: Multiple Random Variables 14 / 29
Conditional distribution of a random variable given an
event
Definition (Conditional distribution given an event)
Suppose X is a discrete random variable with range TX , and A is an event
in the same probability space. The conditional PMF of X given A is defined
as the PMF
Q(t) = P(X = t|A), t ∈ TX .
We will use the notation fX |A (t) for the above conditional PMF, and (X |A)
to denote the "conditional" random variable.
P((X = t) ∩ A)
fX |A (t) =
P(A)
Important: Range of (X |A) can be different from TX and will depend
on A
Week 3: Multiple Random Variables 14 / 29
Conditional distribution of one random variable given
another
Definition (Conditional distribution of Y given X = t)
Suppose X and Y are jointly distributed discrete random variables with joint
PMF fXY . The conditional PMF of Y given X = t is defined as the PMF
P(Y = t 0 , X = t) fXY (t, t 0 )
Q(t 0 ) = P(Y = t 0 |X = t) = = .
P(X = t) fX (t)
We will use the notation fY |X =t (t 0 ) for the above conditional PMF, and
(Y |X = t) to denote the "conditional" random variable.
Week 3: Multiple Random Variables 15 / 29
Conditional distribution of one random variable given
another
Definition (Conditional distribution of Y given X = t)
Suppose X and Y are jointly distributed discrete random variables with joint
PMF fXY . The conditional PMF of Y given X = t is defined as the PMF
P(Y = t 0 , X = t) fXY (t, t 0 )
Q(t 0 ) = P(Y = t 0 |X = t) = = .
P(X = t) fX (t)
We will use the notation fY |X =t (t 0 ) for the above conditional PMF, and
(Y |X = t) to denote the "conditional" random variable.
fXY (t, t 0 ) = fY |X =t (t 0 )fX (t)
Important: Range of (Y |X = t) can be different from range of Y and
will depend on t
Week 3: Multiple Random Variables 15 / 29
Example: Compute conditional PMFs from joint PMF
Joint PMF fXY (t1 , t2 )
t2 \ t1 0 1 2 fY (t2 )
0 1/4 1/8 1/8 1/2
1 1/8 1/8 1/4 1/2
fX (t1 ) 3/8 1/4 3/8
Week 3: Multiple Random Variables 16 / 29
Example: Compute marginal/conditional PMFs from joint
PMF
Joint PMF fXY (t1 , t2 )
t2 \ t1 0 1 2 fY (t2 )
0 1/12 0 3/12
1 2/12 1/12 0
2 3/12 1/12 1/12
fX (t1 )
Week 3: Multiple Random Variables 17 / 29
Example: Throw a die and toss coins
Throw a die and toss a coin as many times as the number shown on die.
Let X be the number shown on die. Let Y be the number of heads. What
is the joint PMF of X and Y ?
Week 3: Multiple Random Variables 18 / 41
Example: Poisson number of coin tosses
Let N ∼ Poisson(λ). Given N = n, toss a fair coin n times and denote the
number of heads obtained by X . What is the distribution of X ?
Week 3: Multiple Random Variables 19 / 41
Example: IPL powerplay over
Let X = number of runs in the over. Let Y = number of wickets in the
over. Assume the following:
13/16 1/8 1/16
Y ∼ { 0 , 1 , 2 },
(X |Y = 0) ∼ Uniform{6, 7, 8, 9, 10, 11, 12},
(X |Y = 1) ∼ Uniform{2, 3, 4, 5, 6, 7, 8},
(X |Y = 2) ∼ Uniform{0, 1, 2, 3, 4, 5, 6}.
Week 3: Multiple Random Variables 20 / 41
Section 2
More than two random variables: Joint, marginal,
conditional PMFs
Week 3: Multiple Random Variables 21 / 41
Multiple discrete random variables: Joint PMF
Definition (Joint PMF)
Suppose X1 , X2 , . . . , Xn are discrete random variables defined in the same
probability space. Let the range of Xi be TXi . The joint PMF of Xi ,
denoted fX1 ···Xn , is a function from TX1 × · · · × TXn to [0, 1] defined as
fX1 ···Xn (t1 , . . . , tn ) = P(X1 = t1 and · · · and Xn = tn ), ti ∈ TXi .
Joint PMF could be written as a table in small examples
P(X1 = t1 and · · · and Xn = tn ) is denoted P(X1 = t1 , . . . , Xn = tn )
Week 3: Multiple Random Variables 22 / 41
Example: Toss a fair coin thrice
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2, 3.
t1 t2 t3 fX1 X2 X3 (t1 , t2 , t3 )
0 0 0 1/8
0 0 1 1/8
0 1 0 1/8
0 1 1 1/8
1 0 0 1/8
1 0 1 1/8
1 1 0 1/8
1 1 1 1/8
Week 3: Multiple Random Variables 23 / 41
Example: Random 3-digit number 000 to 999
X = first digit from left, Y = number modulo 2, Z = first digit from right
Table is too long
Week 3: Multiple Random Variables 24 / 41
Example: IPL powerplay over
Suppose the over has 6 deliveries. Let Xi denote the number of runs scored
in the i-th delivery.
Week 3: Multiple Random Variables 25 / 41
Multiple discrete random variables: Marginal PMF
(individual)
Definition (Marginal PMF (individual))
Suppose X1 , X2 , . . . , Xn are jointly distributed discrete random variables
with joint PMF fX1 ···Xn . The PMF of the individual random variables X1 ,
X2 , · · · , Xn are called as marginal PMFs. It can be shown that
fX1 ···Xn (t, t20 , t30 , . . . , tn0 ),
X
fX1 (t) = P(X1 = t) =
t20 ∈TX2 ,t30 ∈TX3 ,...,tn0 ∈TXn
fX1 ···Xn (t10 , t, t30 , . . . , tn0 ),
X
fX2 (t) = P(X2 = t) =
t10 ∈TX1 ,t30 ∈TX3 ,...,tn0 ∈TXn
..
.
fX1 ···Xn (t10 , . . . , tn−1
0
X
fXn (t) = P(Xn = t) = , t),
0
t10 ∈TX1 ,...,tn−1 ∈TXn−1 ,t∈TXn
where TXi is the range of Xi .
Week 3: Multiple Random Variables 26 / 48
Example: Toss a fair coin thrice
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2, 3.
Joint PMF: fX1 X2 X3 (t1 , t2 , t3 ) = 1/8 for ti ∈ {0, 1}
Week 3: Multiple Random Variables 27 / 48
Example: Toss a fair coin thrice
Let Xi = 1 if i-th toss is heads and Xi = 0 if i-th toss is tails, i = 1, 2, 3.
Joint PMF: fX1 X2 X3 (t1 , t2 , t3 ) = 1/8 for ti ∈ {0, 1}
fX1 (0) = fX1 X2 X3 (0, 0, 0) + fX1 X2 X3 (0, 0, 1) + fX1 X2 X3 (0, 1, 0) + fX1 X2 X3 (0, 1, 1)
= 1/8 + 1/8 + 1/8 + 1/8 = 1/2
fX1 (1) = fX1 X2 X3 (1, 0, 0) + fX1 X2 X3 (1, 0, 1) + fX1 X2 X3 (1, 1, 0) + fX1 X2 X3 (1, 1, 1)
= 1/8 + 1/8 + 1/8 + 1/8 = 1/2
Note: fX1 (0) + fX1 (1) = 1
Week 3: Multiple Random Variables 27 / 48
Example: Random 3-digit number 000 to 999
X = first digit from left, Y = number modulo 2, Z = first digit from right
X ∼ Uniform{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Week 3: Multiple Random Variables 28 / 48
Example: Random 3-digit number 000 to 999
X = first digit from left, Y = number modulo 2, Z = first digit from right
X ∼ Uniform{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Y ∼ Uniform{0, 1}
Week 3: Multiple Random Variables 28 / 48
Example: Random 3-digit number 000 to 999
X = first digit from left, Y = number modulo 2, Z = first digit from right
X ∼ Uniform{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Y ∼ Uniform{0, 1}
Z ∼ Uniform{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Week 3: Multiple Random Variables 28 / 48
Example: IPL powerplay Over 1
Suppose the over has 6 deliveries. Let Xi denote the number of runs scored
in the i-th delivery.
Week 3: Multiple Random Variables 29 / 48
Example: IPL powerplay Over 1
Suppose the over has 6 deliveries. Let Xi denote the number of runs scored
in the i-th delivery.
Xi ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8}: How to assign probabilities?
Week 3: Multiple Random Variables 29 / 48
Example: IPL powerplay Over 1
Suppose the over has 6 deliveries. Let Xi denote the number of runs scored
in the i-th delivery.
Xi ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8}: How to assign probabilities?
Ball 1: 0 - 957 matches, 1 - 429 matches, 2 - 57 matches, 3 - 5 matches, 4
- 138 matches, 5 - 8 matches, 6 - 4 matches (out of 1598 matches)
Idea: Assign probabilities in the same proportion as data
Week 3: Multiple Random Variables 29 / 48
Example: IPL powerplay Over 1
Suppose the over has 6 deliveries. Let Xi denote the number of runs scored
in the i-th delivery.
Xi ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8}: How to assign probabilities?
Ball 1: 0 - 957 matches, 1 - 429 matches, 2 - 57 matches, 3 - 5 matches, 4
- 138 matches, 5 - 8 matches, 6 - 4 matches (out of 1598 matches)
Idea: Assign probabilities in the same proportion as data
0 1 2 3 4 5 6
f X1 0.5989 0.2685 0.0357 0.0031 0.0864 0.0050 0.0025
f X2 0.5551 0.2791 0.0438 0.0031 0.1083 0.0044 0.0063
f X3 0.5338 0.2847 0.0444 0.0044 0.1139 0.0025 0.0163
f X4 0.5344 0.2516 0.0394 0.0031 0.1489 0.0038 0.0188
f X5 0.5313 0.2672 0.0407 0.0056 0.1358 0.0025 0.0169
f X6 0.5056 0.2954 0.0394 0.0050 0.1414 0.0013 0.0119
Week 3: Multiple Random Variables 29 / 48
Marginalisation
Suppose X1 , X2 , X3 ∼ fX1 X2 X3 and Xi ∈ TXi .
We have discussed the marginal PMF fXi of the individual random variables
X1 , X2 and X3 .
What about fX1 X2 , the joint PMF of X1 and X2 ? What about fX1 X3 , fX2 X3 ?
Week 3: Multiple Random Variables 30 / 48
Marginalisation
Suppose X1 , X2 , X3 ∼ fX1 X2 X3 and Xi ∈ TXi .
We have discussed the marginal PMF fXi of the individual random variables
X1 , X2 and X3 .
What about fX1 X2 , the joint PMF of X1 and X2 ? What about fX1 X3 , fX2 X3 ?
fX1 X2 X3 (t1 , t2 , t30 )
X
fX1 X2 (t1 , t2 ) = P(X1 = t1 and X2 = t2 ) =
t30 ∈TX3
fX1 X2 X3 (t1 , t20 , t3 )
X
fX1 X3 (t1 , t3 ) = P(X1 = t1 and X3 = t3 ) =
t20 ∈TX2
fX1 X2 X3 (t10 , t2 , t3 )
X
fX2 X3 (t2 , t3 ) = P(X2 = t2 and X3 = t3 ) =
t10 ∈TX1
Week 3: Multiple Random Variables 30 / 48
Marginalisation
Suppose X1 , X2 , X3 ∼ fX1 X2 X3 and Xi ∈ TXi .
We have discussed the marginal PMF fXi of the individual random variables
X1 , X2 and X3 .
What about fX1 X2 , the joint PMF of X1 and X2 ? What about fX1 X3 , fX2 X3 ?
fX1 X2 X3 (t1 , t2 , t30 )
X
fX1 X2 (t1 , t2 ) = P(X1 = t1 and X2 = t2 ) =
t30 ∈TX3
fX1 X2 X3 (t1 , t20 , t3 )
X
fX1 X3 (t1 , t3 ) = P(X1 = t1 and X3 = t3 ) =
t20 ∈TX2
fX1 X2 X3 (t10 , t2 , t3 )
X
fX2 X3 (t2 , t3 ) = P(X2 = t2 and X3 = t3 ) =
t10 ∈TX1
Marginalisation: Sum over everything you do not want!
Week 3: Multiple Random Variables 30 / 48
Example: X1 , X2 , X3 ∼ fX1 X2 X3
t1 t2 t3 fX1 X2 X3 (t1 , t2 , t3 )
0 0 0 1/9
0 0 1 1/9
0 0 2 1/9
0 1 1 1/9
0 1 2 1/9
1 0 0 1/9
1 0 2 1/9
1 1 0 1/9
1 1 1 1/9
Week 3: Multiple Random Variables 31 / 48
Working
Week 3: Multiple Random Variables 32 / 48
Marginalisation: More examples
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 X2 X3 X4 (t1 , t20 , t30 , t40 )
X
fX1 (t1 ) = P(X1 = t1 ) =
t20 ,t30 ,t40
fX1 X2 X3 X4 (t1 , t2 , t30 , t40 )
X
fX1 X2 (t1 , t2 ) = P(X1 = t1 and X2 = t2 ) =
t30 ,t40
fX1 X2 X3 X4 (t10 , t2 , t30 , t4 )
X
fX2 X4 (t2 , t4 ) = P(X2 = t2 and X4 = t4 ) =
t10 ,t30
fX1 X2 X3 X4 (t1 , t20 , t3 .t4 )
X
fX1 X3 X4 (t1 , t3 , t4 ) =
t20
Marginalisation: Sum over everything you do not want!
Week 3: Multiple Random Variables 33 / 48
Multiple discrete random variables: Marginal PMF
(general)
Definition (Marginal PMF (general))
Suppose X1 , X2 , . . . , Xn are jointly distributed discrete random variables
with joint PMF fX1 ···Xn . The joint PMF of the random variables
Xi1 , Xi2 , . . . , Xik , denoted fXi1 ···Xik , is given by
fXi1 ···Xik (ti1 , . . . , tik ) =
fX1 ···Xn (t1 , . . . , ti01 −1 , ti1 , ti01 +1 , . . . , ti0k −1 , tik , ti0k +1 , . . . , tn ).
X
t1 ,...,ti0 −1 ,ti0 +1 ,...,
1 1
...,ti0 −1 ,ti0 +1 ,...,tn
k k
Week 3: Multiple Random Variables 34 / 48
Conditioning with multiple discrete random variables
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
A wide variety of conditioning is possible when there are many random
variables.
Week 3: Multiple Random Variables 35 / 48
Conditioning with multiple discrete random variables
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
A wide variety of conditioning is possible when there are many random
variables.
fX1 X2 (t1 , t2 )
(X1 |X2 = t2 ) ∼ fX1 |X2 =t2 (t1 ) =
fX2 (t2 )
Week 3: Multiple Random Variables 35 / 48
Conditioning with multiple discrete random variables
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
A wide variety of conditioning is possible when there are many random
variables.
fX1 X2 (t1 , t2 )
(X1 |X2 = t2 ) ∼ fX1 |X2 =t2 (t1 ) =
fX2 (t2 )
fX X X (t1 , t2 , t3 )
(X1 , X2 |X3 = t3 ) ∼ fX1 X2 |X3 =t3 (t1 , t2 ) = 1 2 3
fX3 (t3 )
Week 3: Multiple Random Variables 35 / 48
Conditioning with multiple discrete random variables
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
A wide variety of conditioning is possible when there are many random
variables.
fX1 X2 (t1 , t2 )
(X1 |X2 = t2 ) ∼ fX1 |X2 =t2 (t1 ) =
fX2 (t2 )
fX X X (t1 , t2 , t3 )
(X1 , X2 |X3 = t3 ) ∼ fX1 X2 |X3 =t3 (t1 , t2 ) = 1 2 3
fX3 (t3 )
fX X X (t1 , t2 , t3 )
(X1 |X2 = t2 , X3 = t3 ) ∼ fX1 |X2 =t2 ,X3 =t3 (t1 ) = 1 2 3
fX2 X3 (t2 , t3 )
Week 3: Multiple Random Variables 35 / 48
Conditioning with multiple discrete random variables
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
A wide variety of conditioning is possible when there are many random
variables.
fX1 X2 (t1 , t2 )
(X1 |X2 = t2 ) ∼ fX1 |X2 =t2 (t1 ) =
fX2 (t2 )
fX X X (t1 , t2 , t3 )
(X1 , X2 |X3 = t3 ) ∼ fX1 X2 |X3 =t3 (t1 , t2 ) = 1 2 3
fX3 (t3 )
fX X X (t1 , t2 , t3 )
(X1 |X2 = t2 , X3 = t3 ) ∼ fX1 |X2 =t2 ,X3 =t3 (t1 ) = 1 2 3
fX2 X3 (t2 , t3 )
fX X X X (t1 , t2 , t3 , t4 )
(X1 , X3 |X2 = t2 , X4 = t4 ) ∼ fX1 X3 |X2 =t2 ,X4 =t4 (t1 , t3 ) = 1 2 3 4
fX2 X4 (t2 , t4 )
Week 3: Multiple Random Variables 35 / 48
Example: X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4
t1 t2 t3 t4 fX1 ···X4 (t1 , . . . , t4 )
0 0 0 0 1/12
0 0 0 1 1/12
0 0 1 1 1/12
0 0 2 0 1/12
0 1 1 0 1/12
0 1 1 1 1/12
0 1 2 0 1/12
1 0 0 1 1/12
1 0 2 0 1/12
1 0 2 1 1/12
1 1 0 1 1/12
1 1 1 0 1/12
Week 3: Multiple Random Variables 36 / 48
Working
Week 3: Multiple Random Variables 37 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
Week 3: Multiple Random Variables 38 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 and (X2 = t2 and X3 = t3 and X4 = t4 ))
Week 3: Multiple Random Variables 38 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 and (X2 = t2 and X3 = t3 and X4 = t4 ))
= P(X1 = t1 |(X2 = t2 and X3 = t3 and X4 = t4 ))
P(X2 = t2 and X3 = t3 and X4 = t4 )
Week 3: Multiple Random Variables 38 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 and (X2 = t2 and X3 = t3 and X4 = t4 ))
= P(X1 = t1 |(X2 = t2 and X3 = t3 and X4 = t4 ))
P(X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 |X2 = t2 , X3 = t3 , X4 = t4 ))
P(X2 = t2 |X3 = t3 , X4 = t4 )P(X3 = t3 , X4 = t4 )
Week 3: Multiple Random Variables 38 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 and (X2 = t2 and X3 = t3 and X4 = t4 ))
= P(X1 = t1 |(X2 = t2 and X3 = t3 and X4 = t4 ))
P(X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 |X2 = t2 , X3 = t3 , X4 = t4 ))
P(X2 = t2 |X3 = t3 , X4 = t4 )P(X3 = t3 , X4 = t4 )
= P(X1 = t1 |X2 = t2 , X3 = t3 , X4 = t4 ))
P(X2 = t2 |X3 = t3 , X4 = t4 )
P(X3 = t3 |X4 = t4 )P(X4 = t4 )
Week 3: Multiple Random Variables 38 / 48
Conditioning and factors of the joint PMF
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 and (X2 = t2 and X3 = t3 and X4 = t4 ))
= P(X1 = t1 |(X2 = t2 and X3 = t3 and X4 = t4 ))
P(X2 = t2 and X3 = t3 and X4 = t4 )
= P(X1 = t1 |X2 = t2 , X3 = t3 , X4 = t4 ))
P(X2 = t2 |X3 = t3 , X4 = t4 )P(X3 = t3 , X4 = t4 )
= P(X1 = t1 |X2 = t2 , X3 = t3 , X4 = t4 ))
P(X2 = t2 |X3 = t3 , X4 = t4 )
P(X3 = t3 |X4 = t4 )P(X4 = t4 )
= fX1 |X2 =t2 ,X3 =t3 ,X4 =t4 (t1 )fX2 |X3 =t3 ,X4 =t4 (t2 )
fX3 |X4 =t4 (t3 )fX4 (t4 )
Week 3: Multiple Random Variables 38 / 48
Example: X1 , X2 , X3 ∼ fX1 X2 X3
t1 t2 t3 fX1 X2 X3 (t1 , t2 , t3 )
0 0 0 1/9
0 0 1 1/9
0 0 2 1/9
0 1 1 1/9
0 1 2 1/9
1 0 0 1/9
1 0 2 1/9
1 1 0 1/9
1 1 1 1/9
Week 3: Multiple Random Variables 39 / 48
Working
Week 3: Multiple Random Variables 40 / 48
Factoring can be done in any sequence
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
Week 3: Multiple Random Variables 41 / 48
Factoring can be done in any sequence
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X4 = t4 and X3 = t3 and X2 = t2 and X1 = t1 )
Week 3: Multiple Random Variables 41 / 48
Factoring can be done in any sequence
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X4 = t4 and X3 = t3 and X2 = t2 and X1 = t1 )
= fX4 |X3 =t3 ,X2 =t2 ,X1 =t1 (t4 )fX3 |X2 =t2 ,X1 =t1 (t3 )
fX2 |X1 =t1 (t2 )fX1 (t1 )
Week 3: Multiple Random Variables 41 / 48
Factoring can be done in any sequence
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X4 = t4 and X3 = t3 and X2 = t2 and X1 = t1 )
= fX4 |X3 =t3 ,X2 =t2 ,X1 =t1 (t4 )fX3 |X2 =t2 ,X1 =t1 (t3 )
fX2 |X1 =t1 (t2 )fX1 (t1 )
fX1 ···X4 (t1 , . . . , t4 ) = P(X3 = t3 and X2 = t2 and X1 = t1 and X4 = t4 )
Week 3: Multiple Random Variables 41 / 48
Factoring can be done in any sequence
Suppose X1 , X2 , X3 , X4 ∼ fX1 X2 X3 X4 and Xi ∈ TXi .
fX1 ···X4 (t1 , . . . , t4 ) = P(X1 = t1 and X2 = t2 and X3 = t3 and X4 = t4 )
= P(X4 = t4 and X3 = t3 and X2 = t2 and X1 = t1 )
= fX4 |X3 =t3 ,X2 =t2 ,X1 =t1 (t4 )fX3 |X2 =t2 ,X1 =t1 (t3 )
fX2 |X1 =t1 (t2 )fX1 (t1 )
fX1 ···X4 (t1 , . . . , t4 ) = P(X3 = t3 and X2 = t2 and X1 = t1 and X4 = t4 )
= fX3 |X2 =t2 ,X1 =t1 ,X4 =t4 (t3 )fX2 |X1 =t1 ,X4 =t4 (t2 )
fX1 |X4 =t4 (t1 )fX4 (t4 )
Week 3: Multiple Random Variables 41 / 48
Example: X1 , X2 , X3 ∼ fX1 X2 X3
t1 t2 t3 fX1 X2 X3 (t1 , t2 , t3 )
0 0 0 1/9
0 0 1 1/9
0 0 2 1/9
0 1 1 1/9
0 1 2 1/9
1 0 0 1/9
1 0 2 1/9
1 1 0 1/9
1 1 1 1/9
Week 3: Multiple Random Variables 42 / 48