When producing something while having a chance of 4% for getting a bad item I can calculate the chances for having 2 bad items by just using the Bernoulli formula
$$ P(x=k) = ( \begin{matrix} n \\ k \end{matrix} ) \times p^k \times (1-p)^{n-k} $$ (in the parantheses n is over k)
So if I enter my values (took 50 items for testing, having $4%$ chance of bad item, want to have the chances of having 2 bad items): $$ P(x=2) = ( \begin{matrix} 50 \\ 2 \end{matrix} ) \times 0.04^2 \times (1-0.04)^{50-2} $$ I get as result a chance of $27.62%$.
But another task is to calculate what is the probability that "at least 3 items are bad.
For this I looked for some binomial distribution calculator (at least I think they are called this way) and came to a solution that just takes the chances of having 1 bad item as q1 and 2 bad items as $q2$, sum them up and subtracts that $(q1+q2)$ from 1 (so instead of summing up all the chances of having $3, 4, 5, ...., 50$ bad items, I take the whole chance and just take away the chances of having 1 and 2 bad items.
But the solution seems wrong. Can someone tell me where my mistake is?
Using symbolab.com and summing up the chances
$$
\sum _{x=1}^{50}\left(\frac{50!}{x!\cdot \left(50-x\right)!}\right)\cdot 0.04^x\cdot \left(1-0.04\right)^{50-x}
$$
tells me that the Input is invalid for sequence calculations
Thanks!
If you use software, you can simply use CDF of binomial; with R:
Or if you prefer to use PMF instead of CDF
or else