Professional Documents
Culture Documents
Handout2 PDF
Handout2 PDF
1
1 Conditional Probability and Independence
- Multiplication rule
- Bayes’ theorem
Importance
We are often interested in calculating probabilities when some partial information concerning the
result of the experiment is available or recalculating probabilities in light of additional information.
Conditional Probability Motivation: Consider that you want to buy a second hand car
with your limited knowledge. You calculate (estimate) the probability that the car is drivable
to be 0.8 (say). Then you call your friend who is an expert in automobile. He find some ugly
truths about your selected second hand car and now you revise your probability (that the car
is worthy to buy) to 0.3 (say).
Example 1.1. Consider that all 6 possible outcome of a fair die roll are equally likely. Con-
sider two events
A = the outcome is 6.
B = the outcome is an even number = {2, 4, 6}.
1 #(A ∩ B)
P(the outcome is 6|the outcome is even) = =
3 #(B)
#(A ∩ B)/#(Ω)
=
#(B)/#(Ω)
P(A ∩ B)
=
P(B)
Example 1.2. Consider single role of a pair of dice. The sample space Ω of this experiment
is
Ω = {(i, j) : i = 1, 2, . . . , 6, j = 1, 2, . . . , 6}
Suppose that each of the 36 outcomes are equally likely. Let A be the event that sum of the
5
outcomes on two dice is 8. Thus, A = {(2, 6), (3, 5), (4, 4), (5, 3), (6, 2)}. Then P(A) = 36 .
2
Suppose you know that first roll was 3 and this is denoted by event B. What is the probability
that the sum of two rolls is 8.
1
P(B) = , P(A|B) =?
6
First roll is 3, then the total possibilities are 6, i.e. B = {(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)}.
By looking at the new universe (or new sample space) B, it is easy to observe that
1
P(A|B) = .
6
Further,
P(A ∩ B) 1/36 1
= = .
P(B) 1/6 6
Thus
P(A ∩ B)
= P(A|B)
P(B)
The above examples motivate the definition of conditional probability as follows.
P(A ∩ B)
P(A|B) = , P(B) 6= 0.
P(B)
Remark 1.1. 1. Suppose B has occurred that means the outcome is inside B. P(A|B) =
probability of A, given that B has occurred. Since B has already occurred the outcome
may at most lie within A ∩ B. Hence the probability of occurrence of A given B occurred
is P(A ∩ B)/P(B).
P(A∩B)
(a) P(A|B) = P(B)
≥ 0.
P(Ω∩B) P(B)
(b) P(Ω/B) = P(B)
= P(B)
= 1.
(c) Additivity Axiom. For A and B disjoint
3
P((C ∪ D) ∩ B) P((C ∩ B) ∪ (D ∩ B))
P(C ∪ D/B) = = , C ∩D =φ
P(B) P(B)
P(C ∩ B) P(D ∩ B)
= + (by A3 )
P(B) P(B)
= P(C|B) + P(D|B).
#(A∩B)
4. If the possible outcomes are finitely many and equally likely, then P(A|B) = #(B)
.
Example 1.3. Toss a fair coin three times successively. We wish to find the conditional
probability P(A|B), where A = {more heads than tails comes up}, B = {1st toss is a head}.
Solution.
Ω = {HHH, HHT, HT H, T HH, HT T, T HT, T T H, T T T };
A = {HHH, HHT, HT H, T HH}, B = {HHH, HHT, HT H, HT T };
A ∩ B = {HHH, HHT, HT H}.
)
3
P(A ∩ B) = 8
3
=⇒ P(A|B) =
P(B) = 84 4
Note: Since all possible outcomes are equally likely here, we can calculate P(A|B) =
#(A∩B)
#(B)
= 34 .
Multiplication Rule
Assuming that all the conditioning events have positive probabilities, then it follows
n−1
P (∩ni=1 Ai ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩ A2 ) . . . P An | ∩i=1
Ai ,
P(A2 ∩ A1 ) P(A1 ∩ A2 ∩ . . . ∩ An )
P (∩ni=1 Ai ) = P(A1 ) · ···
P(A1 ) P(A1 ∩ A2 ∩ . . . ∩ An )
= P(A1 ).P(A2 |A1 ) . . . P(An |A1 ∩ A2 ∩ . . . ∩ An−1 ).
Example 1.4. A bag of marbles contains 2 blue and 3 red marbles. 2 marbles are drawn at
random. What is the probability that both are blue?
Solution. Let A be the event that first marble is blue and B be the event that second mar-
ble is also blue. Now, P(A) = 2/5 and P(B|A) = 1/4. Using multiplication rule, we have,
4
2 1 1
P(A ∩ B) = P(A) · P(B|A) = 5
· 4
= 10
.
Partition of s set. A family of sets P is a partition of X iff all of the following condition
hold.
3. The intersection of any two distinct sets in P is empty (or elements of P are pairwise
disjoint).
Proof.
Total probability can be viewed as a weighted sum where weights are respective
probabilities.
5
Example 1.5. Two cards from an ordinary deck of 52 cards are missing. What is the proba-
bility that a random card drawn from this deck is a spade ?
Solution. Let E be the event that the randomly drawn card is a spade. Let Fi , i = 0, 1, 2 be
the events that i spades are missing from the deck. By total probability theorem
- Aim is to calculate P(Ai |B), that is revise “beliefs”, given that B has occurred.
6
We are given that
Now calculate
P(B|A)P(A)
P(Aircraft is present|Alarm) = P(A|B) =
P(B)
P(B|A)P(A)
=
P(B|A)P(A) + P(B|Ac )P(Ac )
0.99 × 0.05
= = 0.3426.
0.99 × 0.05 + 0.95 × 0.1
Here it says that given that radar is giving an alarm the probability that an aircraft is
present is only 34.26%.
Example 1.7 (Spam filtering using naive Bayesian). Consider the following data.
P(B|A)P(A)
P(A|B) =
P(B|A)P(A) + P(B|Ac )P(Ac )
In spam filtering example P(Spam) = 0.8, P(Not spam) = 0.2, P(Lottery|Spam) = 7/8 and
P(Lottery|N ot spam) = 1/2. Now
P(Lottery|Spam)P(Spam)
P(Spam|Lottery) =
P(Lottery|Spam)P(Spam) + P(Lottery|N ot spam)P(N ot spam)
7/8 × 0.8
= = 0.875.
7/8 × 0.8 + 1/2 × 0.2
7
Thus the probability of a new mail containing word “Lottery” being spam is 0.875. Suppose
the cutoff probability of a mail to be sent to SPAM folder is 0.90, this new mail will go to
INBOX.
When the above equality holds, we say that A is independent of B. Since P(A|B) =
P(A∩B)
P(B)
=⇒ P(A ∩ B) = P(A) · P(B). This lead to the following definition.
Definition 2.1. Two events A and B are said to be independent if P(A ∩ B) = P(A)P(B).
Notes.
1. Independence is often easy to grasp intuitively. For example, outcomes from random
experiments separated by time and space are generally independent. For example if
you toss a coin here and your friend roll a die in another room are independent events.
Further, if India wins cricket match there will be rain describes two independent events.
However, if India wins match and there will be fire crackers describe two dependent
events.
8
If A and B are such that A ∩ B = φ, P(A) > 0 and P(B) > 0, then A and B are not
independent. Since P(A ∩ B) = 0 6= P(A) · P(B).
Suppose A and B are disjoint events. If P(A) 6= 0 and it is told that event B has occurred then P
revised probability of event A given occurrence of event B and which is changed
and hence A and B are not independent.
This implies
P(A ∩ B c ) = P(A)[1 − P(B)] = P(A)P(B c ).
5. In fact if A and B are independent. Then following pairs of events are independent
(a) Ac , B
(b) A, B c
(c) Ac , B c
1 1 1
P(A ∩ B) = = P(A)P(B) = · .
36 6 6
1 1 1
P(A ∩ C) = = P(A)P(C) = · .
36 6 6
P(A ∩ B ∩ C)
P(A|B ∩ C) = = 1 6= P(A).
P(B ∩ C)
9
Conditional Independence. We know that conditional probabilities of events, conditioned
on a particular event form a legitimate probability law. We can thus define independence of
various events with respect to this probability law.
Definition 2.2 (Conditional independence). Given an event C, the event A and B are called
conditionally independent if
Example 2.2. Consider two independent fair coin tosses, in which all four possible outcomes
are equally likely. Let
H1 = { 1st toss is a head }.
H2 = { 2nd toss is head }.
D = { the two tosses have different result }.
We can check that P(H1 ) = 21 , since H1 = {HH, HT }
P(H2 ) = 12 , since H2 = {T H, HH}
P(H1 ∩ H2 ) = 14 , since H1 ∩ H2 = {HH}.
Thus P(H1 ∩ H2 ) = P(H1 )P(H2 ) and hence these events are unconditionally independent.
Next,
P(H1 ∩ D) 1/4 1
P(H1 |D) = = =
P(D) 1/2 2
Similarly, P(H2 |D) = 1/2
P(H1 ∩ H2 |D) = 0, since H1 ∩ H2 ∩ D = φ.
So,
P(H1 ∩ H2 |D) 6= P(H1 |D)P(H2 |D).
P(A ∩ B) = P(A)P(B).
Here, A ∩ B ∩ C = φ, A ∩ B 6= φ, B ∩ C 6= φ
and (A ∩ C) ∩ (B ∩ C) = φ.
P(A ∩ B ∩ C)
P(A ∩ B|C) = = 0,
P(C)
10
but
P(A ∩ C)
P(A|C) = 6= 0,
P(C)
P(B ∩ C)
P(B|C) = 6= 0.
P(C)
Example 2.3 (Conditional independence doesn’t imply independence). A and A are condi-
tionally independent given A but are not independent. Since, P(A ∩ A|A) = P(A|A) = 1 =
P(A|A)P(A|A). But P(A ∩ A) 6= P(A)P(A), if P(A) 6= 0, 1.
n n n
There will be total 2
+ 3
+ ··· + n
= 2n − n − 1 conditions.
(b) Further the fourth condition does not imply the first three.
Example 2.4 (Pairwise independence doesn’t imply mutual independence). Consider an urn
containing 4 balls numbered 110, 101, 011 and 000. From this urn one ball is drawn at random.
For k = 1, 2, 3 let Ak be the event of drawing a ball numbered with 1 in the kth position. Now
P(A1 ) = P(A2 ) = P(A3 ) = 21 . Further, P(A1 ∩ A2 ) = P(A2 ∩ A3 ) = P(A3 ∩ A1 ) = 14 .
Moreover, P(A1 ∩ A2 ∩ A3 ) = 0. Hence A1 , A2 and A3 are pairwise independent but not
mutually independent.
Example 2.5 (The fourth condition does not imply the first three). Toss two different stan-
dard dice having colors white and black. The sample space S of the outcomes consists of all
ordered pairs (i, j), i, j = 1, . . . , 6 such that S = {(1, 1), (1, 2), · · · , (6, 6)}. Consider the events
A1 = {first die = 1, 2 or 3}
A2 = {first die = 3, 4 or 5}
11
A3 = {sum of faces is 9}
In this example P(A1 ∩ A2 ∩ A3 ) = P(A1 )P(A2 )P(A3 ), but P(A1 ∩ A2 ) 6= P(A1 )P(A2 ), P(A1 ∩
A3 ) 6= P(A1 )P(A3 ). Here P(A1 ) = 1/2, P(A2 ) = 1/2 and P(A3 ) = 1/9. Further, P(A1 ∩ A2 ∩
A3 ) = 1/36, P(A1 ∩ A2 ) = 1/6, P(A2 ∩ A3 ) = 1/12 and P(A1 ∩ A3 ) = 1/36.
Example 2.6. Suppose S = {1, 2, . . . , 8}, with all outcomes equally likely. Let A1 = A2 =
{1, 2, 3, 4} and A3 = {2, 5, 6, 8}. It is easy to verify that the fourth condition does not imply
the first three.
Example 2.7. If A1 , A2 and A3 are independent events, then A1 and A2 ∪A3 are independent.
Also, A1 and A2 ∪ Ac3 are independent.
Solution.
12
Similarly for other pairs of events. Next
(b)
References
Dimitri Bertsekas and John N. Tsitsiklis (2008). Introduction to Probability, Athena
Scientific, 2nd edition.
Sheldon M. Ross (2009). Introduction to Probability and Statistics for Engineers and
Scientists, Academic Press.
13