Sets and Set Operations

Videos (~40 mins)

Reading (~30 mins)

Optional Reading

This is a slightly more advanced reading that may appeal to you if you want to see more theoretical math examples.

Warmup Problems (~40 mins)

Please complete these problems “by hand,” without typing. Pencil/pen and paper is best practice for the quiz, but using a stylus with a tablet is also fine. Then, scan/photograph or otherwise produce an image of your solutions and upload them to Canvas.

Problem 1

Write the following sets in roster notation:

  1. \(\left\{ x \in \mathbb{Z} \; : x^2 \leq 10 \right\}\)
  2. \(\left\{ x \in \mathbb{N} \; : x \leq 10 \right\} \cap \left\{ x \in \mathbb{Z} \; : x \text{ is a prime number.} \right\}\)
  3. \(\left\{ x \in \mathbb{Z} \; : x/2 \geq 10 \right\} \cap \left\{ x \in \mathbb{Z} \; : 5x < 100 \right\}\)

Problem 2

Write each of the following sets in set-builder notation. Then, write them again in set-generator notation.

  1. \(\left\{ 2, 4, 8, 16, 32, 64,\ldots \right\}\)
  2. \(\left\{ 3, 4, 5, 6, 7, 8 \right\}\)
  3. \(\left\{ 0, 3, 6, 9, 12, 15 \right\}\)

Problem 3

Set-generator notation corresponds closely to set comprehensions in Python. After reading the linked documentation:

Part A

For each of the sets below, write a Python set comprehension which produces that set. You may use the range function but may not explicitly define any other sets or lists.

  1. \(\{1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16\}\).
  2. \(\{\sqrt{x} \;|\; x \in \mathbb{N}\;,\; 0 \leq x \leq 5\}\).
  3. \(\{1, 4, 7, 10, 13, 16\}\).

Part B

Determine the set produced by the Python set comprehension. Try to do this without running the Python code.

  1. {x for x in range(1, 10) if x % 2 == 0}
  2. {2*x for x in range(1, 5)}
  3. {x**3 for x in range(10) if x < 4}



© Phil Chodrow, 2024