# Thread: Problem with basic probability exercise. Any help will be very appreciated !

1. ## Problem with basic probability exercise. Any help will be very appreciated !

Hi !
I'm very unsure of my answers to this problem :

A company produces boxes. 1% of the boxes have a defect. A control of the boxes detects and eliminates 95% of the defective boxes but eliminates by mistake 2% of the boxes produced.

1) What's the probability not to eliminate a box, knowing it is not defective ?
2) What's the probability the control doesn't work, i.e. that a non defective box is eliminated or a defective box is accepted ?
3) What's the probability an accepted box is defective ?

P(D) = 0,01
P(E\D) = 0,95
P(E n nonD) = 0,02

1) P(nonE/nonD)=1-P(E/nonD)=1-0,02 = 0,98

2) Pcontrol-failure = P(E n nonD)+P(nonE n D) - P(E n nonD) n (nonE n D) = p(D)*p(E/D) + p(nonD)*p(E/nonD) - P(E n nonD) n (nonE n D)
Here I am stuck. I calculated that p(D)*p(E/D) + p(nonD)*p(E/nonD) = 0,0203. But for me the part I put in bold are exclusive events. However, I must be wrong because I was given 0,0195 as an answer.
Are those events independant or exclusive ? I can't wrap my mind around this even though it's so basic I'm sorry...

3) P(D/nonE) = P(nonE/D).P(D)/P(nonE)=(1- P(E/D)).P(D) / P(nonE)
With P(nonE)= P(nonE/D).P(D) + P(nonE/nonD).P(nonD) = (1-P(E/D)).P(D) + P(nonE/nonD).P(nonD)

Thank you for your help !!

2. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

I'll just show you my solution and you can compare the two.

The problem statement is a bit ambiguous. Does the control process remove 2% of non-defective boxes, or 2% of all boxes? I'm going to assume it's the first.

we're told

$P[D] = 0.01$ so $P[!D]=0.99$

$P[E | D] = 0.95$

$P[E | !D] = 0.02$

1) you did correctly $P[!E|!D] = 1-P[E|!D] = 1-0.02 = 0.98$

2) we want

$P[(E \wedge !D) \vee (!E \wedge D)]$

These are pretty clearly disjoint events so

$P[(E \wedge !D) \vee (!E \wedge D)] = P[E | !D)]P[!D] + P[!E | D]P[D] = (0.02)(0.99)+(0.05)(0.01) = 0.0203$

Which is what you got.

3) we want

$P[D|!E] = \dfrac{P[!E|D]P[D]}{P[!E]} = \dfrac{(0.05)(0.01)}{(0.05)(0.01)+(0.98)(0.99)} =5.15092\times 10^{-4}$

I don't know what to tell you other than either we're interpreting the problem statement incorrectly or that the answer you were given is wrong.

3. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

The assistant of my teacher replied to me and interpreted it as 2% of all boxes, so :
P(E n nonD) = 0,02

However I also find this very ambiguous... I translated from french, however this was just as ambiguous originally, and it was an exam exercise ahah.
So I guess the answers are wrong in this case and the whole exercise has to be done differently.

4. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

Originally Posted by Jo37

The assistant of my teacher replied to me and interpreted it as 2% of all boxes, so :
P(E n nonD) = 0,02

However I also find this very ambiguous... I translated from french, however this was just as ambiguous originally, and it was an exam exercise ahah.
So I guess the answers are wrong in this case and the whole exercise has to be done differently.
ok let's take another look then

so 2% of all boxes are eliminated

$P[E] = P[E|D]P[D] + P[E|!D]P[!D] = (0.95)(0.01) + P[E|!D](0.99) = 0.02$

$P[E |!D] = \dfrac{0.02 - 0.0095}{0.99} = 0.0106061$

substituting this new value for $P[E|!D]$ we get

$P[(E\wedge !D) \vee (!E \wedge D)] = (0.0106061)(0.99)+(0.05)(0.01) = 0.011$

