Logarithms "real life" usage for multiplication of 2 numbers

What's 128 times 512?

For those of us who grew up in the digital age and so have memorized the table of powers of 2 to many exponents (I know them to exponent 16 off top of my head), this is easy using logarithms base 2: $$128 * 512 = 2^7 * 2^9 = 2^{16} = 65536 $$ Notice: this is nothing more nor less than a logarithm calculation. Let me lay it out in a different way. $$\log_2(128) = 7 $$ $$\log_2(512) = 9 $$ $$\log_2(128 * 512) = \log_2(128) + \log_2(512) = 7 + 9 = 16 $$ So, $$128 * 512 = 2^{16} = 65536 $$ At all stages, I have consulted a memory device (in this case, my brain) to do the calculations.

Okay, now let me turn to your problem. $$734 * 213 $$ You say "the log usage doesn't give the correct result". Well, if you want all 6 digits of the answer to be completely correct, that's true.

But wait, how did I even know that the answer was 6 digits? I knew this because, in my head and very rapidly, I did an estimated calculation that amounts to the following logarithm calculation (it takes me 50 times longer to write this out than it took to do it in my head): \begin{align*} \log_{10}(734) &= \log_{10}(100 * 7.34) = \log_{10}(100) + \log_{10}(7.34) = 2 + \log_{10}(7.34) \\ \log_{10}(213) &= \log_{10}(100 * 2.13) = \log_{10}(100) + \log_{10}(2.13) = 2 + \log_{10}(2.13)\\ \log_{10}(734 * 213) &= \log_{10}(734) + \log_{10}(213) = 2 + \log_{10}(7.34) + 2 + \log_{10}(2.13) \\ &= 4 + \log_{10}(7.34) + \log_{10}(2.13) \\ &= 4 + \log_{10}(7.34 * 2.13) \end{align*} Now I apply this to do an estimate. $$4 + \log_{10}(7 * 2) < 4 + \log_{10}(7.34 * 2.13) < 4 + \log_{10}(8*3) $$ $$4 + \log_{10}(14) < \log_{10}(734 * 213) < 4 + \log_{10}(24) $$ $$\log_{10}(10000*14) < \log_{10}(734 * 213) < \log_{10}(10000*24) $$ $$\log_{10}(140000) < \log_{10}(734 * 213) < \log_{10}(240000) $$ and so I conclude that $$140000 < 734 * 213 < 240000 $$ Hence I know that $734 * 213$ is a six digit number, in fact I know quite a bit more.

This is the real value of logarithms: it lets you do estimated calculations very, very quickly. The better logarithm table you have, the better and more accurate your calculation will be.


The practical real-life application of logarithms in doing arithmetic came before the days of hand-held electronic calculators (if you are young, let me explain that a hand-held calculator was your cell phone plus its calculator app, minus the ability to text, take pictures, access the internet, spend money on other apps, or -gulp- talk on the phone).

Engineers would carry a slide rule, which is a pair of sticks with logarithmic-spaced rulings marked on them. You could use a slide rule to multiply, say, $743\times 213$ in less than a second, getting the answer to three-digit accuracy.

As to on-paper calculations, although the theoretical complexity of multiplication of $b$-bit numbers is the same as that of addition which is $O(b\log b)$, divide-and-conquer algorithms are needed to achieve this efficiency, and they are too complicated to be practical by hand.

The usual on-paper multiplication takes $O(b^2)$ work, whle looking up logs and adding them is again $O(b\log b)$ so there can be a practical advantage.

Tags:

Logarithms