I want to map integers 1,2,3,... to real [$0$,$1$]. A simple formula I can think of is $\frac{1}{n}$ (or $1-\frac{1}{n}$). But I would like to see uniform gaps on real line upon mapping as I jump from one integer to the next. Not sure if that is mathematically absurd. Any help?
-
4I wouldn't call it "absurd", but it is certainly impossible to have uniform gaps. – jjagmath Apr 09 '24 at 00:36
-
Does this answer your question? [How to define a bijection between $(0,1)$ and $(0,1]$?](https://math.stackexchange.com/questions/160738/how-to-define-a-bijection-between-0-1-and-0-1) – Grizzlly Apr 09 '24 at 00:37
-
Also this. – Grizzlly Apr 09 '24 at 00:38
-
2The uniform gap has to be $0$. – peterwhy Apr 09 '24 at 00:41
-
2Thanks Grizzlly. They seem to be mapping real to real, or maybe I haven't understood those threads fully. I will re-read carefully. – Srini Apr 09 '24 at 00:42
-
2@Grizzlly How those questions relate to this? – jjagmath Apr 09 '24 at 00:44
-
@Grizzlly, if you are convinced that it's already answered, please feel free to close this. Looking at a couple of comments already, it confirms my hunch that I am chasing something that's not possible mathematically – Srini Apr 09 '24 at 00:44
-
@jjagmath the second link has the question "mapping the real line to 0..1" – Grizzlly Apr 10 '24 at 22:31
1 Answers
You can't just use a small gap because no matter how small your gap you will eventually get out of $[0,1]$. What you can do is to use uniform small gaps to go from near $0$ to near $1$, then use a slightly different uniform small gap to go down from near $1$ to near $0$ and repeat the process. If you make the gaps irrational in length you can assure that the points never repeat but it will be hard to know at what integer you need to turn around.
For a particular example, let our upward gaps be $\frac 1{\sqrt{999\ 999}}$ and our downward gaps be $\frac 1{\sqrt{1\ 000\ 001}}$. These are both rather close to $0.001$ so for $1 \le n \le 999$ we have $f(n)=\frac n{\sqrt{999\ 999}}$ We can then do $999$ steps downward so for $1000 \le n \le 1998$ we have $f(n)=\frac {999}{\sqrt{999\ 999}}-\frac {n-999}{\sqrt{1\ 000\ 001}}$. Alpha can tell us whether we can do one more step downward without dropping below $0$ but I think you can see it will get hard to know when to turn around. This gets rather uniform steps.
- 383,099
-
-
Somehow I got the impression you wanted the function to be injective, which makes it much more complicated. If that is not important, you can just count up by $0.001$ to $0.999$ then down to $0.001$ again. It would not be hard to write an explicit formula for that. – Ross Millikan Apr 09 '24 at 13:03
-