Method fo Appoximating Iational Numbes Eic Reichwein Depatment of Physics Univesity of Califonia, Santa Cuz June 6, 0 Abstact I will put foth an algoithm fo poducing inceasingly accuate ational appoximations fo the squae oot of any natual numbe that is not a pefect squae. Theoem If n is a natual numbe and n is ational, then n is in fact a natual numbe itself. We say in this case that n is a pefect squae. The contapositive of this statement is the fact that if the natual numbe n is not a pefect squae, then n is not a ational numbe. The simple iteative algoithm descibed below geneates inceasingly accuate ational appoximations to the (iational squae oot of a given non-pefect squae. We assume that n is not a pefect squae. We also choose a desied degee of accuacy, i.e., we choose some ε > 0. The boxed algoithm below poduces a ational numbe satisfying n < ε. Let 0 be the (unique natual numbe satisfying ( 0 < n < 0. Iteative step: Assuming that k and k has been calculated, let k = ( k + n. k If k n ε, set = k. If k n > ε, epeat the iteative step. This is anothe genealization of the fact that is iational. This implies in paticula that n >.
Poof Poposition. If n is a natual numbe but not a pefect squae, then n is not ational. Poof. Let k be a natual numbe that is not a pefect squae such that k = p q, whee p and q ae integes and gcd(p, q =. Squaing both sides we get k = p = p p. This means q q q that q p o q p. Since p is not a multiple of q thee is no intege j such that p = j q hence, k (j q(j q fo any j Z. The only way k can be natual numbe is when q = q = q q hence k = p. Theefoe k is a pefect squae, which contadicts ou assumption. This conclusion motivates the need to appoximate the squae oot of non-pefect squaes. One such way is the algoithm I have poposed above.. The Algoithm Hee we will layout a seies of steps to obtain an appoximation of the iational oot to as much as accuacy as desied.. Choose a positive ε fo the coveted pecision.. Pick a natual numbe, 0, that satisfies ( 0 < n < 0. 3. Obtain fom k = ( k + n whee k = 0. k. Check to see if the temination condition, n < ε, holds tue. If it is not tue continue to step 5, othewise we have obtained an appopiate appoximation that we define as. 5. Obtain k fom k = ( k + n whee k is the value peviously did not meet k the temination condition. Fo each new value of k check to see if k n < ε is tue. Repeat this step if the temination condition is not met.. Existence and Uniqueness Lemma. Fo all n N whee n is not a pefect squae, thee exists a unique natual numbe, 0, satisfying ( 0 < n < 0. Poof. Let A n = { N > n}, whee A n N and n is not a pefect squae. Since n >, n > n so n A n. Hence A n is nonempty. By the Well Odeing Pinciple A n has a least element, which we will define as 0. Note that ( 0 < 0 and that 0 is the least element of A n. Theefoe ( 0 is not in A n. Since n is not a pefect squae, ( 0 n. If ( 0 n then it is the fist pefect squae lage than n so ( 0 = 0, which is not tue. Thus ( 0 < n < 0.
.. Rational Temination Poposition 3. All successive appoximations ae ational numbes. Poof. We will pove this poposition by induction. Ou base case is k = so = ( 0 + n0 = ( 0 + n ( = 0 + n 0 0 0 which is a ational numbe because 0 + n and 0 ae integes. Now we must show that k being ational implies k+ is ational. k = ( k + n ( = k + n k k which is a ational numbe. k+ = ( ( k + nk = k + n k Using ou definition of k we obtain ( k + n + n k k+ = ( k + n = k + n + nk ( k (k + n k By induction all successive appoximations ae ational...3 Temination in a Finite Numbe of Iteations Lemma. Fo k, ( k n = k n k Poof. Squae both sides k = ( k + n k = ( k k + ( k = k + n k n k ( = k + n k Subtact n fom both sides k n = k + n n = k + nk + n ( n k = k k k 3
Simplifying and completing the squae we obtain k + nk + n nk k n = k = k nk + n k = k n ( = k n k k = k nk + n k Conjectue 5. Fo k k n 0 n ( k Poof. We will pove this by induction. Obseve that k n k so k n k case is k = ( n = 0 n = ( 0 n 0 0 ( = 0 n ( Using ou obsevation along with lemma we see that k+ n = ( k n k Using ou inductive hypothesis we obtain k. The base ( 0 n 0 0 n ( ( ( = k n (k n ( k n k+ n 0 n ( k ( = 0 n ( k+ Poposition 6. The temination condition k numbe of steps. n ε will always be met afte a finite Poof. Fo any k N we see that 0 k n and fom conjectue 5 we see that k n 0 n ( k. Theefoe 0 k n 0 n ( k We see that lim k 0 n ( k = 0 since 0 n is a constant and ( k is a conveging geometic seies. By the Squeeze Theoem lim k k n must convege to zeo at least as quickly as lim k 0 n ( k conveges to zeo. This means that only afte a infinite amount iteations will ou appoximation become exact. Consequently, thee will be a finite amount of iteations to obtain an appoximation of any finite accuacy.
. Uppe Bound to Numbe of Iteations Poposition 7. Thee is a finite uppe bound on the numbe of iteations equied to obtain the desied accuacy of the appoximation. Poof. Combining the condition fo temination and the esult of conjectue 5 we obtain 0 n ( k ε By solving fo k we find the numbe of iteations needed fo a desied accuacy. ( k ε 0 n Take the logaithm base of both sides k log ε 0 n Consequently, the numbe of iteations, k, is always finite unde the algoithm conditions, ε 0 and 0 n. 3 Examples Let us appoximate the squae oot of 7 to a degee of accuacy of using ou algoithm (step. Fist we see that the closest pefect squae lage than 7 is 5. This will be ou 0 hence, 0 = 5 which satisfies the condition of step. We also see that the next lowest pefect squae is 6, fom hee we can conclude that < 7 < 5. We begin by plugging into ou equation in step 3. = ( 5 + 7 = ( 5 5 5 + 7 = ( 5 + 7 = ( = 5 5 5 5 We now must check if ou is an accuate enough appoximation as equied by step. ( 5 7 < 5 (7(5 5 = 5 5 < 6 5 We must plug ou new value, into the equation of step 3. = ( 5 + 7 = 5 = ( 5 + 5 5 ( (( (5( + (7(5(5 ((5 = ( + 5 5 = 33 5 5
We now must check if ou is an accuate enough appoximation as equied by step. ( 33 5 7 < 8789 5 (7(5 5 = 8789 875 5 = 6 5 < Let us obtain common denominatos to clealy see that this is a tue statement. (6( < ((5 (5( ((5 60 50 < 5 50 It is obvious to see that ou appoximation is well within ou desied accuacy so we can define = = 33 5. 6