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.
solve({2,4,6}, {4,5,6}, {1,2,3,4,5,6})
-> {"not_a_or_b": {1, 3}, "not_a_and_b": {1, 2, 3, 5}}
Sign in to write and run your own code.
solve(...)