I would like to compute the tight upper bound of an error term, $\epsilon$, defined as
$\epsilon = \left |\frac{1}{k}\sum\limits_{i=1}^{k} \frac{x_i}{y_i} - \frac{\sum\limits_{i=1}^{k} x_i}{\sum\limits_{i=1}^{k} y_i} \right |$ ,
where $k$, $x_i$ and $y_i$ are non-negative integers such that $x_i \leq y_i$. It is easy to see that $\sum\limits_{i=1}^{k} \frac{x_i}{y_i} \leq \sum\limits_{i=1}^{k} x_i$. But that does not get me anywhere.
Suppose $N$ is a positive integer, $k = N + 1$, $x_1 = 1$, $y_1 = N^2$, and $x_i = y_i = 1$ for all $i > 1$. Then $$ \epsilon = \frac1{N+1}\left(N + \frac{1}{N^2}\right) - \frac{N+1}{N^2 + N} > 1 - \frac1{N} - \frac1{N+1}, $$ so the least upper bound (assuming $k$ is variable) is $1$.