I'm interested in minimizing an expression
$F(i) = |1 - \frac{a}{i}|$
where $a > 1.0$ is a known positive real number, and $i$ is a positive integer.
EDIT: In particular, I am interested in how the minimum scales with $a$
EDIT 2: Ok, I found my answer. By noticing that reals and integers can only differ by 0.5, and doing a tiny bit of math, one arrives at
$F_{min} \in [0, \frac{1}{2a}]$ and thus the minimum scales inverse-linearly with $a$
Denote with $\lfloor a \rfloor$ the biggest integer no greather than $a$ and with $\lceil a \rceil$ the smallest integer no less than $a$. In other words $\lfloor 2.0 \rfloor = \lceil 2.0 \rceil = 2$, $\lfloor 2.2 \rfloor = 2$, $\lceil 2.2 \rceil = 3$
If $i\ge a$:
$$f(i) = \frac{|i-a|}{a}=\frac{i-a}{a} =1-\frac{a}{i}$$
This epxression reaches minimal value for x=$\lceil a \rceil$ and the minimal value is:
$$f_1 = 1 - \frac{a}{\lceil a \rceil}$$
If $i\lt a$:
$$f(i) = \frac{|i-a|}{a}=\frac{a-i}{a} =1-\frac{i}{a}$$
This epxression reaches minimal value for x=$\lfloor a \rfloor$ and the minimal value is:
$$f_2 = 1 - \frac{\lfloor a \rfloor}{a}$$
Minimum value of $f(i)$ for a given $a$ is:
$$f_{min}=min \left(1 - \frac{a}{\lceil a \rceil},1 - \frac{\lfloor a \rfloor}{a}\right)$$
or:
$$f_{min}=1 - max \left(\frac{a}{\lceil a \rceil},\frac{\lfloor a \rfloor}{a}\right)$$
Here is the graph of $f_{min}$ as a function of $a$:
Red line represents asymptotic boundary of $f_{min}$: $\frac1{2x}$