Square roots by subtraction

Similar documents
COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Chapter 11 Number Theory

POLYNOMIAL FUNCTIONS

Vieta s Formulas and the Identity Theorem

Binary Adders: Half Adders and Full Adders

6.4 Normal Distribution

Continued Fractions and the Euclidean Algorithm

Lies My Calculator and Computer Told Me

The correlation coefficient

Preliminary Mathematics

0.8 Rational Expressions and Equations

Sequences. A sequence is a list of numbers, or a pattern, which obeys a rule.

Year 9 set 1 Mathematics notes, to accompany the 9H book.

The Method of Partial Fractions Math 121 Calculus II Spring 2015

3.1. RATIONAL EXPRESSIONS

Lesson Plan. N.RN.3: Use properties of rational and irrational numbers.

23. RATIONAL EXPONENTS

Computer Science 281 Binary and Hexadecimal Review

Pigeonhole Principle Solutions

Playing with Numbers

Welcome to Basic Math Skills!

Radicals - Rationalize Denominators

SOLVING EQUATIONS WITH RADICALS AND EXPONENTS 9.5. section ( )( ). The Odd-Root Property

3. Mathematical Induction

3.3 Addition and Subtraction of Rational Numbers

5.1 Radical Notation and Rational Exponents

No Solution Equations Let s look at the following equation: 2 +3=2 +7

=

Fractions to decimals

The BBP Algorithm for Pi

Working with whole numbers

Session 7 Fractions and Decimals

JobTestPrep's Numeracy Review Decimals & Percentages

Squaring, Cubing, and Cube Rooting

1.6 The Order of Operations

Integers are positive and negative whole numbers, that is they are; {... 3, 2, 1,0,1,2,3...}. The dots mean they continue in that pattern.

2.6 Exponents and Order of Operations

EVALUATING ACADEMIC READINESS FOR APPRENTICESHIP TRAINING Revised For ACCESS TO APPRENTICESHIP

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 1 Section 1 Real Numbers

Sample Problems. Practice Problems

Normal distribution. ) 2 /2σ. 2π σ

MODERN APPLICATIONS OF PYTHAGORAS S THEOREM

Indices and Surds. The Laws on Indices. 1. Multiplication: Mgr. ubomíra Tomková

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Addition Methods. Methods Jottings Expanded Compact Examples = 15

Kenken For Teachers. Tom Davis June 27, Abstract

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20

Linear Programming Notes VII Sensitivity Analysis

Contents. Subtraction (Taking Away) Multiplication... 7 by a single digit. by a two digit number by 10, 100 or 1000

PYTHAGOREAN TRIPLES KEITH CONRAD

Ready, Set, Go! Math Games for Serious Minds

Mathematics of Sudoku I

Solutions of Linear Equations in One Variable

A Short Guide to Significant Figures

Numerator Denominator

MATH Fundamental Mathematics IV

NUMBER SYSTEMS. William Stallings

Solving Rational Equations

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

8 Primes and Modular Arithmetic

Greatest Common Factor and Least Common Multiple

Radicals - Multiply and Divide Radicals

Number Systems and Radix Conversion

Solving Systems of Two Equations Algebraically

Stanford Math Circle: Sunday, May 9, 2010 Square-Triangular Numbers, Pell s Equation, and Continued Fractions

CALCULATIONS & STATISTICS

+ = has become. has become. Maths in School. Fraction Calculations in School. by Kate Robinson

Exponents and Radicals

Category 3 Number Theory Meet #1, October, 2000

LINEAR EQUATIONS IN TWO VARIABLES

Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Answer Key for California State Standards: Algebra I

Cubes and Cube Roots

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

Domain of a Composition

The theory of the six stages of learning with integers (Published in Mathematics in Schools, Volume 29, Number 2, March 2000) Stage 1

Free Pre-Algebra Lesson 55! page 1

I remember that when I

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Opposites are all around us. If you move forward two spaces in a board game

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

26 Integers: Multiplication, Division, and Order

Our Primitive Roots. Chris Lyons

1 Determine whether an. 2 Solve systems of linear. 3 Solve systems of linear. 4 Solve systems of linear. 5 Select the most efficient

Tom wants to find two real numbers, a and b, that have a sum of 10 and have a product of 10. He makes this table.

1 Solving LPs: The Simplex Algorithm of George Dantzig

APPLICATIONS AND MODELING WITH QUADRATIC EQUATIONS

Just the Factors, Ma am

47 Numerator Denominator

Simplifying Square-Root Radicals Containing Perfect Square Factors

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers.

Activity 1: Using base ten blocks to model operations on decimals

Radicals - Square Roots

Objective. Materials. TI-73 Calculator

