Start with a bold claim, then build the machine that proves it. Pick any two real numbers a < b on the line. However close together you pick them — a metre apart, a millimetre apart, 10^{-100} apart — a rational number \tfrac{p}{q} always sits strictly inside the interval (a,\,b).
This is not a vague "densely-packed" intuition. It is a concrete construction. Given a and b, you can write down integers p and q with a < \tfrac{p}{q} < b. The recipe is short, mechanical, and only needs two ingredients you already met in Real Numbers — Properties: the Archimedean property and the division algorithm (the fact that every real number sits between two consecutive integers).
The widget below runs the recipe live. Drag the two endpoints. The rational appears in the middle, fully spelled out as a fraction. Then press Play and watch the endpoints squeeze together — the rational recomputes, its denominator explodes, but a rational always shows up. That is density in action.
The widget
Try a few things.
- Pull a and b far apart — say a = -1.5, b = 1.2. The gap is large; the widget returns a tiny denominator like q = 1, and a plain integer like p/q = 0 works.
- Pull them very close — say a = 0.999, b = 1.001. The gap is 0.002. The widget returns q = \lceil 1/0.002\rceil = 500, and pins down a rational like 1000/1000 = 1 (or the next one along). The fraction has a bigger denominator, but it still sits inside.
- Hit Play. The interval oscillates from wide to razor-thin and back. The green tick for p/q never disappears.
Why the construction works
The recipe has two steps, and each step leans on exactly one theorem.
Step 1: Pick the denominator. Given a < b, set
Why this works: the Archimedean property says that for any positive real \varepsilon = b - a, there exists a positive integer n with n \varepsilon > 1, or equivalently n > \tfrac{1}{\varepsilon}. The smallest such integer is \lceil 1/\varepsilon \rceil. So q(b - a) > 1, meaning the scaled interval (qa,\, qb) has length greater than 1.
Step 2: Pick the numerator. Inside any open interval of length greater than 1 on the real line, there is at least one integer. The smallest integer strictly greater than qa is
Why this works: every real number x satisfies \lfloor x\rfloor \le x < \lfloor x\rfloor + 1, so \lfloor qa\rfloor + 1 > qa. And since qb - qa > 1, you have \lfloor qa \rfloor + 1 \le qa + 1 < qb. So qa < p < qb.
Dividing by q > 0:
You have built a rational number strictly between a and b. The construction takes two arithmetic operations. It works for any a < b, and it is the exact recipe the widget runs.
What density really means
It is tempting to picture "dense" as "packed solid." That is not what density is. Density is a pairwise statement: for every pair a < b, there is a rational in (a, b). Individual rationals can still be isolated from a given irrational by a positive distance; density only promises that you cannot wall off any open interval from the rationals.
Two clean consequences follow immediately.
Between any two reals there are infinitely many rationals. Proof: given a < b, find a rational r_1 inside (a, b). Now (a, r_1) is itself an open interval, so it contains a rational r_2. Now (a, r_2) contains r_3. Iterate forever. You get an infinite decreasing sequence of distinct rationals, all inside (a, b).
You can approximate any real by rationals to any precision. Proof: given a real x and a target error \varepsilon > 0, apply density to the interval (x, x + \varepsilon). The rational inside that interval is within \varepsilon of x. This is why your calculator's decimal display — always a rational — can be made arbitrarily close to \sqrt{2} or \pi.
Irrationals are also dense — same proof, with a twist
The same argument, with one line changed, proves that the irrationals are dense in \mathbb{R} too.
Given a < b, apply the rational-density result to the shifted interval \big(a - \sqrt{2},\, b - \sqrt{2}\big). There is a rational r inside this interval:
Add \sqrt{2} back:
The number r + \sqrt{2} is irrational (a rational plus an irrational is always irrational — because if their sum were rational, subtracting the rational would make \sqrt{2} rational, contradicting its irrationality). So there is an irrational between a and b.
Why this trick works: density is a translation-invariant property. Shifting the interval, solving there, and shifting back is a common move in real analysis. You are reusing one theorem by changing coordinates.
So rationals and irrationals are both dense. Every open interval on the real line, no matter how thin, contains infinitely many of each type. The two populations are woven together at every scale. This is what the article Dense But Full of Holes is getting at with the "sieve" image: the rationals form an infinitely fine mesh, and the irrationals are the water between the wires.
What density does not say
One easy misconception to burn out of your head: density does not mean "the rationals fill the number line." There is no rational at the point \sqrt{2}; there is no rational at \pi; there is no rational at e. The real line still has uncountably many irrational points that no rational lands on. Density only says: however close to \sqrt{2} you zoom, a rational is nearby. It does not say a rational lands on \sqrt{2}.
That is why \mathbb{R} needs the extra property of completeness beyond density. Density gives you arbitrarily good rational approximations. Completeness guarantees that the limit of those approximations is itself a real number — the point they are closing in on, which may be irrational and therefore not rational itself. The two properties do different jobs.
One more viewing angle
Think of what the widget is doing when you drag a and b closer. The denominator q = \lceil 1/(b - a)\rceil grows without bound as b - a \to 0. The fraction p/q has a numerator and denominator that both blow up, but they do so in a coordinated way: their ratio stays pinned inside the shrinking interval. No matter how tight the squeeze, the mesh of rationals with denominator q has spacing exactly 1/q, and you just keep picking q large enough that at least one mesh point lands inside your interval. That is the whole proof, visualised.
Related: Real Numbers — Properties · Dense But Full of Holes · If Rationals Are Dense, How Do Irrationals Fit In? · Irrationals Outnumber Rationals