Now this might be a very dumb question but this has been bothering me from some days.

Imagine I want to create the real number line and for that I start with the rational numbers. So I start to put the numbers on the line (like toppings on a pizza). Now I know that between any two rational numbers I can add another rational number.

So I keep on adding infinitely many rationals between any two rational numbers by adding more and more digits in the decimal expansion.

I can keep on doing this forever but I don't think I will ever reach a point where I can't put a rational and only an irrational number can go there i.e. I don't think there will be any gap between two rationals which can be only fit in by an irrational (or is it ?)

So where do irrationals actually fit in on the line ?

I know this entire argument can be done the other way starting with irrationals too.

  • 11
    $\begingroup$ Well there is just enough room between the rational numbers x such that x^2<2 and the rational numbers y such that y^2>2 to fit exactly one number more, and that number cannot be rational, since we already accounted for all rational numbers! $\endgroup$ Aug 15 at 5:34
  • 1
    $\begingroup$ The reals including the irrationals are linearly ordered so they go to the left of numbers that are bigger and to the right of numbers that are smaller. $\endgroup$
    – John Douma
    Aug 15 at 5:35
  • 32
    $\begingroup$ The short answer is that infinity is weird, and intuition about where things "fit" is likely to be wrong (at least until well after we learn to accept that they do indeed fit). The long answer is way outside the scope of this comment, unfortunately! :-) $\endgroup$
    – Brian Tung
    Aug 15 at 5:36
  • 2
    $\begingroup$ I'm not sure one can answer this in any precise/satisfactory way without making clear the notion of "fit." Indeed, you can think of $\mathbb{R}$ as "continuous" in a sense, despite the very real fact that $\mathbb{Q}$ itself has "gaps." From other perspectives, $\mathbb{Q}$ has no gaps. It gets even weirder when you look at constructing $\mathbb{R}$ (and beyond) using the surreal numbers where $\mathbb{R}$ shouldn't have any "gaps" but in fact you have an ordered system of numbers containing $\mathbb{R}$ that is as "gappy" as possible. It all depends on what you mean by "fit" and "gap." $\endgroup$ Aug 15 at 5:38
  • 1
    $\begingroup$ See related math.stackexchange.com/a/3651131/72031 $\endgroup$
    – Paramanand Singh
    Aug 15 at 10:33

5 Answers 5


The gaps you're thinking of are very simple gaps - gaps of the form "greater than $a$ but smaller than $b$" for appropriate $a,b$ (that is, $a$ and $b$ are rational and $a<b$). However, this is not the only sort of gap we have to worry about! We could have a gap described by sets of rationals instead of individual rationals; that is, maybe we have (nonempty) sets $S,T$ of rationals such that $s<t$ holds whenever $s\in S$ and $t\in T$.

This sort of gap is exactly what irrational numbers are needed to fill. For example, consider the sets $$S=\{x\in\mathbb{Q}: x^2<2\}\quad\mbox{and}\quad T=\{y\in\mathbb{Q}: x^2>2\}.$$ Since every rational number appears in one or the other "sides" of this gap, this is a gap that can't be filled with a rational number.

This leads to the general idea of a Dedekind cut, and I strongly recommend Dedekind's original essays on the topic.

