0

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?

Srini
  • 1,405

1 Answers1

2

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.

Ross Millikan
  • 383,099
  • Thanks @Ross Millikan. Very useful – Srini Apr 09 '24 at 01:14
  • 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
  • I was definitely looking for preferably injective function – Srini Apr 09 '24 at 13:55