BasicsByHand: Square Roots
Premise
Long ago in middle school (or even earlier), along with the concept of what a square root is, I was also taught a method to calculate them by hand. This method did not involve Taylor series expansions, nor was it the popular numeric Newton-Raphson method - we didn’t have a lick of knowledge of Calculus to use them anyway.
It worked, and nobody ever quite taught why it worked. Given that I’m an adult now and free to do adult things, I wanted to cross this off my (admittedly non-existent) list as a part of something else I was trying to understand.
What method?
This is for my readers who may not be familiar with this method, or just need a refresher. Suppose you need to calculate the square root of 78129.329 while you’re stuck on an island. Maybe your captor is a math fanatic. This is how you would go about it.
Start with grouping the digits in pairs - starting from the decimal point, moving on either side of it:
┌─────────────────
│ 7,81,29.32,9Now, we begin a method that suspiciously looks a lot like long-form division. Find the largest number whose square is equal to, or less than the left-most group.
2
┌─────────────────
2 │ 7,81,29.32,9Then, you subtract its square from the digit:
2
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
│ 3and multiply the number at the top with 2 (how arbitrary! or is it…?) and call it the new divisor you’re going to work with. The next task is to find a value for a digit such that is less than or equal to :
2 x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
4x │ 3,81This will require some manual multiplication (since we’re doing this by hand!). Looks like meets this requirement (as ). Apply the same subtraction:
2 7
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
│ 52and repeat the process once more. We need to first multiply by , which gives us . Similarly, should then be less than or equal to :
2 7 x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
54x │ 52,29I’ll forgive you if you use the calculator here! I’ll skip a step here (we end up at as ) to show that we need to now find such that is less than or equal to :
2 7 9. x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
549 │ 52,29
│ -49,41
│─────────────────
558x │ 2,88,32 We settle on 5. Note here that the next number is , not , a small subtlety here. The next is going to be :
2 7 9. 5 x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
549 │ 52,29
│ -49,41
│─────────────────
5585 │ 2,88,32
│ -2,79,25
│─────────────────
5590x │ 9,07,90and we get:
2 7 9. 5 1
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
549 │ 52,29
│ -49,41
│─────────────────
5585 │ 2,88,32
│ -2,79,25
│─────────────────
55901 │ 9,07,90
│ - 5,59,01
│─────────────────
│ 3,48,89 We could stop here, or go on further. I elect to stop here, and verify my result. Let’s go to trusty Python:
1>>> from math import sqrt
2>>> print(sqrt(7_81_29.32_9))
3279.51624103082094Excellent, so we were right!
But… why? How did we get it right?
Building the Intuition
Getting our foot in the door
Let’s start with our previous example.
Note that commas intentionally retained every two digits instead of the usual three.
Why are commands retained every two digits?
This is because squares of numbers have, up to twice the number of digits of the original number. Anecdotally, consider . It will be less than , which is and has 7 digits (and 7 is less than 4, the number of digits that ) has.
On the other hand, smaller numbers like go to ( digit to digits). to remain at digit (1, 4, 9).
Remember that we usually also write our numbers in base . Since any power of is easy to calculate, this makes the estimate of our first digit rather easy. Let’s start by finding the closest square of that is less than or equal to .
Why did we write this as ? This tells us that our desired square root is greater than . What’s the closest multiple of hundred that is less than or equal to ? It’s 200, because
In other words,
When we calculated that was the closest multiple of that was less than or equal to , we were calculating the first digit of the square root.
We continue by applying a common formula…
…which is derived below to minimize cognitive load, in case it’s been a long time since you’ve touched algebra.
Connecting the dots
Let’s consider the next digit. Because the true root lies between and , we can say that the next digit of the root will be the closest multiple of that is greater than and whose square is less than .
That means we’re trying to find a single digit that meets the criteria:
Look closely at the bolded parts of the last equation:
This is exactly what we did here:
2 x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
4x │ 3,81The single digit that satisfies this equation is , as we had obtained earlier.
One more step for clearer understanding
Let’s do one more round to inscribe the logic in our heads:
We know that is the next best approximation of the root of . We also know that to get the next digit, we need the closest multiple of that is between and whose square is less than .
Once again, in trying to find the single digit , the expressions become (note that in this iteration, is just , not , because it’s a multiple of , not ):
and the bolded parts of the expression are:
once again, matching exactly to:
2 7 x
┌─────────────────
2 │ 7,81,29.32,9
│ -4
│─────────────────
47 │ 3,81
│ -3,29
│─────────────────
54x │ 52,29Estimating to more decimal points
You also now understand why this process can continue on till as many decimal points are needed.
The rest of the estimation, however, is, um… left as an exercise to the reader 😬.
Conclusion
I hope you now understand that the so called “long-division” method is just encoding the technique that I laid out above step-by-step, and is not really doing division alone, it’s extending the binomial identity and refining it successively every iteration.
You will also notice that as we proceed further in calculating the root, the smaller the error becomes, allowing us to ignore it when we see fit.
References
The method laid out in the article is described in NIST article. However, the explanation of the method is my own, as I was not able to grasp how the explanation provided in that link actually worked “all the way” to the end.