Numbers and Arithmetic

Rational and Irrational Numbers and How to Tell Them Apart

Learn practical tests for deciding whether a number is rational, with worked proofs, decimal rules and common traps.

Key takeaways

  • A real number is rational exactly when its decimal expansion either ends or eventually repeats a block of digits forever.
  • The square root of a positive whole number is rational only when that number is a perfect square.
  • A calculator display cannot prove a number irrational, because it shows only finitely many digits.
  • Combining irrational numbers can give a rational result, so each case needs its own argument.

A rational number can be written as a fraction p/q, where p and q are integers and q is not 0. An irrational number is a real number that cannot be written that way, no matter how large you let p and q be.

To tell them apart, you can look at the decimal expansion, rewrite the number as a fraction, or prove that no fraction could work. Which approach succeeds depends on how the number is given to you.

The definition in practice

"Rational" comes from "ratio." The numbers 3/8, −11/5, 6 and 0 are all rational, since 6 = 6/1 and 0 = 0/1. So is 2.75, which equals 11/4.

To show a number is rational, you only have to produce one suitable fraction. For example, 1.2 + 1/3 looks mixed, but it equals 6/5 + 1/3 = 23/15.

Sums, differences, products and quotients of rationals (with a nonzero divisor) are always rational. You can see it from the formulas: a/b + c/d = (ad + bc)/bd, and the top and bottom are integers.

Showing that a number is irrational is a different kind of task. You must rule out infinitely many fractions at once, and that usually calls for proof by contradiction: assume a fraction exists and show that something impossible follows.

The decimal test

When you divide p by q using long division, each step leaves a remainder smaller than q. There are only q possible remainders. So either you reach remainder 0 and the decimal ends, or a remainder returns and the digits repeat from then on.

7/40 = 0.175                    ends
3/11 = 0.272727...              block 27 repeats
1/7  = 0.142857142857...        block 142857 repeats
5/6  = 0.8333...                repeats after one digit

The reverse also holds. Any ending or repeating decimal is rational. Take x = 0.272727...

100x = 27.272727...     shift by one full block
  x  =  0.272727...
99x  = 27               subtract
  x  = 27/99 = 3/11

The method for repeating decimals covers expansions that have a non-repeating start.

A fraction in lowest terms gives an ending decimal exactly when its denominator has no prime factors other than 2 and 5, because those are the primes in 10.

Decimals that never repeat

A number whose decimal neither ends nor repeats is irrational. You can build one on purpose.

Consider 0.101001000100001..., where each run of zeros is one longer than the run before. There is a clear pattern, but no fixed block ever repeats, because the runs of zeros grow beyond any block length. So this number is irrational.

That example shows that "pattern" and "repetition" are not the same thing.

It also shows the limit of the test. For a number such as π, you cannot inspect all the digits. Seeing a trillion digits with no repetition proves nothing, since a repeating block could in principle begin later or be longer than what you have checked. The decimal test works only when you know the whole structure of the expansion.

Proving that √2 is irrational

Suppose √2 = p/q, with p and q positive integers sharing no common factor greater than 1.

2 = p²/q²           square both sides
p² = 2q²            so p² is even
p is even           an odd number has an odd square
p = 2k              for some integer k
4k² = 2q²           substitute
q² = 2k²            so q is even too

Now p and q are both even, which contradicts the assumption that they share no factor. Therefore no such fraction exists.

The discovery that some lengths are not ratios of whole numbers goes back to Greek mathematics. Stories about how it was first received are mostly legend, as the account of the Pythagoreans and irrational lengths explains.

Quick tests for roots and logarithms

For a positive integer n, √n is either a whole number or irrational. So √49 = 7 is rational, while √50 is irrational. The same holds for cube roots and higher roots: ∛8 = 2, but ∛9 is irrational.

The reason is a general fact called the rational root theorem. If a polynomial with integer coefficients and leading coefficient 1 has a rational root, that root is an integer. √50 solves x² − 50 = 0 and lies between 7 and 8, so it cannot be rational.

For fractions, reduce first: √(18/8) = √(9/4) = 3/2.

Logarithms yield to a factorization argument. Suppose log₁₀ 2 = p/q with positive integers p and q. Then 10^p = 2^q. The left side is divisible by 5 and the right side is not, which is impossible. So log₁₀ 2 is irrational. By contrast, log₄ 8 = 3/2, since 4^(3/2) = 8.

A decision guide

When you meet a new number, work through these questions in order.

Deciding whether a number is rational
1 Simplify first Evaluate roots, cancel terms and reduce fractions. 2 Find a fraction If you can write p/q with integers and q ≠ 0, it is rational. 3 Study the decimal A known ending or repeating expansion means rational. 4 Seek a proof Use contradiction, factorization or the rational root theorem. 5 Admit uncertainty Some natural constants have not been classified. Simplify first Evaluate roots, cancel terms and reduce fractions. 1 Find a fraction If you can write p/q with integers and q ≠ 0, it is rational. 2 Study the decimal A known ending or repeating expansion means rational. 3 Seek a proof Use contradiction, factorization or the rational root theorem. 4 Admit uncertainty Some natural constants have not been classified. 5