still not matching the answer given.

5. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

I think there must be a mistake in the correction I was given.
Thank you for your help and confirming the reasoning for question 2) in the first interpretation of the exercise !

6. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

Originally Posted by Jo37
I think there must be a mistake in the correction I was given.
Thank you for your help and confirming the reasoning for question 2) in the first interpretation of the exercise !
I am really bothered by this problem.
Please check the translation of “A control of the boxes detects and eliminates 95% of the defective boxes”

Have you studied the concept of false positives?
Maybe if you posted the French, someone here can read it.

7. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

The original problem statement in french was :

Une société produit des boîtes. 1% des boîtes produites sont défectueuses. Un contrôle de qualité automatisé permet de détecter et d'éliminer 95% des boîtes produites défectueuses mais élimine à tort 2% des boîtes produites.

However the answer of 0,0195 was given to me by a member on another math forum. I then couldn't get this same result (and it is wrong) and noone ever replied back on the thread.
My teacher confirmed this had to be interpreted as P(E n nonD) = 0,02.

Yes, false positives would be non-defective boxes that the control considers defective by mistake ?

8. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

Originally Posted by Jo37
My teacher confirmed this had to be interpreted as P(E n nonD) = 0,02.
so the first way we did it is correct? The answer of 0.0203?

9. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

The second way was the correct one !
The ambiguity comes from "élimine à tort 2% des boîtes produites". It literally means word-by-word "eliminates wrongly 2% of produced boxes".
I understood this as : 2% of good boxes are eliminated my mistake, since only good boxes can be eliminated by mistake, not bad ones which can only be accepted by mistake. So p(E |nonD).
However it had to be read as out of all the boxes, 2% are eliminated by mistake.

Wait, honestly my written explanation doesn't seem clear at all. ahah.
I will send a final email to my teacher for clarification because this might cause me trouble for my exam.

10. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

Originally Posted by Jo37
The second way was the correct one !
Ok, good.

11. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

Originally Posted by Jo37
A company produces boxes. 1% of the boxes have a defect. A control of the boxes detects and eliminates 95% of the defective boxes but eliminates by mistake 2% of the boxes produced.
1) What's the probability not to eliminate a box, knowing it is not defective ?
2) What's the probability the control doesn't work, i.e. that a non defective box is eliminated or a defective box is accepted ?
3) What's the probability an accepted box is defective?

Originally Posted by Jo37
The second way was the correct one !
The ambiguity comes from "élimine à tort 2% des boîtes produites". It literally means word-by-word "eliminates wrongly 2% of produced boxes". However it had to be read as out of all the boxes, 2% are eliminated by mistake.
My teacher confirmed this had to be interpreted as P(E n nonD) = 0,02.
I absolutely agree that it is $\mathscr{P}(E\cap\neg D)=0.02.$
So #1) becomes $\mathscr{P}(E|\neg D)=\dfrac{\mathscr{P}(E\cap\neg D)}{\mathscr{P}(\neg D)}=?$

So #2) becomes $\mathscr{P}(E|\neg D)+\mathscr{P}(\neg E| D)=\dfrac{\mathscr{P}(E\cap\neg D)}{\mathscr{P}(\neg D)}+ \dfrac{\mathscr{P}(\neg E\cap D)}{\mathscr{P}(D)}=?$

#3) Reads: "What is the probability that an accepted box is actually defective?"
$\mathscr{P}(D|\neg E)=\dfrac{\mathscr{P}(D\cap\neg E)}{\mathscr{P}(E)}=~?$

12. ## Re: Problem with basic probability exercise. Any help will be very appreciated !

1) 0.02 / 0.99

2) 0.011 as romsek has calculated above.

3) P(D/nonE) = = [P(nonE/D).P(D)] /P(nonE)

I believe this is all correct now ! Thank you!

PS : I posted a few threads at once trying to solve past exam subjects. I hope it is not contrary to the rules of the forum, I don't intend to flood.