math.wiki
Number › Irrational and real numbers › Sorting a number into its sets
Open on the map
Math 8 · 8.NS.A.1

Sorting a number into its sets

Is \displaystyle -\frac{8}{4} a fraction or an integer, and is \displaystyle \sqrt{49} irrational because it has a root sign? Given any number, which of the named families does it belong to?

Where you are 5 in Irrational and real numbers

When you reach for it

The numbers met so far came in families, each built by adding to the one before: counting numbers, then zero, then the negative Integers, then fractions and decimals, and most recently numbers such as \displaystyle \sqrt{2} that are not fractions at all. So one number usually belongs to several families at once. 5 is a counting number, and also an integer, a rational number and a real number.

Sorting a number means listing every family it belongs to. You need it whenever a statement depends on the kind of number in play: a count of people must be a whole number, and “solve in the integers” throws out an answer such as \displaystyle \frac{7}{2}. It takes two things: knowing how the families sit inside one another, and seeing past the way a number is written to the number itself.

The procedure

The six sets

  • The natural numbers, also called the counting numbers: \mathbb{N} = \{1, 2, 3, \ldots\}. The braces list the members, as in roster notation, and the dots mean the list goes on forever. In this lesson they start at 1.
  • The whole numbers: 0, 1, 2, 3, \ldots, the natural numbers with 0 added. This set has no standard letter.
  • The integers: \mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}, the whole numbers together with their opposites.
  • The rational numbers, \mathbb{Q}: every number that can be written as \displaystyle \frac{a}{b} with a and b integers and b \neq 0. As What makes a number rational shows, these are exactly the numbers whose decimals either stop or repeat.
  • The irrational numbers: the real numbers that are not rational. Their decimals never stop and never repeat. \displaystyle \sqrt{2} is one, and so is \pi.
  • The real numbers, \mathbb{R}: the rational and irrational numbers together, which are exactly the numbers that label the points of the number line.

How the sets nest

Every natural number is whole, since the whole numbers are the natural numbers with one member added. Every whole number is an integer, since the integers add the opposites. Every integer n is rational, since \displaystyle n = \frac{n}{1}. And every rational number is real. Writing \subset for “sits inside”,

\mathbb{N} \subset \{\text{whole numbers}\} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}

Each step adds something new: 0 is whole but not natural, -1 is an integer but not whole, \displaystyle \frac{1}{2} is rational but not an integer, and \displaystyle \sqrt{2} is real but not rational.

The irrational numbers are not in the chain. They are the real numbers that are not rational, so the two sets share no member, and together they make up all of \mathbb{R}. Every real number is rational or irrational, and none is both.

Real numbers Rational numbers Irrational numbers Integers Whole numbers Natural numbers
23
\displaystyle \sqrt{49}
\displaystyle \frac{\pi}{\pi}
0
-11
\displaystyle -\frac{8}{4}
\displaystyle \frac{13}{5}
1.444\ldots
-6.4
\displaystyle \sqrt{35}
\pi
\displaystyle 35\sqrt{35}
0.2020020002\ldots
Figure 1Every number lands in exactly one region. It belongs to the set of that region and to every set whose region surrounds it, and to no other.

The smallest set decides the rest

A number in a region is also in every region drawn around it, and in no other. So once you know the smallest of the six sets a number belongs to, the full list follows. A real number can land in only five places, so there are only five possible answers:

The number isIt belongs to
a natural number, such as 9natural, whole, integer, rational, real
zerowhole, integer, rational, real
a negative integer, such as -9integer, rational, real
rational but not an integer, such as \displaystyle \frac{9}{2}rational, real
irrational, such as \displaystyle \sqrt{3}irrational, real

The useful order of questions runs from the outside in. Is the number rational or irrational? If irrational, that is the last row and you are done. If rational, is it an integer, meaning that in lowest terms its denominator is 1? If it is an integer, its sign settles the rest: positive means natural, zero means whole but not natural, negative means an integer and no smaller set.

Find the value before you sort

