How do i calculate the probability of the relay in the circuits? I am trying to solve my following probability question but I can't see how to make any progress. Any help will be highly appreciated
Question: The probability of the closing of the $i$-th relay in the circuits shown is given by $p_i$ for $i = 1,2,3,4,5$. If all relays function independently, what is the probability that a current flows between $A$ and $B$ for the respective circuits?

 A: Using $1-$ open, $1'-$closed:
$$a) \ \ P(1,2,3)+P(4,5)-P(1,2,3,4,5).\\
b) \ \ P(1,2,5)+P(3,4,5)-P(1,2,3,4,5).\\
c) \ \ P(1,4)-P(1,3,4,5)+P(2,5)-P(2,3,4,5)+P(1,3,5)-P(1,3,4,5)+\\
P(2,3,4)-P(2,3,4,5).$$
A: There may be a more elegant way of doing this, but one way is simply to list the different combinations of gates which can be closed to allow current to flow. For example, for part b), we have 


*

*Three gates: 1,2,not3,not4,5; not1,not2,3,4,5

*Four gates: 1,2,3,not4,5; 1,2,not3,4,5; 1,not2,3,4,5; not1,2,3,4,5

*Five gates: 1,2,3,4,5
The other parts of the question can be done in the same way
A: I hadn't seen the "bumped to homepage" before.
For case a) I'd suggest you look for the probability that no current flows. So
$$
\begin{aligned}
\mathbb{P}(I = 0)\ =\ &(1-p_1) \cdot (1-p_2) \cdot (1-p_3) + (1-p_4) \cdot (1-p_5)\\
&-\ (1-p_1) \cdot (1-p_2) \cdot (1-p_3)\cdot(1-p_4) \cdot (1-p_5)
\end{aligned}
$$
which follow from $\mathbb{P}(\{1,2,3\}\cup\{4,5\})=\mathbb{P}(\{1,2,3\})+\mathbb{P}(\{4,5\})-\mathbb{P}(\{1,2,3\}\cap\{4,5\})$.
At the end, calculate $\mathbb{P}(I = 0) =1-\mathbb{P}(I \neq 0)$.
A: A general observation towards approaching this problem.
The layouts can be broken into parallel  circuits only one of which needs to be functional for current to flow. If the current through $i^{th}$ circuit is represented as $C_i$ and $E$ is the event that current flows, then one or more circuit needs to be complete for the current to flow. Thus,
$$
 P(E)= P \left(\bigcup_{i=1}^{n} C_i \right)
$$
The individual cases can be solved through inclusion-exclusion principle.
For case (a), there are 2 possible circuits . $C_1 = \{1,2,3\}$,$C_2= \{4,5\}$. $P(C_1)= p_1p_2p_3$,$P(C_2)= p_4 p_5$
$$
\begin{align}
P(E)=P(C_1\cup C_2)  &= P(C_1)+ P(C_2)- P(C_1 \cap C_2)\\&
= p_1p_2p_3 + p_4 p_5 - p_1p_2p_3p_4 p_5
\end{align}
$$
For case(b), $C_1 = \{1,2,5\}$,$C_2= \{3,4,5\}$. $P(C_1)= p_1p_2p_5$, $P(C_2)= p_3 p_4 p_5$
$$
\begin{align}
P(E)=P(C_1\cup C_2)  &= P(C_1)+ P(C_2)- P(C_1 \cap C_2)\\&
= p_1p_2p_5 + p_3 p_4 p_5 - p_1p_2p_3p_4 p_5\\&
= p_5 (p_1p_2+ p_3 p_4 -p_1p_2p_3p_4)
\end{align}
$$
For case(c), $C_1 = \{1,4\}$,$C_2= \{1,3,5\}$,
$ C_3=\{2,3,4\}$ ,$C_4=\{2,5\}$. $P(C_1)= p_1p_4$,
$P(C_2)= p_1 p_3 p_5$,
$P(C_3)= p_2 p_3 p_4$ ,$P(C_4)= p_2 p_5$
$$
\begin{align}
P(E)=P(C_1\cup C_2\cup C_3\cup C_4)  &= P(C_1)+ P(C_2)+ P(C_3)+ P(C_4)
\\&- P(C_1 \cap C_2)- P(C_1 \cap C_3)
-P(C_1 \cap C_4)- P(C_2 \cap C_3)\\&
-P(C_2 \cap C_4) - P(C_3 \cap C_4)\\& 
+ P(C_1 \cap C_2 \cap C_3) + P(C_1 \cap C_2 \cap C_4)\\& +
P(C_2 \cap C_3 \cap C_4)+P(C_1 \cap C_3 \cap C_4)-
P(C_1 \cap C_2 \cap C_3 \cap C_4 )\\&
\end{align}
$$
