Premium problem99. Are Two Events Independent?

Medium Locked

Events are independent when knowing one tells you nothing about the other:

P(A∩B)=P(A) P(B)P(A \cap B) = P(A)\,P(B)

Return True if the two events are independent in this sample space, else False. Compare with a tolerance rather than ==.

Input

a = {2, 4, 6}
b = {3, 6}
sample_space = {1, 2, 3, 4, 5, 6}

Output

True

Premium problem

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

Implement solve(...)