Premium problem49. Law of Total Probability

Medium Locked

When an event can be reached through several separate routes, multiply along each route and add the routes:

P(A)=∑i=1nP(A∣Bi) P(Bi)P(A) = \sum_{i=1}^{n} P(A \mid B_i)\,P(B_i)

Return P(A)P(A). The two lists are aligned and the same length.

Input

case_probabilities = [0.6, 0.4]
conditional_probabilities = [0.02, 0.05]

Output

0.032

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)