The probability of a union is not simply the sum, because the overlap would be counted twice:
Return P(A∪B)P(A \cup B)P(A∪B).
Input
p_a = 0.5 p_b = 0.5 p_both = 0.3333333333333333
Output
0.6666666666666667
solve(...)