Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I couldn't find a bijective map from $(0,1)$ to $\mathbb{R}$. Is there any example?

share|cite|improve this question
Yes, and there's even one from (0,1) to R²... – Axel Sep 21 '12 at 12:56

10 Answers 10

Here is a nice one ${}{}{}{}{}{}{}{}{}$, can you find the equation? enter image description here fg fgf gf gdddddfgfdgfgdgfgdfg

share|cite|improve this answer
That's really nice! – Clive Newstead Sep 21 '12 at 12:26
Note: I would be interested in an explicit formula. – The Chaz 2.0 Oct 21 '13 at 19:59
@The Chaz 2.0 If the diameter of the circle is 1 and the interval is $(0, 1)$ and 1/2 mapped to 0 and the distance between the center of the circle and the 2nd numberline is 1/2 then the formula is $f(x)=\frac{x-1/2}{\sqrt{x-x^2}}$. Becouse scaling does not matter you can multiply by 2 and get the formula $f(x)=\frac{2x-1}{\sqrt{x-x^2}}$, but i don't know how you can get Cameron Buie's formula, out of this. – 05storm26 Feb 2 '14 at 8:31
I am thinking about: $f:(0,1)\to\mathbb{R}$, $f(x)=-\cot\left(\pi x\right)$ – Darius Apr 22 '14 at 19:58
As far as I can tell, the connection between our answers' formulae is coincidental (aside from the fact that if $g$ is a positive function on some subset of $\Bbb R,$ then so is $\sqrt{g},$ so our functions are related, but not in an obvious heuristic way. Please let me know if you can discern a connection between our answers (aside from the obvious algebraic one). – Cameron Buie Oct 31 '14 at 3:07

Here is a bijection from $(-\pi/2,\pi/2)$ to $\mathbb{R}$: $$ f(x)=\tan x. $$ You can play with this function and solve your problem.

share|cite|improve this answer

$g(x)=\frac 1{1+e^x}$ gives a bijection from $\Bbb R$ to $(0,1)$, so take the inverse of this map.

share|cite|improve this answer
And the inverse is $f(x)=\ln\left(\frac{1}{x}-1\right)$ – celtschk Sep 21 '12 at 12:19

A homeomorphism (continuous bijection with a continuous inverse) would be $f:(0,1)\to\Bbb R$ given by $$f(x)=\frac{2x-1}{x-x^2}.$$

Added: Let me provide some explanation of how I came by this answer, rather than simply leave it as an unmotivated (though effective) formula and claim in perpetuity.

Many moons ago, I was assigned the task of demonstrating that the real interval $(-1,1)$ was in bijection with $\Bbb R.$ Prior experience with rational functions had shown me graphs like this:

Rational Graph

The above is a graph of a continuous function from most of $\Bbb R$ onto $\Bbb R.$ This doesn't do the trick on its own, since it certainly isn't injective. However, it occurred to me that if we restrict the function to the open interval between the two vertical asymptotes, we get this graph, instead:

Restricted Rational Graph

This graph is of a continuous, injective (more precisely, increasing) function from a bounded open interval of $\Bbb R$ onto $\Bbb R.$ This showed that rational functions could do the job. Other options occurred to me, certainly (such as trigonometric functions), but of the ideas I had (and given the results I was allowed to use) at the time, the most straightforward approach turned out to be using rational functions.

Now, given the symmetry of the interval $(-1,1)$ (and, arguably, of $\Bbb R$) about $0,$ the natural choice of the unique zero of the desired function was $x=0.$ In other words, I wanted $x$ to be the unique factor of the desired rational function's numerator that could be made equal to $0$ in the interval $(-1,1)$--meaning that for $\beta\in(-1,1)$ with $\beta\ne0,$ I needed to make sure that $x-\beta$ was not a factor of the numerator. For simplicity, I hoped that I could make $x$ the only factor of the numerator that could be made equal to $0$ at all--that is, I hoped that I could have $\alpha x$ as the numerator of my function for some nonzero real $\alpha.$

