• Foundation
  • About 14 min
  • 5 practice questions

Number sets and intervals: N, W, Z, Q, R and operations on intervals

Place numbers in the right set (natural, whole, integer, rational, real, irrational), then find unions, intersections, differences and complements of intervals using the number line.

If something looks wrong, please tell us.

Most sets in later chapters are sets of numbers, so you need to know the standard number sets and how to combine intervals on the number line. The first lesson named the sets N, Z, Q and R; here we place them in order, separate the rational from the irrational, and learn to combine intervals without errors at the end points.

The standard number sets

SymbolNameElements
Nnatural numbers1, 2, 3, ...
Wwhole numbers0, 1, 2, 3, ...
Zintegers..., −2, −1, 0, 1, 2, ...
Qrational numbersp/q with p, q integers and q ≠ 0
Rreal numbersall points of the number line

Each set sits inside the next: N ⊂ W ⊂ Z ⊂ Q ⊂ R. A number that is not rational is called irrational, and the real numbers are the rationals together with the irrationals. Numbers like √2 and π are irrational, because their decimals never end and never repeat. Terminating decimals such as 0.75 = 3/4 and repeating decimals such as 0.333... = 1/3 are rational. A number such as √16 is rational, in fact a natural number, because √16 = 4.

Worked example 1: placing numbers

Name the smallest standard set containing each of these: 7, 0, −3, 0.75, √2, √16. The number 7 is in N. The number 0 is in W, because N has no zero. The number −3 is in Z. The number 0.75 = 3/4 is in Q. The number √2 is irrational, so the smallest standard set is R. The number √16 = 4 is in N.

Operations on intervals

Draw the number line and mark each interval with a solid dot for a closed end and an open dot for an open end. Then read off the answer. The union is everything covered by either interval, the intersection is the overlap, the difference A − B is the part of A that B does not cover, and the complement is everything in R outside the set.

On the number line: union = covered by either, intersection = covered by both, A − B = in A and not in B. A closed end [ or ] is in the set; an open end ( or ) is not. A complement turns closed ends into open ends and the other way round.

Worked example 2: two intervals

Let A = [1, 5) and B = (3, 8]. The overlap starts after 3 (3 is not in B) and stops before 5 (5 is not in A), so A ∩ B = (3, 5). The union starts at 1, which is in A, and ends at 8, which is in B, with no gap between, so A ∪ B = [1, 8]. For A − B we keep the part of A that B does not cover: B starts just after 3, and 3 itself is not in B, so A − B = [1, 3]. For B − A, A stops just before 5 and 5 is not in A, so 5 is in B − A and B − A = [5, 8].

Worked example 3: complements

Take U = R. The complement of (−∞, 2] is (2, ∞), since 2 itself is in the original set and so must be left out. The complement of [−1, 3) has two pieces, everything to the left of −1 and everything from 3 onwards: (−∞, −1) ∪ [3, ∞). Here −1 is in the original set, so it is left out, while 3 is not in the original set, so it is in the complement.

Worked example 4: integers in an interval

The same inequality gives different sets depending on the universal set. For −2 ≤ x < 3 with x ∈ Z, the set is {−2, −1, 0, 1, 2}, which has 5 elements. With x ∈ R, the same rule gives the interval [−2, 3), which has infinitely many elements. Always read which set x belongs to.

Common mistakes

  • Using a square bracket at ∞: infinity is not a number, so always write (−∞ or ∞).
  • Treating 0 as a natural number in this course: N starts at 1 and W starts at 0.
  • Calling √16 irrational: it equals 4, which is rational.
  • Putting the wrong bracket on an end point of a difference, such as writing A − B = [1, 3) when 3 is in A and not in B.

Key takeaways: N ⊂ W ⊂ Z ⊂ Q ⊂ R, with irrationals as the real numbers that are not rational. Use the number line for interval operations, decide each end point on its own, and check which universal set x comes from.

Check your understanding

  1. 1. If A = [1, 5) and B = (3, 8], what is A ∩ B?

    1. (3, 5]
    2. (3, 5)
    3. [3, 5)
    4. [1, 8]
    Show answer

    Answer: B. A ∩ B is the overlap. 3 is not in B and 5 is not in A, so both ends are open: (3, 5).

  2. 2. What is [−2, 1] ∪ (0, 4)?

    1. [−2, 4]
    2. (−2, 4)
    3. [−2, 1]
    4. [−2, 4)
    Show answer

    Answer: D. The intervals overlap on (0, 1], so the union runs from −2 (included, from the first set) to 4 (not included, from the second): [−2, 4).

  3. 3. What is the complement of (−∞, 2] in R?

    1. (2, ∞)
    2. [2, ∞)
    3. (−∞, 2)
    4. (−∞, 2]
    Show answer

    Answer: A. Everything not in (−∞, 2] is greater than 2. The number 2 is in the original set, so it is left out: (2, ∞).

  4. 4. How many integers lie in the interval [−2, 3)?

    1. 4
    2. 6
    3. 5
    4. 3
    Show answer

    Answer: C. The integers are −2, −1, 0, 1 and 2. The number 3 is not included, so there are 5.

  5. 5. Which of these numbers is irrational?

    1. √16
    2. 0.333... (repeating)
    3. −7/3
    4. √2
    Show answer

    Answer: D. √16 = 4, 0.333... = 1/3 and −7/3 are all rational. The decimal of √2 neither ends nor repeats, so it is irrational.

Privacy · Terms · Refunds · Delivery