2.5.3Number Theory (Intermediate)

Rational numbers — definition, decimal expansion (terminating - repeating)

2,329 words11 min readdifficulty · medium5 backlinks

Definition

Why include integers? Every integer nn can be written as n1\frac{n}{1}, so integers are a subset of rationals: ZQ\mathbb{Z} \subset \mathbb{Q}.

Why exclude q=0q = 0? Division by zero is undefined in mathematics. If we allowed it, we'd break the field axioms (every non-zero element must have a multiplicative inverse).


Decimal Expansion: The Two Types

When we convert pq\frac{p}{q} to decimal form using long division, exactly two things can happen:

1. Terminating Decimals

Why this condition? Our decimal system is base 10, and 10=2×510 = 2 \times 5. When we perform long division, we repeatedly multiply the remainder by 10. If the denominator qq divides some power of 10exactly, the division terminates.

Derivation:

  1. Start with pq\frac{p}{q} in lowest terms
  2. Assume the decimal terminates after nn digits
  3. Then pq=k10n\frac{p}{q} = \frac{k}{10^n} for some integer kk
  4. Cross-multiply: p10n=kqp \cdot 10^n = k \cdot q
  5. Since gcd(p,q)=1(p, q) = 1, we need q10nq \mid 10^n
  6. Since 10n=2n5n10^n = 2^n \cdot 5^n, the only prime factors of 10n10^n are 2 and 5
  7. Therefore qq can only have prime factors 2 and 5

2. Non-Terminating Repeating Decimals

Why do they repeat? When performing long division, the possible remainders are limited: 0,1,2,..,q10, 1, 2, .., q-1. Since we only have qq possible remainders, after at most qq steps, we must see a remainder we've seen before. Once a remainder repeats, the entire division pattern repeats.


Converting Repeating Decimals Back to Fractions



Why This Matters

  1. Distinguishing Number Types: Decimal behavior immediately tells us if a number is rational or irrational
  2. Computer Representation: Computers represent rationals exactly but approximate irrationals—understanding terminating vs. repeating helps predict precision issues
  3. Foundation for Real Numbers: The rationals are dense in the reals (between any two real numbers, there's a rational), but they have "gaps" (the irrationals)
  4. Practical Computation: Converting repeating decimals to fractions is essential in engineering calculations where exact values matter

Recall Explain to a 12-year-old

Imagine you have a pizza. A rational number is like saying "I ate3 out of 8 slices" — you can write it as a fraction: 38\frac{3}{8}.

Now, when you divide 3 by 8 using a calculator or long division, you get 0.3750.375. The decimal stops! That's called a terminating decimal. It happens when the bottom number (8) can be made using only 2's and 5's multiplied together. (8 = 2 × 2).

But what if you divide 1 by 3? You get 0.333333...0.333333... — the 3's never stop! But they repeat forever. That's a repeating decimal. It happens when the bottom number has other numbers in it (like 3).

Here's the cool part: if you give me ANY decimal that either stops or repeats, I can convert it back into a fraction! But if the decimal goes on forever WITHOUT repeating (like π\pi), then it's NOT a rational number — it's calledrrational, and you can't write it as a simple fraction.

So rational numbers are special: their decimals always play by the rules (stop or repeat). Irrational numbers are rebels!


Connections

  • Prime factorization — essential for checking terminating condition
  • Euler's totient function — determines maximum repetend length
  • Real numbers — rationals are a proper subset of reals
  • Irrational numbers — numbers whose decimals don't terminate or repeat
  • Dense sets — rationals are dense in the reals
  • Long division algorithm — the computational process revealing decimal patterns
  • Modular arithmetic — explains why remainders cycle in repeating decimals

Flashcards

What is a rational number? :: A number that can be expressed as pq\frac{p}{q} where p,qp, q are integers and q0q \neq 0.

When does a rational number have a terminating decimal?
When the denominator (in lowest terms) has the form q=2a5bq = 2^a \cdot 5^b — only prime factors 2 and 5.
When does a rational number have a repeating decimal?
When the denominator (in lowest terms) contains at least one prime factor other than 2 or 5.
Why do repeating decimals repeat?
In long division by qq, there are only qq possible remainders. Eventually a remainder must repeat, causing the division pattern to repeat.
How to convert 0.abc0.\overline{abc} to a fraction?
Let x=0.abcx = 0.\overline{abc}, multiply by 10n10^n (where nn is repetend length), subtract original, solve for xx. Result: x=abc10n1x = \frac{abc}{10^n - 1}.
What is 18\frac{1}{8} in decimal?
0.1250.125 (terminates because 8=238 = 2^3)
What is 16\frac{1}{6} in decimal?
0.160.1\overline{6} (repeats because 6=236 = 2 \cdot 3 contains prime3)
True or False: All decimals are rational numbers.
False. Only terminating or repeating decimals are rational. Non-repeating infinite decimals are irrational.
What is 0.90.\overline{9}?
Exactly1. Proof: Let x=0.9x = 0.\overline{9}, then 10x=9.910x = 9.\overline{9}, so 10xx=910x - x = 9, giving x=1x = 1.

Concept Map

subset of

requires

often in

long division gives

either

or

holds iff

because of

when other primes divide q

contrast: never terminates or repeats

Rational number p over q

Integers Z

q not equal 0

Lowest terms gcd=1

Decimal expansion

Terminating decimal

Repeating decimal

q = 2^a times 5^b

Base 10 = 2 times 5

Irrational numbers

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Rational numbers ka matlab hai "ratio" wale numbers – yani jo numbers hum fraction ke form mein likh sakte hain, jaise 34\frac{3}{4} ya 72\frac{-7}{2}. Yeh definition simple lagti hai, lekin iska sabse interesting part hai inke decimal expansion mein – jab hum fraction ko decimal mein convert karte hain, tab hamesha do hi tarah ki patterns dekhne ko milti hain.

Pehli type: Terminating decimals – jaise 78=0.875\frac{7}{8} = 0.875. Yeh decimals khatam ho jate hain, infinite nahi jate. Yeh tab hota hai jab denominator (neeche wala number) sirf 2 aur 5 ke powers se bana ho, kyunki hamara decimal system base-10 hai (10=2×510 = 2 \times 5). Jab denominator 10 kisi power se perfectly divide ho jata hai, tab division process stop ho jaata hai.

Dosri type: Repeating decimals – jaise 56=0.8333...\frac{5}{6} = 0.8333... jisme 3 infinite times repeat hota hai. Yeh tab hota hai jab denominator mein 2 aur 5 ke alawa koi aur prime factor ho (jaise 3, 7, 11). Long division karte waqt remainders limited hote hain (sirf 0 se q-1 tak), toh eventually koi remainder repeat hona hi hai – aur jab remainder repeat ho, toh pura pattern repeat hone lagta hai.

Yeh kyun important hai? Isse hum turant pata laga sakte hain ki koi number rational hai ya irrational.Agar decimal terminate ya repeat karta hai, toh rational hai. Agar decimal infinite jaye BINA repeat kiye (jaise π\pi ya 2\sqrt{2}), toh irrational hai. Engineering aur science mein jab exact calculations chahiye, tab repeating decimals ko wapas fractions mein convert karna zaroori hota hai – aur iska ek fixed mathematical method hai (multiply by 10n10^n, subtract, solve). Yeh samajhna number theory ki foundation hai!

Go deeper — visual, from zero

Test yourself — Number Theory (Intermediate)

Connections