# Conditional Probability & Baye's Theorem - Nitin Gupta, AlphaNumeric (Part 2/2)

• In Part 1, we have discussed the methods of finding the probability of events. If we have two events from the same sample space, does the information about the occurrence of one of the events affect the probability of the other event? Let us try to answer this question by taking up a random experiment in which the outcomes are equally likely to occur.

CONDITIONAL PROBABILITY

Consider the experiment of tossing three fair coins. The sample space of the experiment is
S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}

Since the coins are fair, we can assign the probability 1/8 to each sample point. Let E be the event ‘at least two heads appear’ and F be the event ‘first coin shows tail’.

Then
E = {HHH, HHT, HTH, THH}
and F = {THH, THT, TTH, TTT}

Therefore P(E) = P ({HHH}) + P ({HHT}) + P ({HTH}) + P ({THH})
= 1/8 + 1/8 + 1/8 + 1/8 = 1/2 (why??)
and P(F) = P ({THH}) + P ({THT}) + P ({TTH}) + P ({TTT})
= 1/8 + 1/8 + 1/8 + 1/8 = 1/2
Also E ∩F = {THH}
with P(E ∩F) = P({THH}) = 1/8

Now, suppose we are given that the first coin shows tail, i.e. F occurs, then what is the probability of occurrence of E? With the information of occurrence of F, we are sure that the cases in which first coin does not result into a tail should not be considered while finding the probability of E. This information reduces our sample space from the set S to its subset F for the event E. In other words, the additional information really amounts to telling us that the situation may be considered as being that of a new random experiment for which the sample space consists of all those outcomes only which are favourable to the occurrence of the event F.

Now, the sample point of F which is favourable to event E is THH.
Thus, Probability of E considering F as the sample space = 1/ 4 ,
or Probability of E given that the event F has occurred = 1/ 4

This probability of the event E is called the conditional probability of E given that F has already occurred, and is denoted by P (E|F).

Thus P(E|F) = 1/4

Note that the elements of F which favour the event E are the common elements of E and F, i.e. the sample points of E ∩F.
Thus, we can also write the conditional probability of E given that F has occurred as
P(E|F) = Number of elementary events favourable to E∩ F/ Number of elementary events which are favourable to F

DEFINITION CONDITIONAL PROBABILITY

Definition 1
If E and F are two events associated with the same sample space of a random experiment, the conditional probability of the event E given that F has occurred, i.e. P (E|F) is given by
P(E|F) = P(E ∩ F) / P(F) provided P(F) ≠0

Properties of conditional probability

Let E and F be events of a sample space S of an experiment, then we have

Property 1 :
P(S|F) = P(F|F) = 1
We know that
P(S|F) = P(S ∩F)/ P(F) = P(F)/ P(F) = 1
Also P(F|F) = P(F∩ F)/ P(F) = 1
Thus P(S|F) = P(F|F) = 1

Property 2 :
If A and B are any two events of a sample space S and F is an event of S such that P(F) ≠0, then
P((A ∪B)|F) = P(A|F) + P(B|F) – P ((A ∩B)|F)
In particular, if A and B are disjoint events, then
P((A∪B)|F) = P(A|F) + P(B|F)

Property 3:
P(E′|F) = 1 − P (E|F)

If P(A) = 7/ 13 , P (B) = 9/ 13 and P (A ∩ B ) = 4/ 13 , evaluate P (A|B)

P(A|B)= P(A ∩B) / P(B) = (4/13)/ (9/13)

A family has two children. What is the probability that both the children are boys given that at least one of them is a boy ?

Let b stand for boy and g for girl. The sample space of the experiment is
S = {(b, b), (g, b), (b, g), (g, g)}
Let E and F denote the following events :
E : ‘both the children are boys’
F : ‘at least one of the child is a boy’
Then E = {(b,b)} and F = {(b,b), (g,b), (b,g)}
Now E ∩F = {(b,b)}
Thus P(F) = 3/4
and P (E ∩F) = 1/ 4
Therefore P(E|F) = P(E ∩ F) / P(F) = (1/4)/(3/4) = 1/3

