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