How does this change of log happen?

31 Views Asked by At

enter image description here

Given this expression:

enter image description here

I am unable to understand how the following change of log happens. How did that expression become that result, especially yhr p2^li

1

There are 1 best solutions below

0
On BEST ANSWER

$$\sum_{i=1}^n p_i \log \frac 1{p_i} - \sum_{i=1}^n p_i l_i = \sum_{i=1}^n p_i \log \frac 1{p_i}-p_il_i=\sum_{i=1}^n p_i (\log \frac 1{p_i}-l_i)$$ Because $-l_i$ can be represented as $\log_2 2^{-l_i}$, we substitute to get $$\sum_{i=1}^n p_i (\log \frac 1{p_i}+\log_2 2^{-l_i})$$ Addition of logs is just log of multiplication, so that will give you $$\sum_{i=1}^n p_i (\log \frac {2^{-l_i}}{p_i})=\sum_{i=1}^n p_i (\log \frac {1}{p_i2^{l_i}})$$