Skip to content

a log is an exponent

foundations

the puzzle

Tear a sheet of paper in half, stack the halves, and tear the stack in half again. One sheet becomes 2 pieces, then 4, then 8. How many tears make 2048 pieces?

a worked example

Count the tears by counting the times 2 multiplies.

  1. Each tear doubles the pile, so after kk tears there are 2k2^k pieces.
  2. The puzzle gives the result, 2048, and asks for kk. Doubling from 1 runs 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, which is 11 doublings.
  3. So 211=20482^{11} = 2048, and 11 tears make 2048 pieces.
  4. The number 11 has a name. It is the logarithm, or log, of 2048 to base 2, written log⁡2 2048=11\log_2\, 2048 = 11, with the base 2 written small and low.
numberlog× 2+ 110214283164325
Powers of 2 from 1 to 32, each above its log, the count of doublings from 1.

how it works

211=20482^{11} = 2048 gives the result; log⁡2 2048=11\log_2\, 2048 = 11 gives the exponent.

powerlogbbyyxx
211=20482^{11} = 2048log⁡2 2048=11\log_2\, 2048 = 112112048
104=1000010^4 = 10000log⁡10 10000=4\log_{10}\, 10000 = 410410000
72=497^2 = 49log⁡7 49=2\log_7\, 49 = 27249
61=66^1 = 6log⁡6 6=1\log_6\, 6 = 1616
40=14^0 = 1log⁡4 1=0\log_4\, 1 = 0401
Each row says one fact twice. The log is always the exponent, yy.

In general, by=xb^y = x and log⁡b x=y\log_b\, x = y are one fact. The log is the exponent yy. When xx is a whole power of bb, yy counts how many times bb multiplies, from 1, to reach xx.

The base need not be 2. log⁡10 10000=4\log_{10}\, 10000 = 4, as 104=1000010^4 = 10000, and log⁡7 49=2\log_7\, 49 = 2, as 72=497^2 = 49.

in symbols

Take a base bb above 1, the bases algorithms use (a base of 1 is no use, as 1 to any power stays 1). Then log⁡b 1=0\log_b\, 1 = 0, as b0=1b^0 = 1 (lesson 3.4), and log⁡b b=1\log_b\, b = 1, as b1=bb^1 = b.

An exponent below 0 makes a fraction, so a fraction can have a log: log⁡2 14=−2\log_2\, \frac{1}{4} = {-2}, as 2−2=142^{-2} = \frac{1}{4}. On the line, each step left halves and takes 1 off the log.

Halving 1 again and again gives 12\frac{1}{2}, 14\frac{1}{4}, 18\frac{1}{8}, and never reaches 0. So no power of 2 is 0 or less, and the same holds for any base above 1. A log needs a number above 0: log⁡b 0\log_b\, 0 has no value, and neither has log⁡b(−8)\log_b (-8).

24=16<20<32=252^4 = 16 < 20 < 32 = 2^5, and a bigger exponent makes a bigger power, so log⁡2 20\log_2\, 20 lies between 4 and 5: it is not whole. Some books on algorithms write log⁡2\log_2 as just log⁡\log, others as lg⁡\lg; in code, a plain log is a different base.

numberlog× 2+ 11/4−21/2−110214283
Powers of 2 from a quarter to 8, each above its log. Each step left halves and takes 1 off the log, so a quarter sits above minus 2.

your turn

Work each one out. Where there is a box, type your answer and check it. Each exercise's worked answer opens under it.

exercise 1

Tearing paper as in the puzzle, kk tears make 2k2^k pieces.

A number, like 13, 9.5 or 19/2.

worked answer
  1. 211=20482^{11} = 2048 and 212=40962^{12} = 4096, so log⁡2 3000\log_2\, 3000 lies between 11 and 12.
  2. Eleven tears give 2048 pieces, under 3000. Twelve give 4096, at least 3000.

Check it another way: 3000 sits between 2048 and 4096, and 4096 is the first power of 2 past it.

exercise 2

Work out each log.

A number, like 13, 9.5 or 19/2.

A number, like 13, 9.5 or 19/2.

worked answer
  1. 4 multiplies as 4, 16, 64, 256, 1024, which is 5 times, so 45=10244^5 = 1024 and log⁡4 1024=5\log_4\, 1024 = 5.
  2. 1100=1102=10−2\frac{1}{100} = \frac{1}{10^2} = 10^{-2} (lesson 3.4), so log⁡10 1100=−2\log_{10}\, \frac{1}{100} = {-2}.

Check it another way: 45=4×4×4×4×4=10244^5 = 4 \times 4 \times 4 \times 4 \times 4 = 1024.

exercise 3

A base bb above 1 has log⁡b 625=4\log_b\, 625 = 4.

A number, like 13, 9.5 or 19/2.

worked answer
  1. log⁡b 625=4\log_b\, 625 = 4 says b4=625b^4 = 625, four equal factors making 625.
  2. Try bases in turn. 24=162^4 = 16, 34=813^4 = 81, 44=2564^4 = 256, 54=6255^4 = 625.
  3. So b=5b = 5.

Check it another way: 5 multiplies as 5, 25, 125, 625, which is 4 times, so log⁡5 625=4\log_5\, 625 = 4.

exercise 4

Logs of 1, of fractions and of 0.

The log that does not exist:

A number, like 13, 9.5 or 19/2.

worked answer
  1. 50=15^0 = 1, so log⁡5 1=0\log_5\, 1 = 0, and it exists.
  2. 4−2=1164^{-2} = \frac{1}{16}, so log⁡4 116=−2\log_4\, \frac{1}{16} = {-2}, and it exists too.
  3. Every power of 2 is above 0, so no power of 2 is 0, and log⁡2 0\log_2\, 0 does not exist.
  4. 91=99^1 = 9, so log⁡9 9=1\log_9\, 9 = 1.

Check it another way: Halving 1 again and again gives 12\frac{1}{2}, 14\frac{1}{4}, 18\frac{1}{8}, and never reaches 0.