It is possible to use Bayes theorem?

We have two companies $A$ & $B$ that produces an item, let's say for the sake of argument, that they both produces light bulbs.

Light bulbs of company $A$ have a probability of $p(A)$ of being defective, while $B$'s light bulbs are defective with probability $p(B)$.

I always buy light bulbs from these two companies with the same proportions, $x(A)$ & $x(B)$ with, of course, $x(A) + x(B) = 1$.

Now, if I pick $n$ light bulbs to test them and I got that $m$ (with $m \leq n$) were defective, what is the conditional probability that the $n$ lights were produced by company $A$?

Should I use Bayes theorem to answer? And if so, how?

• Do you know that all of the $n$ were produced by the same company, or could they be a mix of the two? Commented Nov 24, 2016 at 15:21
• They are a mix of the two. But it would be interesting to know also the case if a pick $n$ light bulbs from the same company (without knowing the company of course... ) Commented Nov 24, 2016 at 15:24
• @AttDefCon if a pick contains light bulbs from only one company, $P(A) = P(B)$ and the problem isn't really that interesting ... Commented Nov 24, 2016 at 15:35
• ... In which case, $x(A)$ or $x(B)$ becomes $1$ and the probability that the bulbs came from company A or B is 1. Commented Nov 24, 2016 at 15:39
• @AnthonyP Mh... after some thought, I think you're right 'cause I choose at random between the two company... so the most interesting case is when the $n$ light bulbs are a mix. Commented Nov 24, 2016 at 15:41

For $i=0,1,\ldots,n$ let $a_i$ represent the event that $i$ of the $n$ selected light bulbs come from company $A$. Let $d_m$ represent the event that $m$ of the $n$ bulbs are defective. You're asking for $P(a_n|d_m)$, if I understand correctly. By Bayes' theorem, that is given by:
$P(a_n|d_m)=\frac{P(d_m|a_n)P(a_n)}{\displaystyle{\sum_{i=0}^n}\left(P(d_m|a_i)P(a_i)\right)}$
In order to use this, you need to be able to calculate each $P(a_i)$ and each $P(d_m|a_i)$. Do you know how to calculate those?