What is the square root of 10?
1024 = 32^2
1000 = 32^2 - 24
1000 = 32^2 - 2(12)
1000 = 32^2 - 2(32)(12/32)
1000 = 32^2 - 2(32)(3/8)
1000 = 32^2 - 2(32)(3/8) + 9/64 - 9/64
1000 = (32-3/8)^2 - 9/64
1000 = 31.625^2 - 9/64
1000 + 1/7 = 31.625^2
10 + 1/700 = 3.1625^2
August 4, 2003 8:30 AM
| TrackBack
Of course, you could do this with continued fractions:
sqrt(10)=3 + (sqrt(10)-3)
= 3 + 1/(sqrt(10)+3)
= 3 + 1/(6+(sqrt(10)-3))
= 3 + 1/(6+1/(6+...))
This will give you "best" rational approximations for sqrt(10). In sequence:
f1=3, f2=3 1/6, f3=3 6/37, f4=3 37/228,...
Note that 10 - f3^2 = 1/37^2. Similarly,
10 - f4^2 = -1/288 ^2
Now, given two fractions, P/Q and P'/Q', you can construct any number between them with:
(P+a*P')/(Q+a*Q') for positive a
Now, f(2)=P(2)/Q(2)=19/6 and
f(3)=P(3)/Q(3)=117/37
Notice that your fraction is
253/80=(P(2)+2*P(3))/(Q(2)+2*Q(3))
which means that it is closer than f(2), but still further away than f(3). It is a good approximation, and certainly easy to represent in base 10 :-)
Gack, I needed to get to sleep. OK, working backwards....
Z = a / ( b + a / ( b + ....
Z = a / ( b + Z )
[I haven't played with these for a while, so it took some time to remember that trick]
Z^2 + bZ - a = 0
Z = [ -b + ( b^2 + 4a ) ^.5 ] /2
Just a refresher on how partial fractions work. Now, given a root, how to find the right partial fraction?
n = ( k + Z ) ^2
n = k^2 + 2kZ + Z^2
n - k^2 = Z(2k + Z)
(n-k^2)/(2k+Z) = Z
So we choose the root of a convenient perfect square, and begin plugging away, with
a = (n-k^2)
b = 2k
a / ( b + N(n)/D(n) )
a / ( bD(n) + N(n) ) / D(n)
a D(n) / ( bD(n) + N(n))
N (n+1) = a D(n)
D (n+1) = b D(n) + N(n)
or, rearranging the terms slightly
D (n) = b D(n-1) + a D(n-2)
Comment by: Danil August 6,2003