Ten cards numbered 1 to 10 are placed in a box, mixed up thoroughly and then one card is drawn randomly. If it is known that the number on the drawn card is more than 3, what is the probability that it is an even number?

Let A be the event ‘the number on the card drawn is even’ and B be the event ‘the number on the card drawn is greater than 3’. We have to find P(A|B).
Now, the sample space of the experiment is S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Then A = {2, 4, 6, 8, 10}, B = {4, 5, 6, 7, 8, 9, 10}
and A ∩B = {4, 6, 8, 10}
Also P(A) = 5 /10 , P(B) = 7/10 and P(A ∩ B ) = 4/10
Then p(A|B) = P(A ∩ B ) / P(B) = (4/10)/ (7/10)

In a school, there are 1000 students, out of which 430 are girls. It is known that out of 430, 10% of the girls study in class XII. What is the probability that a student chosen randomly studies in Class XII given that the chosen student is a girl?

Ans - 1/10

A die is thrown three times. Events A and B are defined as below:
A : 4 on the third throw
B : 6 on the first and 5 on the second throw
Find the probability of A given that B has already occurred.

The sample space has 216 outcomes.
Now A =
(1,1,4) (1,2,4) ... (1,6,4) (2,1,4) (2,2,4) ... (2,6,4)
(3,1,4) (3,2,4) ... (3,6,4) (4,1,4) (4,2,4) ...(4,6,4)
(5,1,4) (5,2,4) ... (5,6,4) (6,1,4) (6,2,4) ...(6,6,4)
B = {(6,5,1), (6,5,2), (6,5,3), (6,5,4), (6,5,5), (6,5,6)}
and A ∩B = {(6,5,4)}.
Now P(B) = 6/ 216
And P(A ∩ B ) = 1/216
Then p(A|B) = P(A ∩ B ) / P(B) = (1/216)/(6/216) = 1/6

A die is thrown twice and the sum of the numbers appearing is observed to be 6. What is the conditional probability that the number 4 has appeared at least once?

Let E be the event that ‘number 4 appears at least once’ and F be the event that ‘the sum of the numbers appearing is 6’.
Then, E = {(4,1), (4,2), (4,3), (4,4), (4,5), (4,6), (1,4), (2,4), (3,4), (5,4), (6,4)}
and F = {(1,5), (2,4), (3,3), (4,2), (5,1)}
We have P(E) = 11/ 36
and P (F) = 5/ 36
Also E∩F = {(2,4), (4,2)}
Therefore P(E∩F) = 2/ 36
Hence, the required probability
P(E|F) = P(E ∩ F) / P(F) = (2/36)/ (5/36) = 2/ 5

For the conditional probability, we have considered the elementary events of the experiment to be equally likely and the corresponding definition of the probability of an event was used. However, the same definition can also be used in the general case where the elementary events of the sample space are not equally
likely, the probabilities P (E∩F) and P (F) being calculated accordingly. Let us take up the following example.

Consider the experiment of tossing a coin. If the coin shows head, toss it again but if it shows tail, then throw a die. Find the conditional probability of the event that ‘the die shows a number greater than 4’ given that ‘there is at least one tail’.

The sample space of the experiment may be described as
S = {(H,H), (H,T), (T,1), (T,2), (T,3), (T,4), (T,5), (T,6)}
where (H, H) denotes that both the tosses result into
head and (T, i) denote the first toss result into a tail and
the number i appeared on the die for i = 1,2,3,4,5,6.
Thus, the probabilities assigned to the 8 elementary
Events (H, H), (H, T), (T, 1), (T, 2), (T, 3) (T, 4), (T, 5), (T, 6)
Are 1/4, 1/4, 1/12, 1/12, 1/12, 1/12, 1/12, 1/12,
respectively.
Let F be the event that ‘there is at least one tail’ and E be the event ‘the die shows
a number greater than 4’. Then
F = {(H,T), (T,1), (T,2), (T,3), (T,4), (T,5), (T,6)}
E = {(T,5), (T,6)} and E ∩F = {(T,5), (T,6)}
Now P(F) = P({(H,T)}) + P ({(T,1)}) + P ({(T,2)}) + P ({(T,3)}) + P ({(T,4)}) + P({(T,5)}) + P({(T,6)})
= 1/4 + 1/12 + 1/12 + 1/12 +1/12+ 1/12+1/12 = 3/4
and P(E ∩F) = P ({(T,5)}) + P ({(T,6)}) = 1/12 +1/12 = 1/6
Hence, the required probability
P(E|F) = P(E ∩ F) / P(F) = (1/6)/ (3/4) = 2/9.

