]> Exercise 1.2

Exercise 1.2

Is countable?

Solution:

Each rational number r in is a numerator in divided by a denominator in . It is characterized then by the pair ( a , b ) such that r = a b . If we look at all pairs ( a , b ) for a in and b in , we will actually get every r over and over again, as a b , 2 a 2 b , 3 a 3 b ,

Therefore if we can list all the pairs ( a , b ) for a in and b in we can get a list of the elements of by throwing away duplicates on this list.

Imagine then that we have a vertical column for each b in and that column consists of a list of the elements of (as in Exercise 1.1). We can list the resulting pairs by going up every diagonal as in the illustration below. This will give a list of every pair ( a , b ) for a in and b in .

You run through the elements of much faster than you do the elements of but again nobody cares about this fact.

To be explicit, we order the elements n of our array in increasing order of a + b and for fixed a + b in increasing order of i .

Thus the first few ratios in this order are

1 1 , 1 2 , 2 1 , 1 3 , 2 2 , 3 1 , 1 4 , 2 3 , 3 2 , 4 1 ,

The first of these has a + b = 2 then there are two with a + b = 3 , three with a + b = 4 , and so on.

The ratio a b will then appear as the ratio in the position ( a + b 1 ) ( a + b 2 ) 2 + a on the list.

You can enter any ratio below and see where it occurs on the list and vice versa.

figure