# Cardinality of the set $[a,b]$ where $0 < a \leq b$ and $a,b \in \mathbb{N}$.

Let $S = [a,b]$ where $0 < a \leq b$ and $a,b \in \mathbb{N}$. Meaning all possible sets where this is true (e.g., $[1,1],[1,2],[5,5],[5,n],\cdots$)

Alright, this isn't for an assignment, just a question I arrived at and have been having difficulty figuring out. My original thought was that this must have the same cardinality as $\mathbb{Q}$, but then when attempting to find a bijection between the two sets , I ran into an issue.

My first attempt,

for all $s \in S$ let $s = a/b$ (first ,last number in the set be assigned to that rational). The problem with this is that I cannot arrive at any rational bigger than $1$. If I reverse the order ( $s = b/a$), I cannot get to any number smaller than $1$.

My second attempt was to try and find some way to use the diagonalization argument , but again, if I block the numbers in either way as I stated above, I cannot reach a large set of numbers (either smaller than or bigger than zero).

So since this set extends $\mathbb{N}$ I assume its cardinality must be at least that. But I cannot find a bijection between $\mathbb{N}$ and $S$ or between $\mathbb{Q}$ and $S$.

EDIT, I don't think that i was clear that this was a set of sets. So things so the set $S$ would contain :

$$[1,1],[1,2],[1,3],\cdots [2,2],[2,3],[2,3],\cdots$$

• Is $S$ a set of consecutive integers, or an interval of real numbers? – Arthur Sep 16 '16 at 17:16
• S is a set of sets. All sets [a,b] where a,b are integers and 0<a<=b – razeal113 Sep 18 '16 at 21:13

If $a=b$, $S=\{a\}$, so its cardinality is $1$
If $a<b$, its cardinality is the same as the cardinality of $[0,1]$ since there is a linear function $f$ such that $f(a)=0$, $f(b)=1$. Now $\DeclareMathOperator\card{card}\card\,(0,1)=\card\mathbf R$, hence the $\card\,[0,1]\ge\card\mathbf R$. But as it is contained in $\mathbf R$, we also have $\card\,[0,1]\le\card\mathbf R$, whence $$\card\,[0,1]=\card\mathbf R.$$
Added: Answer to the updated question – the cardinality of $\;S=\{[a,b]\mid 0 <a\le b,\;a, b\in\mathbf N \}$. There's a injection \begin{aligned}[t]S&\longrightarrow\mathbf N\times\mathbf N\\{}[a,b]&\longmapsto (a,b)\end{aligned},\; which is countable. Hence $S$ is at most countable. As it is infinite, it is countable.
• +1. Note for the OP: we can see that $(0, 1)$ and $\mathbb{R}$ have the same cardinality by given an explicit bijection between them - for example, consider $$f(x)={(\arctan(x)+{\pi\over 2})\over \pi}.$$ Also note for the OP, this means that we can have $A$ and $B$ have the same cardinality even when $A$ is a proper subset of $B$! – Noah Schweber Sep 16 '16 at 18:07
• @Noah Schweber; Maybe $f(x)=\dfrac{\mathrm e^x}{1+\mathrm e^x}$ is more intuitive? Or $\dfrac{1+x+\lvert x\rvert}{2(1+\lvert x\rvert)}$. – Bernard Sep 16 '16 at 18:46
• Those also work, but I think the one I presented is clearer, since it is more transparent (IMHO) where the idea comes from: take a function you already know bijects $\mathbb{R}$ with an interval, then shift and scale appropriately. – Noah Schweber Sep 16 '16 at 18:52
• That's what I did with the last one, as $\dfrac x{1+\lvert x\rvert}$ is a bijection onto $(-1,1)$ well-known to many people. Many beginners are reluctant with trigonometric functions, I think – but maybe I'm wrong. – Bernard Sep 16 '16 at 18:57