No account? Create an account # rho

## Just keep on trying till you run out of cake

Arithmetical tricks
The fact that hardly anyone seems able to do mental arithmetic these days is one of my fairly standard rants, which most if not all of you have probably heard me make before, at some point. And the thing about mental arithmetic is that in a lot of cases -- especially the cases where you aren't looking for an exact answer -- the mindset and methodology is entirely different to the forma, step by step method that is taught in schools and written out on paper.

One thing that has been interesting me recently is the calculation of roots (square roots, cube roots, and so on). I'm not even sure what the "right" way to calculate these without a calculator or computer is. It's probably something to do with a series expansion, I'd suppose. Or it's dead straightforward if you have a log table, but that's just using a different method of having something else work out the result for you.

Approximations, though, are relatively straightforward. For instance I know that you can get a good estimate of the square root of 2 as follows:

7^2 = 50 (that should be an "is approximately equal to" symbol, but I'm too lazy to figure out how to get one of them)
14^2 = 2^2 * 7^2 = 4 * 50 = 200
14 = sqrt(200) = sqrt(2) * sqrt(100)
14 = 10 * sqrt(2)
sqrt(2) = 14/10 = 1.4

Which is close enough for most purposes (the actual answer is a little above 1.41).

Then just recently, I accidentally stumbled across a similar method for the cube root of 2:

1000 = 1024
10^3 = 2^10 = 2 * (2^9)
10 = cuberoot(2) * cuberoot(2^9) =cuberoot(2) * 2^3 = cuberoot(2) * 8
cuberoot(2) = 10/8 = 5/4 = 1.25

Again, this is good enough for most purposes (the actual value is just slightly below 1.26).

There's nothing particularly difficult about any of the maths involved (at least, not for people who deal with maths frequently; I appreciate that most of this will have gone over the head of the non-mathematical out there, but I doubt that any of you ever need to know what the square root of 2 is). Mental arithmetic of that sort is primarily difficult because people just don't learn of the tricks and techniques involved, and so don't have any idea how to tackle such things.

Admittedly, these particular tricks aren't of any particular use, since you pretty much have to know them in order to use them. They do rather nicely illustrate the mindset involves though, I think. I'm meaning to get around to hunting for other such methods of approximation for other roots at some point, though I haven't got there yet. [Ack, sorry, repost. I messed up my HTML]

Logs. Logs are like the opposite of powers. If a^b = c then loga c = b (pronounced log to the base a of c equals b). The two bases that tend to get used the most are base 10 and base e (which is a Special Number which is approximately 2.72). Log to the base e is often (especially on calculators) marked as ln (meaning natural log). On calculators, log to the base 10 is just marked as "log", which can be confusing because some naughty peope (like me) will just write down "log" when what they actualy mean is "loge".

People use base 10, because we're used to counting in tens, so it's an intuitive number for us. And they use base e because e to the power of something comes up in an awful lot of mathematical things, and having the inverse around is handy.

So, for instance log101000 = 3, because 103 = 1000. Or log10100000000 = 8, because 108 = 100000000.

This is handy, because numbers like 8 tend to be a whole lot easier to work with than numbers like 100000000. There are all sorts of useful rules for doing arithmetic with logs. For instance:

log(a*b) = log(a) + log(b)
log(a/b) = log(a) - log(b)
log(a^b) = b * log(a)

(These work for any base of log)

So what you can do when you have some nasty arithmetic to do with big numbers is change it into something involving logs, do a little calculation involving little numbers, and then change back at the end. That's how things like slide rules and log tables worked, I think.

Or to do the square root of 2, you could say something like this:

log(sqrt(2)) = log(2^(1/2)) (raising something to the power of a half is the same thing as taking the square root)
log(sqrt(2)) = 1/2 * log(2) (that's the third of the rules I gave above)

So you go off to look at your log table to see what the log of 2 is. And if you're using logs to the base ten, you see that the answer is 0.3010. Then you half that, and you get 0.1505. And then you go and get another table which gives you "anti-logs", which is just 10 to the power of whatever, and that gives you 1.414, which is the square root of two that you were looking for.

Or doing a web search, here's a page that shows how to do 8472 * 6339 using logs.

Does that help at all? 