Which sets a number belongs to is a fact about the number, not about how it is written. \displaystyle -\frac{8}{4} has a fraction bar, but it is the integer -2; \displaystyle \sqrt{49} has a root sign, but it is 7. So simplify exactly first, and sort second, with tools you already have.

  • A fraction bar is division. If the top is a multiple of the bottom, the number is an integer.
  • For a whole number n, \displaystyle \sqrt{n} is a whole number when n is a perfect square (0, 1, 4, 9, 16, \ldots), and irrational otherwise.
  • For a \geq 0 and b > 0, \displaystyle \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} and \displaystyle \frac{\sqrt{a}}{\sqrt{b}} = \sqrt{\frac{a}{b}} (operations with radicals). So \displaystyle \sqrt{2} \cdot \sqrt{32} = \sqrt{64} = 8, a natural number made from two irrational ones.
  • A repeating decimal turns into a fraction, and a terminating one is a fraction over a power of 10.

The definition of rational asks only whether the number has some name \displaystyle \frac{a}{b} with integers a and b \neq 0. A name of another form, such as a fraction with roots in it, proves nothing either way.

Rational or irrational

A decimal known completely settles it: one that stops or repeats is rational, one that does neither is irrational, where “completely” means a rule for every digit. Beyond that, Irrational numbers gives three facts to use. The square root of a whole number that is not a perfect square is irrational, and so is \pi. If r is rational and x is irrational, then r + x and r - x are irrational, and so is r \cdot x when r \neq 0: if r + x were a rational s, then x = s - r would be rational. And two irrational numbers together follow no rule, since \displaystyle \sqrt{2} \cdot \sqrt{32} = 8 but \displaystyle \sqrt{2} \cdot \sqrt{5} = \sqrt{10}, so such a case has to be simplified.

All, some and none

“All A are B” is true exactly when A sits inside B, and one member of A outside B, a counterexample, makes it false. “All integers are rational” is true; “all rational numbers are integers” is false, and \displaystyle \frac{1}{2} alone shows it.

“Some A are B” says at least one number is in both, and one example proves it. In mathematics “some” does not mean “not all”: “some whole numbers are integers” is true, even though all of them are.

“No A is B” says the two sets share no member. “No irrational number is an integer” is true, because every integer is rational and nothing is both. The figure answers most such questions at a glance.

Worked examples

Example 1

Sorting a list

List every set each number belongs to: 23, 0, -11, \displaystyle \frac{13}{5}, -6.4, \displaystyle \sqrt{35}.

Solution

Find each number’s smallest set, then read its row from the table above.

23 is a counting number, so it is natural. 0 is whole but not natural, since counting starts at 1. -11 is a negative integer, so it is not whole.

\displaystyle \frac{13}{5} is an integer over a nonzero integer, so it is rational. It is not an integer, because 5 does not divide 13: \displaystyle \frac{13}{5} = 2.6 lies between 2 and 3.

-6.4 terminates, so \displaystyle -6.4 = -\frac{64}{10} = -\frac{32}{5}, which is rational and not an integer.

For \displaystyle \sqrt{35}: 5^2 = 25 < 35 < 36 = 6^2, so 35 is not a perfect square and \displaystyle \sqrt{35} is irrational.

NumberIt belongs to
23natural, whole, integer, rational, real
0whole, integer, rational, real
-11integer, rational, real
\displaystyle \frac{13}{5}rational, real
-6.4rational, real
\displaystyle \sqrt{35}irrational, real
Example 2

Names that hide the number

List every set each number belongs to.

(a) \displaystyle \sqrt{49} \qquad (b) \displaystyle -\frac{8}{4} \qquad (c) \displaystyle \frac{\pi}{\pi} \qquad (d) 1.444\ldots, where the 4s go on forever

Solution

In each case find the value first.

(a) \displaystyle \sqrt{49} is the non-negative number whose square is 49, and 7^2 = 49, so \displaystyle \sqrt{49} = 7: natural, whole, integer, rational, real. The root sign did not make it irrational; only the root of a whole number that is not a perfect square is.

