# Homework Help: Conditional Probability of defective components

1. Jan 28, 2010

### exitwound

1. The problem statement, all variables and given/known data

Components of a certain type are shipped to a supplier in batches of ten. suppose that 50% of all such batches contain no defective components, 30% contain one defective component, and 20% contain two defective components. Two components from a batch are randomly selected and tested. What are the probabilities associated with 0, 1, and 2 defective components being in the batch under each of the following conditions?

a.) Neither tested component is defective.
b.) One of the two tested components is defective.

3. The attempt at a solution

Can anyone explain to me what the heck this problem is even describing? I can't wrap my head around the scenario at all. Can you describe it to me better than the book does???

2. Jan 28, 2010

### LCKurtz

The experiment can be thought of as two steps. Step one is to select a batch and step 2 is to draw two balls. If you call the events B0, B1, B2 according to whether the selected batch has 0, 1, or 2 defects, respectively, you are given the probabilities of these three events. The second step is to pick two balls to look at. If you knew which batch was selected, presumably you could calculate the required probabilities for 0, 1, or 2 balls being defective. For example, you know that the probablility of 1 or 2 defects from batch B0 = 0. So you want to use the conditional probability formula. If X represents the number of defective balls you see, then

P(X=n) = P(X=n|B0)P(B0) + P(X=n|B1)P(B1) +P(X=n|B2)P(B2)

and hopefully, you can calculate these.

3. Jan 28, 2010

### exitwound

I'm sorry, but I still don't understand the problem. I don't understand what it's describing and asking for. Not necessarily the math, but I can't follow the wording of the question.

I have batches of 10 components. Of all the batches sent out, 50% of them have 0 defects, 30% have 1 defect, and 20% have 2 defects. Inspectors choose 2 components from a batch. From there, I'm lost. I don't know what's actually going on.

4. Jan 28, 2010

### vela

Staff Emeritus
You test the two selected and say you find neither is defective. It's still possible that 0, 1, or 2 of the remaining 8 in the batch is defective, depending on the type of batch you're testing. They're asking you to calculate the probabilities of finding 0, 1, or 2 defects in the remaining 8.

If you knew what type of batch you're sampling, you could answer the question of how many defects are in the remaining 8 with certainty, but you don't know. All you know is there's a 50% chance you've selected from a batch with no defects, a 30% chance of a batch with 1 defect, and a 20% chance of a batch with 2 defects.

5. Jan 28, 2010

### LCKurtz

The problem is that you don't know what batch the balls came from. If you knew that, presumably you could calculate the probability that none, 1, or both of the balls you select are defective. If I'm wrong about that, you have a more basic problem.

So you have to take into account the probability for each batch being selected, and condition the probabilities for the balls on which batch it is. That's why you have terms in the conditional probability equation which can be described informally like:

Probability that batch 1 is selected times the probability that none of the two are defective given that batch 1 was selected, which you presumably can calculate.

6. Jan 28, 2010

### LCKurtz

Agreed.

No, that is not what they are asking.

7. Jan 28, 2010

### vela

Staff Emeritus
You're right. I misspoke. They're asking for the defects in the batch, not just the remaining 8.

8. Jan 30, 2010

### exitwound

Well I've been looking at this since Wednesday and I still don't understand it. It's due tomorrow.

9. Jan 31, 2010

### exitwound

Last chance. Anyone out there able to explain it to me in different terms that may turn on a light bulb? I still don't even understand what it's asking for.

10. Feb 1, 2010

### MarcMTL

They are asking what are the probabilities that 2 random samples from a batch are either:

a.) Neither tested component is defective. (0 Defective components)
b.) One of the two tested components is defective. (1 Defective component)

I don't know how it could be worded differently.

Good luck.

11. Feb 1, 2010

### vela

Staff Emeritus
Say you receive a batch of components from the manufacturer. What are the probabilities that the batch contains no defective components, one defective component, or two defective components? Without knowing anything about the batch, the best you can say is there's a 50% chance the batch contains no defective components, a 30% chance it contains one defective component, and a 20% chance it contains two defective components.

Now say you test two components, and they both turn out to be defective. What are the probabilities now? Well, there's a 0% chance the batch contains no defective components, a 0% chance it contains one defective component, and a 100% chance it contains two defective components. The additional information you obtained from testing the sample caused the probabilities to change.

Now consider the case where neither of the two tested components was defective. That's most likely to happen if you have a batch with no defective components and least likely with a batch containing two defective components. So given this information, you might expect the probability of a batch with zero defects to go up and the probabilities of a batch with one or two defects to go down.

The question is asking you to calculate what the new probabilities are for the two given cases.

12. Feb 1, 2010

### LCKurtz

No Vela. Again, that is not what the problem is asking. It is not asking a question like "What is the probability the components came from batch 2 given there was 1 defective in the sample". That would be a Bayes rule type problem, but this isn't. This is a straight conditional probability question. I gave the OP a formula to use but he doesn't seem to understand yet. I think he needs to sit down with his teacher and go over the topic with him.

13. Feb 1, 2010

### vela

Staff Emeritus
I'll have to disagree with you this time. The question asked:
Only batch type 2 has 2 defects, so the probability that there are two defective components in a batch is the probability that the batch is type 2. Similarly, the probability of only one defective component in a batch is the probability of a type-1 batch, and the probability of no defective components is the probability of a type-0 batch. The problem is asking for P(Bn|X=0) and P(Bn|X=1) where X is the number of the two components tested that is defective for n=0, 1, and 2.

14. Feb 1, 2010

### LCKurtz

