$k$-out-of-$n$ system probabilities 
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?

If you want something "prettier" you could take all the possible cases and write them using products and sums, such as $$\prod_{i=1}^4 p_i \left(1+\sum_{j=1}^4\frac{1-p_j}{p_j} + \sum_{k=1}^3 \sum_{l=k+1}^4 \frac{(1-p_k)(1-p_l)}{p_k \; p_l} \right)$$
or you could work out the probability that one or none work and subtract that from $1$ to get $$1 - \prod_{i=1}^4(1-p_i)\left(1+\sum_{j=1}^4\frac{p_j}{1-p_j}\right)$$ 
