I'm trying to design a function with the following requirements:
- it will be implemented in an electronic device, where it will be called a discrete number of times. However, it will only be given the previous value $y_{prev}$. This is "stateless" in the sense that I don't have access to a discrete counter of the number of time the function is called (i.e., $x$). In other words, it must be expressed as $y = f(y_{prev})$.
- $y_{prev}$ is initialized at an arbitrary positive small $ε$ (e.g., 0.001) before the function is ever called.
- the function is asymptotic to 1
- the function is increasing monotonic and has decreasing first derivative. In other words, it has a shape similar to a log function like: sample shape
Thanks!
As from your reply to my comment to your question, your are describing two different things as "the function".
To restate, you want to design and implement a function $f: \mathbb R^+ \to \mathbb R^+$, then choose a starting value $y_0=\epsilon$ and iterate the function $f$ over it:
$$y_{n+1}:=f(y_n)\quad \forall n\ge 0.$$
Such a sequence is formally understood to be a function $y: \mathbb N \to \mathbb R^+$ via $y(n)=y_n \;\forall n \ge 0$.
At the end you state some requirements for "the function":
Now what made William Elliot give the 'incorrect answer' from your point of view is that William applied the requirements to the function $$f,$$ while you wanted them applied to the function $$y.$$
Once that is clear, one has to slightly change the requirement for the first derivative being decreasing, as sequences don't have derivatives. But an 'equivalent' formulation can be found, considering that
$$\frac{y_{n+1}-y_n}{(n+1)-n} = y_{n+1}-y_n$$
can be considered the equivalent of the derivative:
$$y_{n+2} - y_{n+1} < y_{n+1} - y_n. \tag{1} \label{eq1}$$
Considering this, your desired function $f$ can be relatively simple, for example
$$f(y):=\frac{1+y}2$$
works.
We have
$$1-y_{n+1}=1-\frac{1+y_n}2 = \frac{1-y_n}2,$$
which means that the term $1-y_n$ will halve in each iteration, so $\lim_{n\to\infty}y_n=1$.
If $0 \le y_0 < 1$, then per indunction we get easily $0 \le y_n < 1\; \forall n \ge 0$. We have for each $n$ $$y_{n+1} - y_n=\frac{1+y_n}2 -y_n = \frac{1-y_n}2 > 0,$$ the last inequality following from $y_n < 1.$ So $y_n$ is increasing.
To verify $\eqref{eq1}$, we use what we've just shown
$$y_{n+2} - y_{n+1} = \frac{1-y_{n+1}}2 = \frac12 \frac{1-y_n}2 < \frac{1-y_n}2 = y_{n+1}-y_n.$$