# Thread: Example of a map from [-1,1] to [0,1]

1. ## Example of a map from [-1,1] to [0,1]

How would I find an example of such a function that maps from $[-1,1]$ -> $[0,1]$

I was thinking.. $q(x)$ $=$
$0$ if $x$ is in $Q$
$1$ if $x$ is NOT in $Q$
$x$ in $(0,1)$

2. Originally Posted by Throughpoint
How would I find an example of such a function that maps from $[-1,1]$ -> $[0,1]$

I was thinking.. $q(x)$ $=$
$0$ if $x$ is in $Q$
$1$ if $x$ is NOT in $Q$
$x$ in $(0,1)$
How about $\displaystyle q(x) = \frac 1{\pi} \cos^{-1} (x)$ ?

you're function maps to only two elements in [0,1], what a waste and x in (0,1) won't work, you must use up all elements in your domain

3. Does that map closed sets to closet sets? I need to find a function that doesn't. =/

4. Hello, Throughpoint!

$\text{How would I find a function that maps from }[-1,1]\:\to\:[0,1]\,?$

One such function is: . $q(x) \,=\,x^2$
. . This maps two points of the domain onto one point of the range,
. . with the sole exception $x = 0.$

If a one-to-one mapping is desired, try: . $q(x) \:=\:\dfrac{x+1}{2}$

5. Originally Posted by Throughpoint
Does that map closed sets to closet sets? I need to find a function that doesn't. =/