Let A1 is the event P1 working, and so on...., P(Ai)=0.5,
then
P(AB)=P[A1A2UA5A2UA5A3UA4A3]
=P(A1A2)+P(A5A2)+P(A5A3)+P(A4A3)-P(A1A2A5A2)-P(A1A2A5A3)-P(A1A2A4A3)-P(A5A2A5A3)-P(A5A2A4A3)-P(A1A2A4A3)
+P(A1A2A5A2A5A3)+P(A1A2A5A2A4A3)+P(A1A2A5A3A4A3)+P(A5A2A5A3A4A3)-P(A1A2A5A2A5A3A4A3)
=1/4+1/4+1/4+1/4-1/8-1/16-1/16-1/8-1/16-1/8+1/8+1/16+1/16+1/8-1/32
=25/32.
So the answer is 25/32