Intermediate level

Number sets N, Z, Q, R

Natural, integer, rational and real numbers — four families, each one contained in the next. Learn the symbols ℕ, ℤ, ℚ, ℝ, the membership signs ∈ and ∉, the empty set ∅, the proof that √2 is irrational, and the 2k / 2k+1 notation every divisibility proof is built on.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • Shopping and planning
    A trip takes 47 people and one car seats 6 — the division gives 7.83, but the answer has to be a natural number, so 8 cars are needed. That is not rounding: the result must live in ℕ, because the eighth car either goes or it does not.
  • Software development
    A till keeps prices as integers in cents (1999 rather than 19.99), because a floating-point type cannot store 0.1 exactly and after 10,000 line items the bill drifts by a few cents. Choosing the set is a design decision here.
  • Construction and surveying
    The diagonal of a square 5 m slab measures 5√2 ≈ 7.071 m — an irrational number. On site it is written down as 7.07 m, an approximation, and that is the only thing a tape measure can deliver.
  • Quality control
    A batch passes when the number of defects is an integer between 0 and 3 per 500 units. A reading of 0.6% sounds acceptable, but it means 3 units — because units are countable and percentages are not.

All formulas

  • Natural numbers

    N={0,1,2,3,}\mathbb{N} = \{0, 1, 2, 3, \ldots\}

    the numbers you count items with — no sign, no fractional part

  • Integers

    Z={,2,1,0,1,2,}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}

    the natural numbers together with their opposites

  • Rational numbers

    Q={pq:pZ, qZ, q0}\mathbb{Q} = \left\{ \frac{p}{q} : p \in \mathbb{Z},\ q \in \mathbb{Z},\ q \neq 0 \right\}

    anything writable as a fraction of two integers

  • Chain of inclusions

    NZQR\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}

    each set contains the previous one whole

  • Irrationality

    2Q\sqrt{2} \notin \mathbb{Q}

    no fraction whatsoever equals the square root of 2

  • Even and odd

    a=2kora=2k+1,kZa = 2k \quad\text{or}\quad a = 2k + 1, \quad k \in \mathbb{Z}

    the notation every divisibility proof rests on

The numbers we work with are not one big family. Counting items needs only the natural numbers, frost and debts need the integers, splitting a pizza needs the rationals, and the diagonal of a square escapes all three. Each family has a name, a symbol and a place in a chain where every set contains the one before it.

The four sets

The natural numbers N\mathbb{N} are the numbers you count items with — no sign, no fractional part:

N={0,1,2,3,}\mathbb{N} = \{0, 1, 2, 3, \ldots\}

The integers Z\mathbb{Z} add their opposites, which is the whole left half of the line:

Z={,2,1,0,1,2,}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}

The rational numbers Q\mathbb{Q} are everything writable as a fraction with an integer numerator and a non-zero integer denominator:

Q={pq:pZ, qZ, q0}\mathbb{Q} = \left\{ \frac{p}{q} : p \in \mathbb{Z},\ q \in \mathbb{Z},\ q \neq 0 \right\}

More numbers are rational than one expects: every integer (5=515 = \tfrac{5}{1}), every terminating decimal (0.25=140.25 = \tfrac{1}{4}) and every repeating one (0.(3)=130.(3) = \tfrac{1}{3}).

The real numbers R\mathbb{R} are every number sitting on the number line — the rationals plus the ones no fraction can write, the irrationals: 2\sqrt{2}, 3\sqrt{3}, π\pi.

−3−2−101234ZQ√2N
Four numbers from four families on one line: −2 is an integer, 0.5 is rational, √2 is irrational, and 3 is natural.

The families do not sit side by side — they nest:

NZQR\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}

So the number 33 belongs to all four sets at once. When a question asks which set a number belongs to, it usually means the smallest one — because that is the one that says the most about it.

The symbols ∈, ∉, ⊂ and ∅

Four signs are enough to write every statement about membership:

  • xAx \in A — the number xx belongs to the set AA: 5Z-5 \in \mathbb{Z},
  • xAx \notin A — the number xx does not belong to AA: 5N-5 \notin \mathbb{N},
  • ABA \subset B — the set AA is contained in the set BB: ZQ\mathbb{Z} \subset \mathbb{Q},
  • \varnothing — the empty set, a set with no element at all.

