18. Conditional Probability From Sets

Easy

Conditioning on BB makes BB the new sample space. For equally likely outcomes:

P(AB)=ABBP(A \mid B) = \frac{|A \cap B|}{|B|}

Return P(AB)P(A \mid B) as a float. Assume b is non-empty.

solve({2, 4, 6}, {4, 5, 6})  ->  0.6666666666666666

Sign in to write and run your own code.

Implement solve(...)