Lecture02 Printed
Lecture02 Printed
随机过程及应用
Lecture Two: Conditional Probability and Conditional
Expectation
罗俊 )
Instructor : Jun LUO (罗
Department of Management Science
Antai College of Economics and Management
Shanghai Jiao Tong University
Conditional Probability
In practice, calculating probabilities and expectations when some
partial information is available; hence, the desired probabilities and
expectations are conditional ones
In calculating a desired probability or expectation, it is often extremely
useful to first “condition” on some appropriate random variable
Let (X1 , X2 ) be a bivariate r.v.
F (x1 , x2 ) = P{X1 ≤ x1 , X2 ≤ x2 }
P{X1 ≤ x1 |X2 ≤ x2 } = P{X1 ≤ x1 , X2 ≤ x2 }/P{X2 ≤ x2 } =
F (x1 , x2 )/FX2 (x2 )
If X1 and X2 are independent, then
F (x1 , x2 ) = FX1 (x1 )FX2 (x2 )
P{X1 ≤ x1 |X2 ≤ x2 } = Fx1 (x1 ) and P{X2 ≤ x2 |X1 ≤ x1 } = FX2 (x2 )
Conditional probability mass function: discrete r.v.
pX1 |X2 (x1 |x2 ) = p(x1 , x2 )/pX2 (x2 ) (pX2 (x2 ) > 0)
Conditional probability density function: continuous r.v.
fX1 |X2 (x1 |x2 ) = f (x1 , x2 )/fX2 (x2 ) (fX2 (x2 ) > 0)
Shanghai Jiao Tong University () Stochastic Processes with Applications 2 / 15
Chapter 3: Conditional Probability and Conditional Expectation
Conditional Expectation
E [X ] = E [E [X |Y ]]
discrete case
XX
E [E [X |Y ]] = xP{X = x|Y = y }P{Y = y }
y x
X X
= x P{X = x, Y = y }
x y
X
= xP{X = x}
x
A coin, having probability p of coming up heads, is to be successively flipped until the first head
appears. What is the expected number of flips required?
Suppose that those choosing their own hats depart, while the others (those without a match)
put their selected hats in the center of the room, mix them up, and then reselect. Also, suppose
that this process continues until each individual has his own hat. Find E [Rn ] where Rn is the
number of rounds that are necessary when n individuals are initially present.
1 Since no matter how many people remain there will, on average, be one match per round,
we guess E [Rn ] = n. Let’s use induction.
2 Let Xn be the number of matches that occur in the first round, E [Xn ] = 1.
n
X
E [Rn ] = E [Rn |Xn = i]P{Xn = i}
i=0
Xn
= (1 + E [Rn−i ])P{Xn = i}
i=0
n
X
= 1 + E [Rn ]P{Xn = 0} + (n − i)P{Xn = i}
i=1
= E [Rn ]P{Xn = 0} + n(1 − P{Xn = 0})
Conditional variance:
Var (X |Y = y ) = E [X 2 |Y = y ] − (E [X |Y = y ])2
The Conditional Variance Formula
Var (X ) = E [Var (X |Y )] + Var (E [X |Y ])
Proof:
E [Var (X |Y )] = E [E [X 2 |Y ] − (E [X |Y ])2 ]
= E [E [X 2 |Y ]] − E [(E [X |Y ])2 ]
= E [X 2 ] − E [(E [X |Y ])2 ]
Therefore
X
P(A) = P(A|Y = y )P(Y = y ), if Y is discrete
y
Z ∞
= P(A|Y = y )fY (y )dy , if Y is continuous
−∞
Example 3.21: Suppose X and Y are independent continuous r.v.
with densities fX and fY .
Z ∞
P{X < Y } = P{X < Y |Y = y }fY (y )dy
Z−∞
∞
= FX (y )fY (y )dy
−∞
Shanghai Jiao Tong University () Stochastic Processes with Applications 10 / 15
Chapter 3: Conditional Probability and Conditional Expectation
Suppose the number of people who visit a yoga studio each day follows
Poisson(λ). Suppose each person who visits is, independently, female with
probability p or male with probability 1 − p. Denote N and M the number
of female and male each day respectively.
P{N = n, M = m} =?
1 Exercise?
2 N and M are independent Poisson random variables with respective
means λp and λ(1 − p).
Proof:
XN
Var (SN |N = n) = Var ( Xi |N = n)
i=1
Xn
= Var ( Xi ) = nσ 2
i=1
E (SN |N = n) = nµ