I need to find an explicit expression for a bijection between $[0,1]$ and $(0,1)$. I've seen some between $[0,1]$ and $[0,1]$, but I can't seem to find one between $[0,1]$ and $(0,1)$.
Thanks in advance!
I need to find an explicit expression for a bijection between $[0,1]$ and $(0,1)$. I've seen some between $[0,1]$ and $[0,1]$, but I can't seem to find one between $[0,1]$ and $(0,1)$.
Thanks in advance!
Hint: $[0,1] = [0,1/2] \cup (1/2,1]$ and $(0,1) = (0,1/2] \cup (1/2, 1)$.
What about $\;f:[0,1]\to(0,1)\;$ defined as
$$f(x):=\begin{cases}\cfrac13,&x=0\\{}\\\cfrac1{3^{n+2}},&x=\cfrac1{3^n}\;,\;\;n\in\Bbb N\cup\{0\}\\{}\\x,&\text{otherwise}\end{cases}$$
Let $X_0 = \{\frac1{2^{i+1}}, i \in \Bbb N\}$, $X_1 = \{1 - \frac1{2^{i+1}}, i \in \Bbb N\}$
We then define $f$ as follows:
$$f(x) = \begin{cases} x\ \text{if}\ x \not\in X_0\cup X_1\\ \frac14, x = 0\\ \frac34, x = 1\\ \frac1{2^{i+2}}\ \text{if}\ x\in X_0, x = \frac1{2^{i+1}}\\ 1 - \frac{1}{2^{i+2}}, x \in X_1, x = 1 - \frac1{2^{i+1}} \end{cases}$$
This applies the idea to make a bijection from $[0, 1]$ to $(0, 1]$ two times, one for each end of the interval.