Concave approximation and error

70 Views Asked by At

How can I estimate an upper bound of the following difference : $$ \log \left(\dfrac{1}{n}\sum_{i=1}^n x_i\right)-\dfrac{1}{n}\sum_{i=1}^n \log (x_i), $$ where $x_i \in [1,2]$ and $n=10^6$

1

There are 1 best solutions below

2
On

Be $m$ the number of $1$, $n-m$ the number of $2$.

Be $x:=\frac{m}{n}$ (therefore e.g. $m=\lfloor x\cdot n\rfloor$ for approximation).

One gets as a condition for the maximum $(\ln(2-x)-(1-x)\ln 2)'=0$.

Therefore $m=\lfloor (2-\frac{1}{\ln 2})n\rfloor$.