Translate

Sunday, December 05, 2010

Approximating square roots, easier math?

Here's a fun little result which uses what mathematicians usually call Pell's Equation to find rational approximations to square roots, which was what the earlier mathematicians often used it for anyway, where I also get to sneak in one of my own research findings.

The base equation then is: x2 - Dy2 = 1

Where we want integer solutions, for instance, with D=2: (3)2 - 2(2)2 = 1, and

(17)2 - 2(12)2 = 1, are solutions.

But notice that 17/12 is approximately 1.416, which is close to the sqrt(2).

One result of mine is that given:

u2 + Dv2 = F.

it must be true that

(u-Dv)2 + D(u+v)2 = F(D+1)

which is a general result where I can use u=x, v=y, D = -2, and use it twice to get:

(3x+4y)2 - 2(2x + 3y)2 = 1

so we can easily find another solution using x = 17, y = 12, from above.

So: (3(17)+4(12))2 - 2(2(17) + 3(12))2 = 1

Which is: (99)2 - 2(70)2 = 1

And that gives the slightly more impressive approximation of: 99/70 is about: 1.4142

And if you're bored you can just keep going! Where now x=99 and y=70. And it works out to infinity with ever more precise approximations to sqrt(2). (Next one is: x=577, y=408, and 577/408 is approximately 1.41421.)

Ok, so sqrt(2) is easy, but what about others? Sorry that trick works best for sqrt(2), as I'm sticking to easy. Given one solution to Pell's Equation there are other ways to get new solutions besides my equation which works so simply with D=2.

Finding solutions to Pell's Equation that are integers can be difficult in general, but in some cases it's very easy. For instance, if D+2 is a perfect square then x=D+1, and y = (D-1)/2 are solutions.

For instance, with D=7: 7+2 is a square as it is 9, so x=8:

82 - 7*32 = 1

And that is just one trick for some easy solutions. To see more you can see one of my more complicated posts (swinging for the fences) called Pell's Equation Basics.

But regardless of what more of my research you consider, just be thankful for modern computers which make getting square roots easy, as earlier mathematicians had to figure them out, or rely on approximate tables, where if you needed more precision, you needed to work it out for yourself, versus just asking a computer.

And that need drove research. But for modern people these mathematical tidbits are just curiosities maybe useful for an idle afternoon playing with fractions simply for the fun of it!


James Harris

No comments: