6. Union, Intersection, Difference

Easy

Return a dict with the four basic set operations on events a and b:

keymeaning
"union"in a, in b, or both
"intersection"in both
"a_only"in a but not b
"complement_a"in the sample space but not a
solve({2,4,6}, {4,5,6}, {1,2,3,4,5,6})
->  {"union": {2,4,5,6}, "intersection": {4,6},
     "a_only": {2}, "complement_a": {1,3,5}}

Sign in to write and run your own code.

Implement solve(...)