24. Classify the Relationship

Medium

Mutually exclusive is NOT the same as independent. If two non-impossible events cannot co-occur, then one happening makes the other impossible, so they are strongly dependent.

Return one of these strings, checked in this order:

  1. "mutually exclusive" when AB=A \cap B = \varnothing
  2. "independent" when P(AB)=P(A)P(B)P(A \cap B) = P(A)P(B)
  3. "dependent" otherwise
solve({1,3,5}, {2,4,6}, {1,2,3,4,5,6})  ->  "mutually exclusive"
solve({2,4,6}, {3,6},   {1,2,3,4,5,6})  ->  "independent"
solve({2,4,6}, {4,5,6}, {1,2,3,4,5,6})  ->  "dependent"

Sign in to write and run your own code.

Implement solve(...)