# probability of having defects in a product; defects can occur independently

In a product there can be two types of defects: $A$ and $B$. The probability ($P$) of occurrence of defect $A$ is $0.1$ ($P(A) = 0.1)$. $P(B) = 0.2$. The two types of defects can occur independent of each other.

Let $X$ be a random variable that counts the number of types of defects in a product. Find the probability function.

In class we learned a general type of probability distribution (where you have to find the ad-hoc formula) and four special types of distributions (uniform, binomial, geometric and Poisson). I tend to think that I just need to find a custom formula for this one.

The random variable $X$ can be between $0,1,2$.

Let $C$ be the case when a product doesn't have any defects. $P(C) = 1 - P(A) - P(B) = 0.7$.

The case when there're 2 types of defects is $P(A \cap B) = 0.1 * 0.2 = 0.02$ (because it's given that $A$ and $B$ can occur independently).

The case when either $A$ or $B$ can occur is $P(A \cup B) = P(A) + P(B) = 0.1 + 0.2 = 0.3$

So:

• $P(X = 0) = 0.7$
• $P(X = 1) = 0.30$
• $P(X = 2) = 0.02$

Not sure if I'm on the right track.

• I am not sure if $P(C)$ that has been calculated is right. Suppose instead of two there are 10 types of defects possible each with a probability say $0.2$. In that case if we calculate the $P(C)$ your way we'll get a negative value. Also, in $P(A \cup B)$ why is intersection term zero. You have a non-zero value for that in the upper equation. – Dark_Knight Jan 11 '17 at 14:30
• I think you're right regarding calculating the union, I thought I can leave intersection as zero because $A$ are $B$ are independent. How would you calculate the $P(C)$ then? – Yos Jan 11 '17 at 14:36

The probability that there are no defects, i.e. $\Pr[X = 0]$, is equal to the chance that there are no defects of type $A$ and there are no defects of type $B$. Since a defect of type $A$ occurs with probability $0.1$, i.e. $\Pr[A] = 0.1$, then the probability of no defect of type $A$ is $$\Pr[\bar A] = 1 - \Pr[A] = 1 - 0.1 = 0.9.$$ Similarly, the probability of no defect of type $B$ is $$\Pr[\bar B] = 1 - \Pr[B] = 1 - 0.2 = 0.8.$$ Therefore, $$\Pr[X = 0] = \Pr[\bar A \cap \bar B] \overset{\text{ind}}{=} \Pr[\bar A]\Pr[\bar B] = (0.9)(0.8) = 0.72.$$
The probability that there is exactly one defect is $\Pr[X = 1]$; this can happen if and only if there is a defect of type $A$ and no defect of type $B$; or no defect of type $A$ and a defect of type $B$. That is to say, $$\Pr[X = 1] = \Pr[A \cap \bar B] + \Pr[\bar A \cap B].$$
Another way to reason about this problem is to write out all of the joint probabilities $$\Pr[A \cap B], \quad \Pr[\bar A \cap B], \quad \Pr[A \cap \bar B], \quad \Pr[\bar A \cap \bar B].$$ You can do this with a simple contingency table: $$\begin{array}{c|c|c} & A & \bar A \\ \hline B & (0.1)(0.2) & (0.9)(0.2) \\ \hline \bar B & (0.1)(0.8) & (0.9)(0.8) \\ \end{array}$$
• Nice thanks! So to get $P(X=1)$ I need to sum all 4 probabilities (by law of total probability)? – Yos Jan 11 '17 at 19:33
• @Yos No; refer to the above formula for $\Pr[X = 1]$, which is the sum of only two of the four joint probabilities. If you added all of the probabilities together, you would get $1$. – heropup Jan 11 '17 at 19:56