(Minor soapbox moment: in my experience students are more commonly shown the construction of the reals via Cauchy sequences; while this definitely has its advantages, in my opinion it lacks some of the philosophical beauty of Dedekind's approach. But reading Dedekind's essays was a formative mathematical experience for me, so I'm biased.)

  • 1
    $\begingroup$ I prefer thinking about them (formally) in terms of Dedekind cuts too. One reason I like the cut formulation is that it forces me to contend with the fact that although the cuts of $\mathbb{Q}$ are linearly ordered, there are infinitely more cuts than there are elements in $\mathbb{Q}$—a state of affairs totally foreign to finite sets! Of course the same property is there in Cauchy sequences, but I feel it's more obscured there. $\endgroup$
    – Brian Tung
    Aug 15 at 6:03
  • 1
    $\begingroup$ That's more or less how I see it, I think. I also find the Dedekind cut approach "cleaner" in some hard-to-define sense. $\endgroup$
    – Brian Tung
    Aug 15 at 6:16
  • 3
    $\begingroup$ @HolyKnowledge, My understanding is that "creating a gap" is not a mathematical statement so much as an intuitive one. We have $\mathbb{Q} = S \cup T$ and yet, $s \leq t$ for all $s \in S$ and $t \in T$, also for any $\epsilon > 0$ there exists $s \in S$ and $t \in T$ such that $t-s < \epsilon$. Thus it seems like there is something that is simultaneously an upper bound for $S$ and a lower bound for $T$, but whatever it is cannot be rational. This is the sense in which they mean there is a "gap". $\endgroup$ Aug 15 at 15:31
  • 8
    $\begingroup$ @NotThatGuy The argument isn't that all Dedekind cuts produce irrationals. Rather, the Dedekind cut procedure produces (or defines) a number, but - for certain classes of cuts - all rational numbers are either in S or are in T, so the number which we know is in the gap is excluded from being a rational (therefore it must be irrational). The x>2 and x<2 case fails on the second point. (There does exists a rational with is neither in S nor in T, namely 2.) It's less a tautology and more a formalization of what it means to be irrational. $\endgroup$
    – R.M.
    Aug 15 at 18:05
  • 3
    $\begingroup$ @HolyKnowledge - consider two examples. $$S_1 = \{x\in\Bbb Q: 2x \le 1\}, T_1 = \{x\in\Bbb Q: 2x > 1\}\\S_2 = \{x\in \Bbb Q: x < 0\text{ or } x^2 \le 2\}, T_2 = \{x \in\Bbb Q : x > 0\text{ and }x^2>2\}$$ The second is Noah's example with a minor adjustment for orthodoxy. In both examples $T\cap S = \emptyset, T\cup S = \Bbb Q$, and if $s\in S,t\in T$, then $s < t$, and neither $T$ has a minimum. However in the first $S$ has a maximum element, while in the second it doesn't. This lack of a maximum or minimum at the split in the second is the hole that only an irrational number can fill. $\endgroup$ Aug 16 at 18:06

I don't think there will be any gap between two rationals which can be only fit in by an irrational (or is it ?)

You are entirely correct.

So where do irrationals actually fit in on the line ?


Between any two distinct rationals $a < b$, there is a gap, and in this gap fit infinitely many rationals and infinitely many irrationals. The fancy word for such a "gap" is open interval.


This isn't a dumb question, and thinking about it leads to good ideas.

There's no simple answer, but one thing might be worth noting: The usual idea of what it means to “keep on adding” rationals or to do something “forever” limits you to reaching countably many things. There’s a big jump between countable and uncountable infinity. Whether you add rationals or irrationals one at a time, the best you can do about filling gaps is to end up with a subset of the real numbers with no gap of measurable width, that is, no gap of the form $(x,x+\epsilon)$ for some $\epsilon>0$. But you won’t by far have hit every number on the real line, because there are uncountably many numbers on the real line, and you’ve barely scratched the surface. At best you’ll end up with a “dense set of measure zero.”

If you want to read more about these ideas, you can google various combinations of “real numbers”+“countable”, “rationals”+”infinity” and so on, or for less than $10, you could pick up the somewhat old-fashioned book (but usefully so in light of your question) by E. Kamke called “The Theory of Sets.” That book’s notation isn’t modern, but it’s relatively readable and might help you gain some mathematical foundation to the question you asked.


Suppose there were people telling you about these things called integers. I claim there's a number, I call it 2. I tell you about its properties. I say that there would be a "gap in the number line" (maybe a poor choice of words, see below) without this 2 thing. You respond like this:

Now, hang on a second. Consider this sequence:

1.9, 1.99, 1.999, ...

And this sequence:

2.01, 2.001, 2.0001 ...

No matter how small you make a gap around your mythical 2, I can fit an infinite number of elements from those sequences in there. So how can there be a gap that only this mythical 2 thing can fill when I can fit an infinite number of my sequence members in any gap around 2 that you want to name, no matter how small you make it?

Change the "mythical number" to the square root of two and the "fractionals" to the rationals, and your post is asking the same question.

Yes, there are an infinite number of rationals in any interval around the square root of two. But that doesn't mean you've covered every possible "location" in that interval.

(I theorize that it's a simple semantic thing your brain is doing with the word "gap." Since a "gap" implies some extent in space, like, a measurable distance between the door and the frame, your brain translates it to "interval." It might be better to refer to it as a "hole" rather than a "gap," even though a real-world hole also has width, because you can perhaps more easily imaging a hole being a single, infinitely thin point.)


A simplistic way to think about this is what is commonly noted as significant figures in science. So 99 has two significant figures, 999 has three, and so on. So between 1/99 and 2/99 there is a gap of 1/99. Between two successive fractions of 999 there is a gap of 1/999. As the number of significant figures increases the gaps get smaller, however the gaps are never zero!

Now consider $\pi$. As of 21 March 2022, the record is 100,000,000,000,000 decimal places (see https://en.wikipedia.org/wiki/Chronology_of_computation_of_%CF%80). So we can calculate some integer $x$ where $${x/99,999,999,999,999 < \pi < (x+1)/99,999,999,999,999}$$ and we we know 999,999,999,999,999 digits of $\pi$ we will be able to calculate $${y/999,999,999,999,999 < \pi < (y+1)/999,999,999,999,999}$$ but $$ x\ne y$$ In fact it is easy to understand that $$y \approx 10*x$$ So by using more digits in the fraction's denominator we'll always be able to fit another pair of fractions closer to and on either side of $\pi$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .