given: $$m_1+m_2+...+m_k=m$$ How can I find $\Theta(log(m_1)+...+log(m_k))$ as related to $m$?

I know that i can doing that: $O(log(m_1)+...log(m_k))=O(log(m)+...+log(m))=O(k \cdot log(m))$ , but can I find something without $k$ ?

  • 2
    $\begingroup$ Is $k$ a fixed constant? If not, you can't give a big-Theta bound, since you could have $k=m$ and $m_1 = \dots = m_k = 1$, giving $\sum_i\log m_i = 0$. $\endgroup$ – David Richerby Jun 13 '18 at 18:55

The $\log$ function is concave so, by Jensen's inequality, $$\frac{1}{k}\sum_{i=1}^k\log m_i \leq \log\Big(\frac1k\sum_{i=1}^k m_i\Big)$$ i.e., $$\sum_{i=1}^k \log m_i \leq k\log\frac{m}{k} = k\,(\log m - \log k)\,,$$ which is basically what you got by bounding $\log m_i\leq \log m$. We can't do any better than this because we could have $m_1 = \dots = k_m = \tfrac{m}{k}$, in which case $\sum_i\log m_i = k\log\tfrac{m}{k}$.

However, if $k$ is a fixed constant, then $k\log\tfrac{m}{k}=O(\log m)$.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.