A while ago I bought a copy of Hardy’s “A Course of Pure Mathematics” for a fiver. I think I must’ve got it from Westwood Books1 in Sedbergh.

Anyway, my imagination has completely run dry for the moment, so I’ve decided to do some exercises from the book to pass some time. Maybe this could become a series of posts?

Hardy says in the preface,

This book has been designed primarily for the use of first year students at the Universities whose abilities reach or approach something like what is usually described as scholarship standard’.

I regard the book as being really elementary.

Nothing taxing, then. It occurs that I’m opening myself up to accusations of sloppy thinking and gross inaptitude at mathematics, but I suppose I’m better off knowing if that’s the case.

So here we go, Chapter 1, Exercise 1:

1. If $r$ and $s$ are rational numbers, then $r+s$, $r-s$, $rs$, and $\frac{r}{s}$ are rational numbers, unless in the last case $s = 0$ (when $\frac{r}{s}$ is of course meaningless)

As $r$ and $s$ are rational, let $r = \frac{a}{b}$, and $s = \frac{c}{d}$, $a,b,c,d \in \mathbb{N}$, $b,d \gt 0$. Then,

$r + s = \frac{a}{b} + \frac{c}{d} = \frac{ad}{bd} + \frac{cb}{bd} = \frac{ad+cb}{bd}.$

$ad+cb$ and $bd$ are integers, so $r+s$ is rational. Same idea for $r-s$.

$rs = \frac{a}{b} \cdot \frac{c}{d} = \frac{a}{b} \times c \div d = \frac{ac}{bd}.$

$ac$ and $bd$ are integers, so $rs$ is rational.

Now assume $c \gt 0$.

$\frac{r}{s} = r \div s = \frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \div c \times d = \frac{ad}{bc}.$

$ad$ and $bc$ are integers so $\frac{r}{s}$ is rational.

2. If $\lambda$, $m$ and $n$ are positive rational numbers, and $m \gt n$, then $\lambda(m^2-n^2)$, $2\lambda m n$, and $\lambda(m^2+n^2)$ are positive rational numbers. Hence show how to determine any number of right-angled triangles the lengths of all of whose sides are rational.

Using the facts from part 1, $m^2$ and $n^2$ are rational numbers, hence $m^2+n^2$ and $m^2-n^2$ are rational numbers, hence $\lambda(m^2-n^2)$, $2\lambda m n$, and $\lambda(m^2+n^2)$ are rational numbers. So I just need to show that they’re positive.

$m^2+n^2$ is positive plus positive, so positive. Hence, $\lambda(m^2+n^2)$ is positive times positive, so positive.

$\lambda m n$ is all positives multiplied together, so positive.

As $m \gt n$, $m^2 \gt n^2$. So $m^2 -n^2$ is positive, and hence $\lambda(m^2+n^2)$ is positive.

Now for the triangles. For any rational numbers $\lambda$, $m$ and $n$, construct a triangle with hypotenuse $\lambda(m^2+n^2)$ and one of the other sides $\lambda(m^2-n^2)$. I’ve just shown these are both rational. Now, the length $l$ of the other side is given by

\begin{align} l^2 = \left( \lambda(m^2+n^2) \right)^2 – \left( \lambda(m^2-n^2) \right)^2 &= \lambda^2(m^4+2m^2n^2+n^4) – \lambda^2(m^4 – 2m^2n^2 +n^4) \\ &= 4\lambda^2m^2n^2 = (2\lambda m n)^2. \end{align}

So $l = 2\lambda m n$, which I showed before to be a rational number.

I’m not sure why Hardy felt the need to include $\lambda$ here. I suppose to get across that you can scale the triangle by a rational factor and it’ll still have all sides rational.

3. Any terminated decimal represents a rational number whose denominator contains no factors other than $2$ or $5$. Conversely, any such rational number can be expressed, and in one way only, as a terminated decimal.

Just for kicks, let’s do an induction.

Inductive hypothesis: Let $x$ be a terminated decimal. If $x$ has a terminated decimal representation with $n$ digits after the point, $10^nx$ is an integer.

Base case: If $n = 0$, $x$ is already an integer.

