Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 38 ยท 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