Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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 wonder whether there is a function $f\colon\Bbb R\to\Bbb R$ with the folowing characteristic? for every two real numbers $\alpha,\beta,\alpha\lt\beta$, $$\{f(x):x\in(\alpha,\beta)\}=\Bbb R$$

I can't say such a function does not exist, neither can I construct a example

Thanks a lot!

share|cite|improve this question
How is this a function from $\mathbb{R} \to \mathbb{R}$? $x$ seems to take on values in $\mathbb{R^2}$. – Christopher Liu May 11 '14 at 22:24
$x$ takes on values between $\alpha$ and $\beta$ – user137794 May 11 '14 at 22:25
Oops, thanks. My mistake – Christopher Liu May 11 '14 at 22:26
See the answer to this question for yet another example.… – user4894 Dec 10 '14 at 5:06
This was asked a few times here or on MO:,, Also some answer to this question give also examples of functions like this: – Martin Sleziak Dec 10 '14 at 6:36
up vote 5 down vote accepted

The Conway base 13 function is one such function. From Wikipedia:

$f$ takes as its value every real number somewhere within every open interval $(a,b)$.

The construction of the function is a little bit complicated. Refer to the wiki page for details.

share|cite|improve this answer
I am really grateful for your prompt help! – Clin May 11 '14 at 22:41
@Clin Happy to help. – Ayman Hourieh May 11 '14 at 22:41

I find it easier to define one from $(0,1)$ to $(0,1)$. You can use your favorite bijection to stretch each axis to $\Bbb R$. Express $x \in (0,1)$ in base $3$, choosing the expansion ending in all $2$'s for numbers which would terminate. If $x$ has an infinite number of $2$'s in the expansion, set $f(x)=x$ and ignore it in the rest. If $x$ has a finite number of $2$'s in the expansion, multiply it by $3^k$ so that the last two is just to the left of the ternary point. The expansion is now all $0$'s and $1$'s. Read it as a binary number and return that value. To show it takes all values in an interval, let somebody give you a value $y$ it should take. Express $y$ in binary. Find an interval $(\frac {3m+2}{3^k},\frac {3m+3}{3^k})$ that is within the given interval for some naturals $m,k$. Express $\frac {3m+2}{3^k}$ in ternary and append the binary of $y$ on the right. That will give you an $x$ such that $f(x)=y$ This needs a slight patch because some numbers are mapped to $1$, which is outside the range, so map them to $0.5$ and we are done.

share|cite|improve this answer

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.