The outcomes of the experiment can be represented in following diagrammatic manner called the ‘tree diagram’.  Multiplication Theorem on Probability

Let E and F be two events associated with a sample space S. Clearly, the set E ∩F denotes the event that both E and F have occurred. In other words, E ∩F denotes the simultaneous occurrence of the events E and F. The event E ∩F is also written as EF. Very often we need to find the probability of the event EF. For example, in the experiment of drawing two cards one after the other, we may be interested in finding
the probability of the event ‘a king and a queen’. The probability of event EF is obtained by using the conditional probability as obtained below :

We know that the conditional probability of event E given that F has occurred is denoted by P(E|F) and is given by P(E|F) = P(E∩ F)/ P(F) , P(F) ≠ 0
From this result, we can write
P(E ∩F) = P(F) . P(E|F)---------------(1)
Also, we know that
P(F|E) = P(F∩ E) / P(E) ,P(E) ≠ 0
or P(F|E) = P(E∩ F)/ P(E) (since E ∩F = F ∩E)
Thus, P(E ∩F) = P(E). P(F|E) .... (2)
Combining (1) and (2), we find that
P(E ∩F) = P(E) P(F|E)
= P(F) P(E|F) provided P(E) ≠0 and P(F) ≠0.

The above result is known as the multiplication rule of probability.

An urn contains 10 black and 5 white balls. Two balls are drawn from the urn one after the other without replacement. What is the probability that both drawn balls are black?

Let E and F denote respectively the events that first and second ball drawn are black.
We have to find P (E ∩F) or P (EF).
Now P(E) = P (black ball in first draw) = 10/15
Also given that the first ball drawn is black, i.e., event E has occurred, now there are 9 black balls and five white balls left in the urn. Therefore, the probability that the second ball drawn is black, given that the ball in the first draw is black, is nothing but the conditional probability of F given that E has occurred.
i.e. P(F|E) = 9/ 14
By multiplication rule of probability, we have
P (E ∩F) = P(E) P(F|E)
= ( 10/15) × (9/14 ) = 3/7

Multiplication rule of probability for more than two events:

If E, F and G are three events of sample space, we have
P(E ∩F ∩G) = P(E) P (F|E) P (G|(E ∩F)) = P (E) P(F|E) P (G|EF)
Similarly, the multiplication rule of probability can be extended for four or more events.

Three cards are drawn successively, without replacement from a pack of 52 well shuffled cards. What is the probability that first two cards are kings and the third card drawn is an ace?

Let K denote the event that the card drawn is king and A be the event that the card drawn is an ace. Clearly, we have to find P (KKA)
Now P(K) = 4/52
Also, P (K|K) is the probability of second king with the condition that one king has already been drawn. Now there are three kings in (52 -1) = 51 cards.
Therefore P(K|K) = 3/ 51
Lastly, P(A|KK) is the probability of third drawn card to be an ace, with the condition that two kings have already been drawn. Now there are four aces in left 50 cards.
Therefore P(A|KK) = 4/50
By multiplication law of probability, we have P(KKA) = P(K) P(K|K) P(A|KK)
= (4/ 52) × (3/ 51) ×( 4/ 50) = 2/5525.

Independent Events

Definition 1