The first step matters more than it looks. The expression (√8)/(√2) seems irrational twice over, but it equals √4 = 2. Likewise (√3 + 1)(√3 − 1) = 3 − 1 = 2.

Mixing rational and irrational numbers

Some combinations are predictable.

Operation Result
rational + irrational always irrational
nonzero rational × irrational always irrational
irrational + irrational can be either
irrational × irrational can be either

The first row follows by contradiction. If r is rational, x is irrational and r + x = s were rational, then x = s − r would be rational.

For the third row, √2 + (−√2) = 0 is rational, while √2 + √2 = 2√2 is irrational. For the fourth, √2 × √2 = 2, while √2 × √3 = √6.

Powers hold a neat surprise. Can an irrational raised to an irrational be rational? Look at a = √2^√2. If a is rational, the answer is yes. If a is irrational, then a^√2 = √2^(√2 × √2) = √2² = 2, so the answer is yes again. The argument settles the question without telling you which case is true.

Worked examples to practice on

Try each of these before reading the verdict.

Number Verdict Reason
√121 / 4 rational equals 11/4
√12 − 2√3 rational √12 = 2√3, so the result is 0
3 + √7 irrational rational plus irrational
(2 + √5)(2 − √5) rational equals 4 − 5 = −1
0.123123123... rational equals 123/999 = 41/333
√2 + √3 irrational see below

The last one needs an argument, because adding two irrationals proves nothing by itself. Suppose s = √2 + √3 is rational.

s² = 2 + 2√6 + 3 = 5 + 2√6
√6 = (s² − 5)/2

If s were rational, the right side would be rational, making √6 rational. But 6 is not a perfect square, so √6 is irrational. This contradiction shows that √2 + √3 is irrational.

The technique is worth remembering: square or rearrange until a single known irrational stands alone.

Why measurements cannot settle the question

You might hope to decide whether a length is rational by measuring it very carefully. You cannot. Every measurement has some uncertainty, and within any interval of uncertainty, however narrow, there are both rational and irrational numbers.

The distinction belongs to exact mathematical objects. The diagonal of an ideal unit square is exactly √2. The diagonal of a tile on your floor is a physical length known only approximately, and asking whether it is irrational has no testable meaning.

Computers face a version of the same limit. A standard floating-point number is a binary fraction with finitely many digits, so every value stored that way is rational. When a program prints 1.4142135623730951 for √2, you are seeing a nearby rational stand-in. How computers store decimals explains the consequences. Software that does symbolic mathematics can keep √2 as an exact object and apply the rule (√2)² = 2 without rounding.

Famous cases, known and unknown

Euler established that e is irrational in the eighteenth century, and Johann Lambert proved the same for π in the 1760s. See what pi is and how we know it is irrational for the background.

In 1978 Roger Apéry proved that the sum 1 + 1/2³ + 1/3³ + 1/4³ + ... is irrational.

Many simple-looking questions remain open as of the mid-2020s. Nobody had proved whether π + e is irrational, or π × e, or the Euler–Mascheroni constant γ ≈ 0.5772. Most mathematicians expect all of these to be irrational, but expectation is not proof. Check a current reference, since open problems can be resolved.

How many of each are there?

Both kinds are infinite, but not in the same way. You can list the rationals one after another, for instance by grouping fractions according to the sum of the numerator's size and the denominator, and then walking through the groups. Every rational shows up at some finite position. Such a set is called countable.

No list can contain all the irrationals. In that sense they vastly outnumber the rationals, even though between any two irrationals there is a fraction. Countable infinity explains how a set that looks so crowded can still be listed.

This has a practical flavor too. A "typical" real number, if you imagine choosing one at random from an interval according to length, is irrational with probability 1. Yet nearly every number you write down in daily life is rational, because writing usually means giving finitely many digits or a simple fraction. The irrationals you meet by name, such as √2, π and e, are the ones with short descriptions.

When a problem asks you to classify a number, remember that the burden of proof runs both ways. "I could not find a fraction" is not a proof of irrationality, and "it looks irregular" is not one either.

Common mistakes

  • Treating 22/7 as π. It is a rational approximation that differs from π in the third decimal place.
  • Calling every long decimal irrational. 1/97 has a repeating block of 96 digits, far longer than a basic calculator shows.
  • Assuming a root sign means irrational. √0.25 = 0.5.
  • Calling a fraction rational just because it has a bar. π/2 is a quotient, but π is not an integer, and π/2 is irrational.

Irrational numbers can still be approximated by fractions as closely as you like. Continued fractions find especially efficient ones, such as 355/113 for π. And the rationals and irrationals are thoroughly interleaved: between any two different real numbers lie infinitely many of each.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 38 articles in Numbers and Arithmetic →

Latest news on this topic