Why rational numbers are dense?

So the books says that rational numbers are dense, meaning that for every two rational numbers there is another rational number in between them. Is it actually true? Why? It feels to me that there exists two rational numbers that do not have any other rational number in between...maybe I wrong but I can't understand why. I also cannot come up with counterexample...

• It is a well-known result and you can just google-it to see it. Now, for your particular case, let $a,b\in\mathbb Q,$ with $a<b$ and take $c:=\frac{a+b}{2}.$
– CIJ
Oct 29, 2015 at 4:22
• Dense means the closure of the rationals is $\mathbb{R}$ Oct 29, 2015 at 4:25
• @graydad But it also applies to orderings ("$\mathbb{Q}$ is the unique countable dense linear ordering without endpoints, up to isomorphism"), and I assume that meaning is in play here. But, true, I raised my eyebrow too on reading the question – the title and the question seem to have the topological sense in mind, $\mathbb{Q}$ being dense in $\mathbb{R}$ rather than being "densely ordered". Oct 29, 2015 at 4:27
• @BrianO fair enough, I was thinking of this from a strictly topological viewpoint Oct 29, 2015 at 4:28
• @AndréNicolas True, but note that OP also has problems even conceiving of the rationals as densely ordered. Oct 29, 2015 at 4:31

given any two rational numbers $\frac{p_1}{q_1},\frac{p_2}{q_2}$, we can take the average of the two, $m$ = $\frac{\frac{p_1}{q_1}+\frac{p_2}{q_2}}{2} = \frac{p_1q_2 + p_2q_1}{2q_1 q_2}$ which is rational too. Thus proving there are always a rational number between any two.

• Why do we know the average is rational... Oct 29, 2015 at 20:37
• The average is $m$ = $\frac{p_1q_2 + p_2q_1}{2q_1 q_2}$ right? We know that $p_1,p_2,q_1,q_2$ are all integers, so $p_1q_2 + p_2q_1$ and $2q_1 q_2$ are integers. thus m is rational Oct 29, 2015 at 20:48
• does that make sense? Oct 29, 2015 at 20:50
• Yes, it does. Thank you :) Nov 3, 2015 at 18:09

The other answers address why, between every two rationals, there's a third. However, this isn't actually the same as density (which your book may be using in an unusual way): density says that every real number has rational numbers "arbitrarily close" to it. Formally, "the rationals are dense in the reals" is the statement "For every real $r$, and every positive real $\epsilon$, there is a rational $q$ such that $\vert q-r\vert<\epsilon$ - that is, $q$ is within $\epsilon$ of $r$."

Here's why this is true:

• Fix a real $r$ and a distance (=positive real) $\epsilon$. There's some natural number $n$ such that $10^{-n}<\epsilon$. (Why?)

• So look at $r$. Since $r$ is a real, it has a decimal expansion $r= z.a_1a_2a_3 . . .$ (where "$z$" represents the part before the decimal point, and $a_i$ are digits). Now, this decimal expansion may not be unique - e.g. $0.99999 . . . =1.0000 . . .$ - but there is some decimal expansion.

• Now look at the number $q=z.a_1a_2a_3 . . . a_n$, that is, the number you get by cutting of $r$ at the $n$th decimal place. $q$ is rational (why?), and $\vert q-r\vert<10^n$ (why?), so - since $10^n<\epsilon$ - we are done.

• Yeah it should be between two real numbers. The same problem in Apostol book Vol 1 I-3.12 Ex 6. For your 'Why' part, we need Archimedean property Jun 3, 2021 at 15:28

You'll search for a long time for a counterexample.

If $\dfrac p q, \dfrac r s$ are distinct rationals, then their average: $$\frac {ps + qr} {2qs}$$ is a rational between the two.

• @hermes It is not the definition of a dense set. OP's title and the 1st line of his question suggest that he's interested in denseness of the rationals ..."in the reals", you expect, in the topological sense.. But no, the reals are never mentioned, and the rest of the question shows that OP isn't even convinced that the rationals are densely ordered. I tried to address those more basic concerns. Oct 29, 2015 at 5:04
• Well, it shows Q is dense in Q... but, in general, no. That is not the definition of dense. But it does answer the OP's question. If between any two reals there is a rational, than that is equivalent to Q being dense in R, although it isn't the definition. Oct 29, 2015 at 5:08
• @fleablood All I did was point out why $\mathbb{Q}$ is densely ordered, no talk of topology. Anyone coming here looking for an answer to the title will be disappointed :) Oct 29, 2015 at 5:11
• Yes, you are correct. "Densely ordered" (in itself) is not as frequently used as "dense in X" (every set is dense in itself, isn't it?) but it is used. Oct 29, 2015 at 5:18
• @fleablood Of course it's used. Less frequently than "dense" in the otpological sense just because, it's probably safe to say, people talk more about analysis than about order theory. Usage example I cited above: "$\mathbb{Q}$ is the unique countable dense linear ordering without endpoints, up to isomorphism". Oct 29, 2015 at 5:33