Practice question · Multiple choice
A database JOIN, a Venn diagram and a bitwise AND on two bit-vectors all compute the same thing. What is the shared operation?
Hints
- Ask what question each operation asks about a single element.
- A set over a fixed universe can be stored as one bit per element. What does AND then do?
Show the answer
A. Set intersection, which is boolean AND applied per element
Why
'Is x in A and in B' is one question asked once per element, so the three are one operation in three costumes. It is why sets over a fixed universe are stored as bit-vectors and intersected with a single machine instruction, set theory compiling directly to hardware.
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…
- Set operations mirror boolean logic exactly. Sort each description under the connective it behaves like.
- The universe is {1, 2, ..., 10}, A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Select every number that lies in the…