Computer Science I / Sets and Set Operations
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

Hints
  1. Rewrite each description as a membership test: 'x is in the result exactly when ...'.
  2. 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.

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