(b) The fraction bar means division, and 8 \div 4 = 2, so \displaystyle -\frac{8}{4} = -2: integer, rational, real. It is not whole, because it is negative.

(c) A nonzero number divided by itself is 1, and \pi \neq 0, so \displaystyle \frac{\pi}{\pi} = 1: natural, whole, integer, rational, real. Its top and bottom are irrational, but \displaystyle 1 = \frac{1}{1} is a name of the form integer over nonzero integer, and one such name is all the definition asks for.

(d) Call the number x. Multiplying by 10 moves the decimal point one place:

\begin{aligned} 10x &= 14.444\ldots \\ x &= 1.444\ldots \end{aligned}

The tails after the point are identical, so subtracting leaves 9x = 13, and \displaystyle x = \frac{13}{9}. It is rational and real, and since it lies between 1 and 2 it is not an integer.

Example 3

Square roots that come out whole

List every set each number belongs to.

(a) \displaystyle \sqrt{5} \cdot \sqrt{20} \qquad (b) \displaystyle -\frac{\sqrt{72}}{\sqrt{2}} \qquad (c) \displaystyle (\sqrt{35})^2 - 35 \qquad (d) \displaystyle \sqrt{35} \cdot \sqrt{35} \cdot \sqrt{35}

Solution

Every root here is of a number that is not a perfect square, so each root alone is irrational. That says nothing yet about the results.

(a) Both numbers under the roots are non-negative, so the roots multiply: \displaystyle \sqrt{5} \cdot \sqrt{20} = \sqrt{100} = 10. It is natural, whole, integer, rational, real.

(b) \displaystyle \frac{\sqrt{72}}{\sqrt{2}} = \sqrt{\frac{72}{2}} = \sqrt{36} = 6, so the number is -6: integer, rational, real, but not whole.

(c) \displaystyle \sqrt{35} is the number whose square is 35, so \displaystyle (\sqrt{35})^2 - 35 = 35 - 35 = 0: whole, integer, rational, real, but not natural.

(d) Group the first two factors, as the associative property allows: \displaystyle \sqrt{35} \cdot \sqrt{35} = 35, so the product is \displaystyle 35\sqrt{35}. A nonzero rational times an irrational is irrational, so the number is irrational and real.

Four numbers built from irrational roots landed in four different places. Only the value decides.

Example 4

Reading a decimal

Decide whether each number is rational or irrational, and list its sets.

(a) 0.2020020002\ldots, where each 2 is followed by one more 0 than the 2 before it \qquad (b) -3.\overline{18} \qquad (c) 3.14 \qquad (d) \pi

Solution

(a) The decimal never stops, since another 2 always comes. Suppose that from some digit on it repeated a block of p digits. The runs of zeros grow without end, so some run of more than p zeros lies wholly inside the repeating part, and the block would be all zeros. Then no 2 could come after it, which is false. So the decimal neither stops nor repeats: irrational and real.

(b) Let x = 3.181818\ldots. The block has two digits, so multiply by 100:

\begin{aligned} 100x &= 318.1818\ldots \\ x &= 3.1818\ldots \end{aligned}

Subtracting, 99x = 315, so \displaystyle x = \frac{315}{99} = \frac{35}{11}, and \displaystyle -3.\overline{18} = -\frac{35}{11}. It is rational and real, and lies between -4 and -3, so it is not an integer.

(c) \displaystyle 3.14 = \frac{314}{100} = \frac{157}{50}: rational and real, not an integer.

(d) \pi is irrational and real; its decimal 3.14159\ldots never stops and never repeats. So (c) and (d) are different numbers: 3.14 is a rational number close to \pi, not \pi itself.

Example 5

All, some or none

Decide whether each statement is true or false. Give a reason, or a counterexample.

(a) Every whole number is an integer. \qquad (b) Every integer is a whole number.

(c) Some rational numbers are integers. \qquad (d) No integer is irrational.

(e) Every square root of a natural number is irrational.

(f) Some real numbers are neither rational nor irrational.

