# Conditional probability solved by bayes theorem

I have this problem:

A car dealer sells 20% of cars from brand $$B_1$$, 30% of $$B_2$$ and 50% of $$B_3$$. It was reported that 20% of $$B_1$$ cars have airbags, as well as 5% and 2% for $$B_2$$ and $$B_3$$ respectively.

Given that a selected car has airbag, what is the probability of being $$B_1$$?

I tried to solve the problem using Bayes Theorem:

• A: brand
• C: has airbag

$$p(A=B_1 | C) = \frac{ p(C | A = B_1) \cdot p(A=B_1) } { p(C)},$$

$$p(C | A=B_1) = 0,2 \cdot 0,2 = 0,04$$ $$p(A=B_1) = 0,2$$

$$p(C) = \sum_{i=1}^{n}p(A_i \cap C)\cdot p(A_i) = 0,058$$

$$p(A = B_1 | C) = \frac{0,04 \cdot 0,2}{0,058} = 13,79\%$$

This is the way i solved, but i can't see an alternative in my test with this result. What i've done wrong?

Thanks!

$$P(C|A=B_1)=0.2$$ because you already know that the brand is $$B_1$$, and you don't need to multiply with $$P(B_1)$$ again. What you calculate is actually $$P(C\cap \{A=B_1\})$$.
You've made a similar mistake in the calculation of $$P(C)$$. It should be $$P(C)=\sum_{i=1}^3 P(C\cap \{A=B_i\})=\sum_{i=1}^3 P(C|A=B_i)P(A=B_i)$$