Compare

Rational vs Irrational Numbers

Rational and irrational are the two halves of the real numbers — every real is exactly one or the other.

Rational numbers

A real number is rational if it can be expressed as pq\frac{p}{q} where p,qp, q are integers and q0q \neq 0.

Decimal characterisation: rationals have decimals that either terminate (0.25=140.25 = \frac{1}{4}) or eventually repeat (0.3=130.\overline{3} = \frac{1}{3}, 0.16=160.1\overline{6} = \frac{1}{6}).

The set of rationals is denoted Q\mathbb{Q}. Despite being dense (between any two rationals there's another rational), the rationals are countable — same cardinality as N\mathbb{N}.

Irrational numbers

Cannot be expressed as a ratio of integers. Decimals are non-terminating and non-repeating.

Famous irrationals:

  • π3.14159...\pi \approx 3.14159...
  • e2.71828...e \approx 2.71828...
  • 21.41421...\sqrt{2} \approx 1.41421...
  • ϕ\phi (golden ratio) =(1+5)/2= (1 + \sqrt{5})/2.

The set of irrationals is uncountable — strictly larger than the rationals, even though rationals are dense.

Why this matters

  • 2\sqrt{2} being irrational was a famous Pythagorean discovery (legend: Hippasus was drowned for revealing it).
  • π\pi being irrational means you can never write it as a fraction.
  • The decimal of 1/7=0.1428571/7 = 0.\overline{142857} — the period of repetition is at most q1q - 1.

How to test

If you have a number, ask:

  • Decimal terminates → rational.
  • Decimal repeats with a clear period → rational.
  • Decimal goes on without repetition (e.g. π\pi, ee, 2\sqrt{2}) → irrational.

Algebraic tests use closure: rationals are closed under +,,×,/+, -, \times, / (excluding 0). Sum of two irrationals can be rational (e.g. 2+(2)=0\sqrt{2} + (-\sqrt{2}) = 0).

At a glance

FeatureRationalIrrational
DefinitionCan be written as p/q (integers)Cannot
Decimal expansionTerminates or repeatsNon-terminating, non-repeating
Examples1/2, 0.75, -7, 0.333...π, e, √2, φ
CardinalityCountableUncountable
Density on real lineDenseDense
Verdict

A number is rational iff its decimal terminates or repeats. Otherwise irrational. Most numbers you encounter named (π, e, √2) are irrational; most numbers from arithmetic of integers are rational.

Related