Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Dave's Square roots approximation

1,215 views

Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

Dave's Square roots approximation

  1. 1. A new technique for finding square roots David Coulson, 2012
  2. 2. A few years ago I developed an arithmetic procedure that I called The RadiusMethod, which relates the square of a number to the product of two numbersequally spaced above and below the number. N2 f1 x f 2 a2 a f1 N f2
  3. 3. From there it was possible to derive a new formula that closely approximatesthe square root of a number. N f1 f2 N f1 f2 4The formula produces good results across a range of numbers, and can beapplied in a matter of seconds without use of a calculator and often withoutuse of pen-and-paper.
  4. 4. f1 and f2 are numbers close to the true square root of N, one larger and onesmaller. Ideally, they are equidistant from the true square root, though thiscondition can be relaxed considerably. The distance to one of these numberscan be twice the size of the other and still produce results within 1% of thetrue square root. N f1 f2 N f1 f2 4The formula is therefore quite robust against inaccuracy, and that means wecan choose estimates on the basis of their convenience more-so than on theiraccuracy.
  5. 5. For example, suppose we are interested in the square root of 32. 32 f1 f2 32 f1 f2 4We know (from reference to the times table) that the true square root must liebetween 5 and 6, therefore we can use the sum 5+6=11.This would make the calculation awkward, so I would prefer to use the sumtotal of 10.
  6. 6. For example, suppose we are interested in the square root of 32. 32 10 32 10 2We know (from reference to the times table) that the true square root must liebetween 5 and 6, therefore we can use the sum 5+6=11.This would make the calculation awkward, so I would prefer to use the sumtotal of 10.
  7. 7. For example, suppose we are interested in the square root of 32. 32 3.2 2.5 5.7We know (from reference to the times table) that the true square root must liebetween 5 and 6, therefore we can use the sum 5+6=11.This would make the calculation awkward, so I would prefer to use the sumtotal of 10.
  8. 8. For example, suppose we are interested in the square root of 32. 32 3.2 2.5 5.7We know (from reference to the times table) that the true square root must liebetween 5 and 6, therefore we can use the sum 5+6=11.This would make the calculation awkward, so I would prefer to use the sumtotal of 10. True square root = 5.66; error = 0.7%
  9. 9. Had I used 11 as the sum total, the answer would be more accurate but wouldrequire more intense work. Having said that, however, the result is still fairlyeasily obtained: 32 11 32 11 4 10 11 2 11 4 2.909 2.75 5.659 Out by 0.04%
  10. 10. Second example: square root of 53. 53 f1 f2 53 f1 f2 4The true square root must be between 7 and 8, so I could use 7+8=15.
  11. 11. Second example: square root of 53. 53 15 53 15 4 106 3.75 30 3.53 3.75 7.28 Out by 0.001%
  12. 12. Derivation: The method comes initially from the algebraic identity ( x a)( x a) x2 a2 a (x-a) N (x+a)
  13. 13. This makes it possible to treat the squaring of a number as a multiplication oftwo equidistant numbers, followed by the addition of another simple square. N2 f1 x f 2 a2 a f1 N f2
  14. 14. For example, 22 2 (20 x 24) 2 2 480 4 N2 f1 x f 2 a2 a f1 N f2
  15. 15. Alternatively, the product of two numbers can be seen as the squaring of anintermediately located value followed by the subtraction of a simple square. 2 f1 f2 f1 x f 2 a2 2 a f1 N f2
  16. 16. For example, 18 x 22 202 22 400 4 2 f1 f2 f1 x f 2 a2 2 a f1 N f2
  17. 17. These procedures can be rearranged to produce a formula for the square rootof a number in terms of two other numbers equally spaced above and belowthe required square root. f1 N f2
  18. 18. Suppose f1 and f2 are numbers equidistant from a number N whose valuewe wish to determine, given that N2 is known. f1 f2 In that case, N 2 f1 N f2
  19. 19. This can be rearranged easily to produce ( f1 f 2 ) (2 N ) 0 f1 f2 N 2 f1 N f2
  20. 20. Squaring: ( f1 f 2 )2 2( f1 f 2 )( 2 N ) (2 N ) 2 0 f1 f2 N 2 f1 N f2
  21. 21. Isolate the linear term: ( f1 f2 )2 (2 N ) 2 2( f1 f 2 )( 2 N ) f1 f2 N 2 f1 N f2
  22. 22. ( f1 f 2 ) 2 (2 N ) 2Isolate the linear term: N 4( f1 f 2 ) f1 f2 N 2 f1 N f2
  23. 23. 4N 2 ( f1 f 2 ) 2Isolate the linear term: N 4( f1 f 2 ) 4( f1 f 2 ) f1 f2 N 2 f1 N f2
  24. 24. N2 f1 f2Isolate the linear term: N f1 f2 4 f1 f2 N 2 f1 N f2
  25. 25. N2 f1 f2 N f1 f2 4f1 N f2
  26. 26. N2 f1 f2 N f1 f2 4The formula assumes that f1 and f2 are exactly equidistant from N. But thediagram below shows that these two numbers can migrate disproportionatelyoutwards from the true square root and have only a slight impact on thecalculated square root. error f1 N f2
  27. 27. Factors: N2 f1 f2 N f1 f2 4Reasonably good results can be obtained by using two numbers that multiplyto produce N2 (i.e., a pair of factors). Choose the pair which are closesttogether in value. error f1 N f2
  28. 28. Factors: N2 f1 f2 N f1 f2 4Reasonably good results can be obtained by using two numbers that multiplyto produce N2 (i.e., a pair of factors). Choose the pair which are closesttogether in value. 63 7 9 63 7 9 4 63 16 16 4 7.94 Out by 0.04%
  29. 29. Factors: N2 f1 f2 N f1 f2 4Choosing to use a pair of factors ensures that there will be one number abovethe square root and another number below the square root. Choosing the pairwhich have the most similar values minimises the deviation from equidistance. 63 7 9 By comparison, factors 1 and 63 would 63 produce a very poor approximation. 7 9 4 63 16 16 4 7.94 Out by 0.04%
  30. 30. Factors: N2 f1 f2 N f1 f2 4Interestingly, the pair of factors do not have to be whole numbers. This makesit possible to find the square roots of prime numbers, or numbers withunsuitable integer factors. For example, the square root of 34. 34 2 17 34 4 8.5 34 34 2 17 4 4 8.5 4 15 3 1 4 34 2.72 3.125 19 4 6.539 Out by 12% 34 5.845 Out by 0.2%
  31. 31. Equidistance: N2 f1 f2 N f1 f2 4The one ingredient that affects accuracy in the answer is equidistance of thetwo factors from the square root, which reminds us that f1 and f2 do not needto be factors at all, merely numbers that are more-or-less the same distanceabove and below the square root.For example, the square root of 162 is somewhere between 12 and 13.If I assume that the square root is more-or-less 12.5, then the numbers 12 and13 are equidistant from the root, as are the numbers 11 and 14, 10 and 15 andso on. The actual numbers do not matter; it’s the sum of the two numbers thatis used to generate the answer.
  32. 32. Equidistance: N2 f1 f2 N f1 f2 4 162 25162 25 4 6.48 6.25 12.73 Out by 0.02%
  33. 33. Equidistance: N2 f1 f2 N f1 f2 4 162 25 162 25 4 6.48 6.25 12.73 Out by 0.02%This is a significant step forwards. Now extremely high accuracy is guaranteed.
  34. 34. Equidistance: N2 N est N 2 N est 2Furthermore, the formula can be simplified by noting that the sum of f1 and f2is constant as I proceed outwards (left and right) from the estimate squareroot. f1 f2 2 N est f1 N f2
  35. 35. Equidistance: N2 N est N 2 N est 2There may be some advantages to using the formula in this guise. However Ifind it easier (conceptually) to use the formula in its more primitive form.
  36. 36. Homeostasis: N2 f1 f2 N f1 f2 4Why is the formula as tolerant of errors as it is?The structure of the formula suggests that errors in the first fractional term arecompensated for to some extent by opposing errors in the second term; a kindof homeostasis of numbers.
  37. 37. Homeostasis: N2 f1 f2 N f1 f2 4A look at the schematic supports this notion. You can see f1 and f2 growingcollectively by an amount that appears to be three times the displacement ofthe circle centre. f1 N f2
  38. 38. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. f1 N f2
  39. 39. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. N2 f1 f2 N2 f1 f2 d e f1 f2 4 f1 f2 d 4 4
  40. 40. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. N2 N2 d e f1 f2 f1 f2 d 4
  41. 41. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. N2 N2 d e f1 f2 d f1 f2 4
  42. 42. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. N2 f1 f2 N2 d e d f1 f2 4 1 f1 f2
  43. 43. Homeostasis: N2 f1 f2 d N e f1 f2 d 4Suppose error terms, d and e, are added to the formula. N2 1 d e 1 f1 f2 d 4 1 f1 f2
  44. 44. Homeostasis: N2 f1 f2 d N e f1 f2 d 4f1 + f2 = 2N N2 1 d e 1 2N d 4 1 2N
  45. 45. Homeostasis: N2 f1 f2 d N e f1 f2 d 4f1 + f2 = 2N N 1 d e 1 2 d 4 1 2N
  46. 46. Homeostasis: N2 f1 f2 d N e f1 f2 d 4f1 + f2 = 2N N 2N d e 1 2 (2 N d) 4
  47. 47. Homeostasis: N2 f1 f2 d N e f1 f2 d 4f1 + f2 = 2N N2 N d e 2N d 2 4
  48. 48. Homeostasis: N2 f1 f2 d N e f1 f2 d 4I’ve tabulated the resultanterror (e) in terms of theinduced error (d) and themagnitude of N2.N2 is the vertical axis and ‘d’is the horizontal axis.The estimate for the squareroot can be out by 3 or 4 andgenerally not affect thecalculated value by morethan 1%.
  49. 49. Homeostasis: N2 f1 f2 d N e f1 f2 d 4This means I can afford to be quite cavalier with the estimates. 12.34 3 4 12.34 Looks difficult. 3 4 4 12.34 8 12.34 easier 8 4 12 .34 (1.5 0.043 ) 2 3.543 (Less than 1% error)
  50. 50. Application in algebra:
  51. 51. Application in algebra:The formula can be applied with some success to the square roots of functions. N ( x) 2 f1 ( x) f 2 ( x) N ( x) f1 ( x) f 2 ( x) 4In this context, f1 and f2 are boundary functions that (ideally) are equally-spaced above and below the true square root function. This won’t be true overthe entire number line but can be made true for one or more regions ofinterest.
  52. 52. Application in algebra:For example, if I want to generate a rational approximation to the square rootfunction that is valid near the square root of 4, I should select boundaries thatencompass the point (4,2). The easiest are two horizontal lines, equally spacedabove and below y = 2. x 1 3 x 1 3 4 1 4 x 1
  53. 53. Application in algebra:The purple line, representing the approximation, is tangent to the curve at thelocation desired and provides – in seconds – the best straight lineapproximation for this region. x 1 3 x 1 3 4 1 4 x 1
  54. 54. Application in algebra:Using this approach in general, the tangent to the square root function at anydesired point (k2,k) is: x 2k x 2k 4
  55. 55. Application in algebra:Better results can be obtained by using higher order f1 and f2 based on factors: x 1 x x 1x x 1 x 4 f1 1 f2 x
  56. 56. Application in algebra:Better results can be obtained by using higher order f1 and f2 based on factors: x 1 x x 1x x 1 x 4 f1 1 f2 x
  57. 57. Application in algebra:Better results can be obtained by using higher order f1 and f2 based on factors: x 1 x x 1x x 1 x 4 f1 1 f2 xThe boundary functions intersect at(1,1), making this the best part ofthe approximation.
  58. 58. Application in algebra: x 1 x x 1x x 1 x 4 f1 1 f2 xThe approximation curve (inpurple) is so close to the truesquare root function (blue) that it ishardly visible.
  59. 59. Application in algebra:It should be possible to generate a good approximation function for anydesired region of the (positive) number line. For example, we can use this kindof factorisation to obtain an approximation near the point (4,2). x x x 2 2 x 2x 2 x 2 2 4 f1 2 1 f2 2 x
  60. 60. Application in algebra:Here’s an approximation centred on the point (0.25, 0.5): 1 x 2x x 2 1 x 2x 2 1 2x 2 4 f1 2 1 f2 2 x
  61. 61. Application in algebra:In general, the square root of a value near (k2, k) can be approximated as x x x k k x kx k x k k 4 kx k2 x k2 x 4k
  62. 62. Square roots of quadratic functions:Some functions suggest themselves as natural candidates for this procedurebecause they are composed of obvious factors. ( x 2)( x 6) ( x 2) ( x 6) ( x 2)( x 6) ( x 2) ( x 6) 4
  63. 63. Square roots of quadratic functions:The boundary functions are equally spaced above and below the square rootfunction and run parallel with it, which is good. ( x 2)( x 6) ( x 2) ( x 6) ( x 2)( x 6) ( x 2) ( x 6) 4
  64. 64. Square roots of quadratic functions:The boundary functions are equally spaced above and below the square rootfunction and run parallel with it, which is good.But as good as it is, the approximation is redundant since the square rootconverges to a much simpler straight line, y = x+3.
  65. 65. Square roots of quadratic functions:It would be more helpful to have an approximation for the curved sectionbetween x = -2 and x = 0. ( x 2)(x 6) ( x 2 8x 12) x(1)
  66. 66. Square roots of quadratic functions:The boundary functions for this approximation are shown. ( x 2)(x 6) ( x 2 8x 12) x(1)
  67. 67. Square roots of quadratic functions: x 2 8 x 12 x 2 8 x 13( x 2)(x 6) x 2 8 x 13 4
  68. 68. Square roots in trigonometry: Sin( x) 1 Sin( x) Sin( x) 1 x Sin( x) 1 Sin( x) 4
  69. 69. Square roots in trigonometry: Sin( x) 1 Sin( x) Sin( x) 1 x Sin( x) 1 Sin( x) 4
  70. 70. Square roots in geometry:Perhaps the best known square root formula is that of Pythagoras. It was apleasant surprise for me to find that this formula could be approximated sowell by this procedure. a 2 b2 (a ib)(a ib) a2 b2 (a ib) (a ib) (a ib) (a ib) 4 a2 b2 a 2a 2
  71. 71. Square roots in geometry:It’s no longer practical to sketch the boundary functions since they are non-real. However, using a spreadsheet to survey the performance of theapproximation over a range of values verifies that the approximation isaccurate as long as ‘a’ represents the longer leg of the triangle (as shown inwhite).
  72. 72. Square roots in geometry:The row and column headings are the ‘a’ and ‘b’ values corresponding to thesides of a hypothetical right-angle triangle. The tabulated values are thepercentage errors between the approximation and the true hypotenuse ascalculated by Pythagoras’ formula.
  73. 73. [END] dtcoulson@gmail.com

×