Solution

(a) True. The whole numbers sit inside the integers.

(b) False. -6 is an integer and not whole, because it is negative.

(c) True. \displaystyle -2 = -\frac{2}{1} is rational and an integer.

(d) True. Every integer is rational, and no number is both rational and irrational.

(e) False. \displaystyle \sqrt{49} = 7 is the square root of a natural number, and it is rational. The statement holds only for natural numbers that are not perfect squares.

(f) False. An irrational number is defined as a real number that is not rational, so there is no third kind.

Example 6

Is there such a number?

For each description, give a number that fits, or explain why none exists.

(a) An integer that is not a whole number. \qquad (b) A whole number that is not natural.

(c) A natural number that is not rational. \qquad (d) An irrational number whose square is a natural number.

(e) A rational number that is not an integer, but whose square is an integer.

Solution

(a) -5, or any negative integer.

(b) 0, and nothing else, since the whole numbers are the natural numbers with only 0 added.

(c) None. Every natural number n equals \displaystyle \frac{n}{1}, so \mathbb{N} \subset \mathbb{Q}: in the figure, the natural numbers box lies inside the rational part.

(d) \displaystyle \sqrt{22}. It is irrational, since 4^2 = 16 < 22 < 25 = 5^2, and \displaystyle (\sqrt{22})^2 = 22.

(e) None. Suppose q is rational and q^2 = n, an integer. Then n is not negative, so it is a whole number, and q is \displaystyle \sqrt{n} or \displaystyle -\sqrt{n}. So \displaystyle \sqrt{n} equals q or -q and is rational, which leaves only the other case: \displaystyle \sqrt{n} is a whole number. Then q, being \displaystyle \sqrt{n} or its opposite, is an integer.

Boundaries

The form \displaystyle \frac{a}{b} counts only with integers a and b, and b \neq 0. \displaystyle \frac{\sqrt{35}}{5} has a fraction bar and is irrational. \displaystyle \frac{5}{0} is not a number at all, so it belongs to none of the six sets.

“Natural” does not mean the same thing in every book. Here the natural numbers start at 1, and the set with 0 added is the whole numbers. Some books, and most writing on computing, start the natural numbers at 0. Check which a text means.

The digits on show do not decide. A decimal written 1.41421356\ldots with no rule for the rest might be \displaystyle \sqrt{2}, or a rational number that shares those first digits and then repeats. A calculator display always stops, so it always shows a rational number, even when the exact answer is irrational.

Not every number is real. No real number squares to a negative number, so \displaystyle \sqrt{-9} is not real and belongs to none of the six sets. It is one of the complex numbers.

Where this goes next

Once you can tell where a number lands, you can ask which sets keep their answers inside. The integers are not closed under division, since \displaystyle 1 \div 2 = \frac{1}{2} falls outside them, while the rational numbers are, apart from division by zero. That is the closure property, decided by exactly this sorting.

The real number line shows the same sets as points, with the irrational numbers filling every gap the rational ones leave; placing one there starts by bracketing it between perfect squares. The same sorting works for cube roots, with a twist: a negative number has a real cube root, so \displaystyle \sqrt[3]{-125} = -5 is an integer. Pictures of sets inside sets are Venn diagrams, and beyond \mathbb{R} lie the complex numbers, built so that \displaystyle \sqrt{-9} has a meaning.

Exercises

Sort the number

List every set each number belongs to: natural, whole, integer, rational, irrational, real.

  1. -15
  2. \displaystyle \frac{21}{3}
  3. -2.\overline{5}
  4. \displaystyle \sqrt{40}
  5. \displaystyle -\sqrt{64}
  6. \displaystyle \frac{0}{9}

Simplify first

List every set each number belongs to.

  1. \displaystyle \sqrt{12} \cdot \sqrt{3}
  2. \displaystyle \frac{\pi}{2}
  3. \displaystyle (\sqrt{19})^2 - 22
  4. \displaystyle \frac{\sqrt{75}}{\sqrt{3}}
  5. \displaystyle \frac{\sqrt{2} + \sqrt{2}}{\sqrt{2}}

