16

Can any one tell me how to prove that the set of rational numbers are countable? Prove give me a prove?

Thanks.

LoveMath
  • 769

3 Answers3

29

Map each rational $\frac{a}{b}$ into the integer $2^a 3^b$. This shows that the number of rationals is at most the number of integers.

If you want to handle the negative rationals, map the sign ($-1$, $0$, or $+1$) to $5^{\mathrm{sign}+1}$ and stick it on the end, so the mapping is $\mathrm{sign} \times \frac{a}{b} \to 2^a \, 3^b \,5^{\mathrm{sign}+1}$.

If you find this troubling, that's OK. You are not the only one.

wchargin
  • 1,802
marty cohen
  • 107,799
  • How would you go about proving that $\mathbb{N}\leftrightarrow{\text{integers in the form }2^a3^b5^{\text{sign} + 1}}$. Proving this is not trivial (at least for me.) – Nairit Jul 02 '17 at 04:08
  • hello, the function doesn’t have to be a bijection. We know that any infinite subset of the naturals (a sequence) has the same cardinality as the naturals. So you just have to find an injective function of Q into N, since Q is infinite. This one is injective because the decomposition of an integer in primes is unique. So each a/b (Irreducible) goes to a unique element in N and there you have it. – Sahdo Jul 07 '20 at 23:23
12

Here is another argument:

Consider the map $\varphi:\mathbb{Q}\rightarrow \mathbb{Z}\times\mathbb{N}$ which sends the rational number $\frac{a}{b}$ in lowest terms to the ordered pair $(a,b)$ where we take negative signs to always be in the numerator of the fraction. This map is an injection into a countably infinite set (the cartesian product of countable sets is countable), so therefore $\mathbb{Q}$ is at most countable. Since $\mathbb{Q}$ is not finite, it must be countably infinite.

Jared
  • 31,451
  • Well, I became confused. So what does mean "has the same cardinality as the natural numbers"? Does countable mean that we count them or mean anything else? – LoveMath Mar 17 '13 at 23:01
  • 1
    Two sets have the same cardinality if we can exhibit a bijection between them, i.e., a map that is one-to-one on the elements. Any set that can be put in one-to-one correspondence in this way with the natural numbers is called countable. In some sense, this means there is a way to label each element of the set with a distinct natural number, and all natural numbers label some element of the set. – Jared Mar 18 '13 at 00:33
5

For an explicit enumeration of positive rationals, you can use the Calkin-Wilf sequence: $$q_{i+1}= \frac{1}{ \lfloor q_i \rfloor +1 - \{q_i\} }, \ q_0=1.$$

More details can be found in Proofs from THE BOOK.

Seirios
  • 33,157