Probability Coditional
Probability Coditional
Let X and Y are two random variables. In this note, we will learn how to solve any problem regarding
conditional probability or conditional expectation under joint distribution (X,Y ).
1. Conditional Probability
Any question regarding conditional probability falls under the following form
P(X = x0 , Y = y0 ) f (x0 , y0 )
P(X ∈ A|Y ∈ B) ≡ P(X = x0 |Y = y0 ) = = .
P(Y = y0 ) f (y0 )
Case-3: If A = {x1 , x2 , . . . , xm } contains m points and B = {y0 } contains a singleton point. Then
P(X ∈ A|Y ∈ B)
P(X ∈ A|Y ∈ B) ≡ P(X = x0 |Y ∈ (c, d)) = 0 (single point for conditional density X).
Case-3: If A is an interval (a, b) and B = {y0 } contains a singleton point. Then you need to first calculate
f (x, y0 )
f (x|y0 ) = .
f (y0 )
And then, Z b
P(X ∈ A|Y ∈ B) ≡ P(X ∈ (a, b)|Y = y0 ) = f (x|y0 ) dx.
a
Case-4: If A is an interval (a, b) and B is an interval (c, d). Then you need to first calculate
Rd
f (x, y) dy
f (x|y ∈ (c, d)) = Rc d .
c f (y) dy
And then, Z b
P(X ∈ A|Y ∈ B) ≡ P(X ∈ (a, b)|Y ∈ (c, d)) = f (x|y ∈ (c, d)) dx.
a
2. Conditional Expectation
Any question regarding conditional expectation falls under the following form
E(g(X)|Y ∈ B),
Case-1: If B = {y0 } contains a singleton point. Then first find the conditional pmf function f (x|y0 ) as
P(X = x, Y = y0 ) f (x, y0 )
f (x|y0 ) = = (for all x ∈ R(x)).
P(Y = y0 ) f (y0 )
And then
E(g(X)|Y = y0 ) = ∑ g(xi ) f (xi |y0 ).
xi ∈R(x)
Case-2: If B = {y1 , y2 , . . . , yn } contains n points. Then first find the conditional pmf function f (x|y ∈ B) as
n
P(X = x, Y ∈ {y1 , y2 , . . . , yn }) ∑ j=1 f (x, y j )
f (x|y ∈ B) = = n , (for all x ∈ R(x)).
P(Y ∈ {y1 , y2 , . . . , yn }) ∑ j=1 f (y j )
And then
E(g(X)|Y ∈ B) = ∑ g(xi ) f (xi |y ∈ B).
xi ∈R(x)
2
Case-1: If B = {y0 } contains a singleton point. Then, first find the conditional pdf function f (x|y0 ) as
f (x, y0 )
f (x|y0 ) = .
f (y0 )
Then Z ∞
E(g(X)|Y = y0 ) = g(x) f (x|y0 ) dx.
−∞
Case-2: If B = (c, d) is an interval. Then, first find the conditional pdf function f (x|y ∈ (c, d)) as
Rd
f (x, y) dy
f (x|y ∈ (c, d)) = Rc d .
c f (y) dy
Then Z ∞
E(g(X)|Y ∈ (c, d)) = g(x) f (x|y ∈ (c, d)) dx.
−∞
Here, in this note, we describe rules for (X|Y ) variable. If question comes for (Y |X) variable, the roles of X
and Y will interchange for the above rules accordingly.