# Explicit bijection between $[0,1)$ and $(0,1)$ [duplicate]

Proving that $[0,1)$ and $(0,1)$ have the same cardinality (without assuming any previous knowledge) can be done easily using Cantor-Bernstein theorem.

However I'm wondering if someone can build an explicit bijection between these sets.

It's easy to build a bijection between $(0,1)$ and $\mathbb R$, so a bijection from $[0,1)$ to $\mathbb R$ will also fit the bill.

## marked as duplicate by Gabriel Romon, hardmath, Did, user1551, Cameron BuieSep 7 '15 at 17:00

• Have a look at this question. – Krijn Sep 7 '15 at 15:43
• @Krijn, that's exactly what I need. Too bad it didn't come up in the suggestions when I wrote my question. Closing as a duplicate. – Gabriel Romon Sep 7 '15 at 15:45
• It comes up on the right of this page under Related, third entry. – André Nicolas Sep 7 '15 at 15:47
• @AndréNicolas it should also appear here: imgur.com/5L9qViH – Gabriel Romon Sep 7 '15 at 15:50
• I agree that it should have appeared there. Luckily, from now on, it wil. – Krijn Sep 7 '15 at 15:51

Let us partition $(0,1)$ into a countable number of disjoint subsets of the form $[\frac{1}{n+1},\frac{1}{n})$ for $n=0,1,2,\ldots$.
These half-open intervals may then be positioned in reverse order to form a half-open interval of equal length. Whether this construction is sufficiently explicit is open to question, but it does allow the relocation of any $x\in (0,1)$ to $[0,1)$ to be computed in short order.
A more succinct construction is to define $f:[0,1) \to (0,1)$ by $f(0) = 1/2$, $f(1/n) = 1/(n+1)$ for integer $n \ge 2$, and $f(x) = x$ otherwise.