The little graphics are great!

At last something which has be bugging me for ages. My maths teachers didn't have any idea we just did a 'trial and error' estimation thing which seemed a bit inaccurate and quite un-mathematical. I always thought there had to be away as calculators can do it (is there a different way of doing it binary then?). Also does this technique for other roots like cube roots?

The little graphics are great!

I don't know how calculators do it Mouldy, but if you read through the method again you will see that it does actually use trial and error, only on smaller parts and with only ten possible options. Now if I wasn't at work and feeling guilty for posting h2g2 messages already I would have checked to see what has the more steps, this method, or doing things the hard way...

The little graphics are great!

The little graphics are great!

You can write functions such as sin, cos, tan and log in terms of "infinite" polynomials - equations that go on forever. The calculator truncates the infinite polynomial at a point where adding something makes no difference to the display (i.e. it doesn't change any of the numbers shown on the screen).

I'm not entirely sure whether the same thing happens for square roots - I know there is an infinite expansion for certain values of x, but I'm not sure whether it holds for all values of x, hence my uncertainty in my previous post. Anyone else know?

The little graphics are great!

This technique actually works in any base, including binary, but unless you're very comfortable doing arithmetic in different bases, I don't recommend it. If you want to see something like the square root of 2 in binary, though, this is the only way I know to find it. (It's a non-terminating, non-repeating string of 0s and 1s; big surprise there.)

Another way to get a square root it with an iterative process. Suppose you want a square root of a number N. You start with some approximation, that might not be very close, and call it X1. To get your second approximation, X2, use this formula:

X2 = (X1 + N/X1) / 2

Just keep repeating this process, using the same formula to get each X in terms of the previous one. Suppose you want the square root of 42. First, suppose it's 6.

X1 = 6

X2 = (6 + 42/6) / 2 = 6.5

X3 = (6.5 + 42/6.5) / 2 = 6.4807692...

X4 = (X3 + 42/X3) / 2 = 6.4807407....

The real square root of 42 is 6.4807407..., so the fourth approximation was accurate to seven decimal places. Not bad.

I'm just looking for infinite series expansions for sqrt(x), but the one I calculated by hand only works for numbers near 1, which isn't good. I'll keep looking.

The little graphics are great!

I wish I could see the little graphics on my laptop. I'm stuck in the middle of the desert in Peru, with very little in the way of entertainment. I was suddenly intriged by the sqr roots but can't see the graphics!

The little graphics are great!

I think this is one of the most useful articles I've come across on h2g2, I've been wanting to do this for years... but then it wasn't something that was taught in school - I was either taught to use a calculator or estimate... which was immensely frustrating for me. It wasn't until my Mum told me that she'd learned it another way, that I actually realised that it could be done by hand, although she'd forgotten it. So this is great!

I too would also be fascinated if there was a way of doing it for other roots like cube roots and so on.

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."