Consider the experiment of drawing a card from a deck of 52 playing cards, in which the elementary events are assumed to be equally likely. If E and F denote the events 'the card drawn is a spade' and 'the card drawn is an ace' respectively, then
P(E) = 13/52 = 1/4 and P(F) = 4/52 = 1/13
Also E and F is the event ' the card drawn is the ace of spades' so that
P(E ∩F) = 1/52
Hence P(E|F) = P(E∩ F)/ P(F) = (1/52)/ (1/13) = 1/4
Since P(E) = 1/4 = P (E|F), we can say that the occurrence of event F has not affected the probability of occurrence of the event E.
We also have
P(F|E) = P(E∩ F)/ P(E) = (1/52)/(1/4) = 1/13 = P (F)
Again, P (F) = 1/13 = P (F|E) shows that occurrence of event E has not affected the probability of occurrence of the event F.
Thus, E and F are two events such that the probability of occurrence of one of them is not affected by occurrence of the other.
Such events are called independent events.

Definition 2

Two events E and F are said to be independent, if
P(F|E) = P (F) provided P (E) ≠0
and P (E|F) = P (E) provided P (F) ≠0
Thus, in this definition we need to have P (E) ≠0 and P(F) ≠0
Now, by the multiplication rule of probability, we have
P(E ∩F) = P(E) . P (F|E) ... (1)
If E and F are independent, then (1) becomes
P(E ∩F) = P(E) . P(F) ... (2)
Thus, using (2), the independence of two events is also defined as follows:

Definition 3
Let E and F be two events associated with the same random experiment, then E and F are said to be independent if
P(E ∩F) = P(E) . P (F)

Remarks

(i) Two events E and F are said to be dependent if they are not independent, i.e. if
P(E ∩F ) ≠P (E) . P (F)

(ii) Sometimes there is a confusion between independent events and mutually exclusive events. Term ‘independent’ is defined in terms of ‘probability of events’ whereas mutually exclusive is defined in term of events (subset of sample space). Moreover, mutually exclusive events never have an outcome common, but independent events, may have common outcome. Clearly, ‘independent’ and ‘mutually exclusive’ do not have the same meaning.

In other words, two independent events having non-zero probabilities of occurrence can not be mutually exclusive, and conversely, i.e. two mutually exclusive events having non-zero probabilities of occurrence can not be independent.

(iii) Two experiments are said to be independent if for every pair of events E and F, where E is associated with the first experiment and F with the second experiment, the probability of the simultaneous occurrence of the events E and F when the two experiments are performed is the product of P(E) and P(F) calculated separately on the basis of two experiments, i.e., P (E ∩F) = P (E) . P(F)

(iv) Three events A, B and C are said to be mutually independent, if
P(A ∩B) = P(A) P(B)
P(A ∩C) = P(A) P(C)
P(B ∩C) = P(B) P(C)
and P(A ∩B ∩C) = P(A) P (B) P (C)

If at least one of the above is not true for three given events, we say that the events are not independent.

A die is thrown. If E is the event ‘the number appearing is a multiple of 3’ and F be the event ‘the number appearing is even’ then find whether E and F are independent ?

We know that the sample space is S = {1, 2, 3, 4, 5, 6}
Now E = { 3, 6}, F = { 2, 4, 6} and E ∩F = {6}
Then P(E) = 2/6 = 1/3 ,
P(F)= 3/6 = 1/2
and P(E ∩F) 1/6
Clearly P(E ∩F) = P(E). P (F)
Hence E and F are independent events

Independent and Mutually exclusive events

Two events are independent if the outcome of one doesn't affect the outcome of the other. Otherwise they are dependent.

Examples

When tossing a fair coin twice, the result of the first toss doesn't affect the probability of the outcome of the second toss.
When drawing two cards from a deck of 52 playing card, the event 'getting a King' on the first card and the event 'getting a black card' are not independent. The probability of the second card change after the first card is drawn. The two events would be independent if after drawing the first card, the card is returned to the deck (thus the deck is complete 52 again).
For two independent events, A and B, the probability of both occurring together, P(A and B ), is the product of the probability of each event.
P(A and B ) = P(A ∩ B ) = P(A) × P(B)
For example, when tossing a fair coin twice, the probability of getting a 'Head' on the first and then getting a 'Tail' on the second is
P(H and T) = P(H) × P(T)
P(H and T) = 0.5 × 0.5
P(H and T) = 0.25

