[Math] $k$-out-of-$n$ system probabilities

probability

An engineering system consisting of $n$ components is said to be a $k$-out-of-$n$ system ($k \le n$) when the system functions if and only if at least $k$ out of the $n$ components function. Suppose that all components function independently of each other.
If the $i^{th}$ component functions with probability $p_i$, $i = 1, 2, 3, 4$, compute the probability that a 2-out-of-4 system functions.

This problem in itself does not seem very difficult to solve, but I suspect I am not doing it the way it was intended to be done, because the formulas that come out are very ugly. I calculated the probability by conditioning on whether or not the $1^{st}$ and $2^{nd}$ components worked, and it came out to be
$$
p_3 p_4 + p_2 (p_3 + p_4 – 2 p_3 p_4) + p_1 (p_3 + p_4 – 2 p_3 p_4 + p_2 (1 – 2 p_3 – 2 p_4 + 3 p_3 p_4))
$$
Even if this is right, there's no way it's what the answer is supposed to look like. Can someone give me a push in the right direction?

Best Answer

We derive an expression which is also somewhat complicated, but is based on simple fail-safe ideas, and can be easily imitated in similar problems. It is very convenient to let $q_i=1-p_i$. So $q_i$ is the probability that component $i$ fails.

0 bad: Maybe they all work. The probability of this is $$p_1p_2p_3p_4.$$

1 bad: Maybe exactly one goes bad. The probability of this is $$q_1p_2p_3p_4+p_1q_2p_3p_4+p_1p_2q_3p_4+p_1p_2p_3q_4$$ (one $q$ and three $p$'s, in all possible ways).

2 bad: This is a little more complicated, there are $6$ terms. The probability is $$q_1q_2p_3p_4+q_1p_2q_3p_4+ q_1p_2p_3q_4+p_1q_2q_3p_4+p_1q_2p_3q_4+p_1p_2q_3q_4$$ (two $q$'s and two $p$'s, in all possible ways). To find the desired probability, add together the probabilities of the $3$ cases.

Remark: In this particular problem, it is easier to find the probability of failure, since there are fewer cases to examine. The system fails if $3$ or more components fail.

The probability that exactly $3$ fail is $$p_1q_2q_3q_4+ q_1p_2q_3q_4+q_1q_2p_3q_4+q_1q_2q_3p_4,$$ and the probability they all fail is $$q_1q_2q_3q_4.$$ Add, and subtract the result from $1$ to get the probability the system works.