Is it possible to unify this expression and its special case into one?

63 Views Asked by At

I have the following expression $\forall n \ge 1 \in \Bbb N, f(n) \ge 2 \in \Bbb N$:

$$E = f(n)-1$$

$f(n)$ is a increasing function. The value $f(1)$ is a special case, its value can be $2$ or $3$. In the case that $f(1)=2$ I just want $E = f(1) = 2$, and in the case that $f(1)=3$ I would like to use the general expression $E = f(n)-1$, so $E=f(1)-1=2$. So basically I would like $f(1)$ to be always $2$ independently of $f(1)$.

So if possible I would like to have only one expression, specifically avoiding definitions-by-case, like this one:

$E = f(n)+$(some nice notation able to unify the general case and the special case)

Valid for any value of $n$ including the special cases of $f(1)$.

I was thinking about something like this:

$$E = f(n) + \frac{\mid 2-f(n) \mid}{2-f(n)}$$

That will work for $n \gt 2$ and also for the case $n=1$ when $f(1)=3$ but I am not sure if it is valid for the case $n=1$ when $f(1)=2$ (not sure if $\frac{\mid 2-f(n) \mid}{2-f(n)}$ can be evaluated as $0$ for $f(1)=2$).

Is there a notation able to unify the expressions into one? $f(1)=2$ is an special case. Initially I do not think it is possible but there might be a notation capable of doing it and I do not see it. Thank you!

2

There are 2 best solutions below

4
On BEST ANSWER

$$E=f(n)-1\,+\,\delta_{n,1}\, \delta_{f(n),2}$$

This uses the Kronecker delta.

However, I don't necessarily recommend doing this. The point of writing is clarity, and it's probably clearer to write something like this in cases.

1
On

$$E = \mathbf{1}_{\{1\}} \cdot 2 + (1-\mathbf{1}_{\{1\}}) \cdot (f(n) - 1)$$ will do that (where $\mathbf{1}_X$ is the indicator function of $X$), though honestly I wouldn't recommend it.