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|$

121 Views Asked by At

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?

3

There are 3 best solutions below

2
On 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.

0
On

Firstly, if one of the $b_k$'s is equal to zero then the inequality is trivial because the right-hand side is $+\infty$.

Now, assuming that for all $k$, $b_k>0$. Let $u_k=\frac {a_k}{b_k}$. Then $$\left|\frac{a_1 + ... + a_n}{b_1 + ... + b_n} \right|=\left|\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n} \right|$$ The right-hand side is the weighted average of the $u_k$'s (it is a convex combination of the $u_k$'s). Therefore it's a number that lies between $\min_k u_k$ and $\max_k u_k$.

Now pick an arbitrary number $c$. Two cases:

If $c\leq\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n} $, then clearly $$c\leq\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n}\leq \max_k u_k$$ and this implies that $$\left|\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n} -c\right|\leq |\max_k u_k-c|\leq \max_k |u_k-c|$$ which is what you wanted by replacing $u_k$ with $\frac{a_k}{b_k}$.

The case $c\geq\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n} $, is similar, where you now observe that $$\min_k u_k \leq \frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n}\leq c$$ which yields $$\left|\frac{b_1 u_1+ ... + b_n u_n}{b_1 + ... + b_n} -c\right|\leq |\min_k u_k-c|\leq \max_k |u_k-c|$$ which, again, leads to what you wanted.

0
On

In general if $(\min_nx_n)\le y \le(\max_nx_n)$ then $|y-c|\le\max_n|x_n-c|$ (just take cases in which $y-c$ is positive or negative).

So for the case of this problem what needs to be shown is that $$\min_n\frac{a_n}{b_n}\le\frac{a_1+\cdots+a_n}{b_1+\cdots+b_n}\le\max_n\frac{a_n}{b_n}.$$

This is easily shown by induction from $\min(\frac{a_1}{b_1},\frac{a_2}{b_2})\le\frac{a_1+a_2}{b_1+b_2}\le\max(\frac{a_1}{b_1},\frac{a_2}{b_2})$. (This inequality is often used to show that $\mathbb{Q}$ is dense.