Topic 4 of 10

Sets

šŸŽÆ Learning Objectives

5.1 Basic Definition

šŸ”‘ Definition: Set

Informal Definition: A set is a collection of items

Sets are fundamental mathematical objects that group related items together.

Examples of Sets

  • Days of week: {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}
  • Factors of 24: {1, 2, 3, 4, 6, 8, 12, 24}
  • Prime numbers below 15: {2, 3, 5, 7, 11, 13}

5.2 Standard Number Sets

Number Set Hierarchy

ā„•: {0, 1, 2, 3, ...} ℤ: {..., -2, -1, 0, 1, 2, ...} ā„š: {p/q | p, q ∈ ℤ, q ≠ 0} ā„: All rationals and irrationals

āš ļø Course Convention

Important: In this course, ā„• includes 0

ā„• = {0, 1, 2, 3, 4, ...}

Some textbooks exclude 0 from natural numbers, but we include it.

5.3 Subset Notation

šŸ”‘ Definition: Subset

A āŠ† B means "A is a subset of B"

Every element of A is also in B

Subset Examples

  • ā„• āŠ† ℤ (all natural numbers are integers)
  • ℤ āŠ† ā„š (all integers are rational)
  • ā„š āŠ† ā„ (all rationals are real)
  • Primes āŠ† ā„• (all primes are natural numbers)

Venn Diagram Representation

ā„ (Real Numbers) ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ ā„š (Rationals) │ │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ │ │ ℤ (Integers)│ │ │ │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ │ │ │ │ℕ(Naturals)│ │ │ │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ │ │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

5.4 Set Comprehension (Set Builder Notation)

šŸ”‘ General Form

{x | x ∈ S, P(x)}

Read as: "the set of all x such that x belongs to S and x satisfies property P"

Components:

  • Generator: The underlying set (S)
  • Condition/Filter: Property P(x) that elements must satisfy

šŸ—ļø Building Sets with Comprehension

Example 1: Even Natural Numbers

{n | n ∈ ā„•, n mod 2 = 0}

Or equivalently: {n | n ∈ ā„•, n is even}

Result: {0, 2, 4, 6, 8, 10, ...}

Example 2: Integers Between -6 and 6

{z | z ∈ ℤ, -6 ≤ z ≤ 6}

Result: {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6}

Example 3: First 500 Natural Numbers

X = {n | n ∈ ā„•, n < 500}

Result: {0, 1, 2, ..., 499}

Example 4: Cubes of First 500 Natural Numbers

{n³ | n ∈ X} where X is defined above

Result: {0³, 1³, 2³, ..., 499³} = {0, 1, 8, 27, 64, ...}

šŸ’” Flexibility in Notation

  • Can write conditions in various equivalent ways
  • Can use words or mathematical symbols
  • Precision matters, but readability is important

5.5 Intervals (for Real Numbers)

Types of Intervals

Closed Interval [a, b]:

  • Includes endpoints
  • [0, 1] = {r | r ∈ ā„, 0 ≤ r ≤ 1}
  • Used for probabilities

Open Interval (a, b):

  • Excludes endpoints
  • (0, 1) = {r | r ∈ ā„, 0 < r < 1}

Half-Open Intervals:

  • [a, b) = includes a, excludes b
  • (a, b] = excludes a, includes b

Visual Representation (Number Line)

Filled dot (ā—) means included

Open dot (ā—‹) means excluded

[2, 5]: ā—ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā— (includes both 2 and 5)

(2, 5): ○────────○ (excludes both 2 and 5)

[2, 5): ā—ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—‹ (includes 2, excludes 5)

(2, 5]: ā—‹ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā— (excludes 2, includes 5)

5.6 Cardinality

šŸ”‘ Definition: Cardinality

The cardinality of a set is the number of elements in it

Notation: |A| represents the cardinality of set A

For Finite Sets

Simply count the elements:

  • |{1, 2, 3, 4, 5}| = 5
  • |{a, b, c}| = 3
  • |{factors of 24}| = |{1, 2, 3, 4, 6, 8, 12, 24}| = 8

For Infinite Sets

Use bijections (covered in later topics)

This is how we compare the "sizes" of infinite sets like ā„•, ℤ, ā„š, and ā„

🧮 Practice Problems

Problem 1: Set Builder Notation

Write the following sets using set comprehension notation:

  1. All odd natural numbers less than 20
  2. All perfect squares between 1 and 100
  3. All negative integers greater than -10

Solutions:

  1. {n | n ∈ ā„•, n < 20, n is odd} = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}
  2. {n² | n ∈ ā„•, 1 ≤ n² ≤ 100} = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100}
  3. {z | z ∈ ℤ, -10 < z < 0} = {-9, -8, -7, -6, -5, -4, -3, -2, -1}

Problem 2: Subset Relations

Determine if the following statements are true or false:

  1. ā„• āŠ† ā„
  2. {2, 4, 6} āŠ† {even natural numbers}
  3. {-1, 0, 1} āŠ† ā„•

Solutions:

  1. True - All natural numbers are real numbers
  2. True - 2, 4, 6 are all even natural numbers
  3. False - -1 is not a natural number (ā„• = {0, 1, 2, 3, ...})

Problem 3: Intervals

Express the following intervals using set comprehension:

  1. The closed interval [-3, 7]
  2. The half-open interval (0, 1]
  3. All real numbers greater than 5

Solutions:

  1. {r | r ∈ ā„, -3 ≤ r ≤ 7}
  2. {r | r ∈ ā„, 0 < r ≤ 1}
  3. {r | r ∈ ā„, r > 5} or using interval notation: (5, āˆž)

Problem 4: Cardinality

Find the cardinality of the following sets:

  1. A = {n | n ∈ ā„•, n² < 50}
  2. B = {factors of 36}
  3. C = {prime numbers less than 30}

Solutions:

  1. |A| = 8
    A = {0, 1, 2, 3, 4, 5, 6, 7} since 7² = 49 < 50 but 8² = 64 > 50
  2. |B| = 9
    B = {1, 2, 3, 4, 6, 9, 12, 18, 36}
  3. |C| = 10
    C = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}