In order to get the vertical asymptotic behavior I wanted on the given interval--that is, only at the interval's endpoints--I needed to make sure that $x=\pm1$ gave a denominator of $0$--that is, that $x\mp1$ were factors of the denominator--and that for $-1<\beta<1,$ $\beta$ was not a zero of the denominator--that is, that $x-\beta$ wasn't a factor of the denominator. For simplicity, I hoped that I could make $x\mp1$ the only factors of the denominator.

Playing to my hopes, I assumed $\alpha$ to be some arbitrary nonzero real, and considered the family of functions $$g_\alpha(x)=\frac{\alpha x}{(x+1)(x-1)}=\frac{\alpha x}{x^2-1},$$ with domain $(-1,1).$ It was readily seen that all such functions are real-valued and onto $\Bbb R.$

I wanted more, though! (I'm demanding of my functions when I can be. What can I say?) I wanted an increasing function. I determined (through experimentation which suggested proof) that $h_\alpha$ would be increasing if and only if $\alpha<0.$ Again, for convenience, I chose $\alpha=-1,$ which gave me the function that satisfied the desired (and required) properties: $g:(-1,1)\to\Bbb R$ given by $$g(x)=\frac{-x}{x^2-1}=\frac{x}{1-x^2}.$$

Much later, you posted your question, and I realized (again, based on experience) that my earlier result could be adapted to the one you wanted. Playing around a bit with linear interpolation showed that the function $h:(0,1)\to(-1,1)$ given by $h(x)=2x-1$ was a bijection--in fact, an increasing bijection.

It is readily shown (and I had previously seen) that if $X,Y,$ and $Z$ are ordered sets and if we are given increasing maps $X\to Y$ and $Y\to Z,$ then the composition of those maps is an increasing map $X\to Z.$ Also, it is readily shown (and I had seen previously) that if both such maps are continuous and surjective, then so is their composition. Just from these results, my originally posted map was obtained (though named differently): $$\begin{align}(g\circ h)(x) &= g\bigl(h(x)\bigr)\\ &= \frac{h(x)}{1-\left(h(x)\right)^2}\\ &=\frac{2x-1}{1-(2x-1)^2}\\ &=\frac{2x-1}{1-\left(4x^2-4x+1\right)}\\ &= \frac{2x-1}{4x-4x^2}\\ &=\frac{2x-1}{4(x-x^2)}.\end{align}$$

As lhf astutely pointed out shortly thereafter (and as I should have seen immediately), the factor of $4$ in the denominator serves no particular purpose, hence its later removal to yield the function $f$ that I eventually posted.

The remaining claim that I made (that $f$ has a continuous inverse), I leave to you (the reader). If you're curious how I determined this, try to prove it on your own first. If you're stymied (or if you simply want to run your proof attempt by me), let me know. I will do what I can to get you "unstuck."

share|cite|improve this answer
This is the answer you want. A direct map that just stretches the unit interval onto the (-inf,inf) interval. This shows you don't need an exotic function like the bijection between [0,1] and [0,1]^2. – John Baber-Lucero Sep 21 '12 at 12:17
No need for that 4... – lhf Sep 21 '12 at 12:22
Fair point, @lhf. Not sure why I bothered with that.... – Cameron Buie Sep 21 '12 at 17:21
+1 for the motivation. – Timere Jan 6 at 4:45

For a less differentiable example, consider the bijection in the following picture, enter image description here

In symbols, given $x \in (0,1)$ let $n$ be the largest natural number such that $1-\frac{1}{n}<x$, define $$y=\frac{x-n}{\frac{1}{n}-\frac{1}{n+1}}$$ to be the renormalized version of $x$ if the interval $(1-\frac{1}{n},1-\frac{1}{n+1}]$ is rescaled and shifted to map to $(0,1)$. Then we have the following bijection: $$f(x)=\begin{cases}\frac{n-1}{2}+y,& n \text{ odd} \\ -\frac{n-2}{2}-y,& n \text{ even}\end{cases}$$

share|cite|improve this answer
Not only less differentiable but also much less continuous. – Stefan Geschke Sep 21 '12 at 10:15
(: One might even consider the composition $f \circ g$ with a nowhere continuous bijection $g:(0,1)\rightarrow (0,1)$. – Nick Alger Sep 21 '12 at 10:27

Yes. let $f(x)=\tan((x-1/2)\pi)$. the domain is $(0,1)$ and range is $\mathbb{R}$

share|cite|improve this answer
Here is a more visual description of the same function (modulo a factor of $\pi$) Bend the line segment (0, 1) into a semicircle, with the open part facing upwards, and rest it on the real line (with 0.5 on the semicircle resting on 0 on the real line). To map a point on one line to a point on the other, draw a line through that point and the centre of the circle. The mapped point is where it intersects the other line. – Max Sep 21 '12 at 10:10
Of course, knowing the domain and range simply guarantees that $f$ is surjective, but this $f$ does turn out to be injective, too. – Cameron Buie Sep 21 '12 at 10:36

Yes, see above answers. There are even bijective maps between $(0,1)$ and $\mathbb{R}^n$. To see this, note that a bijection $\phi$ between $(0,1)$ and $(0,1)^2$ can be made in this way: Let $x= 0.b_1b_2\ldots$, with $b_j$ being the digits in a decimal expansion. Define $$\phi(x) = (0.b_1b_3b_5\ldots,0.b_2b_4b_6\ldots),$$ i.e., extract even and odd digits. For $\phi^{-1}(x_1,x_2)$, let $x_1 = 0.a_1a_2a_3\ldots$, and $x_2=b_1b_2b_3\ldots$. Then, $$ \phi^{-1}(x,y) = 0.a_1b_1a_2b_2\cdots$$ Some care has to be taken with identification between digital expansions like $0.199999\cdots$ and $0.20000\cdots$, but that is an exercise.

Having the bijection between $(0,1)$ and $(0,1)^2$, we can apply one of the other answers to create a bijection with $\mathbb{R}^2$.

The argument easily generalizes to $\mathbb{R}^n$.

share|cite|improve this answer
Actually you don't even have to generalize the argument: If you have the bijection between $(0,1)$ and $(0,1)^2$, you get a bijection from $(0,1)$ to $(0,1)^3$ by just applying the same bijection to one of the two factors of $(0,1)^2$. Of course the same way you get to $(0,1)^n$. – celtschk Sep 21 '12 at 12:16

The trigonometric function $\tan x$ is an invertible function from $(-\pi/2,\pi/2)$ to $\mathbb{R}$. Also to find an invertible function from $(0,1)$ to $(-\pi/2,\pi/2)$ find the equation of the straight line joining the points $(0,-\pi/2)$ and $(1,\pi/2)$. Now compose the two functions together. You can likewise find bijections between any two open intervals and any open interval and $\mathbb{R}$.

share|cite|improve this answer

$x \mapsto \ln (- \ln x)$ with the inverse $y \mapsto e^{-e ^ {\ y}}$. It's also a $C ^ \infty$ diffeomorphism.

share|cite|improve this answer

By virtue of, here's another picture. The interval at the bottom is $\mathbb{R}$.

enter image description here

share|cite|improve this answer
It's not clear to me which point on the circle is missed from the map described by the blue arrows. It looks like it could be some point between the images of the point $0$ and the point $1$, but then the map described by the red arrows from the circle to the real line is not a bijective map because that missed point has no preimage and so its image in the real line after the red mapping has no preimage in the interval. This is a poor picture. – Dan Rust Feb 18 '14 at 12:45
@DanielRust Ought I delete my answer then? Or can someone please improve it? Please advise. – Timere Apr 5 '15 at 18:43
the idea is good : draw a circle of radius $1$ and center $(0,1)$, draw the segment $(-1,1) , (1,1)$, and map the segment to $\mathbb{R}$ by taking from any point of the segment the nearest point on the half bottom circle, drawing the line passing through these 2 points, and considering its intersection with the horizontal line $y = 0$. finally, prove that every continuous bijection between $]-1;1[$ and $\mathbb{R}$ can be constructed this way (replacing the circle by other curves). and the reciprocal : characterize the curves from which we get such a bijection. – user1952009 Jan 5 at 22:54
@user1952009 +1. Thanks. Please feel free to post your comment as an answer for which I shall upvote. – Timere Jan 6 at 4:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.