The empty set is not decoration: the equation x2=1x^2 = -1 has no solutions among the real numbers, so its solution set is \varnothing. Mind the difference: {0}\{0\} has one element, \varnothing has none.

Which sets does −7 belong to, and which does 0.75 belong to?

Writing a number in binary or hexadecimal changes none of this: 1011(2)1011_{(2)} and 1111 are the same integer in two notations — the number-system calculator converts the notation, not the value, which is exactly why it takes integers only.

Why √2 is not a fraction

That 21.41\sqrt{2} \approx 1.41 follows from arithmetic. That no fraction gives that number exactly has to be proved — and the proof is short. It goes by contradiction: we assume the opposite of the claim and run it into an impossibility.

Suppose 2\sqrt{2} is rational, that is

2=pq,\sqrt{2} = \frac{p}{q},

where the fraction pq\tfrac{p}{q} is in lowest terms (every fraction reduces to such a form). Square both sides:

2=p2q2p2=2q22 = \frac{p^2}{q^2} \quad\Rightarrow\quad p^2 = 2q^2

Since p2p^2 is even, pp must be even too — the square of an odd number is odd, which we show below. So write p=2kp = 2k:

(2k)2=2q24k2=2q2q2=2k2(2k)^2 = 2q^2 \quad\Rightarrow\quad 4k^2 = 2q^2 \quad\Rightarrow\quad q^2 = 2k^2

By the same reasoning qq is even as well. But a fraction with both numbers even reduces by 22 — and we assumed it was already in lowest terms. Contradiction. The assumption was therefore false:

2Q\sqrt{2} \notin \mathbb{Q}

The same proof works for 3\sqrt{3}, 5\sqrt{5} and the root of any number that is not a perfect square.

Divisibility proofs

The proof above rested on one move that recurs across all of mathematics: a number of known divisibility gets written as a formula. If kZk \in \mathbb{Z}, then

a=2kora=2k+1,a = 2k \quad\text{or}\quad a = 2k + 1,

so every integer is either even or odd — there is no third option. In the same way, a multiple of 33 is 3k3k, and a number leaving remainder 11 on division by 33 is 3k+13k + 1.

With that notation, proofs are done by calculation rather than by examples:

Prove that the square of an odd number is odd.

The same move shows that the sum of two odd numbers is even: (2k+1)+(2m+1)=2(k+m+1)(2k + 1) + (2m + 1) = 2(k + m + 1), which is divisible by 22.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
Smallest set containing: 30

Common mistakes

  • Treating every root as irrational9=3\sqrt{9} = 3 is a natural number. What is irrational is the root of a number that is not a perfect square.
  • Excluding integers from the rationals55 is 51\tfrac{5}{1}, so 5Q5 \in \mathbb{Q}. The sets nest; they do not exclude one another.
  • Confusing \varnothing with zero — the empty set has no elements, while {0}\{0\} has one.
  • Calling 3-3 a natural number — natural numbers carry no minus sign; 3-3 starts only at Z\mathbb{Z}.
  • Proving by example — checking a claim on five numbers is not a proof. A proof speaks about every number at once, which is why it writes them as 2k2k or 2k+12k + 1.

Formula card

Topic: Number sets

  • Natural numbers

    N={0,1,2,3,}\mathbb{N} = \{0, 1, 2, 3, \ldots\}

    the numbers you count items with — no sign, no fractional part

  • Integers

    Z={,2,1,0,1,2,}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}

    the natural numbers together with their opposites

  • Rational numbers

    Q={pq:pZ, qZ, q0}\mathbb{Q} = \left\{ \frac{p}{q} : p \in \mathbb{Z},\ q \in \mathbb{Z},\ q \neq 0 \right\}

    anything writable as a fraction of two integers

  • Chain of inclusions

    NZQR\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}

    each set contains the previous one whole

  • Irrationality

    2Q\sqrt{2} \notin \mathbb{Q}

    no fraction whatsoever equals the square root of 2

  • Even and odd

    a=2kora=2k+1,kZa = 2k \quad\text{or}\quad a = 2k + 1, \quad k \in \mathbb{Z}

    the notation every divisibility proof rests on

−3−2−101234ZQ√2N
One line carries numbers from all four sets — the wider the set, the more densely it fills the line.

Frequently asked questions

Related articles