# Conditional Probability Help

I'm studying for an upcoming test, and I'm stuck on how to understand conditional probability.

The study guide question we got is:

Given a box of 5 computer chips, with
two of them being defective.
If we were to randomly select 2 chips,
compute the probability that the second
chip is defective given that the first
chip is good using conditional probability?


What I got was P(selecting a good chip) = 3/5 = 0.6 P(selecting a bad chip) = 2/5 = 0.4

Let A = first chip is good.

Let B = second chip is bad.

So I need to compute P(B|A).

P(B|A) = P(A and B) / P(A)

If I'm only given P(A) and P(B), how do I figure out P(A and B) as well as the rest of the problem?

(The answer given to us was 6/20, or 0.3, but I have no idea how to get there)

If the first chip is good, then there are four remaining chips, two good, two bad.

So.....

Your problem is poorly stated, and the professor's "correction" is of little help. The only way I can interpret the question so that it gives your professor's answer is as follows:

What is the probability that the first chip you draw is good and the second chip is defective?

That would be $$\frac{2}{5} \cdot \frac{3}{4} = \frac{6}{20} = 0.3.$$

• Given the intended answer, I'm wondering if the intended question is: What is the probability that one of the two selected chips is bad given that at least one of them is good? I agree with you about the question as phrased above. But if my question is what was intended, I get an answer of $\frac 13$. I don't see any way to get $\frac{6}{20}$. Jun 7, 2019 at 0:22
• My prof. just emailed out a mistake correction. The 6/20 was for P(A and B), so it's (6/20)/(3/5) which is 0.5. I know 2/4 is 0.5, but we have to show work with conditional probability 🤷‍♂️
– ESM
Jun 7, 2019 at 0:35
• @ESM "I know 2/4 is 0.5, but we have to show work with conditional probability" That is the much smarter and more elegant approach to simply state, 'hey lookie here, there are clearly just four chips left, two of which are bad so the answer is 0.5.' That is plenty rigorous enough and it is a conditional probability, it is just calculated directly rather than indirectly like he did. Jun 7, 2019 at 2:21
• I think this answer is for P(AB), which is very different than P(B|A). Jun 7, 2019 at 14:21

If I'm only given P(A) and P(B), how do I figure out P(A and B) as well as the rest of the problem?

No, what you are given is that there are 2 bad chips among the 5, and you are selecting two chips in order without replacement.

So you may work out what is the probability for selecting a good chip followed by a bad chip.   IE: $$\mathsf P(A\cap B)$$.

Mind, in working this out you should immediately realise what $$\mathsf P(B\mid A)$$ will be without needing to use the definition.

You are right that you want to compute $$P(B|A)$$, but you might use the more explicit:

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

$$P(A)$$ is the probability of selecting a good chip from the box, which is $$\frac{3}{5}$$. (Three good chips, five total chips).

$$P(B)$$ is the probability of selecting a bad chip from the box, which is $$\frac{2}{5}$$. (Two bad chips, five total chips).

$$P(A|B)$$ is the probability of selecting a good chip, assuming you have already selected a bad chip. If you have already selected a bad chip, there are 4 chips left of which 1 is bad and 3 are good, so this is $$\frac{3}{4}$$.

$$P(B|A) = \frac{\frac{3}{4} * \frac{2}{5}}{\frac{3}{5}} = \frac{1}{2}$$

There are some good names for the individual components of this definition - do a search for "prior", "posterior", "likelihood", and "marginal" and it will be enlightening.

I will add that I do not know why Bayes formula is always written in that form - I always felt it would be more clear when written like this:

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

Because this makes it clear that you are updating your knowledge about P(B) with new information - and scaling P(B) with a fraction according to that information.

You can see it more clearly in the form of a tree diagram as below

D = selected chip is defective ND = selected chip is non-defective

Note: D1 and ND1 are mutually exclusive outcomes of 1st selection. The probabilities of 2nd selection are dependent on 1st selection. The probability of 2nd selection is conditioned on the 1st selection because you are told that the first chip is good so it is removed and total no. of remaining chips is one less. An event is the probability of the result of the two selections. e.g. p(D1) x p(D2|D1) is one of the four events. This is also equivalent to p(D1 n D2).

            p(D2|D1)
/
p(D1)
\
p(ND2|D1)

p(D2|ND1)
/
p(ND1)
\
p(ND2|ND1)


If 1st chip is good it has p(ND1) = 2/5 Then if one good chip is selected and removed after 1st selection there will only be left 4 chips out of 5 in total.

2nd selection.

This leaves p(D2|ND1) = 3/4 for D2.

The desired event.

p(ND1 n D2) = p(ND1) x p(D2|ND1)


= 2/5 x 3/4

= 6/20

Then p(ND1|D2) = 1/4