# bernoulli trial

I have to find a probability that 2 in 30 electrical component coming off a production line is defective. The probability to get a defective one is 0.04. Assume that whether or not a component is defective is independent of whether or not any other component is defective.

so as parameters i have:

K = {1,2,3,..,30}
p = defective = 0.4
q = working = 1 - p = 0.6
n = 30
k = 2


I'm applying the formula as:

which is giving me a probability of 4.2741e-05.

is that the right?

-
Do you want to find the probability that both components chosen at random from a batch of $30$ are defective, or at least one of them is defective? Also, is $p$ $0.04$ as it says in your problem statement of $0.4$ as in your highlighted work? –  Dilip Sarwate Dec 2 '12 at 12:31
The formula you quote is correct, but why is $q=1-p=0.5$ when $p=0.4$? –  Sarastro Dec 2 '12 at 12:55
@Sarastro typo. fixed thanks –  VP. Dec 2 '12 at 13:45

The number of defects $K$ obeys a binomial distribution with $K\tilde~B(30,p)$, so $P(K=2)=\binom{30}{2}p^2(1-p)^{28}$

Now it is not clear what the value of $p$ is from your question.

If $p=0.04$, $P(K=2)=0.2219$. If $p=0.4$, $P(K=2)=4.274\cdot10^{-5}$.

So you are right if $p=0.4$.

-

If $\,p=0.4\,$ then $\,q=1-p=0.6\neq0.5\,$ , so the probability of getting exactly two deffective components out of $\,30\,$ is

$$P_{30}(2):=\binom{30}{2}(0.4)^2(0.6)^{28}=4.274095\times 10^{-5}$$

Which, surprisingly enough, matches your result, so that you must have mistyped $\,q=0.5\,$ instead of the correct $\,q=0.6\,$

-
yes i did mistyped. thanks –  VP. Dec 2 '12 at 13:45