> next up previous
Next: About this document ... Up: Information Theory Primer With Previous: Bibliography

   
APPENDIX: A Tutorial On Logarithms



Understanding the Log Function. In the mathematical operation of addition we take two numbers and join them to create a third:

1 + 1 = 2. (21)

We can repeat this operation:

1 + 1 + 1 = 3. (22)

Multiplication is the mathematical operation that extends this:

$\displaystyle \frac{1}{12} \times \log_2(\frac{1}{12})
\; + \; \frac{8}{12} \times \log_2(\frac{8}{12}) ]$ (23)

In the same way, we can repeat multiplication:

$\displaystyle \;$ (24)

and

$\log_2 8 = 3$ (25)

The extension of multiplication is exponentiation:

$\sqrt{P_y + N_y}$ (26)

and

$\sqrt{N_y}$ (27)

This is read ``two raised to the third is eight''. Because exponentiation simply counts the number of multiplications, the exponents add:

 $\sqrt{P_y}$ (28)

The number `2' is called the base of the exponentiation. If we raise an exponent to another exponent, the values multiply:

 $\lambda$ (29)

The exponential function y = 2x is shown in this graph4:


\begin{figure}% \vspace{12cm}
\special{psfile=''fig/expgraph.ps'' hoffset=0 voffset=0
hscale=60 vscale=60 angle=0} \end{figure}

Now consider that we have a number and we want to know how many 2's must be multiplied together to get that number. For example, given that we are using `2' as the base, how many 2's must be multiplied together to get 32? That is, we want to solve this equation:

2B = 32. (30)

Of course, 25 = 32, so B = 5. To be able to get a hold of this, mathematicians made up a new function called the logarithm:

$\frac{4}{3}\pi r^3$ (31)

We pronounce this as ``the logarithm to the base 2 of 32 is 5''. It is the ``inverse function'' for exponentiation:

 $v_{before} \propto r_{before}^D = \sqrt{P_y + N_y}^D$ (32)

and

 $v_{after} \propto r_{after}^D = \sqrt{N_y}^D$ (33)

The logarithmic function $M = v_{before} / v_{after} = \sqrt{\frac{P_y}{N_y} +
 1}^D$ is shown in this graph5:


\begin{figure}% \vspace{10.5cm}
\special{psfile=''fig/loggraph.ps'' hoffset=0 voffset=0
hscale=60 vscale=60 angle=0} \end{figure}

This graph was created by switching the x and y of the exponential graph, which is the same as flipping the curve over on a 45 $\log_{2} M$ line. Notice in particular that \begin{displaymath}C_y = d_{space}\log_{2}{\left(
 \frac{P_y}{N_y} + 1 \right)} \;\;\;\;\;\mbox{(bits per
 operation).} \end{displaymath}and $\log_2(0)=-\infty$.



The Addition Law. Consider this equation:

\begin{displaymath}\fbox{ $2^{a + b} = 2^a \times 2^b$
}\end{displaymath} (34)

which is just a generalization of equation (28). Take the logarithm of both sides:

\begin{displaymath}\log_2{2^{a + b}} = \log_2 \left(
{2^a \times 2^b} \right) \end{displaymath} (35)

Exponentiation and the logarithm are inverse operations, so we can collapse the left side:

\begin{displaymath}{\cal E}\equiv \frac{P_y}{C_y}
\end{displaymath} (36)

Now let's be tricky and substitute: ${\cal E}$and $\displaystyle {\cal E}_{min}$:

$\textstyle \equiv$ (37)

Again, exponentiation and the logarithm are inverse operations, so we can collapse the two cases on the right side:

1/Emin = 1/(kBT ln(2)) bits gained per joule dissipated
is a precise upper bound on what can be done by a molecular
machine. (38)

This is the additive property that Shannon was interested in.



The ``Pull Forward'' Rule. From equation (32):

$\displaystyle \lim_{P_y \rightarrow 0} \frac{P_y}
{d_{space}\ln \left( \frac{P_y}{N_y} + 1 \right) / \ln(2) }$ (39)

Raise both sides to the u:

\begin{displaymath}{\cal E}_{min}= \lim_{P_y \rightarrow
0} \frac {\ln(2) \left... ... 1 \right) N_y} {d_{space}} =
\frac{\ln(2) N_y }{ d_{space}} \end{displaymath} (40)

