Computer Science I / Sets and Set Operations
Practice question · Select all that apply

The universe is {1, 2, ..., 10}, A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Select every number that lies in the complement of A union B.

Hints
  1. Work out A union B first, then ask which numbers of the universe are left over.
  2. By De Morgan's law the same set is the intersection of the two complements, which is a useful cross-check.
Show the answer
  • A. 7
  • C. 10
  • E. 8
Why

A union B is {1,2,3,4,5,6}, so its complement within {1,...,10} is {7,8,9,10}, of the options that means 7, 8 and 10. Cross-checking with De Morgan: the complement of A is {5,...,10} and the complement of B is {1,2,7,8,9,10}; their intersection is {7,8,9,10}, the same answer. Taking the union of the complements instead would wrongly give almost everything.

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