[This post is targeted at a Level 2 student.]

When we first started to learn how to count, we learned the numbers $0, 1, 2, 3, \ldots$, which are referred to as the natural numbers, and often denoted by $\mathbb{N}$. Then, we got around to learning about subtraction, which led to the negative numbers $-1, -2, -3, \ldots$ Together with the natural numbers, these are called integers or whole numbers, and denoted by $\mathbb{Z}$. Eventually, we learned about division, and bravely explored fractions. The rational numbers are numbers of the form $\frac {a}{b}$, where $a$ and $b$ are integers and $b \neq 0$. They are denoted by $\mathbb{Q}$. We also learned about the real numbers, denoted by $\mathbb{R}$, which are often represented by the number line.

Formally, the rational numbers are defined as an equivalence class of all ordered pairs $(a, b)$, where $a$ is an integer and $b$ is a non-zero integer, and the equivalence relation $(a_1, b_1) \equiv (a_2, b_2)$ if $a_1 b_2 = a_2 b_1$. We have previously seen another equivalence relation in Modulo Arithmetic. Similarly, we have to show that this equivalence relation is well defined, and that we can add and multiply rational numbers. This will be set aside (or left for the adventurous reader), and we will believe that rational numbers follow the rules of arithmetic. Moreover, we know that every rational number can be expressed in its simplest form, which occurs when $\gcd(a,b)=1$.

How do we know that there is a difference between the set of real numbers and the set of rational numbers? Certainly, every rational number is a real number, but is every real number also a rational number? Below, we will show that $\sqrt{2}$ is not rational, through the classic proof by contradiction.

Proof: Suppose that $\sqrt{2}$ is rational. This means that there exists integers $a$ and $b$ such that $\sqrt{2} = \frac {a}{b}$ and $\gcd(a, b) =1$. Squaring both sides and cross multiplying yields $2b^2 = a^2$. Then, by Parity, since the LHS is even, so is the RHS, and thus $a$ is even. Set $a=2a'$, where $a'$ is an integer, and substitute this into the equation. This gives $2b^2 = a^2 = (2a')^2 = 4a'^2 \Rightarrow b^2 = 2a'^2$. Repeating the above argument, since the RHS is even, so is the LHS, and thus $b$ is even. Set $b=2b'$, where $b'$ is an integer. However, this means that $\gcd(a,b) = \gcd(2a', 2b') = 2 \gcd(a', b')\geq 2$, which contradicts the initial assumption that $\gcd(a,b)=1$.

In fact, using the same argument, we can actually show that $\sqrt{D}$ is not rational if $D$ is not a perfect square. This gives us a lot of numbers that are real numbers, but not rational numbers, and they are called irrational numbers.

This post is continued in Rational Numbers II.

### Worked Examples

1. Show that the sum, difference, and product of 2 rational numbers is also rational.

Solution: Let the 2 rational numbers be $\frac {a}{b}$ and $\frac {c}{d}$. Then $\frac {a}{b} + \frac {c}{d} = \frac {ad+bc}{bd}$, where $ad+bc$ is an integer, and $bd$ is a non-zero integer (since $b$ and $d$ are non-zero integers). Similarly, $\frac {a}{b} - \frac {c}{d} = \frac {ad-bc}{bd}$, where $ad-bc$ is an integer, and $bd$ is a non-zero integer. Similarly, $\frac {a}{b} \times \frac {c}{d} = \frac {ac}{bd}$, where $ac$ is an integer, and $bd$ is a non-zero integer.

Note: The division of 2 rational numbers need not be rational. [Pop Quiz: Why not?]

2. Determine the value of $0.\overline{238095}$. The line over $238095$ denotes that it is a repeating decimal, of the form $0.238095238095238095\ldots$.

Solution. Let $S = 0.\overline{238095}$, then we have

\begin{aligned} - S & = -000000.\overline{238095} \\ 1000000S & = 238095.\overline{238095}\\ \hline \\ 999999S & = 238095& \\ \end{aligned}

Hence, $S = \frac {238095}{999999} = \frac {5}{21}$.

3. Show that $\sqrt{2} + \sqrt{3}$ is not rational.

Solution: Proof by contradiction. Suppose that $\sqrt{2}+\sqrt{3}$ is rational, then since $(3-2) \times \frac {1}{(\sqrt{2} + \sqrt{3})} = \sqrt{3}-\sqrt{2}$, we know from Worked Example 1 that $\sqrt{3} - \sqrt{2}$ is also rational. Since $(\sqrt{3} + \sqrt{2}) - (\sqrt{3}-\sqrt{2}) = 2 \sqrt{2}$, by Worked Example 1, $2 \sqrt{2}$ is also rational. Thus, $2 \sqrt{2} \times \frac {1}{2} = \sqrt{2}$ is also rational, which is a contradiction.

4. Show that, if $x$ is a positive rational such that $x^2 + x$ is an integer then $x$ must be an integer.

Suppose $x = \frac {a}{b}$ with $\gcd(a,b)=1$ satisfies $x^2 + x = n$, where $n$ is an integer, then $a^2 = b^2 n - ba = b(bn-a)$. Since $\gcd(a,b)=1$, then $bn-a$ is never 0, and so any prime $p$ that divides $b$ must also divide $a^2$ and thus must divide $a$. But since $\gcd(a,b)=1$, there are no primes that divide both $a$ and $b$. Hence, $b=1$, and thus $x=a$ is an integer.

### Test Yourself

1. Show that any repeating decimal is rational.

2. How many integers $n$ are there such that $\sqrt{n} +\sqrt{n+100}$ is rational? Hint: Show that $\sqrt{n}$ and $\sqrt{n+100}$ both have to be rational.

3. Show that $\sqrt{2} + \sqrt{3} + \sqrt{5}$ is not rational.

4. (*) (Rational Approximation Theorem) Show that if we are given any irrational number $x$ and a positive integer $n$, then there exists a rational number $\frac {a}{b}$ with $1 \leq b \leq n$ such that $\left| x - \frac {a}{b} \right| < \frac {1}{nb}$. Hint: Pigeonhole Principle.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 89, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://blog.brilliant.org/2012/09/18/rational-numbers/", "fetch_time": 1371714923000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2013-20/segments/1368711005723/warc/CC-MAIN-20130516133005-00015-ip-10-60-113-184.ec2.internal.warc.gz", "warc_record_offset": 27262511, "warc_record_length": 18537, "token_count": 1659, "char_count": 5388, "score": 4.75, "int_score": 5, "crawl": "CC-MAIN-2013-20", "snapshot_type": "latest", "language": "en", "language_score": 0.9516848921775818, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00056-of-00064.parquet"}