Can we have a one-one function from [0,1] to the set of irrational numbers?
Since both of them are uncountable sets, we should be able to construct such a map. Am I correct?
If so, then what is the map?
Solution 1:
Both sets $[0,1]$ and $[0,1]\setminus\mathbb Q$ have the same cardinality $\mathfrak c=2^{\aleph_0}$, so there is a bijection between them.
If you want write down some explicit bijection, you can use basically the standard Hilbert's hotel argument which shows that if $|A|\ge\aleph_0$ then $|A|+\aleph_0=|A|$.
So let us try to describe some bijection $f \colon [0,1] \to [0,1]\setminus\mathbb Q$.
- Choose some infinite sequence $x_n$, $n=0,1,2,3,\dots$ of irrational numbers in the interval $[0,1]$.
- Choose some bijection $g\colon \mathbb N\to\mathbb Q\cap[0,1]$.
Then you can define $f$ as:
- $f(x_{2n})=x_n$;
- $f(x_{2n+1})=g(n)$;
- $f(x)=x$ for $x\in [0,1] \setminus \{x_n; n=0,1,2,\dots\}$
Let me add links to some posts where a very similar ideas can be used to construct a bijection between two given sets:
- How to define a bijection between $(0,1)$ and $(0,1]$?
- Construct some explicit bijective functions
- Constructing a bijection
- Construct a bijection from $\mathbb{R}$ to $\mathbb{R}\setminus S$, where $S$ is countable
Solution 2:
Define $f : [0,1] \to \mathbb{R}$ as follow : if $x \in \mathbb{Q}$, then $f(x) = \pi + x$. If $x$ is irrational, then $f(x) = x$. This function is injective. It is not a bijection.
Solution 3:
You can construct such a function in the following steps (it's certainly by far not the only way):
Map the closed interval $[0,1]$ to the open interval $(0,1)$ by the function $$f(x) = \begin{cases} \frac{1}{4} & x = 0\\ \frac{1}{4(n+1)} & x = \frac{1}{4n}, n\in\mathbb Z^+\\ \frac{3}{4} & x = 1\\ 1-\frac{1}{4(n+1)} & x = 1 - \frac{1}{4n}, n\in\mathbb Z^+\\ x & \text{otherwise} \end{cases}$$
Map the interval $(0,1)$ to $\mathbb R$ by the function $$g(x) = \ln(-\ln x)$$
Map $\mathbb R$ to the set of irrational numbers by the function $$h(x) = \begin{cases} x\pi^{n+1} & x = q\pi^n, q\in\mathbb Q, n \in \mathbb N_0\\ x & \text{otherwise} \end{cases}$$
Then the function $F = h\circ g\circ f$ is a bijection from $[0,1]$ to the set of irrational real numbers.
Here I've used the notations $\mathbb Z^+ = \{1,2,3,\ldots\}$ the set of positive integers, and $\mathbb N_0 = \{0,1,2,3,\ldots\}$ the set of positive integers (natural numbers, including $0$).
Solution 4:
Let $p_0 = 0$ and $p_n$ be the $n$-th prime for any $n \in \mathbb{N}^+$.
Let $f:\mathbb{R}\to\mathbb{R}$ such that:
$f(x) = \cases{ r+\sqrt{p_{n+1}} & \text{if $x = r+\sqrt{p_n}$ for some $n \in \mathbb{N}$ and $r \in \mathbb{Q}$} \\ x & \text{otherwise} }$.
To prove that this function is well-defined, we just need to check that it is impossible to have $a+\sqrt{p_m} = b+\sqrt{p_n}$ for distinct $m,n \in \mathbb{N}^+$ and $a,b \in \mathbb{Q}$, which is clearly the case otherwise $(a-b)^2 = (\sqrt{p_m}-\sqrt{p_n})^2$ $= p_m+p_n-\sqrt{p_mp_n} \notin \mathbb{Q}.$
I leave you to prove that it is a bijection from $\mathbb{R}$ to $\mathbb{R} \setminus \mathbb{Q}$. Then you can compose it with a bijection from $[0,1]$ to $\mathbb{R}$.
Solution 5:
Yes, the irrationals and the set [0,1] have the same cardinality. Using cardinal arithmetic:
$$\text{card}([0,1]) = \text{card}(\mathbb{R}) = \text{card}(\mathbb{Q} + (\mathbb{R} \setminus \mathbb{Q}) ) = \text{card}(\mathbb{Q}) + \text{card}(\mathbb{R} \setminus \mathbb{Q} ) = \text{card}(\mathbb{R} \setminus \mathbb{Q} )$$
I cannot recall an explicit construction of such a bijection, however.