3

I'm looking for some sort of function $f$ that can take any integer $n>0$ and give a real number $100 \le m \lt 200$ such that if $a \lt b$ then $f(a) \lt f(b)$. How can I do that? I'm a programmer and I need this for an application of mine.

Rachid O
  • 133

3 Answers3

8

Try $$f(x)= 150 + 50 \cdot \frac{x}{1+|x|}$$ This is a bijection from $\mathbb{R}$ to $(100,200)$. The graph is
enter image description here

which gives you the idea why it is monotone and why it works.

2

$\tan\dfrac{\pi (x-150) }{100 } $ is a monotone bijection from $(100,200)$ to $\mathbb{R}$. (You can obtain it by looking at $\tan x$ and then trying a linear function). The inverse of this is the function you want.

2

$f(n)=200-2^{-n}$ satisfies your criteria.