Inductive step: Assume IH true for $n=k$. Now suppose we have an $x = a + 0.x_1x_2x_3 \dots x_{k+1}$, $a$ an integer. Then $10x = 10a + x_1.x_2x_3 \dots x_{k+1}$. Let $d = 10x – 10a$, so just the fractional part. $d$ has $k$ digits after the decimal place, so $10^kd$ is an integer by the IH.

Hence,

$10^{k+1}x = (10x) \cdot 10^k = (10a + d) \cdot 10^k = 10^{k+1}a +10^kd,$

which is an integer plus an integer, so an integer. So the induction holds for all $n \geq 0$.

So, if $x$ is a terminated decimal with $n$ digits after the decimal place, $x = \frac{10^nx}{10^n}$, where the numerator and denominator of the fraction are both integers, so $x$ is a rational number. The denominator is $10^n = (2 \times 5)^n$, so has no factors other than $2$ or $5$.

For the conversely…’  part, suppose we have a number $y = \frac{m}{2^a5^b}$, $a,b \geq 0$. Cancel twos and fives until the numerator doesn’t have two or five as a factor, to get $y = \frac{n}{2^c5^d}$, with $c,d \geq 0$.

If $c \gt d$, multiply top and bottom by $5^{c-d}$ to get $y = \frac{5^{c-d}n}{2^c5^c} = \frac{5^{c-d}n}{10^c}$. Get a decimal representation of $y$ by writing down $5^{c-d}n$ and shifting the decimal point $c$ places left.

Vice versa for $d \gt c$.

Can’t be bothered to think of some formatting for a lemma about the uniqueness of decimal representations, so: suppose two decimal representations of a number $x$ differ in the digit $k$ places to the right of the decimal point, and call those digits $x_k$ and $x_k’$. So $x = x + (x_k’) \cdot 10^{-k} – x_k \cdot 10^{-k}$.

So $(x_k’) \cdot 10^{-k} – x_k \cdot 10^{-k} = 0$, hence $x_k = x_k’$, a contradiction.

So a number has a unique decimal representation2.

4. The positive rational numbers may be arranged in the form of a simple series as follows:

$\frac{1}{2}, \frac{2}{1}, \frac{1}{2}, \frac{3}{1}, \frac{2}{2}, \frac{1}{3}, \frac{4}{1}, \frac{3}{2}, \frac{2}{3}, \frac{1}{4}, \dots$

Show that $\frac{p}{q}$ is the $\left[ \frac{1}{2}(p+q-1)(p+q-2)+q \right]$ th term of the series.

This series is obtained by laying out the fractions $\frac{p}{q}$ in a table, with $p$ increasing rightwards and $q$ increasing downwards, and reading off the top-right-to-bottom-left diagonals. Note that on the diagonals, $p+q$ is constant, because by moving left you decrease $p$ by 1, but moving down increases $q$ by 1. There are $p+q-1$ fractions in each diagonal.

So if we’ve got a fraction $\frac{p}{q}$, consider the square whose diagonal is the one containing our $\frac{p}{q}$. Its sides have length $p+q-1$, so its area is $(p+q-1)^2$.

Now take away the fractions lying on the diagonal, leaving $(p+q-1)^2 – (p+q-1) = (p+q-1)(p+q-2)$ fractions inside the square. The fractions in the top-left half appear in the series before $\frac{p}{q}$, and the ones in the bottom-right half appear after it. The top-left half contains $\frac{1}{2}(p+q-1)(p+q-2)$ fractions.

Finally, $\frac{p}{q}$ is the $q$th fraction encountered in its diagonal, because that diagonal starts at $\frac{p+q-1}{1}$, so in total $\frac{p}{q}$ is the $\left[ \frac{1}{2}(p+q-1)(p+q-2) + q \right]$th term in the series.

1. Westwood Books has a really good collection of maths books – one of the owners is an ex-mathematician, and he finds his way to be in just the right place when departments clear out their libraries. I found a book by the only other mathematising Perfect I know of at Westwood. Great place! []
2. strictly I’ve only proven at most one, but I don’t care about proving every number has at least one decimal representation []