The World of Numbers

Long before anyone wrote an equation, a herder in an ancient settlement placed one pebble in a pot for every cow that walked into the forest, and removed one pebble for every cow that walked back. That simple act of matching — one pebble, one cow — is where mathematics begins, and where this chapter begins too. The Lebombo bone and the Ishango bone, carved with tally marks tens of thousands of years ago, show that the natural numbers ℕ = {1, 2, 3, …} are humanity's oldest mathematical tool. But counting was never enough. Traders needed to record an empty stall, so India gave the world śhūnya — zero — and Brahmagupta turned it into a working number with explicit rules. Merchants needed to record debt, so the number line grew leftward into negative numbers, and the integers ℤ were born from Brahmagupta's language of dhana (fortune) and ṛiṇa (debt). Farmers needed to split a field into thirds, so fractions arrived, and combining them with the integers gave the rational numbers ℚ — every number expressible as p/q. Then geometry delivered a shock: the diagonal of a unit square is a length no fraction can ever equal exactly. That length, √2, forced open a new category, the irrational numbers, first proved impossible-to-fraction by Hippasus using proof by contradiction, a technique you will learn to wield yourself. Uniting the rational and irrational numbers fills every last gap on the line, producing the real numbers ℝ — the complete number system used to measure every length, temperature and quantity in the observable universe. This chapter retraces that entire five-thousand-year expedition: from tally bones to Brahmagupta's arithmetic, from fractions on a number line to the proof that √2 cannot be a fraction, and from terminating decimals to the strange, beautiful fact that 0.999… equals 1 exactly. By the end, you will know precisely which number lives in which set, how to prove it, and how to locate it exactly on the line.

Key takeaways
  • Natural numbers ℕ = {1, 2, 3, …} arose from one-to-one correspondence (tally marks); adding 0 and negative numbers gives the integers ℤ.
  • Brahmagupta (628 CE) gave the first rigorous rules for zero and signed numbers: a + 0 = a, a × 0 = 0, and (−) × (−) = (+).
  • A rational number is any number p/q with p, q integers and q ≠ 0, set ℚ; a/b = c/d exactly when ad = bc.
  • ℚ is closed under addition, subtraction and multiplication, and under division whenever the divisor is not zero.
  • Between any two distinct rationals there is always another one, for example their average (a + b)/2 — this property is density.
  • √2 is irrational, proved by Hippasus by contradiction: assume p/q in lowest terms, derive that both p and q are even — a contradiction.
  • Every rational's decimal expansion terminates or repeats in a cyclic block; every irrational's decimal is non-terminating and non-repeating.
  • A fraction p/q in lowest terms terminates exactly when the prime factors of q are only 2s, only 5s, or both.
  • Uniting ℚ with the irrational numbers fills every gap on the number line, giving the real numbers ℝ.
  • Key idea: every real number is either rational (terminating or repeating decimal) or irrational (non-terminating, non-repeating decimal), and together they fill the number line with no gaps left over.
The core insight

The real number line ℝ is built by uniting the rational numbers ℚ, which fill it densely but leave gaps, with the irrational numbers, which fill precisely those gaps.

What this chapter covers

This chapter tells the story of how the number system grew, layer by layer, to meet human need, and then teaches you to work precisely within each layer.

  • The historical arc. Tally marks give natural numbers; Brahmagupta's work in India gives zero and negative numbers, producing the integers.
  • Rational numbers ℚ. Their definition as p/q, the rules of equality and arithmetic, closure, and density on the number line.
  • Locating numbers exactly. Placing any rational number, and even irrational lengths such as √2, at an exact point using ruler-and-compass construction.
  • Irrational numbers. What they are, why √2 cannot be a fraction (proof by contradiction), and why π needs an infinite series.
  • Decimal expansions. Why rational decimals terminate or repeat, how to predict which without long division, and how to reverse a repeating decimal back to p/q.
  • The complete real number line ℝ, formed by uniting the rational and irrational numbers, and a glimpse of what lies beyond it.

The core ideas

From counting to zero: the birth of integers

The natural numbers ℕ = {1, 2, 3, 4, …} are the numbers you count with; they came from the physical act of one-to-one correspondence, matching a pebble to a cow, a notch to a day. For centuries no symbol existed for "nothing." Brahmagupta, in his 628 CE treatise the Brāhmasphuṭasiddhānta, defined zero explicitly as the result of subtracting a number from itself, and gave it working rules of arithmetic.

