Mathematics - Logarithm Function (log)

> Mathematics

1 - About

logarithms permit to replace multiplication by addition. More comfortable to carry at a time the calculator does not exist.

If you see log, you must think trees

Advertising

3 - <math>log_2 n</math>

<math>log_2 n</math> is the # of times you divide n by 2 until you get down to 1.

You keep repeating dividing by two and you count how many times you divide by two until you get a number that drops below one

<MATH> \begin{array}{rrl} log_2 (42) = 5.39 &&&\\ 1- & 42/2 & = & 21 \\ 2- & 21/2 & = & 10.5 \\ 3- & 10.5 / 2 & = & 5.25 \\ 4- & 5.25/2 & = & 2.625 \\ 5- & 2.625/2 & = & 1.3125 \\ 6- & 1.3125/2 & = & 0.65625 \\ \end{array} </MATH>

The logarithm is much, much smaller than the input. log is running much, much, much slower than the identity function. <MATH> \begin{array}{rrl} log_2 (10) & \approx & 3 \\ log_2 (100) & \approx & 7 \\ log_2 (1000) & \approx & 10 \\ \end{array} </MATH>

4 - Documentation / Reference

log_2(x) is approximately log_e(x) + log_10(x)

mathematics/logarithm.txt · Last modified: 2017/09/13 16:15 by gerardnico