Two events are mutually exclusive if they cannot occur at the same time.

Examples

When tossing a fair coin, the event 'getting a head' and the event 'getting a tail' are mutually exclusive because they can't occur at the same time.
When throwing a fair die, the event 'getting a 1' and the event 'getting a 4' are mutually exclusive because they can't occur at the same time. But the event 'getting a 3' and the event 'getting an odd number' are not mutually exclusive since it can happen at the same time (i.e. if you get 3)
For two mutually exclusive events, A and B, the probability of either one occuring, P(A or B ), is the sum of the probability of each event.
P(A or B ) = P(A) + P(B )
For example, when choosing a ball at random from a bag containing 3 blue balls, 2 green bals, and 5 red balls, the probability of getting a blue or red ball is
P(Blue or Red) = P(Blue) + P(Red)
P(Blue or Red) = 3/10 + 5/10
P(Blue or Red) = 8/10 = 0.8

For non mutually exclusive events the probability of either one or both occurring is
P(A or B ) = P(A) + P(B) − P(A ∩ B )
where P(A ∩ B ) is the probability of event A and event B happening at the same time.

For example, when drawing a card from a deck of 52 playing cards, the probability of getting a red card or a King is
P(Red or King) = P(Red) + P(King) − P(Red ∩ King)
P(Red or King) = 26/52 + 4/52 − 2/52
P(Red or King) = 28/52 = 7/13

This is so because a card can either be red, king, or both (i.e. red king). So that's why we need to subtract the probability of a card being both red and king because it has already been accounted for in the probability of the card being red and the probability of the card being king.

Definition of a mutually exclusive event

If event A happens, then event B cannot, or vice-versa. The two events "it rained on Tuesday" and "it did not rain on Tuesday" are mutually exclusive events. When calculating the probabilities for exclusive events you add the probabilities.

Independent events

The outcome of event A, has no effect on the outcome of event B. Such as "It rained on Tuesday" and "My chair broke at work". When calculating the probabilities for independent events you multiply the probabilities. You are effectively saying what is the chance of both events happening bearing in mind that the two were unrelated.

To be or not to be.....?

So, if A and B are mutually exclusive, they cannot be independent. If A and B are independent, they cannot be mutually exclusive. Simple isn't it? Or is it? This is where a lot of people go wrong in trying to work out probabilities as sometimes the status of two sets of probabilities are not as clear cut as it seems.

Three coins are tossed simultaneously. Consider the event E ‘three heads or three tails’, F ‘at least two heads’ and G ‘at most two heads’. Of the pairs (E,F), (E,G) and (F,G), which are independent? which are dependent?

The sample space of the experiment is given by S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
Clearly E = {HHH, TTT},
F= {HHH, HHT, HTH, THH}
and G = {HHT, HTH, THH, HTT, THT, TTH, TTT}
Also E ∩F = {HHH}, E ∩G = {TTT}, F ∩G = { HHT, HTH, THH}
Therefore P(E) = 2/8 = 1/4 , P(F) = 4/8 =1/2 , P(G) = 7/8
and P(E∩F) =1/8 , P(E ∩G) = 1/8 , P(F∩ G) 3/8
Also P(E) . P (F) = (1/4) × (1/2) = 1/8 , P(E). P(G) = (1/4) × (7/8) = 7/32
and P(F) . P(G) = (1/2) × (7/8) = 7/16
Thus P(E ∩F) = P(E) . P(F)
P(E ∩G) ≠P(E) . P(G)
and P(F ∩G) ≠P (F) . P(G)
Hence, the events (E and F) are independent, and the events (E and G) and (F and G) are dependent.

One card is drawn at random from a well shuffled deck of 52 cards. In which of the following cases are the events E and F independent ?
(i) E : ‘the card drawn is a spade’
F : ‘the card drawn is an ace’
(ii) E : ‘the card drawn is black’
F : ‘the card drawn is a king’
(iii) E : ‘the card drawn is a king or queen’
F : ‘the card drawn is a queen or jack’.

