ข้ามไปยังเนื้อหา

บทเรียนที่ 4 · Getting Started

Special Sets and Intervals

Meet the standard number sets N, Z, Q, R and C, the universal set, and interval notation for sets of real numbers, with examples and quizzes.

Some sets are used so often that they have their own symbols. This lesson introduces the standard number sets, the idea of a universal set, and interval notation for describing stretches of the number line. You will use all of these in the rest of the track.

The standard number sets

Symbol Name Description
ℕ natural numbers {0, 1, 2, 3, ...} or {1, 2, 3, ...} (see the note)
ℤ integers {..., -2, -1, 0, 1, 2, ...}
ℚ rational numbers fractions p/q with p, q ∈ ℤ and q ≠ 0
ℝ real numbers all points on the number line
ℂ complex numbers a + bi with a, b ∈ ℝ and i² = -1

Books disagree about whether ℕ includes 0. Many set theory texts start at 0 because the number 0 corresponds to the empty set, while many school courses start at 1. Always check the convention. This track writes ℕ = {0, 1, 2, ...} and writes ℕ⁺ = {1, 2, 3, ...} when it needs to be explicit.

They form a chain of proper subsets:

Text
ℕ ⊊ ℤ ⊊ ℚ ⊊ ℝ ⊊ ℂ

The inclusions are strict. For instance 1/2 ∈ ℚ but 1/2 ∉ ℤ; and √2 ∈ ℝ but √2 ∉ ℚ; and i ∈ ℂ but i ∉ ℝ.

Superscripts add restrictions: ℝ⁺ is the positive reals, ℤ⁻ the negative integers, and a star or a "minus zero" notation such as ℝ \ {0} removes zero.

flowchart TB
    C["ℂ complex"] --> R["ℝ real"]
    R --> Q["ℚ rational"]
    Q --> Z["ℤ integer"]
    Z --> N["ℕ natural"]

Each set contains the one below it: ℕ ⊊ ℤ ⊊ ℚ ⊊ ℝ ⊊ ℂ.

The universal set

When you work on a particular problem, all your sets usually live inside one big set called the universal set, written U (or 𝒰). For a problem about students in a school, U might be "all students in the school". For a problem about digits, U = {0, 1, ..., 9}. The universal set is not a single special object: it just records the context. It is needed to talk about complements (the next chapter), because "everything that is not in A" only makes sense once you say what "everything" means.

There is no set of "all sets" in standard set theory. The universal set is always relative to a context, such as the integers or the students in one class. Chapter 8 shows why a truly universal set leads to contradiction.

Interval notation

Subsets of ℝ that are unbroken stretches of the number line are written with intervals. A square bracket means the endpoint is included; a round bracket means it is excluded.

Interval Set-builder form Meaning
[a, b] {x ∈ ℝ : a ≤ x ≤ b} closed: both endpoints included
(a, b) {x ∈ ℝ : a < x < b} open: neither endpoint included
[a, b) {x ∈ ℝ : a ≤ x < b} half-open: left included
(a, b] {x ∈ ℝ : a < x ≤ b} half-open: right included
[a, ∞) {x ∈ ℝ : x ≥ a} unbounded on the right
(-∞, b) {x ∈ ℝ : x < b} unbounded on the left

The symbols ∞ and -∞ are not numbers and are never included, so they always get round brackets. Note that (2, 5) could be mistaken for an ordered pair of numbers; the context tells you which is meant.

Example. [1, 3] ⊆ (0, 4). Every x with 1 ≤ x ≤ 3 also satisfies 0 < x < 4. But [0, 4] ⊄ (0, 4) because 0 ∈ [0, 4] while 0 ∉ (0, 4).

Python An interval class

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Sets of integers and the roster form

Because ℤ is discrete, intervals of integers can be listed: {n ∈ ℤ : -2 ≤ n < 3} = {-2, -1, 0, 1, 2}. In Python, range(-2, 3) generates exactly this list, with the same half-open convention that includes the start and excludes the end.

Python From a rule to a list

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Countable versus continuous

The number sets differ in an important way that this track will develop: ℕ, ℤ and ℚ can in a sense be "listed", while ℝ cannot. You will see exactly what that means in the chapters on cardinality.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which is correct?

    Every rational number is real, and √2 is a real number that is not rational, so the inclusion is proper.
  2. 2. Which interval equals {x ∈ ℝ : 2 < x ≤ 7}?

    2 is excluded (round bracket) and 7 is included (square bracket).
  3. 3. Why does the interval [3, ∞) use a round bracket next to ∞?

    Infinity is only a symbol for 'no upper bound'. It is not an element of ℝ.
  4. 4. Is [0, 4] ⊆ (0, 4)?

    The closed interval contains its endpoints; the open one does not.

Summary

  • Standard sets: ℕ, ℤ, ℚ, ℝ, ℂ, with ℕ ⊊ ℤ ⊊ ℚ ⊊ ℝ ⊊ ℂ.
  • The convention for whether ℕ contains 0 varies; this track includes 0.
  • A universal set U records the context of a problem; there is no set of all sets.
  • Interval notation: square brackets include an endpoint, round brackets exclude it, and ∞ always gets a round bracket.

Next: Union and Intersection

ติดตามความคืบหน้าของคุณ

สร้างบัญชีฟรีเพื่อติ๊กบทเรียนที่เรียนแล้วและเรียนต่อจากจุดเดิมได้บนทุกอุปกรณ์