How to define a function so that $a<f(n)<b$?

44 Views Asked by At

For a given interval $(a,b)$, whre $a,b\in \mathbb{N}$, is it possible to define a function such that $a<f(n)<b$, for any positive integer $n$.

For example, $0<\dfrac{n}{2^n}<1$ for all integers $n$($>0$).

Updated:
I would like to define $f$ like this way :
$f(n)=\phi(n,a,b)$, where $a,b$ are given in advance and $n\in \mathbb{N}$, i.e., in the definition of $f(n)$, $n$ will present as well as $a,b$.

3

There are 3 best solutions below

6
On

Sure, and you've given the answer right there. As you say $0 < \frac {n}{2^n} < 1$. Note also that we must have $b \geq a+1$. So, $a < a + \frac{n}{2^n} < a+1 \leq b$. So, given such a pair $a,b \in \mathbb{N}$, if you define $f(n) = a + \frac{n}{2^n}$, then it will have that property.

2
On

You say you need $n$ in the definition. If that's so important to you, you can take $f(n)=\frac {a+b} 2+0\times n$

0
On

We have that $$\forall x:\tanh(x) \in (-1,1)$$ so $$\frac{b-a}{2}\tanh(x) \in\left(\frac{a-b}{2},\frac{b-a}{2}\right)$$ and $$\frac{a+b}{2}+\frac{b-a}{2}\tanh(x) \in \left(\frac{a+b}{2}+\frac{a-b}{2},\frac{a+b}{2}+\frac{b-a}{2}\right)=\left(a, b\right)$$