An Introduction to Number Theory Prime Numbers and Their Applications.

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

PURSUITS IN MATHEMATICS often produce elementary functions as solutions that need to be

Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1

Transcription:

Square roots by subtraction Frazer Jarvis When I was at school, my mathematics teacher showed me the following very strange method to work out square roots, using only subtraction, which is apparently an old Japanese method. I ll start by writing down the algorithm in a fairly formal way, which may, for example, make it easier to implement on a computer. Although this method converges much more slowly than Newton s method for finding square roots, for example, this method also has its advantages. Perhaps the main advantage from the computational point of view is that, when finding square roots of integers, no infinite decimals are involved at any step, which can cause loss of precision due to rounding errors. Algorithm to compute the square root of an integer n Initial step Let a = 5n (this multiplication by 5 is the only time when an operation other than addition and subtraction is involved!), and put b = 5. Repeated steps () If a b, replace a with a b, and add 10 to b. (R2) If a < b, add two zeroes to the end of a, and add a zero to b just before the final digit (which will always be 5 ). Conclusion Then the digits of b approach more and more closely the digits of the square root of n. 1

An example To illustrate the method, let s begin to work out the value of the square root of 2. The initial step sets a = 5 2 = 10 and b = 5. So we start with the pair (a, b) = (10, 5). Now we perform the repeated steps. As 10 > 5, we must apply. We therefore replace a with a b, so that now a = 10 5 = 5, and add 10 to b, so that b becomes 15. The new pair is therefore (5, 15). We apply the rule again. This time, however, a = 5 < 15 = b, and so we use R2. This rule says: Add two zeroes to the end of a, to make a = 500, and put a zero before the final digit of b, so that now b = 105. The pair becomes (500, 105). Now 500 > 105, so we apply, and we replace a by a b = 500 105 = 395, and add 10 to b, so that b becomes 115. Our pair is then (395, 115). Repeatedly applying the rules in turn gives: (10, 5) (5, 15) R2 (500, 105) (395, 115) (280, 125) (155, 135) (20, 145) R2 (2000, 1405) (595, 1415) R2 (59500, 14105) (45395, 14115) (31280, 14125) (17155, 14135) (3020, 14145) R2 (302000, 141405) (160595, 141415) (19180, 141425) R2 (1918000, 1414205) and you can see that the digits of b are settling down to start with 14142.... Moreover, 2 = 1.41421356.... In fact, the method does not only work for positive integers. The method works for all positive numbers, even decimals such as 2.71, and even π. In these cases, rather than add two zeroes at the end, we have to multiply by 100 (which comes to the same thing for integers), i.e., to shift the decimal point two places to the right. Here s another example, where we work out the square root of 2.345. Initially, a = 5 2.345 = 11.725, and b = 5. Now apply the steps as before to get: (11.725, 5) (6.725, 15) R2 (672.5, 105) (567.5, 115) (452.5, 125) (327.5, 135) (192.5, 145) (47.5, 155) R2 (4750, 1505) (3245, 1515) (1730, 1525) (205, 1535) R2 (20500, 15305) (5195, 15315) R2 (519500, 153105) and the correct value for 2.345 is 1.53133928.... 2

Although the method works perfectly well for any positive number, it is usually easiest to begin by multiplying or dividing the given number by 100 as often as is necessary until it lies between 1 and 100. For example, given the number 23450, we would begin by dividing by 100 twice to get 2.345, and then continuing as above. Since we have divided by 100 twice, we must multiply by 10 twice to get the correct square root: thus, the square root of 23450 is 153.133928... Finally, let s see how the algorithm copes with a perfect square. Let s work out the square root of 16. First, multiply by 5, and set a = 80. As usual, b = 5. Then, applying our rules gives; (80, 5) (75, 15) (60, 25) (35, 35) (0, 45) R2 (0, 405) R2 (0, 4005) R2 (0, 40005) since multiplying 0 by 100 leaves it unchanged. In practice, one can stop as soon as a = 0, and identify the square root by removing the final digit from b. It is an amusing exercise to program a computer to do this algorithm, at least if n is an integer, and because only integer additions and subtractions are used, there are no errors due to floating-point arithmetic. On the other hand, it is necessary to use more complicated storage techniques (strings or arrays) to store the values of a and b as they get larger and larger, and the algorithm will get slower and slower at producing successive digits. Explanation of the algorithm It s a bit tricky to explain that the algorithm does indeed produce the correct answer. Before we embark on the demonstration, let s make a couple of observations. Note that the number of times rule is applied in between the applications of rule R2 ought to give the sequence of digits in b. We can check that all these digits lie between 0 and 9. Indeed, let s choose a point at which R2 is applied. So we begin with a < b, we change a to 100a, and then subtract successively 10b 45 (this is what you get by putting 0 before the final 5 of b), 10b 35, 10b 25 and so on. We can do no more than 9 of these subtractions; to subtract 10 times would take away 10 numbers averaging exactly 10b from 100a i.e., to subtract 100b from 100a, but since a < b, the first number of the pair would become negative, which is not allowed. It follows that we can apply rule at most 9 times between any two applications of rule R2, and so the digits appearing in b really are exactly the number of times is applied in between applications of R2. 3