(i) In a deck of 52 cards, 13 cards are spades and 4 cards are aces.
∴ P(E) = P(the card drawn is a spade) =13/52 = 1/4
∴ P(F) = P(the card drawn is an ace) = 4/52 =1/13
In the deck of cards, only 1 card is an ace of spades.
P(EF) = P(the card drawn is spade and an ace) =1/52
P(E) × P(F) =1/4 * 1/13 = 1/52
⇒ P(E) × P(F) = P(EF)
Therefore, the events E and F are independent.

(ii) In a deck of 52 cards, 26 cards are black and 4 cards are kings.
∴ P(E) = P(the card drawn is black) = 26/52 = 1/2
∴ P(F) = P(the card drawn is a king) = 4/52 = 1/13
In the pack of 52 cards, 2 cards are black as well as kings.
∴ P (EF) = P(the card drawn is a black king) = 2/52 =1/26
P(E) × P(F) = 1/2 * 1/13 = 1/26 = P (EF)
Therefore, the given events E and F are independent.

(iii) In a deck of 52 cards, 4 cards are kings, 4 cards are queens, and 4 cards are jacks.
∴ P(E) = P(the card drawn is a king or a queen) = 8/52 = 2/13
∴ P(F) = P(the card drawn is a queen or a jack) = 8/52 = 2/13
There are 4 cards which are king or queen and queen or jack.
∴ P(EF) = P(the card drawn is a king or a queen, or queen or a jack)
= 4/52 = 1/13
P(E) × P(F) = 2/13 *2/13 = 4/169 ≠ 1/13
Therefore, the given events E and F are not independent.

BAYE'S THEOREM

Consider that there are two bags I and II. Bag I contains 2 white and 3 red balls and Bag II contains 4 white and 5 red balls. One ball is drawn at random from one of the bags. We can find the probability of selecting any of the bags (i.e. 12 ) or probability of drawing a ball of a particular colour (say white) from a particular bag (say Bag I). In other words, we can find the probability that the ball drawn is of a particular colour, if we are given the bag from which the ball is drawn. But, can we find the probability that the ball drawn is from a particular bag (say Bag II), if the colour of the ball drawn is given? Here, we have to find the reverse probability of Bag II to be selected when an event occurred after it is known. Famous mathematician, John Bayes' solved the problem of finding reverse probability by using conditional probability. The formula developed by him is known as ‘Bayes theorem’ which was published posthumously in 1763.

P( A | B ) = P( B | A ) P(A) / P(B)
P(A | B ) = P(B | A) P(A) / ( P(B | A)P(A) + P(B | A' )P(A' ) )

A person has undertaken a construction job. The probabilities are 0.65 that there will be strike, 0.80 that the construction job will be completed on time if there is no strike, and 0.32 that the construction job will be completed on time if there is a strike. Determine the probability that the construction job will be completed on time.

Let A be the event that the construction job will be completed on time, and B be the event that there will be a strike. We have to find P(A).
We have
P(B) = 0.65, P(no strike) = P(B′) = 1 −P(B) = 1 −0.65 = 0.35
P(A|B) = 0.32, P(A|B′) = 0.80
Since events B and B′form a partition of the sample space S, therefore, by theorem on total probability,
we have
P(A) = P(B) P(A|B) + P(B′) P(A|B′)
= 0.65 × 0.32 + 0.35 × 0.8
= 0.208 + 0.28 = 0.488
Thus, the probability that the construction job will be completed in time is 0.488.

Bag I contains 3 red and 4 black balls while another Bag II contains 5 red and 6 black balls. One ball is drawn at random from one of the bags and it is found to be red. Find the probability that it was drawn from Bag II.

Let E1 be the event of choosing the bag I, E2 the event of choosing the bag II and A be the event of drawing a red ball.
Then P(E1) = P(E2) = 1/2
Also P(A|E1) = P(drawing a red ball from Bag I) = 3/7
and P(A|E2) = P(drawing a red ball from Bag II) = 5/11
Now, the probability of drawing a ball from Bag II, being given that it is red, is P(E2|A)

