New Year's Eve 2001/2002.

You know how it is, you are at a party and someone comes up with a ridiculous question! The question last monday evening (31st December 2001) was "What is the Square Root of 12,345,678,987,654,321?"

What a silly question!

As anyone who knows me will know, not only would I want to know the answer, but I would want to know how to work out the answer.

After a bit of searching, here is a summary of three different ways to calculate the answer. By the way, solution (1) was the first one I found, and took me absolutely ages to do long hand. The rest are easy and self explanatory.

Anyone for quantum Phsyics?

All the very best for a healthy and happy 2002.

Martin

 5th January 2002 (Scroll down for the solutions)

# Number 1: SQUARE ROOT THEORY

Up until some time in the 1960's, school children were taught a really clever algorithm for taking the square root of an arbitrarily large number. The technique is quite similar to long division. Here's how it works for decimal square roots.

a) Starting at the decimal point pair off the digits.

b) Find the largest square that subtracts from the left-most pair and still yields a positive result. This is the remainder that will be used in the next step and note that it is only two (or one) digits. The square root of this largest square is the first digit of the square root of the whole number.

c) Concatenate the next pair of digits with the remainder.

d) Multiply the square root devloped so-far by 20. Note that the least significant digit is a zero.

e) The next digit in the square root is the one that satisfies the inequality:

(20 * current + digit) * digit <= remainder

where "current" is the current square root and "digit" is the next digit produced by the algorithm.

f) Form the new positive remainder by subtracting the left side of the equation in the previous step from the right side.

g) go to step (c)

As an example, suppose we want to find the square root of 31415.92653:

a) Pair off the digits

`3 14 15.92 65 3 ^  ^  ^  ^  ^`

b) The left most pair is 03 and the largest square that subtracts from it is 1. And since the square root of 1 is 1, the first digit of our answer will be 1.

c-g)

`      1  7  7. 2   -------------   ) 03 14 15.92     -1     --27 |  2 14       1*20 = 20*7=   1 89       (20+x)*x < 214 ==> x=7      ---- 347 |  25 15    17*20 = 340  *7=   24 29    (340+x)*x < 2515 ==> x=7        -----  3542 |   86 92    177*20 = 3540    *2=    70 84    (3540+x)*x < 8692 ==> x=2           -----           16 08`

The reason this works is easy to show. We can rewrite the number we wish to root:

`           2n           2(n-1)N = A  * 10   + A   * 10      + . . . + A     n           n-1                     1`