Probability/Conditional Probability

From Wikibooks, open books for an open world
< Probability
Jump to: navigation, search

In some situations we need a new kind of probability. You are standing in front of three closed doors, and you know that there is a tiger behind one of them. To your relief, door #1 is opened and there is no tiger. What is the conditional probability that the tiger is behind door #2, given that there was no tiger behind door #1?


The conditional probability of an event A, given the occurrence event B, is written as P(A|B). What Wikipedia calls Bayes' theorem is,


provided P(B) > 0. In the case where P(B) = 0, the conditional probability of A given B is meaningless, but for completeness we define P(A|B) = 0 for P(B) = 0. This formula is equivalent to: P(A|B) P(B) = P(A and B). The expression,P(A and B),is often written as P(A & B)

Independent events

Intuitively, we would like two events, A and B, to be independent if P(A|B) = P(A), that is, if A is as likely to occur whether or not B has occurred. In this case, the occurrence of A is independent of the occurrence of B.

However, P(A|B) = P(A) P(A and B)/P(B) = P(A) P(A and B) = P(A)P(B).

Therefore, A is independent from B B is independent from A P(A and B) = P(A)P(B).


Even and prime numbers[edit]

P(even | prime)=1/3.    P(prime | even)=1/2
Can you find P(even & prime) using three different methods... and get the same anwer?

Consider the integers {1,2,3,4,5}. Using the notation shown in the chart below, the set of odd numbers { 1, 3, 5 } = e'. The integer "1" not considered a prime number, while "2" is prime, so that: pe = { 2 }.

Category elements set compliment
Prime numbers 2,3,5 p denote "prime" p' denote "not prime"
Even number 2,4,6 e denotes "even" e' denotes "not even"

The set {1,2,3,4,5} contains three prime numbers, but only one of them ("2") is even. Therefore, the conditional probability that an element of the set {1,2,3,4,5} is even, given that it is prime, is P(even | prime) = 1/3.

The set {1,2,3,4,5} contains two even numbers, but only one of them is prime. Therefore, the conditional probability that an element of the set {1,2,3,4,5} is prime, given that it is even, is P(prime | even) = 1/2.

What is the probability that a randomly selected member of this set is both prime and even? There are three ways to answer this question. The first is direct and makes no use of conditional probability. Since the only number in the set that is both prime and even is "2", we have:


The other two methods use P(A & B) = P(A ∩ B) = P(A)P(B|A) = P(B)P(A|B):[1]



Can you use the three different methods to calculate P(even & prime) for elements in the set {1,2,3,4,5,6,7,8,9,10}?

Wikiversity-logo.svg Venn diagram used to prove Bell's theorem on Wikiversity


We shall throw two dice: the probability of getting double six is 1/36. We have thrown the dice, but they are still under the cup: the probability of double six still is considered to be 1/36. Now we have someone else look under the cup at the result, and they tell us that at least one of the dice is a 6. What will the probability be of double six? Although we ask for the "probability" of double six, it's not the original probability we're talking about. It's a new kind of probability of the event "double six" under the condition that we know that another event has occurred, i.e. the event that one of the dice shows six. We call it "conditional probability". It indicates how likely the event "double six" is amongst all events in which (at least) one of the dice shows six. In 11 of the 36 possibilities at least one of the dice shows six. Thus, the probability of one of the dice showing six is 11/36 and the probability of double six is 1/36. Hence, the conditional probability of double six, given one die shows six is (1/36)/(11/36) = 1/11. We write this conditional probability as:

P( "double six" | "at least one six" ),

using the same letter P as for the original probability, and separating the event of which the conditional probability is indicated from the event that states the condition by a vertical line ("|").

Gender and occupation[edit]

As another example we pick at random an inhabitant of the UK. The probability of the chosen person to be a woman (W) is 1/2, it's nothing else than the fraction women amongst the British. What if we are informed that the chosen person is working in a hospital (H)? It now comes down to the fraction of women amongst hospital staff, let's say 0.7. So we have:

P(W) = 0.5


P(W|H) = 0.7.

References and footnotes[edit]

  1. Note the mixed notations, P(A & B) = P(A ∩ B). The former means the element is in A 'and the element is in B, while the latter means the element is in the intersection of sets A and B.