Mathematics.

number systems

Rational Numbers

Foundations20 minDifficulty1 out of 10

You should know: integers

Overview

A rational number is any number that can be written as a fraction p/q of two integers, with q ≠ 0. This includes every integer (since n = n/1), every terminating decimal, and every repeating decimal. The rationals fill in the gaps left by the integers — you can always divide two integers and land back inside the same number system — but as the ancient Greeks discovered with √2, the rationals themselves still have gaps, which is exactly what motivates the real numbers.

Intuition

If integers are whole steps on a number line, rationals fill in every point you can reach by splitting a step into equal pieces — halves, thirds, hundredths, and so on. Any two rationals, no matter how close, always have another rational squeezed between them (density) — yet, surprisingly, they still don't cover the whole line.

Formal Definition

Definition

The rational numbers are the set of all ratios of an integer to a nonzero integer:

Q={pq:p,qZ, q0}\mathbb{Q} = \left\{ \frac{p}{q} : p, q \in \mathbb{Z},\ q \neq 0 \right\}
Definition
pq=rs    ps=qr\frac{p}{q} = \frac{r}{s} \iff ps = qr

Two fractions represent the same rational number exactly when they cross-multiply equal

Notation

NotationMeaning
Q\mathbb{Q}The set of all rational numbers (from 'quotient')

Properties

Closure

a,bQ    a+b, ab, abQ, and abQ if b0a, b \in \mathbb{Q} \implies a+b,\ a-b,\ ab \in \mathbb{Q}, \text{ and } \frac{a}{b} \in \mathbb{Q} \text{ if } b \neq 0

Density

Between any two distinct rationals a<b, there exists a rational c with a<c<b\text{Between any two distinct rationals } a < b, \text{ there exists a rational } c \text{ with } a < c < b

Example: Between 1/3 and 1/2 lies 5/12.

Decimal characterization

A number is rational    its decimal expansion terminates or eventually repeats\text{A number is rational} \iff \text{its decimal expansion terminates or eventually repeats}

Countability

Q is countably infinite, despite being dense\mathbb{Q} \text{ is countably infinite, despite being dense}

Applications

Rational number types in software (e.g. Python's Fraction) avoid the rounding error of floating-point decimals for exact arithmetic.

Worked Examples

  1. A terminating decimal is always rational.

    0.75=75100=340.75 = \frac{75}{100} = \frac{3}{4}

Answer: Yes, 0.75 = 3/4

Practice Problems

Difficulty 2/10

Is 5 a rational number? Justify briefly.

Common Mistakes

Common Mistake

Believing every decimal number is rational.

Only terminating or eventually-repeating decimals are rational. Non-repeating, non-terminating decimals like π = 3.14159... are irrational.

Historical Background

Fractions have been used since antiquity — Egyptian scribes worked with unit fractions as early as 1800 BCE, and Babylonian mathematicians used base-60 fractional notation. The formal, symbolic treatment of rational numbers as ratios of integers was systematized by Euclid in Book VII of the Elements (c. 300 BCE). The term 'rational' itself comes from 'ratio', not from the everyday sense of 'reasonable'.

  1. c. 1800 BCE

    Egyptian scribes use unit fraction notation (Rhind Papyrus)

  2. c. 300 BCE

    Euclid formalizes the theory of ratios of whole numbers in the Elements

    Euclid

Summary

  • A rational number is any ratio p/q of integers with q ≠ 0.
  • ℚ includes all integers, terminating decimals, and repeating decimals.
  • The rationals are dense — infinitely many lie between any two — yet still countable.
  • Not every number is rational: √2 and π are famous irrational counterexamples.

References