# How can I calculate log?

$$-0.4 \cdot \log(0.4) - 0.3 \cdot \log(0.3) - 0.3 \cdot \log(0.3) = 1.571$$

The answer is given. How can I calculate the equation for obtaining $1.571$? Please help me understand.

-
Calculate how? on a calculator? – Dennis Gulko Dec 10 '12 at 12:57
@DennisGulko: I think something is wrong at the OP's identity. ??! – Babak S. Dec 10 '12 at 13:08
The question is what do you mean when you write $\log$. Do you mean $\log_{10}$, $\log_e$ or $\log_2$ (the last seems to be the correct, according to WA) – Dennis Gulko Dec 10 '12 at 13:12
They're base-2 logarithms. Otherwise the answer is wrong. – Michael Hardy Dec 10 '12 at 13:50

As Michel pointed out, this equation is only correct if you're using base-2 logs. Writing $\lg x$ for $\log_2 x$ the left side of your equation is \begin{align} -0.4\lg(0.4)-0.6\lg(0.3) &= -0.4\lg(4/10)-0.6\lg(3/10)\\ &=-0.4(\lg4-\lg10)-0.6(\lg3-\lg10)\\ &=-0.4\lg4+0.4\lg10-0.6\lg3+0.6\lg10\\ &= -0.4(2)-0.6\lg3+\lg10\\ &=-0.8-0.6\lg3+\lg(2\cdot5)\\ &=-0.8-0.6\lg3+\lg2+\lg 5\\ &=-0.2-0.6\lg3+\lg5 \\ &\approx 1.571 \end{align}