Real, Rational, Integer and Whole Numbers Sorted for Algebra Students
A clear map of natural, whole, integer, rational, irrational and real numbers, with tests for classifying any number you meet.
Key takeaways
- Whole numbers are 0, 1, 2, 3 and so on, and integers add the negatives -1, -2, -3 and so on.
- A rational number can be written as a fraction of two integers with a nonzero denominator.
- The decimal form of a rational number either ends or eventually repeats, and an irrational number's decimal does neither.
- Every real number is either rational or irrational, never both.
- Classify a number by its value after simplifying, not by how it happens to be written.
The number sets in algebra fit inside one another. Natural numbers sit inside the whole numbers, which sit inside the integers, which sit inside the rational numbers, which sit inside the real numbers. The irrational numbers are the real numbers that are not rational.
So one number usually belongs to several sets at once. The number 7 is natural, whole, an integer, rational and real. The number -1/2 is rational and real, and nothing smaller on the list.
Counting numbers: natural and whole
The natural numbers are the ones you count with: 1, 2, 3, 4 and so on. Many mathematicians also include 0 among them, so you should check which convention your textbook uses.
The whole numbers, as the term is used in most American school books, are 0, 1, 2, 3 and so on. In that usage they are the natural numbers starting at 1, plus zero.
Neither set contains negatives or fractions. Both are closed under addition and multiplication, but subtracting can take you outside: 4 - 9 is not a whole number.
The word "whole" is used loosely in everyday speech. If a problem says "whole number answers" and a negative seems possible, check the definition the problem intends. "Integer" is the less ambiguous term.
Integers
The integers are the whole numbers together with their opposites: ..., -3, -2, -1, 0, 1, 2, 3, ...
The usual symbol for the set is ℤ, from the German word Zahlen, meaning numbers. Zero is an integer that is neither positive nor negative.
Integers are closed under addition, subtraction and multiplication. Division can leave the set, since 7 ÷ 2 = 3.5. Many puzzle problems ask only for integer solutions, which makes them very different from ordinary equations. The equation 2x = 7 has a perfectly good solution, but not an integer one.
Integers also come in two parities. An integer is even if it equals 2k for some integer k, and odd if it equals 2k + 1. That makes 0 even and -5 odd.
Rational numbers
A rational number is any number that can be written as p/q, where p and q are integers and q ≠ 0. The name comes from "ratio", and the symbol ℚ stands for quotient.
All of these qualify:
3/4 already a fraction
-5 -5/1
0 0/1
2 1/3 7/3
0.35 35/100 = 7/20
-1.2 -6/5
0.333... 1/3 The definition asks whether a fraction form exists, not whether you were handed one. Every integer is rational because you can put it over 1.
An expression with a zero denominator, such as 5/0, is not a number of any kind. It is undefined. By contrast, 0/5 equals 0, a perfectly good rational number.
Reading decimals
Decimals give a quick test. A rational number has a decimal expansion that terminates (ends) or repeats a block of digits forever. The reason is long division: dividing by q leaves only q possible remainders, from 0 to q - 1. Either a remainder of 0 appears and the division stops, or some remainder returns and the digits start cycling.
You can predict which will happen. Reduce the fraction fully. It terminates exactly when the denominator has no prime factors other than 2 and 5. So 7/40 terminates (40 = 2³ × 5), while 5/12 repeats, because 12 contains a 3.
Going backward, algebra turns a repeating decimal into a fraction.
x = 0.272727...
100x = 27.272727...
100x - x = 27
99x = 27
x = 27/99 = 3/11 When some digits come before the repeat, use two multiples.
x = 0.1666...
10x = 1.666...
100x = 16.666...
100x - 10x = 15
x = 15/90 = 1/6 The same method shows that 0.999... equals 1: if x = 0.999..., then 10x - x = 9, so 9x = 9.
Irrational numbers
An irrational number is a real number that cannot be written as a fraction of integers. Its decimal expansion goes on forever without settling into a repeating block.
Familiar examples are π, √2, √3, √10 and the constant e that appears with exponential growth. The square root of a positive integer is irrational unless that integer is a perfect square, so √49 = 7 is rational and √50 is not. The proof idea appears in why square roots of non-squares are irrational.
Two cautions help here. First, 22/7 and 3.14 are approximations of π. Both are rational, and π is not. Second, a calculator screen shows only finitely many digits, so it can never prove that a number is irrational.
A decimal can have an obvious pattern and still be irrational. In 0.101001000100001..., where each group has one more zero, no single block repeats forever.
Real numbers and the number line
The real numbers, written ℝ, are all the rational and irrational numbers together. Each point on a number line corresponds to exactly one real number, and each real number to one point.
Between any two different rational numbers there is another rational: take their average. There are irrationals between them too. So you will never find two "neighboring" real numbers.
Not every number is real. No real number squares to give -1, so √-1 lies outside the line. It belongs to the complex numbers, which have the form a + bi with a and b real. Every real number is also a complex number with b = 0.
A classification procedure
To sort any number, work through these steps.
- Simplify it. Reduce fractions and evaluate roots and operations.
- Check that it is defined. Division by zero gives no number at all.
- If it involves the square root of a negative number and does not simplify to a real value, it is not real.
- If it is a whole value of 0 or more, it is whole, an integer, rational and real, and natural if positive.
- If it is a negative whole value, it is an integer, rational and real.
- If it is another fraction of integers, or a terminating or repeating decimal, it is rational and real.
- Otherwise it is irrational and real.
| Number as written | Simplified | Smallest set from the list |
|---|---|---|
| √64 | 8 | natural |
| 0/9 | 0 | whole |
| -18/3 | -6 | integer |
| √(4/25) | 2/5 | rational |
| 5π/π | 5 | natural |
| √12 | 2√3 | irrational |
| √-9 | 3i | not real |
| 8/0 | undefined | no set |
Comparing and ordering mixed forms
Algebra often asks you to put numbers from different families in order. Convert them to a common form, usually decimals with enough places to tell them apart.
Order these from smallest to largest: 7/3, √5, -1.5, 2.3 and -√2.
7/3 ≈ 2.333
√5 ≈ 2.236
-√2 ≈ -1.414
order: -1.5, -√2, √5, 2.3, 7/3 The negatives need care. Since 1.5 is larger than 1.414, its opposite -1.5 lies farther left, so it is the smaller number.
The positives show why rounding too early is risky. At one decimal place, 7/3 and 2.3 both read as 2.3, yet 7/3 is larger by 1/30.
For a root, squaring gives an exact comparison without any decimals. Is √5 less than 2.3? Both are positive, and 2.3² = 5.29, which exceeds 5, so yes. The skill of estimating square roots makes these comparisons quick.
Building new members from old ones
You can often predict the family of a result before computing it. A sum, difference or product of integers is an integer. A quotient of rationals, with a nonzero divisor, is rational. A rational number added to an irrational one stays irrational, so 5 + √2 is irrational. A nonzero rational times an irrational is also irrational, so 3π and √7/2 are irrational.
Two irrationals can go either way. The sum √2 + √3 is irrational, but π + (4 - π) = 4. The product √3 × √12 = √36 = 6 is a natural number built entirely from irrational pieces. This is why you simplify first and classify second.
Why the sets matter when you solve
The same equation can have different answers depending on the set you are searching.
(x - 3)(2x + 1)(x² - 5) = 0
natural numbers: x = 3
rational numbers: x = 3, -1/2
real numbers: x = 3, -1/2, √5, -√5 The set also decides what counts as a sensible answer in a word problem. A number of students must be a whole number. A length may be irrational, such as the diagonal of a unit square, √2, but may not be negative. A temperature can be negative and non-integer.
Which operations always stay inside a set is its own topic, treated in closure and number sets. The sets also shape factoring, as shown in how factoring depends on the allowed numbers.
Variables and the set they range over
A letter in algebra stands for a member of some set, called its domain or replacement set. When no set is named in a first algebra course, it is usually assumed to be the real numbers, with values excluded wherever an expression would be undefined.
Naming the set can change whether a statement is true. "x² ≥ x" holds for every integer. It fails for real numbers: at x = 1/2, the left side is 1/4. A claim checked only on whole numbers may break as soon as fractions or negatives enter, so test those too.
Common questions
Is every integer a rational number?
Yes. Any integer n equals n/1. The reverse is false, since 1/2 is rational but not an integer.
Can a number be both rational and irrational?
No. Irrational means "real and not rational", so the two sets share nothing.
Is -√16 irrational because it has a root sign?
No. It equals -4, which is an integer. Judge the value. A root sign only warns you to check.
Is infinity a real number?
No. The symbol ∞ describes unbounded behavior, as in an interval that goes on forever. It is not an element of the real numbers, and the usual rules of arithmetic do not apply to it. When you write the interval from 2 to infinity, you mean every real number greater than 2, with no upper end.