Prove $\left|\frac{a_1 + … + a_n}{b_1 + … + b_n} – c \right| \le \max\limits_{k \in 1:n}\left|\frac{a_k}{b_k} – c\right|$

inequalitymaxima-minimaoptimization

Given two sets of numbers – ${a_1, …, a_n}$ and ${b_1, …, b_n},b_i \ge 0 \; \forall i \in 1:n$ and some constant $c$.

I'm trying to prove that
$$\left|\frac{a_1 + … + a_n}{b_1 + … + b_n} – c \right| \le \max_{k \in 1:n}\left|\frac{a_k}{b_k} – c\right|.$$
Will it be right to say we need to prove, that we need to find $\max\frac{a_k}{b_k}$ for $c\le 0$ and $\min\frac{a_k}{b_k}$ for $c\ge 0$?
Or can we say just we need to prove
$$\left|\frac{a_1 + … + a_n}{b_1 + … + b_n} \right| \le \max_{k \in 1:n}\left|\frac{a_k}{b_k}\right|?$$
And how can i proceed?

Best Answer

EDIT: By using @David C. Ullrich idea, the proof can be greatly simplified (credit goes to his deleted post):

Let $M=\max_{k \in 1:n}\left|\frac{a_k}{b_k}-c\right|$ it follows that:

$|a_i-cb_i|\le Mb_i$ for all $i=1,2,\ldots,n$

$|a_1+\ldots+a_n -c(b_1+\ldots+b_n)|\le|a_1-cb_1|+\ldots+|a_n-cb_n|\le M(b_1+\ldots+b_n)$

And one gets the desired result by dividing both sides by $b_1+\ldots+b_n$

INITIAL ANSWER:

To prove the last inequality,drop first the absolute value, as you deal with positive numbers. Then, without loss of generality, reorder the indices such that $\frac{a_1}{b_1}\le\frac{a_2}{b_2}\le\ldots\le\frac{a_n}{b_n}$ and proceed by induction.

The second step is to observe that you can drop the requirement $a_i\ge 0$, as we always have $\frac{|a_1+\ldots+a_n|}{b_1+\ldots+b_n}\le\frac{|a_1|+\ldots+|a_n|}{b_1+\ldots+b_n}\le\max_{k \in 1:n}\frac{|a_k|}{b_k}$

As the last step, you may apply the last inequality for $a_1\leftarrow a_1-cb_1, \ldots a_n\leftarrow a_n-cb_n$ to get your desired result.

Related Question