Now, we can combine the exponents by multiplying, as in (29):

$\frac{1}{2} k_{\mbox{\scriptsize B}}T$ (41)

Finally, take the log base 2 of both sides and collapse the right side:

\begin{displaymath}N_y = ({\textstyle \frac{1}{2}}
k_{\mbox{\scriptsize B}}T) \times (2 d_{space}) .
\end{displaymath} (42)

This can be remembered as a rule that allows one to ``pull'' the exponent forward from inside the logarithm.



How to Convert Between Different Bases. Calculators and computers generally don't calculate the logarithm to the base 2, but we can use a trick to make this easy. Start by letting:

 \begin{displaymath}{\cal E}_{min}= k_{\mbox{\scriptsize
B}}T \ln(2) \;\;\;\;\; \mbox{(joules per bit)} .
\end{displaymath} (43)

Rearrange it as:

\begin{displaymath}H \equiv - \sum_{i = 1}^\Omega P_i
\log_2 P_i \;\;\;\;\;\mbox{(bits per microstate)}
\end{displaymath} (44)

Now use a ``reverse pull forward'' (!):

$i^{\mbox{\scriptsize th}}$ (45)

and drop the logs:

a = bx. (46)

Now take the log base b:

$\Omega$ (47)

This simplifies to:

\begin{displaymath}R = H_{before} - H_{after} = - \Delta
H \;\;\;\;\;\mbox{(bits per operation)} \end{displaymath} (48)

But we know what x is from equation (43):

\begin{displaymath}S \equiv - k_{\mbox{\scriptsize
B}}\sum_{i = 1}^\Omega P_i \l... ... {\mbox{${}^\circ
\mbox{K}$ } \cdot \mbox{microstate}} \right)
\end{displaymath} (49)

The conversion rule to get logarithms base 2 from any base z is:

$(1.38 \times 10^{-23}$ (50)

Notice that since the z does not appear on the left hand side it doesn't matter what kind of logarithm you have available, because you can always get to another base using this equation! Try this example on your calculator:

${}^\circ \mbox{K}$ (51)

You should get `5'.



Tricks With Powers of 2. In calculus we learn about the natural logarithm with base \begin{displaymath}\Delta S = S_{before} - S_{after}
 \end{displaymath}6 Calculations with this base can easily be done by a computer or calculator, but they are difficult for most people to do in their head.

In contrast, the powers of 2 are easy to memorize and remember:

choices bits
M B
1 0
2 1
4 2
8 3
16 4
32 5
64 6
128 7
256 8
512 9
1024 10

where 2B = M and \begin{displaymath}\Delta S = -k_{\mbox{\scriptsize
 B}}\ln(2) R . \end{displaymath}.

We can use this table and a trick to make quick estimates of the logs of higher numbers. Notice that

\begin{displaymath}dS \geq \frac{dq}{T} \end{displaymath} (52)

So to take the log base 2 of \begin{displaymath}- T \Delta S \leq -q
 \end{displaymath}, we think:
$\int dq = q$ = \begin{displaymath}k_{\mbox{\scriptsize B}}T \ln(2)
 \leq -q / R \;\;\;\;\; \mbox{(joules per bit)} .
 \end{displaymath} (53)
  = $k_{\mbox{\scriptsize B}}T \ln(2)$ (54)
  = \begin{displaymath}{\cal E}\equiv -q / R
 \end{displaymath} (55)
  \begin{displaymath}{\cal E}\geq k_{\mbox{\scriptsize
 B}}T \ln(2) \;\;\;\;\; \mbox{(joules per bit)} .
 \end{displaymath} $k_{\mbox{\scriptsize B}}T$ (56)
  \begin{displaymath}{\cal E}\geq k_{\mbox{\scriptsize
 B}}T \ln(2) \;\;\;\;\; \mbox{(joules per bit)} .
 \end{displaymath} 2 + 10 + 10 (57)
  \begin{displaymath}{\cal E}\geq k_{\mbox{\scriptsize
 B}}T \ln(2) \;\;\;\;\; \mbox{(joules per bit)} .
 \end{displaymath} 22 (58)

The actual value is 21.93.


next up previous
Next: About this document ... Up: Information Theory Primer With Previous: Bibliography
Tom Schneider
2003-01-06

National Cancer Institute    National Institutes of Health    Health and Human Services    USA Gov - Official Web Portal    Viewing Files    Accessibility