Probability
3.7 Bayes’ Formula and Applications
136 3 Probability
The formula (3.4) is called Bayes’ Formula. It is often combined with (3.3) as follows. Suppose the possible outcomes of an experiment areB1,B2, . . . , Bk. Then
P (Bi |A)= P (A|Bi)P (Bi)
P (A|B1)P (B1)+ · · · +P (A|Bk)P (Bk) (3.5) (the denominator of (3.5) comes directly from (3.3)).
When Bayes’ formula is used, very often the outcomesB1, B2, . . . , Bk are the outcomes of an experiment that occurred earlier, andAis an outcome, or set of out- comes, of a later experiment. Bayes’ formula answers the question, “given the out- come of the second experiment, what is the probability that the outcome of the first experiment was so-and-so?” This sometimes confuses students because it somehow seems to suggest that the outcome of the later experiment can somehow affect the earlier experiment, and that is impossible—causes must come before effects. What in fact happens is that knowledge of the later experiment can increase our (incomplete) knowledge of the earlier experiment.
Sample Problem 3.30. The car pool contains ten Fords (five red and five white) and 15 Pontiacs (five red and ten white). You are allocated a car at random. You see from a distance that it is red. What is the probability that you have been given a Ford?
Solution. We requireP (F | R). There are 25 cars of which ten are Fords, so P (F )= 1025 =0.4, and ten are red, soP (R)=0.4 also. The probability of a red car, given that it is a Ford, is 0.5, since half the Fords are red. So
P (R)P (F |R)=P (F )P (R|F ), 0.4·P (F |R)=0.4·0.5,
P (F |R)=0.5.
Your Turn. Box A contains two blue pens and three red pens. Box B contains two red pens and three blue pens. A box is chosen at random and a pen is chosen at random from it. If the pen is blue, what is the probability that the box was Box A?
Tree Diagrams
It is often convenient to use tree diagrams in Bayes’ formula problems. When the diagram is completed, the terms to be added for the denominator of (3.5) are on the right hand side.
Bayes’ formula calculations can be carried out as follows:
(i) First, start constructing a tree diagram with the possible outcomesB1, B2, . . . , Bk as branches.
(ii) To each of these branches add the branchesA(“the event Aoccurs”) and A (“Adoes not occur”). The paths ending inAtogether represent all the circum- stances in whichAcan occur.
(iii) Now calculate the probability—the product of the conditional probabilities—
for each branch that ends inA. The sum of these probabilities will beP (A), the denominator of (3.5).
(iv) The numeratorP (Bi |A)will be written next to one of the branches.
Sample Problem 3.31. Construct a tree diagram for Sample Problem3.29.
Solution. In the terminology of experiments, Sample Problem3.29could be de- scribed as follows. First, a supplier is chosen; then a light bulb is chosen from that supplier. So the outcomes of the first experiment (theB1, B2, . . .) are fac- toriesX,Y, orZ. The first part of the tree diagram has three branches labeled X,Y, andZ, with probabilities 0.4, 0.35, and 0.25, respectively. EventAis “the bulb is faulty”, and the three probabilities are 0.01, 0.02, and 0.03. So we obtain the diagram
From the diagram, the denominator is 0.0185. So P (Z|A)=P (A|Z)P (Z)
0.0185 = 0.0075
0.0185=0.405.
Your Turn. Repeat the above for Sample Problem3.30.
Sample Problem 3.32. The following table shows the proportion of people over 18 who are in various age categories, together with the probability that a person in a given category will vote in a given election. A vote is selected at random.
What is the probability that the voter was from the 18–24 age group?
Age group Proportion Probability
A: 18–24 18.2% 0.49
B: 25–44 38.6% 0.71
C: 45–64 28.2% 0.63
D: 65+ 15.2% 0.74
138 3 Probability
Solution. We use the following diagram (V andN mean “voter” and “non- voter”, respectively).
P (A|V )= 0.089
0.653 =0.136.
Your Turn. What is the probability that the voter was 65 or older?
Box Diagrams
In many examples, it is easiest to represent a two-stage experiment using a box di- agram. The outcomes of the first experiment are used as labels for rows, and the outcomes of the second experiment are used as labels for columns. Where row A meets columnB, we put a box containingP (A∩B). The sum of entries in rowA, which equalsP (A), is written at the end of rowA, and so on.
As an example, consider Sample Problem3.29. The first experiment—determina- tion of factory—has outcomesX,Y, and Z; the second experiment—“check: is it faulty”—has outcomesA(faulty) andB(okay). Then
P (A∩X)=P (A|X)P (X)=0.004, P (A∩Y )=P (A|Y )P (Y )=0.007, P (A∩Z)=P (A|Z)P (Z)=0.0075.
(See the diagram in Sample Problem3.31for these calculations.)
We can calculateP (B∩X)in various ways. For example,AandBare comple- ments, so
P (A∩X)+P (B∩X)=P (X),
P (B∩X)=P (X)−P (A∩X)
=0.4−0.004=0.396;
A B X 0.004 0.396 0.4 Y 0.007 0.343 0.35 Z 0.0075 0.2425 0.25
0.0185 0.9815
Fig. 3.7. Box diagram of data for Sample Problem3.29
similarlyP (B∩Y )=0.343, P (B∩Z)=0.2425. So the box diagram is as shown in Figure3.7.
Sample Problem 3.33. Use the box diagram in Figure3.7to calculateP (Z|A) in Sample Problem3.29.
Solution. To findP (Z|A), look at columnA, which has a total of 0.0185. Then look at the(Z, A)entry 0.0075, and take the ratio:
P (Z|A)=P (A∩Z)
P (Z) = 0.0075
0.0185 =0.406.
Your Turn. Produce a box diagram for the problem following Sample Prob- lem3.29and use it to find the probability that you have tossed the biased coin, given that it shows heads.
Exercises 3.7 A
1. The eventsEandF satisfyP (E) = 0.6, P (F | E) = 0.5, andP (F | E) = 0.75. FindP (E|F )andP (E|F ).
2. One experiment has possible outcomesA,B,C, while a second experiment has possible outcomesEandF. FindP (A| E),P (B |E),P (C | E),P (A| F ), P (B |F ), andP (C|F )in the following cases:
(i) P (A) = 0.4, P (B) = 0.4, P (E | A) = 0.25, P (E | B) = 0.75, and P (E)=0.6;
(ii) P (A) = 0.25,P (B) = 0.25,P (E | A) = 0.4, P (E | B) = 0.4, and P (E)=0.5;
(iii) P (A)=25, P (B)= 101, P (E|A)= 13, P (E|B)=0, andP (E)=35; (iv) P (A)=25, P (B)= 101, P (E|A)= 13, P (E|B)=0, andP (E)=12. 3. An auto rental company has 12 cars available, four small and eight fullsize.
There are ten customers; six want small and four want fullsize. If a small car is not available, the company gives a free upgrade to fullsize.
(i) How many upgrades are necessary?
(ii) If a customer receives a fullsize, what is the probability that she requested a small car?
140 3 Probability
4. Jason owns two cars, a Caprice and a Mini Cooper. If he drives the Mini Cooper to his office, he is late to work only 10% of the time (because he can usually find a parking space); but if he drives the Caprice, he is late 30% of the time.
He drives the Mini Cooper on four days out of every five, but on the fifth day he needs the larger car.
(i) Draw a box diagram for these data.
(ii) If he arrives on time, what is the probability that he drove the Caprice that morning?
5. An automobile dealership finds that 4% of their customers default on payments, so that the car must be repossessed. On analyzing the records, it is found that among those who did not default, 40% made a large down payment ($2000 or more), while only 10% of those who later defaulted made a large down pay- ment.
(i) Suppose a customer makes a large down-payment. What is the probability that he will default on payments?
(ii) If a customer makes a small down-payment, what is the probability that he will default on payments?
6. In manufacturing metal office equipment, your company uses nuts supplied by three companies, A, B, and C. Company A supplies 30%, company B supplies 45%, and company C supplies 25%. It is known that on average the following percentages of the nuts are defective: 1% of those from A, 1.5% of those from B, and 0.5% of those from C.
(i) If a nut is selected at random, what is the probability that it is defective?
(ii) If a nut is selected at random and is found to be defective, what is the prob- ability that it was made by company B?
7. In a certain city, it is found that equally many people have fair and dark hair.
A survey shows that 20% of people with dark hair and 40% of people with fair hair have blue eyes. A person is chosen at random from the population and is found to have blue eyes. What is the probability that this person has fair hair?
8. A class contains 60% women. It is found that 12% of the men students and 7%
of the women students are left-handed. A student is chosen at random. If the student is left-handed, what is the probability that the student is male?
9. In a factory, 30% of the workers smoke. It is found that smokers have three times the absentee rate of other workers. If a worker is absent, what is the probability that he is a smoker?
10. An auto insurance company classifies 20% of its drivers as good risks, 60% as medium risks, and 20% as bad risks (called classes A, B, and C, respectively).
The probability of at least one accident in a given year is 1% for class C, 0.5%
for class B, and 0.1% for class A. If one of their insureds has an accident this year, what is the probability that he is a class B driver?
Exercises 3.7 B
1. The eventsEandF satisfyP (E) =0.85, P (F | E)=0.8, andP (F |E) = 0.8. FindP (E|F )andP (E|F ).
2. The eventsEandF satisfyP (E)=0.5, P (F |E)=0.4, andP (F |E)=0.4.
FindP (E|F )andP (E|F ).
3. One experiment has the possible outcomesA,B, and C; a second experiment has the possible outcomesEandF. CalculateP (A|E),P (B |E),P (C|E), P (A|F ),P (B |F ), andP (C|F )when:
(i) P (A) = 103, P (B) = 12, P (E | A) = 23, P (F | B) = 25, and P (F |C)= 12;
(ii) P (A) = 0.25,P (B) = 0.25,P (E | A) = 0.6, P (F | B) = 0.6, and P (F |C)=0.5;
(iii) P (A) = 0.5, P (B) = 0.3, P (E | A) = 0.6, P (F | B) = 0, andP (F |C)=0.5;
(iv) P (A)=15,P (B)= 35,P (E|A)= 12,P (F |B)= 13, andP (F|C)=12. 4. 60 percent of the suitcases that are lost by Incompetence Airlines are eventually recovered. Of those that are recovered, 60% were locked, while only 10% of those not recovered were locked.
(i) If a lost case is locked, what is the probability that it will never be recovered?
(ii) If a lost case is not locked, what is the probability that it will eventually be recovered?
5. A builder buys tiles from two companies, A and B; he gets 80% from A and 20% from B. He finds that 98% of the tiles he gets from A are undamaged, while 96% of those from B are undamaged. If he finds a damaged tile, what is the probability that:
(i) The tile came from A?
(ii) The tile came from B?
6. Suppose the shipping department of a company has three workers who prepare shipping labels. They prepare 60%, 30%, and 10% of the labels, respectively.
The respective percentages of errors are 3%, 5%, and 10%. Find the probability that an incorrect label is due to the first person. Also find the probability that an incorrect label is due to each of the other persons.
7. Box 1 contains 2 red pens and 4 blue pens. Box 2 contains 4 red pens, one green pen, and 4 blue pens. A pen is chosen from Box 1 and then it is placed in Box 2.
Then a box is chosen at random and a pen is selected.
(i) What is the probability that the pen is blue?
(ii) If the pen is blue, what is the probability it originally came from Box 1?
142 3 Probability
(iii) Suppose Box 2 is the one from which a pen in finally selected.
(a) If the pen drawn is blue, what is the probability that the pen drawn earlier from Box 1 was red?
(b) If the pen drawn is red, what is the probability that the pen drawn earlier from Box 1 was red?
8. In a manufacturing plant three machines, A, B, and C produce 50%, 35%, and 15%, respectively, of the total production. The quality control department of the company has determined that 1% of the items produced by Machine A and 2%
of the items produced by each of Machines B and C are defective. If an item is selected at random and found to be defective, what is the probability that it was produced by Machine B?
9. A school tax proposition is submitted to voters. The voters’ registered party affil- iation as a percentage of all voters, and the percentage of each group who voted in favor of the proposition, are as follows:
Party Registration In Favor
Democrat 40 70
Republican 40 20
Independent 10 80
Other 10 50
A voter is selected at random.
(i) What is the probability that she voted in favor of the proposition?
(ii) If she voted in favor of the proposition, what is the probability that she is a Democrat?
(iii) If she voted against the proposition, what is the probability that she is not a Republican?
10. A class contains 20% Math majors, 40% Computer Science majors, and 40%
Engineering majors. 50% of the Math Majors, 75% of the Computer Science majors, and 25% of the Engineering majors are women.
(i) Draw a box diagram for these data.
(ii) A student’s name is chosen at random from the class list. What is the prob- ability that the student is a woman?
(iii) A student’s name is chosen at random from the class list and the student is found to be a woman. What is the probability that the student is an Engi- neering major?
11. A computer dealer sells 70% PC’s, 20% Apple products and 10% Sun platforms.
In the first 90 days, an average of 5% of the PCs, 1% of the Apples and 3% of the Suns are returned for repair. What percentage of the repairs are Apples? What percentage are Suns?