Read the decimal

Decide whether each number is rational or irrational. Where it is rational, write it as a fraction.

  1. 0.123456789101112\ldots, the natural numbers written one after another
  2. 1.\overline{216}
  3. -0.0125

All, some or none

Decide whether each statement is true or false, with a reason or a counterexample.

  1. All natural numbers are whole numbers.
  2. Some integers are not rational.
  3. No whole number is negative.
  4. Some irrational numbers are greater than 100.

Reasoning

  1. Explain why no real number belongs to all six sets, and why none belongs to only one of them.
  2. A real number belongs to exactly four of the six sets. Which number is it? Explain why it is the only one, by saying how many sets each of the other kinds of real number belongs to.
Answers
  1. Integer, rational, real. -15 is a negative integer, so it is not whole.
  2. Natural, whole, integer, rational, real. \displaystyle \frac{21}{3} = 7.
  3. Rational, real. With x = 2.555\ldots, 10x = 25.555\ldots, so 9x = 23 and \displaystyle x = \frac{23}{9}. Then \displaystyle -2.\overline{5} = -\frac{23}{9}, which lies between -3 and -2 and is not an integer.
  4. Irrational, real. 6^2 = 36 < 40 < 49 = 7^2, so 40 is not a perfect square.
  5. Integer, rational, real. \displaystyle \sqrt{64} = 8, so \displaystyle -\sqrt{64} = -8.
  6. Whole, integer, rational, real. \displaystyle \frac{0}{9} = 0, which is whole but not natural.
  7. Natural, whole, integer, rational, real. \displaystyle \sqrt{12} \cdot \sqrt{3} = \sqrt{36} = 6.
  8. Irrational, real. If \displaystyle \frac{\pi}{2} were a rational number s, then \pi = 2s would be rational, and it is not.
  9. Integer, rational, real. \displaystyle (\sqrt{19})^2 = 19, so the number is 19 - 22 = -3.
  10. Natural, whole, integer, rational, real. \displaystyle \frac{\sqrt{75}}{\sqrt{3}} = \sqrt{25} = 5.
  11. Natural, whole, integer, rational, real. The top is \displaystyle 2\sqrt{2}, and \displaystyle \frac{2\sqrt{2}}{\sqrt{2}} = 2.
  12. Irrational. The digits never stop, since there is always a next natural number to write. If they repeated a block of p digits from some point on, look at 10^p, 10^{p+1}, \ldots: each is a 1 followed by at least p zeros, and they occur as far out as you like. So the repeating part holds p zeros in a row, the block is all zeros, and no nonzero digit could follow. But every later natural number begins with a nonzero digit.
  13. Rational: \displaystyle \frac{45}{37}. With x = 1.216216\ldots, 1000x = 1216.216\ldots, so 999x = 1215 and \displaystyle x = \frac{1215}{999} = \frac{45}{37}.
  14. Rational: \displaystyle -\frac{1}{80}. \displaystyle -0.0125 = -\frac{125}{10000} = -\frac{1}{80}.
  15. True. The whole numbers are the natural numbers together with 0.
  16. False. Every integer n equals \displaystyle \frac{n}{1}, so every integer is rational.
  17. True. The whole numbers are 0, 1, 2, 3, \ldots, and none of them is less than 0.
  18. True. \displaystyle 100 + \sqrt{2} is a rational number plus an irrational one, so it is irrational, and it is greater than 100 because \displaystyle \sqrt{2} > 0.
  19. No number is both rational and irrational, so none belongs to all six sets. Every real number belongs to \mathbb{R} and also to either \mathbb{Q} or the irrational numbers, so it belongs to at least two.
  20. 0. A natural number belongs to five sets, 0 to four, a negative integer to three, and a rational number that is not an integer, or an irrational number, to two. Only 0 gives four: it is whole, an integer, rational and real, and not natural or irrational.
kg1128 · updated 2026-10-09 · CC-BY-SA-4.0