# Percentage of rational numbers on an interval

Today, I just came up with this random question: What is the percentage of of rational numbers on an interval?

Let $\mathbb{Q}$ be the set of the rational numbers:

1- Take an interval on the real axis: $A=[a,b]$, then define two sets: $S_1=\{x\mid x\in A\cap\mathbb{Q} \},~~ S_2=\{x\mid x\in A ~\text{and} ~x\notin\mathbb{Q} \}$, what is the value of the ratio $\frac{\#S1}{\#S1+\#S2}$, where $\#S1$ and $\#S2$ are the cardinality of the respective sets.

2- How is this ratio related to the choices of $a$ and $b$?

Thanks!

• The answer is suprising: "percentage of rational number on an interval" is $0$. If you want to know more read about Lebesgue measure. – agha Nov 14 '14 at 21:37
• Your question may look naive to a modern mathematician, but it was questions like this that prompted Georg Cantor to construct his famous infinities in the 1870's. If you can understand his diagonal argument, you will see why the answer to your question is 0%. – TonyK Nov 14 '14 at 22:20

## 4 Answers

The percentage of rational numbers in any non-trivial interval of the real numbers (so in particular in $[a,b]$) is $0$. Your particular formulation of that statement does not make sense, however. Except in the trivial case $a=b$, both $S_1$ and $S_2$ will be infinite, and so the expression $\frac{|S_1|}{|S_1|+|S_2|}$ is non-sensical. Furthermore, you'll note that this implies that the result has nothing to do with your choices of $a$ and $b$ so long as they are not the same.

The correct way to formulate this statement is using Lebesgue measure. Precisely, let $a<b$. Then, $m(\mathbb{Q}\cap [a,b])=0$, where $m$ is Lebesgue (outer) measure.

To prove this, let $\varepsilon >0$, let $\{ r_k:k\in \mathbb{N}\}$ be an enumeration of the rationals in $[a,b]$, and consider the open balls $B_{\varepsilon /2^k}(r_k)$. Then, the rationals in $\mathbb{Q}$ are contained in these open balls, the sum of whose measures (by definition) is $2\cdot \sum _{k=0}^\infty \frac{\varepsilon}{2^k}=4\varepsilon$. As $\varepsilon$ is arbitrary, this shows that $m(\mathbb{Q}\cap [a,b])=0$.

I guess technically you would need to know the definition of Lebesgue measure to see that this is actually a proof, but at the very least I think this makes the intuition clear that any reasonable definition of measure should have $m(\mathbb{Q})=0$.

The question as you've stated it isn't meaningful, because there is no operation of dividing infinite cardinals.

A sensible alternative question would be to ask about the Lebesgue measure of $A \cap \mathbb{Q}$ and $A$, and those are $0$ and $b-a$, respectively. As long as $b > a$, the ratio will be zero, though this wasn't what you were asking.

Measure in one dimension is analogous to length, although here we're talking about the "length" of a highly irregular subset.

I thought the same question. There are different cardinalities of infinity, and there are infinity many different cardinality of infinities (This can be proved by contradiction by showing that a powerset has a greater cardinality than the original set and assuming there is a greatest cardinality). For example, the natural numbers and the real numbers are both infinity however the real numbers cardinality is greater.

It is also true that the cardinality of the power set of the natural numbers is equal to the real numbers. Given that to be true, if we take the power set of any infinite set A, what is the probability of choosing an element of A from the powerset of A?

For the finite case we can say that the cardinality for $|A| = k$, for some $k \in \mathbb{N}$, that the power set, I will denote $\mathcal{P}(A)$, has the cardinality $|\mathcal{P}(A)| = 2^k$ (This can be proved by induction). Therefore the probability for choosing an element of $|A|$ out of the set $\mathcal{P}(A)$ (given that the probability is uniform with the lebegue measure) is $\frac{k}{2^k}$, and for the infinite case we take the limit of $k\rightarrow \infty$ and we have that $\frac{k}{2^k} \rightarrow 0$.

Note: Cardinality is the number of elements of a set, and is denoted above as bars around the set $|D|$. For example, for the set $D = \{a, b, c\}$, we would have $|D| = 3$. Also the power set is the set of subsets.

Also, if i made any mistakes please let me know.

TL;DR: The fraction of an infinite set $A$ to its power set $\mathcal{P}(A)$ converges to $0$ as the cardinality grows beyond finite.

$$\frac 1 2,\ \overbrace{\frac 1 3,\ \frac 2 3}^{\cdots\,/3},\ \overbrace{\frac 1 4,\ \frac 3 4}^{\cdots\,/4},\ \overbrace{\frac 1 5,\ \frac 2 5,\ \frac 3 5,\frac 4 5}^{\cdots\,/5},\ \overbrace{\frac 1 6,\ \frac 5 6}^{\cdots\,/6},\ \overbrace{\frac 1 7,\ \frac 2 7,\ \frac 3 7,\ \frac 4 7,\ \frac 5 7,\ \frac 6 7}^{\cdots\,/7}, \cdots\cdots$$ Every rational number between $0$ and $1$ appears in this list. The measure of each set containing just one rational number is $0$. Therefore the measure of the set of all of them is $0+0+0+\cdots=0$. But the measure of the whole interval $(0,1)$ is $1$.