a+0=a,a−0=a,a×0=0.a + 0 = a, \qquad a - 0 = a, \qquad a \times 0 = 0.

where: aa stands for any number. These three rules look obvious today only because Brahmagupta made zero a genuine number rather than a placeholder or a blank. Brahmagupta then asked what happens when a smaller number is subtracted from a larger one, and answered by grounding the question in commerce: he called positive numbers dhana (fortunes) and negative numbers ṛiṇa (debts). Combining the positive whole numbers, their negative counterparts, and zero gives the integers, written ℤ (from the German Zahlen, numbers). Brahmagupta's rules for combining fortunes and debts are exactly the sign rules used today:

(−a)+(−b)=−(a+b),(−a)×b=−(ab),(−a)×(−b)=ab.(-a) + (-b) = -(a+b), \qquad (-a) \times b = -(ab), \qquad (-a) \times (-b) = ab.

where: a,ba, b are positive numbers, so −a-a and −b-b represent debts. The last rule — a debt times a debt is a fortune — is the one students find hardest to accept. Brahmagupta's own reasoning was economic: if someone removes four debts of ₹3 each from your account, you become ₹12 richer, so (−3)×(−4)=+12(-3) \times (-4) = +12. Removing a negative action is a positive outcome.

Figure
A horizontal integer number line from negative five to positive five with the zero point marked as shunya in the centre, the region to the right of zero labelled fortunes or dhana in green and the region to the left labelled debts or rina in red, with an arrow under each region showing the direction of increase
Brahmagupta's number line — debts to the left, fortunes to the right -5 -4 -3 -2 -1 0 1 2 3 4 5 Shunya (zero) Debts (Rina) Fortunes (Dhana)

Rational numbers: definition, equality and closure

A rational number is any number that can be written as pq\dfrac{p}{q}, with p,qp, q integers and q≠0q \neq 0. The set is denoted ℚ (for quotient).

Q={pq  :  p,q∈Z, q≠0}.\mathbb{Q} = \left\{ \frac{p}{q} \;:\; p, q \in \mathbb{Z},\ q \neq 0 \right\}.

where: pp is the numerator and qq is the denominator; every natural number and every integer is also rational, since 5=515 = \dfrac{5}{1}, so ℕ ⊂ ℤ ⊂ ℚ. A single rational number has infinitely many equivalent fraction names — 23=46=1015=⋯\dfrac{2}{3} = \dfrac{4}{6} = \dfrac{10}{15} = \cdots — so we need a rule to check whether two of them represent the same value:

ab=cd  ⟺  ad=bc.\frac{a}{b} = \frac{c}{d} \iff ad = bc.

where: cross-multiplying and comparing adad and bcbc decides equality without a common denominator. By convention, "the rational number pq\dfrac{p}{q}" takes pp and qq co-prime (no common factor other than 1) with q>0q > 0, so each rational number has exactly one simplest representative. Brahmagupta also fixed the arithmetic of fractions, still taught exactly as he stated it:

ab+cd=ad+bcbd,ab×cd=acbd,ab÷cd=ab×dc  (c≠0).\frac{a}{b} + \frac{c}{d} = \frac{ad + bc}{bd}, \qquad \frac{a}{b} \times \frac{c}{d} = \frac{ac}{bd}, \qquad \frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \times \frac{d}{c} \ \ (c \neq 0).

where: the addition rule works for any denominators, because ab\dfrac{a}{b} and cd\dfrac{c}{d} are first rewritten over the common denominator bdbd. Under these rules ℚ is closed under addition, subtraction, multiplication, and division whenever the divisor is not zero: combining two rationals this way always produces another rational.

Locating rationals and the density of ℚ

To place pq\dfrac{p}{q} on the number line, divide the unit interval between two consecutive integers into qq equal parts, then count pp of those parts from 0 (rightward if positive, leftward if negative). The figure below marks 34\dfrac{3}{4} and 94=214\dfrac{9}{4} = 2\dfrac{1}{4} this way.

Figure
A number line from zero to three subdivided into quarters, with the point three quarters marked between zero and one and the point nine quarters marked between two and three, each shown as a red dot with a dashed guide line down to the axis
Locating 3/4 and 9/4 by dividing each unit into four equal parts 0 1 2 3 3/4 9/4 Each unit interval is split into 4 equal parts; count that many parts from 0.

The absolute value of a rational number xx, written ∣x∣|x|, is its distance from 0 on the number line:

∣x∣={x,x≥0−x,x<0.|x| = \begin{cases} x, & x \geq 0 \\ -x, & x < 0. \end{cases}

where: ∣x∣|x| is always non-negative. More generally, the distance between any two rational numbers aa and bb on the line is ∣a−b∣|a - b|. Rational numbers are dense: between any two distinct rationals there is always another one, and therefore infinitely many. The simplest proof of this uses their average.

a<a+b2<bwhenever a<b.a < \frac{a+b}{2} < b \qquad \text{whenever } a < b.

where: a+b2\dfrac{a+b}{2} is itself a ratio of integers whenever aa and bb are, so it is automatically rational, and it sits exactly halfway between aa and bb, strictly inside the interval.

Irrational numbers and the real number line

Not every length on the number line is a fraction. Consider a square of side 1 unit; by the Baudhāyana–Pythagoras theorem its diagonal dd satisfies

d2=12+12=2  ⟹  d=2.d^2 = 1^2 + 1^2 = 2 \quad \implies \quad d = \sqrt{2}.

where: dd is the diagonal's length. Hippasus, of the Pythagorean school, proved around 400 BCE that 2\sqrt{2} cannot be written as any fraction p/qp/q — the first derivation below reconstructs his argument in full. Numbers like 2\sqrt{2}, 3\sqrt{3} and π\pi that cannot be expressed as a ratio of integers are called irrational numbers. Remarkably, an irrational length such as 2\sqrt{2} can still be constructed exactly with ruler and compass and marked precisely on the number line — geometry reaches a point that arithmetic-by-fractions cannot name. The circle constant π\pi is irrational too (proved by Johann Lambert in 1761); no single fraction equals it exactly — Āryabhaṭa's famous 39271250=3.1416\dfrac{3927}{1250} = 3.1416 was only an asanna (approximation). Centuries later, Mādhava of Sangamagrama found an infinite sum of fractions that closes in on π\pi exactly:

π=4(1−13+15−17+⋯ ).\pi = 4\left(1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots\right).

where: each added term nudges the running total closer to π\pi's true value; no finite number of terms ever reaches it exactly, which is precisely why π\pi needs an infinite series rather than a fraction. Uniting all rational numbers with all irrational numbers fills every remaining gap on the number line and produces the real numbers, written ℝ. Every measurable length, temperature or quantity corresponds to exactly one point on this line.

Figure
Three nested rounded rectangles representing sets of numbers, the innermost labelled natural numbers, the next labelled integers, the next labelled rational numbers, and outside all of them a larger rectangle labelled real numbers that also contains a separate patch labelled irrational numbers not overlapping the rational rectangle
How the number sets nest inside one another Real numbers (R) Rational numbers (Q) Integers (Z) Natural numbers (N) 1, 2, 3, … …, -2, -1, 0 also included spacer Irrational numbers root 2, pi, root 3 fractions like 3/4, -5/6
Derivation AProof that the square root of 2 is irrational

The goal is to show, with pure logic and no measurement, that no fraction p/q can ever equal 2\sqrt{2} exactly — a fact first established by Hippasus using proof by contradiction, where we deliberately assume the opposite of what we want to prove and show the assumption collapses. The subtlety students most often miss is why insisting p/q be in lowest terms (no common factor between p and q) is essential — it is exactly this assumption that eventually breaks.

Step 1. Assume, for the sake of contradiction, that 2\sqrt{2} is rational. Then it can be written as 2=pq\sqrt{2} = \dfrac{p}{q} where pp and qq are integers, q≠0q \neq 0, and the fraction is in its simplest form — meaning pp and qq share no common factor other than 1, that is, they are co-prime.

Step 2. Square both sides of the equation to remove the square root: 2=p2q22 = \dfrac{p^2}{q^2}.

Step 3. Multiply both sides by q2q^2 to clear the denominator: 2q2=p22q^2 = p^2.

Step 4. Examine what this says about pp. Since p2=2q2p^2 = 2q^2, p2p^2 is even. A basic fact about integers is that if a number's square is even, the number itself must be even (if pp were odd, p2p^2 would be odd too). So pp is even; write p=2kp = 2k for some integer kk.

Step 5. Substitute p=2kp = 2k back into the equation from Step 3: 2q2=(2k)2=4k22q^2 = (2k)^2 = 4k^2.

Step 6. Divide both sides by 2: q2=2k2q^2 = 2k^2.

Step 7. By exactly the same reasoning as Step 4, since q2q^2 equals 2 times the integer k2k^2, q2q^2 is even, and therefore qq itself must be even.

Step 8. Reach the contradiction. Step 4 showed pp is even and Step 7 showed qq is even, so both share the common factor 2 — contradicting Step 1's assumption that p,qp, q are co-prime. Since every step of algebra was valid, the fault lies in the original assumption: 2\sqrt{2} cannot be written as a fraction, so it is irrational. The same eight steps, with 2 replaced by 3, 5, 7 or 10, prove 3\sqrt{3}, 5\sqrt{5}, 7\sqrt{7} and 10\sqrt{10} irrational too — the argument only needs "if nn divides p2p^2 then nn divides pp," true whenever nn is prime.

Go deeper · Derivation B · 1 minMethod for converting a repeating decimal into the form p over q
Derivation BMethod for converting a repeating decimal into the form p over q

The goal is a reliable algebraic procedure — not guesswork — for turning any repeating decimal, however long its repeating block, back into an exact fraction p/q. The core trick is to multiply the decimal by a power of 10 large enough to shift one full repeating block across the decimal point, then subtract the original equation from the shifted one so the infinitely repeating tail cancels completely, leaving an ordinary linear equation in one unknown.

Step 1. Set up the unknown. Let xx equal the repeating decimal. In a pure repeating decimal such as x=0.6‾=0.666…x = 0.\overline{6} = 0.666\ldots, the repeating block starts immediately after the decimal point. In a general repeating decimal such as x=0.45‾=0.4555…x = 0.4\overline{5} = 0.4555\ldots, some non-repeating digits appear first, then the repeating block begins.

Step 2. Multiply to align blocks. If the decimal is pure repeating with nn repeating digits, multiply by 10n10^n once. If it is a general repeating decimal with mm non-repeating digits followed by an nn-digit repeating block, multiply by 10m10^m first to push the non-repeating part in front of the decimal point, then by a further 10n10^n to slide one complete repeating block across the point too. For x=0.45‾x = 0.4\overline{5}: multiplying by 101=1010^1 = 10 gives 10x=4.5‾10x = 4.\overline{5}, and multiplying that by 10110^1 again gives 100x=45.5‾100x = 45.\overline{5}.

Step 3. Subtract to cancel the infinite tail. Both 10x=4.555…10x = 4.555\ldots and 100x=45.555…100x = 45.555\ldots share the same infinite string of 5s after the decimal point, so subtracting makes that tail vanish: 100x−10x=45.555…−4.555…=41100x - 10x = 45.555\ldots - 4.555\ldots = 41, giving 90x=4190x = 41.

Step 4. Solve for xx: here x=4190x = \dfrac{41}{90}. Check by confirming the division regenerates the original decimal. The same procedure, with two repeating digits, converts 0.453‾0.4\overline{53} into a fraction: let x=0.453‾x = 0.4\overline{53}, so 10x=4.53‾10x = 4.\overline{53} and 1000x=453.53‾1000x = 453.\overline{53}; subtracting, 990x=449990x = 449, so x=449990x = \dfrac{449}{990}.

Worked examples

Board level - Converting a general repeating decimal into p over q

Convert 2.453‾2.4\overline{53} (that is, 2.4535353…2.4535353\ldots, where the digits 5 and 3 repeat) into the form pq\dfrac{p}{q}.

Step 1. Let x=2.453‾x = 2.4\overline{53}. The non-repeating part after the decimal point is "4" (1 digit), and the repeating block is "53" (2 digits).

Step 2. Multiply by 101=1010^1 = 10 to move the non-repeating digit before the decimal point: 10x=24.53‾10x = 24.\overline{53}.

Step 3. Multiply that result by 102=10010^2 = 100 to slide one full repeating block across as well: 1000x=2453.53‾1000x = 2453.\overline{53}.

Step 4. Subtract the Step 2 equation from the Step 3 equation, so the infinite tail cancels: 1000x−10x=2453.5353…−24.5353…=24291000x - 10x = 2453.5353\ldots - 24.5353\ldots = 2429. Hence 990x=2429990x = 2429, so x=2429990x = \dfrac{2429}{990}. Checking, gcd⁡(2429,990)=1\gcd(2429, 990) = 1, so the fraction is already in lowest terms. 2.453‾=24299902.4\overline{53} = \dfrac{2429}{990}.

Board level - Applying Brahmagupta's rules for integers

Using Brahmagupta's laws for fortunes and debts, evaluate: (i) (−12)×5(-12) \times 5, (ii) (−8)×(−7)(-8) \times (-7), (iii) 0−(−14)0 - (-14), and (iv) (−20)÷4(-20) \div 4.

Step 1. For (i), a debt times a fortune is a debt: (−12)×5=−60(-12) \times 5 = -60.

Step 2. For (ii), a debt times a debt is a fortune: (−8)×(−7)=56(-8) \times (-7) = 56.

Step 3. For (iii), subtracting a debt equals adding the corresponding fortune (removing a debt of 14 makes you 14 richer): 0−(−14)=140 - (-14) = 14.

Step 4. For (iv), a debt divided by a fortune is a debt: (−20)÷4=−5(-20) \div 4 = -5. Answers: (i) −60-60, (ii) 5656, (iii) 1414, (iv) −5-5.

Higher-order thinking (HOTS / olympiad-style) - Proving the average always lies strictly between

Let aa and bb be two distinct rational numbers with a<ba < b. Prove rigorously, using algebra rather than a picture, that their average a+b2\dfrac{a+b}{2} is a rational number lying strictly between aa and bb. Then explain how this single fact guarantees that infinitely many rational numbers exist between any two rationals, however close together they are.

Step 1. Show rationality first. Since a=p1q1a = \dfrac{p_1}{q_1} and b=p2q2b = \dfrac{p_2}{q_2} for integers p1,q1,p2,q2p_1, q_1, p_2, q_2 with q1,q2≠0q_1, q_2 \neq 0, their sum a+b=p1q2+p2q1q1q2a + b = \dfrac{p_1 q_2 + p_2 q_1}{q_1 q_2} is a ratio of integers, and dividing that sum by the integer 2 keeps it one. So a+b2\dfrac{a+b}{2} is rational.

Step 2. Prove a<a+b2a < \dfrac{a+b}{2}. Start from the given a<ba < b. Add aa to both sides: a+a<a+ba + a < a + b, that is, 2a<a+b2a < a + b. Divide both sides by the positive number 2 (which preserves the inequality direction): a<a+b2a < \dfrac{a+b}{2}.

Step 3. Prove a+b2<b\dfrac{a+b}{2} < b by a mirror argument. Starting again from a<ba < b, add bb to both sides: a+b<b+b=2ba + b < b + b = 2b. Divide both sides by 2: a+b2<b\dfrac{a+b}{2} < b. Combining Steps 2 and 3 gives a<a+b2<ba < \dfrac{a+b}{2} < b, exactly as required.

Step 4. Extend to infinitely many. Let m1=a+b2m_1 = \dfrac{a+b}{2}; by Steps 1 to 3 it is a new rational strictly between aa and bb. Apply the same argument to the pair a,m1a, m_1 to get m2=a+m12m_2 = \dfrac{a+m_1}{2}, strictly between aa and m1m_1, hence between aa and bb too. Repeating endlessly, each new average sits strictly closer to aa than the last, so no value ever repeats — this generates an infinite list of distinct rationals between aa and bb. The average of two distinct rationals is a new rational strictly between them, and repeating the averaging process forever produces infinitely many such numbers. Timing note: in a board exam, budget about 5 minutes for Steps 1 to 3 (the core inequality proof) and only a brief sentence for Step 4 — full HOTS or olympiad questions may ask you to write out the extension argument in detail, which takes closer to 8 to 10 minutes to justify carefully.

Common traps

  • Writing 2\sqrt{2} as a "long decimal fraction" and calling it exact — any finite decimal is a terminating (hence rational) approximation, never the irrational value itself.
  • Believing (−3)×(−4)=−12(-3) \times (-4) = -12 by habit — Brahmagupta's rule is that a debt removed is a fortune gained, so two negatives multiply to a positive.
  • Forgetting the condition q≠0q \neq 0 in p/qp/q and treating 50\dfrac{5}{0} as some special number rather than undefined.
  • Assuming every non-terminating decimal is irrational — a non-terminating but repeating decimal such as 0.3‾0.\overline{3} is perfectly rational (=13= \dfrac{1}{3}); only non-terminating and non-repeating decimals are irrational.
  • Predicting a terminating decimal by inspecting the numerator instead of the fully reduced denominator — 720\dfrac{7}{20} terminates because 20=22×520 = 2^2 \times 5, not because of anything about 7.
  • Multiplying by the wrong power of 10 when converting a general repeating decimal — the non-repeating shift and the repeating-block shift are two separate multiplications, not one combined guess.
  • Thinking 0.9‾0.\overline{9} is "just below" 1 — algebraically it is exactly equal to 1, as 10x−x=9⇒x=110x - x = 9 \Rightarrow x = 1 shows.
  • Losing the co-prime condition when comparing fractions — 24\dfrac{2}{4} and 36\dfrac{3}{6} look "different" only until you notice both reduce to 12\dfrac{1}{2}.

You should be able to…

  • State the definitions of ℕ, ℤ, ℚ and irrational numbers, and place any given number into the smallest set that contains it.
  • Apply Brahmagupta's rules for zero and for fortunes and debts, including why a debt times a debt is a fortune.
  • Test whether two fractions are equal using ad=bcad = bc, and simplify a fraction to its co-prime, lowest-terms form.
  • Add, subtract, multiply and divide rational numbers, and explain why ℚ is closed under these operations (except division by zero).
  • Locate any rational number exactly on the number line by subdividing the unit interval into qq equal parts.
  • Compute the absolute value of a rational number and the distance ∣a−b∣|a-b| between two rationals on the line.
  • Prove that the average of two distinct rational numbers lies strictly between them, and use this to argue ℚ is dense.
  • Reproduce, step by step, the proof by contradiction that 2\sqrt{2} is irrational, and adapt it to 3\sqrt{3}, 5\sqrt{5} or 7\sqrt{7}.
  • Predict, from the prime factors of a reduced denominator alone, whether a decimal expansion terminates or repeats.
  • Convert any terminating or repeating decimal (pure or general) back into the exact form p/qp/q using multiply-and-subtract.

Ask the tutor: if you are stuck on proving a number like √3 or √5 is irrational, or want another worked example of converting a tricky repeating decimal into p/q, ask the tutor to walk through it with you step by step.

Why can a negative number times a negative number be positive when both numbers themselves are less than zero?

Think of it the way Brahmagupta did, through debts rather than abstract signs. A negative number represents a debt you owe. Multiplying by a positive number repeats an action — three debts of ₹4 leaves you ₹12 poorer, so (−4)×3=−12(-4) \times 3 = -12. Multiplying by a negative number means removing that action instead. If someone takes away four of your debts, each worth ₹3, you are suddenly ₹12 richer, even though nothing was "added." That is exactly why (−3)×(−4)=+12(-3) \times (-4) = +12: removing debts is a gain, not a loss — not an arbitrary convention, but a direct consequence of treating money sensibly.

Is every square root irrational? What about numbers like the square root of 4?

No — only the square roots of numbers that are not perfect squares are irrational. 4=2\sqrt{4} = 2 is a whole number, and 9=3\sqrt{9} = 3, 16=4\sqrt{16} = 4 are all rational because 4, 9 and 16 are perfect squares. The proof by contradiction used for 2\sqrt{2} specifically breaks down here: 4=2/1\sqrt{4} = 2/1 is already genuinely in the form p/qp/q with q=1q = 1, so no contradiction ever arises. The irrationality proof only "bites" when the number under the root is not a perfect square.

How can 0.999... repeating forever actually equal exactly 1, and not just something extremely close to 1?

This surprises almost everyone the first time, but it is a genuine equality, not an approximation. Let x=0.9‾x = 0.\overline{9}. Multiplying both sides by 10 gives 10x=9.9‾10x = 9.\overline{9}. Subtracting the first equation from the second cancels the infinite tail of 9s completely: 10x−x=910x - x = 9, so 9x=99x = 9, giving x=1x = 1. There is no number strictly between 0.9‾0.\overline{9} and 1 — and since the rationals are dense, if two distinct numbers existed, a third rational would have to fit between them. No such number exists, which forces 0.9‾0.\overline{9} and 1 to be the very same point on the number line, just written differently.

When I do long division to convert a fraction to a decimal, how do I know in advance whether it will terminate or repeat, without doing the division?

Reduce the fraction to lowest terms first, so numerator and denominator share no common factor. Then look only at the prime factorisation of the denominator. If the only prime factors present are 2s, only 5s, or a combination of both, the decimal terminates — because you can always multiply numerator and denominator by whatever is needed to turn the denominator into a power of 10. If the denominator has any other prime factor, such as 3, 7, 11 or 13, the decimal is guaranteed to repeat forever, since no multiplication can ever turn that prime into a factor of 10. For example, 720\dfrac{7}{20} terminates since 20=22×520 = 2^2 \times 5, but 17\dfrac{1}{7} repeats since 7 is not a factor of any power of 10.

Before this

Where this leads