October 21, 2008

Geek entry of the day

Another from the PG archives because I've got nuthin' today. As for those of you who think that that makes this day no different from any other, well, you have a point.

Have you ever been caught off guard when someone walks up to you and asks, "What's the square root of X?" Me, too. Usually, I can remember approximations for most square roots up through, uh, maybe I won't finish that statement. Anyway, sometimes the numbers are just too damn big or I need more digits after the decimal place than I can comfortably work out. It's times like that when you really need Newton's formula:

Newtons sqrt.jpg

b represents the number for which you're seeking the square root and x is your first guess. Wanna see how it all works? Of course you do! Observe:

Let's say that you need the square root of 13 and we want to be within 0.00001 of the actual value. For simplicity, we'll make x the same as b, the number we're taking the square root of.

x=13, b=13
NewX=7, difference is 6

x=7, b=13
NewX=4.428571, difference is 2.571429

NewX=3.682028, difference is 0.746544

x=3.682028, b=13
NewX=3.606345, difference is 0.075682

x=3.606345, b=13
NewX=3.6055514, difference is 0.000794

NewX=3.605551, difference <0.000001

There you have it: the square root of 13 is approximately 3.605551.

I feel better already.

Post contains 235 words, total size 2 kb.

Comments are disabled. Post is locked.
16kb generated in CPU 0.63, elapsed 0.5706 seconds.
89 queries taking 0.4871 seconds, 231 records returned.
Powered by Minx 1.1.6c-pink.