De Morgan's laws let you turn a complement of a union into an intersection of complements, and vice versa:
Return a dict with both complements:
| key | value |
|---|---|
"not_a_or_b" | |
"not_a_and_b" |
Compute each one using the right-hand side of the matching law (complement each event first, then combine) and confirm for yourself that it agrees with the direct route.
Input
a = {2, 4, 6}
b = {4, 5, 6}
sample_space = {1, 2, 3, 4, 5, 6}
Output
{'not_a_or_b': {1, 3}, 'not_a_and_b': {1, 2, 3, 5}}
solve(...)