Computer Science I / Sets and Set Operations
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
  1. Ask what question each operation asks about a single element.
  2. 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.

Read the lesson: Sets and Set Operations →

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