9
$\begingroup$

What is a continuous mapping of the real line $(-\infty, \infty)$ to the interval $[0, 1]$? I'm trying out logs and exponentials but they don't seem to work?

$\endgroup$
  • $\begingroup$ Seems like $sin^{-1}$ composed with absolute value may work. $\endgroup$ – gary Oct 23 '11 at 12:14
  • $\begingroup$ Start with sine or cosine and modify it slightly. $\endgroup$ – Brian M. Scott Oct 23 '11 at 12:14
  • $\begingroup$ try a tangent function? $\endgroup$ – Alice Oct 23 '11 at 12:14
  • 1
    $\begingroup$ Notice that a bijection is not possible, though. $\endgroup$ – gary Oct 23 '11 at 12:28
  • 2
    $\begingroup$ There is no continuous bijection from $(-\infty,\infty)$ to $[0,1]$, see this thread where it is shown that there is no continuous bijection from $(0,1)$ to $[0,1]$ and notice that $x \mapsto \frac{1}{\pi}\arctan{x} + \frac{1}{2}$ maps $(-\infty,\infty)$ bijectively to $(0,1)$ with continuous inverse $x \mapsto \tan{\pi(x-\frac{1}{2})}$. $\endgroup$ – t.b. Oct 23 '11 at 12:40
8
$\begingroup$

I take it you want a continuous surjection from $\mathbb{R}$ to $[0,1]$. A simple example of such a function is $f(x)= \begin{cases} 0 & x<0 \\ x & 0 \le x \le 1 \\ 1 & x>1\end{cases}$

$\endgroup$
  • 6
    $\begingroup$ AKA $\frac{|x|-|x-1|+1}{2}$ :-) $\endgroup$ – robjohn Oct 23 '11 at 12:38
6
$\begingroup$

$\frac{x+\sqrt{x^2+1}}{2\sqrt{x^2+1}}$ and $\frac{\tanh(x)+1}{2}$ both map $\mathbb{R}$ into $[0,1]$ but not onto. As Phira mentions $\frac{\sin(x)+1}{2}$ maps $\mathbb{R}$ onto $[0,1]$ but is not $1{-}1$. However, you won't find a $1{-}1$ and onto function whose inverse is continuous, since $[0,1]$ is compact and $\mathbb{R}$ is not.

$\endgroup$
  • $\begingroup$ One can probably replace the hyperbolic tangent in the second example with the whole gamut of "sigmoidal functions": the arctangent, the logistic function, the error function... :) $\endgroup$ – J. M. is a poor mathematician Oct 23 '11 at 12:49
  • $\begingroup$ @J.M.: and even the first example :-) $\endgroup$ – robjohn Oct 23 '11 at 12:55
5
$\begingroup$

$\dfrac{\sin x +1}2$ is a continuous surjective function from the reals to this interval.

$\endgroup$
3
$\begingroup$

$\dfrac{1}{1+e^{-x}}$ is a one-to-one monotonically increasing map from $\mathbb R$ onto the open interval $(0,1)$.

$\endgroup$
  • 1
    $\begingroup$ The question was about the closed interval, not the open one. $\endgroup$ – Julian Kuelshammer Nov 4 '12 at 12:25
  • $\begingroup$ Didn't answer the TS question about closed interval, but answered my related question. $\endgroup$ – Stepan Feb 4 at 18:27
1
$\begingroup$

All you need is a continuous function that maps $\mathbb{R}$ onto a closed interval; once you have that, adjusting the interval is fairly easy. (For instance, you can use a linear function.) The natural starting points are the sine and cosine functions.

$\endgroup$
0
$\begingroup$

As the question is formulated, any function that would map all number of the real line to a fixed number of $[0, 1]$ would do. A Lo's (down voted by Julian) answer is also a correct answer, since mapping to $(0,1)$, you map to $[0,1]$.

But what user18723 probably meant, but didn't specify, is to have more than just a continuous function. Perhaps the intent was to have a bijective function? But in that case, it's not possible. A good discussion on this situation can be found here.

$\endgroup$
  • $\begingroup$ I am quite amazed that you know who's the downvoter. $\endgroup$ – user99914 May 27 '15 at 9:45
  • $\begingroup$ It's not true that $[0,1] \subset (0,1)$ $\endgroup$ – jkabrg May 27 '15 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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