By using Bayes' theorem, we have
P(E2|A) = P(E2 )P(A|E2 ) / P(E1 )P(A|E1 )+P(E2 )P(A|E2 )
= (1/2 × 5/11) / (1/2 × 3/7 + 1/2 × 5/11)
= 35/68

Given three identical boxes I, II and III, each containing two coins. In box I, both coins are gold coins, in box II, both are silver coins and in the box III, there is one gold and one silver coin. A person chooses a box at random and takes out a coin. If the coin is of gold, what is the probability that the other coin in the box is also of gold?

Let E1, E2 and E3 be the events that boxes I, II and III are chosen, respectively.
Then P(E1) = P(E2) = P(E3) = 1/3
Also, let A be the event that ‘the coin drawn is of gold’
Then P(A|E1) = P(a gold coin from bag I) = 2/2 = 1
P(A|E2) = P(a gold coin from bag II) = 0
P(A|E3) = P(a gold coin from bag III) = ½
Now, the probability that the other coin in the box is of gold
= the probability that gold coin is drawn from the box I.
= P(E1|A)

By Bayes' theorem, we know that
P(E1|A) = P(E1 )P(A|E1 ) / P(E1 )P(A|E1 ) + P(E2 )P(A|E2 )+P(E2 )P(A|E2 )
= (1/3 × 1) / {(1/3×1) +( 1/3× 0) + (1/3 ×1/2)} = 2/3

Suppose that the reliability of a HIV test is specified as follows:
Of people having HIV, 90% of the test detect the disease but 10% go undetected.
Of people free of HIV, 99% of the test are judged HIV–ive but 1% are diagnosed as showing HIV+ive.
From a large population of which only 0.1% have HIV, one person is selected at random, given the HIV test, and the pathologist reports him/her as HIV+ive.
What is the probability that the person actually has HIV?

Let E denote the event that the person selected is actually having HIV and A the event that the person's HIV test is diagnosed as +ive. We need to find P(E|A).
Also E′denotes the event that the person selected is actually not having HIV. Clearly, {E, E′} is a partition of the sample space of all people in the population.

We are given that
P(E) = 0.1% = 0.1/100 = 0.001
P( E’) = 1 – P(E) = 0.999
P(A|E) = P(Person tested as HIV+ive given that he/she is actually having HIV)
= 90% = .9
and P(A|E’) = P(Person tested as HIV +ive given that he/she is actually not having HIV)
= 1% = .01

Now, by Bayes' theorem
= (0.001× 0.9) / (0.001× 0.9 + 0.999 ×0.01) = 90/1089
= 0. 083(approx)
Thus, the probability that a person selected at random is actually having HIV given that he/she is tested HIV+ive is 0.083.

In a factory which manufactures bolts, machines A, B and C manufacture respectively 25%, 35% and 40% of the bolts. Of their outputs, 5, 4 and 2 percent are respectively defective bolts. A bolt is drawn at random from the product and is found to be defective. What is the probability that it is manufactured by the machine B?

Let events B1, B2, B3 be the following :
B1 : the bolt is manufactured by machine A
B2 : the bolt is manufactured by machine B
B3 : the bolt is manufactured by machine C
Clearly, B1, B2, B3 are mutually exclusive and exhaustive events and hence, they represent a partition of the sample space.

Let the event E be ‘the bolt is defective’.
The event E occurs with B1 or with B2 or with B3. Given that,
P(B1) = 25% = 0.25, P (B2) = 0.35 and P(B3) = 0.40
Again P(E|B1) = Probability that the bolt drawn is defective given that it is manufactured by machine A = 5% = 0.05

Similarly, P(E|B2) = 0.04, P(E|B3) = 0.02.

Hence, by Bayes' Theorem, we have
= 0.35 × 0.04 /( 0.25× 0.05+ 0.35× 0.04 + 0.40 ×0.02)
= 28/69

1

1

1

2

59

1

1

1