OK, upon re-looking at it I agree you may be right. I guess what is ambiguous to me is the use of the word batch. I interpreted it to mean the "batch" of two components that you are about to pick but your interpretation may well be what was intended.

15. Feb 1, 2010

### exitwound

See? If two of the three of us are having a problem understanding the problem, then it's just not worded properly, which is leading to my dismay. The problem was due today and I couldn't figure it out so I left it out of the homework. I'll get docked the points but whatever. The professor tried to go over it today in class but even he himself took 20 minutes to get it straight and he didn't sound confident in his answers.

Another thing: In his description of the solution (which he didnt' give because it was on the homework) said "it's a direct application of Bayes Theorem"...which makes me think that LCKurtz' may have something to stand on.

16. Feb 2, 2010

### exitwound

Here's the answer from the teacher's solution sheet in case you're interested as much as I am:

Can anyone explain the steps to me for tomorrow's exam?

17. Feb 2, 2010

### LCKurtz

I'm sure that both vela and I would have worked that problem exactly like that once the intent of the problem was clarified. In fact, I was thinking of posting that for you this morning when I found that you had posted the solution from somewhere.

What is it about that solution you don't understand? The steps seem pretty clear and straightforward. This problem is one of a class of problems of the type where you have events A and B where you may know the probability P(A|B) of A, given B, and want to know the reverse probability P(B|A) of B given A. To solve this type of problem you use the equations

$$P(A|B) = \frac{P(A\cap B)}{P(B)},\ \ P(B|A) = \frac{P(A\cap B)}{P(A)}$$

Setting the expressions you get for $P(A\cap B)$ equal to each other gives

$$P(A|B)P(B) = P(B|A)P(A)$$

This gives

$$P(B|A) = \frac{P(A|B)P(B)}{P(A)}$$

Typically, in such problems, you have enough information to calculate the right side.

18. Feb 2, 2010

### exitwound

I understand your breakdown just fine.

In this particular problem, I can't understand the english. I have tried and tried to parse the language used in the explanation of the problem but I can't grasp what it's asking. For instance, I can write down the givens related to 50%, 30%, and 20%, and I understand i'm taking 2 components from each batch. However, after that, I can't relate what's being said in the problem to the individual parts of Bayes' Theorem.

I think the problem is terribly worded and extremely vague in design, compared to the other problems in the book (which aren't that great either, and change the language up from problem to problem). (Modern Mathematical Statistics with Applications (devore & berk))

I can't follow the solution because I simply cannot understand what's going on in the problem. I'm an English speaker as a first language to clarify, FYI.

19. Feb 2, 2010

### LCKurtz

It might help if you take just one part at a time. What about this individual question:

Given that the two selected components contain 1 defective, what is the probability they came from B2?

Do you understand that phrase? And do you see how it was answered?

20. Feb 2, 2010

### exitwound

If I have an event $C_1$ = 1 of the 2 components selected are defective, then I'm looking for P($B_2|C_1$)?

At this point, I'm totally confused. I can't 'see' the link between the Cs and Bs.

Take for instance the other problem we had to do. It's akin to the breast cancer scenarios typically given for Bayes probability problems.

How does the component problem relate to the cancer problem? I can understand and visualize the cancer problem, but I can't for the life of me figure out what's going on in the component problem. Like, I can't even draw a simple tree diagram or a chart to show what's going on. Can you?

21. Feb 2, 2010

### LCKurtz

Yes. You are looking for P(B2|C1). By the formula I posted earlier, you can express it in terms of the reverse probabilities:

$$P(B_2|C_1) = \frac{P(C_1|B_2)P(B_2)}{P(C_1)}$$

Now, presumably you can work both factors in the numerator, right? The problem is in the denominator where the probability of getting 1 defective depends on which batch the sample came from. So you calculate P(C1) by conditioning it on the B's:

$$P(C_1) = P(C_1|B_0)P(B_0) + P(C_1|B_1)P(B_1)+ P(C_1|B_2)P(B_2)$$

One of these terms in the denominator is the same as the numerator, and the other terms are similar and you calculate them using the same techniques you used for the numerator.

22. Feb 2, 2010

### vela

Staff Emeritus
Yup.
The probability of meeting a condition, like C1, depends on how many defective components there are in the batch. The more defective components in a batch, the more likely you are to end up with defective components in the sample of two.
In the breast cancer problem, the conditional probabilities P(+|B) and P(+|B'), corresponding to the probabilities P(Cn|Bm) in this problem, were given to you. In this problem, you're expected to calculate them from the provided information, which is just a straight application of combinatorics.

23. Feb 2, 2010

### exitwound

I understand the derivation of this equation
$$P(B_2|C_1) = \frac{P(C_1|B_2)P(B_2)}{P(C_1)}$$

But I can't figure out the 'why' behind the numerator. I still can't understand the relationship between Cs and Bs, so actually figuring out the numerator doesn't make sense. The problem just doesn't make any sense to me at all. I just can't relate the Cs and Bs together in the same way that the breast cancer problem does, despite your attempts to reword it. I still just can't grasp what's going on.

24. Feb 2, 2010

### vela

Staff Emeritus
Oh, that's actually pretty simple, if I understand what you're asking.

$$P(C_1|B_2) = \frac{P(C_1 \cap B2)}{P(B_2)} \Rightarrow P(C_1|B_2)P(B_2)=P(C_1 \cap B2)$$

so the numerator is just the usual one for a conditional probability, but it's written in a way that's convenient to calculate.

25. Feb 2, 2010

### LCKurtz

$$P(C_1|B_2)P(B_2)+P(C_1|B_2')P(B_2')$$