As remarked above, we ll assume that our initial number lies between 1 and 100, so that its square root lies between 1 and 10. Thus we suppose that b is equal to b 0.b 1 b 2 b 3..., where all of the b i lie between 0 and 9. Let s show that n = b 2. We shall consider a modified version of the algorithm which incorporates the decimal point: Let a = n/2, and put b = 0.5. Repeated steps ( ) If a b, replace a with a b, and increase the next-to-last decimal digit of b by 1; (R2 ) If a < b, add two zeroes to the end of a, divide b by 10, and add a zero to b just before the final decimal digit (which will always be 5 ). Let s see how this works in the example before, where n = 2. We begin by setting a = n/2 = 1, and b = 0.5. Next, we run through the steps: (1, 0.5) (0.5, 1.5) R2 (0.5, 0.105) (0.395, 0.115) (0.280, 0.125) (0.155, 0.135) (0.020, 0.145) R2 (0.02000, 0.01405) (0.00595, 0.01415) R2 (0.0059500, 0.0014105) (0.0045395, 0.0014115) (0.0031280, 0.0014125) (0.0017155, 0.0014135) (0.0003020, 0.0014145) R2 (0.000302000, 0.000141405) (0.000160595, 0.000141415) (0.000019180, 0.000141425) R2 (0.00001918000, 0.00001414205) (Note that the numbers which appear are exactly the same as in the earlier example; we have merely multiplied all of them by a power of 10.) We begin with a = n/2, and, using rule, we have to subtract various numbers (which we occasionally make smaller with rule R2 ), we eventually get that the first number in the pair approaches 0. It follows that a is the sum of all the numbers which we take away from it, to get 0. Before the first application of R2, we make b 0 applications of rule, subtracting b 0 /2 on average each time. The total amount subtracted in these steps is therefore b 2 0 /2. Between the first and second applications of R2, we make b 1 applications of rule, subtracting b 0 /10 + b 1 /200 on average each time. The total amount subtracted in these steps is therefore b 0 b 1.10 1 + b 2 1.10 2 /2. Between the second and third applications of R2, we make b 2 applications of rule, subtracting b 0 /100 + b 1 /1000 + b 2 /20000 on average each time. 4

The total amount subtracted in these steps is therefore b 0 b 2.10 2 +b 1 b 2.10 3 + b 2 2.10 4 /2. In general, between the kth and k + 1st applications of R2, we make b k applications of rule, subtracting b 0.10 k +b 1.10 k 1 + +b k 1.10 1 2k + b k.10 2k /2 on average each time. The total amount subtracted in these steps is therefore b 0 b k.10 k + b 1 b k.10 k 1 + + b k 1 b k.10 1 2k + b 2 k.10 2k /2 But remember that n/2 must be the sum of all the terms we are subtracting. Thus n/2 = b 2 0/2 + b 0 b 1.10 1 + b 2 1.10 2 /2 + b 0 b 2.10 2 + b 1 b 2.10 3 + b 2 2.10 4 /2 + + b 0 b k.10 k + b 1 b k.10 k 1 + + b k 1 b k.10 1 2k + b 2 k.10 2k /2 + the total subtracted before the first R2, between the first and second, between the second and third, and so on. Note that the coefficient of b i b j is 10 i j if i and j are different, and is 10 i j /2 if i = j. However, if we expand (b 0 + b 1.10 1 + b 2.10 2 + b 3.10 3 + ) 2, then the coefficient of b i b j is 2.10 i j if i and j are different, and is 10 i j if i = j. It follows that the sum making n/2 above is exactly (b 0 + b 1.10 1 + b 2.10 2 + b 3.10 3 + ) 2 /2, and so so that n = (b 0 + b 1.10 1 + b 2.10 2 + b 3.10 3 + ) 2, n = b0 + b 1.10 1 + b 2.10 2 + b 3.10 3 +, and the digits b i coming out of the algorithm are therefore exactly the digits in the decimal expansion of n, as required. Frazer Jarvis is a member of the Department of Pure Mathematics at the University of Sheffield, and his research interests are centred on algebraic number theory. Outside mathematics, he is a keen pianist and sings with the Sheffield Philharmonic Chorus. 5