$a_1(a_4+a_8a_5+a_8a_7a_6)+a_2(a_8a_4+a_5+a_7a_6)+a_3(a_6+a_7a_5+a_7a_8a_4)$
Take the above boolean expression, a function of $a_1$ to $a_8$, each of which are independent and is zero by probability .5, one by probability .5. What is the probability of the above boolean expression to be one (true)?
As usual, + indicates OR and multiplication indicates AND.
It would be nice if the expression can be separated into independent terms, but is there a way to manipulate it to that end?
As the commenter said: use the inclusion-exclusion property, which for two events says:
$P(A \lor B) = P(A) + P(B) - P(A \land B)$
and (in your case more relevant!) for three events says:
$P(A \lor B \lor C) = P(A) + P(B) + P(C) - P(A \land B) - P(A \land C)- P(B \land C) + P(A \land B \land C)$
So, use this formula, where:
$A = a_1(a_4+a_8a_5+a_8a_7a_6)$
$B = a_2(a_8a_4+a_5+a_7a_6)$
$C = a_3(a_6+a_7a_5+a_7a_8a_4)$
And, just to work out one of the terms:
$P(A) = P(a_1(a_4+a_8a_5+a_8a_7a_6)) =$ (since $a_1$ is independent from $a_4+a_8a_5+a_8a_7a_6$)
$P(a_1)*P(a_4+a_8a_5+a_8a_7a_6)$
where
$P(a_4+a_8a_5+a_8a_7a_6) =$ (inclusion-exclusion principle again)
$P(a_4) + P(a_8a_5) + P(a_8a_7a_6) - P(a_4a_8a_5) - P(a_4a_8a_7a_6)- P(a_8a_5a_8a_7a_6) + P(a_4a_8a_5a_8a_7a_6)$
And here, note that:
$P(a_8a_5a_8a_7a_6) = $ (because it's a logical And)
$P(a_8a_5a_7a_6) = $ (since they are all independent)
$P(a_8)*P(a_5)*P(a_7)*P(a_6)$
OK, so do this for all of your terms ... long and tedious, but not hard.