Practice question · Sort into groups
Set operations mirror boolean logic exactly. Sort each description under the connective it behaves like.
Groups: Behaves like AND · Behaves like OR · Behaves like NOT
- The complement of A
- The elements belonging to both A and B
- The union of A and B
- The intersection of A and B
Hints
- Rewrite each description as a membership test: 'x is in the result exactly when ...'.
- The wording 'or both' is the giveaway for the inclusive connective.
Show the answer
Behaves like AND: The intersection of A and B, The elements belonging to both A and B
Behaves like OR: The union of A and B
Behaves like NOT: The complement of A
Why
x is in the intersection exactly when x is in A AND in B; x is in the union exactly when x is in A OR in B; x is in the complement exactly when x is NOT in A. This correspondence is why De Morgan's laws hold verbatim for sets: the complement of a union is the intersection of the complements.
Practise Sets and Set Operations
The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Sets and Set Operations
- De Morgan’s laws appear in set theory as A ∪ B = A ∩ B and in logic as lnot(p ∨ q) = lnot p ∧ lnot q. Why is…
- A database JOIN, a Venn diagram and a bitwise AND on two bit-vectors all compute the same thing. What is the…
- The universe is {1, 2, ..., 10}, A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Select every number that lies in the…