Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Easiest Method to Evaluate Imperfect Square Root up to 5 Decimals?

  1. Sep 5, 2014 #1
    Easiest Method to Evaluate Imperfect Square Root up to 5 Decimals?
    Any ideas?
     
    Last edited by a moderator: Jan 19, 2015
  2. jcsd
  3. Sep 5, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    It's not clear what you are asking. A fuller description of what you want other than a cryptic title thread is required, I'm afraid.
     
  4. Sep 5, 2014 #3
    I'm seeking a method to evaluate square root of an imperfect square up to 5 decimal accuracy.
     
  5. Sep 5, 2014 #4
    Use the Taylor expansion. I don't know if it is the easiest.
     
  6. Sep 5, 2014 #5

    Mark44

    Staff: Mentor

  7. Sep 5, 2014 #6
    That's pretty cool. Honestly though, I'm glad it isn't taught anymore. I'm glad to know it now though.
     
  8. Sep 5, 2014 #7
    Lol! I am the international champion in high speed mental math!
     
  9. Sep 5, 2014 #8
    I was asking an easier and simpler method such as the duplex method of roots
     
  10. Sep 5, 2014 #9
    @drewd! Could you please explain me the solution via Taylor series!
     
  11. Sep 5, 2014 #10
    Could you explain me what the Taylor series exactly means?
     
  12. Sep 5, 2014 #11
    I honestly don't think that the Taylor series in an efficient way to calculate a square root, but if you are interested...

    ##f(x)=\sum\frac{f^{(n)}(0)}{n!}x^n## is the general formula for a Taylor series centered at zero. If ##f(x)=\sqrt{x+S}## where ##S## is a perfect square near the number you are interested in.

    The first 5 derivatives (including the zeroth being the function itself) of ##\sqrt{x+S}## evaluated at ##x=0## are ##\sqrt{S},\ \frac{1}{2\sqrt{S}},\ -\frac{1}{4\sqrt{S}},\ \frac{3}{8\sqrt{S}},\ -\frac{15}{16\sqrt{S}}##

    So if you want ##\sqrt{27}## you would pick ##S=25## and the ##x^n## would be ##2^n## because ##S+2=27##. The first 5 terms would be

    ##\sqrt{25}+\frac{1}{2\sqrt{25}}(2)-\frac{1}{2}\frac{1}{4\sqrt{25}}(2^2)+\frac{1}{6}\frac{3}{8\sqrt{25}}(2^3)-\frac{1}{24}\frac{15}{16\sqrt{25}}(2^4)##

    The wiki article has it in simplified form and discusses a bunch of other options.
     
  13. Sep 5, 2014 #12
    You could do a binomial expansion and only use the terms you need. For example, a first order approximation would be:

    [tex](1+x)^n=1+nx+\mathcal{O}(x^2) \approx 1+nx[/tex]

    So:

    [tex]\sqrt{x} \approx 1+\frac{1}{2} (x-1)[/tex]
     
  14. Sep 6, 2014 #13
    Of course that is a lot better... but you know, if you want to make things harder...:redface:
     
  15. Sep 6, 2014 #14

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    A good way to get a square root is to apply newton's method to:

    x2-A=0

    Newton's Method is

    x1=x0-[itex] \frac {F(x_0)}{F'(x_0)}[/itex]

    where x0 is a guess.

    For our function we have:

    F(x)=x2-A
    F'(x)=2x

    Pluging these into Newton's Method and doing some algebra gives

    xn+1= .5 ( xn+[itex]\frac {A}{x_n}[/itex])

    so if A=2 and I guess x=1 I get a first guess of root 2 as 1.5

    Repeat using 1.5 to generate the next guess, repeat. You will be surprised at how fast it converges.
     
  16. Sep 6, 2014 #15

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Oddly enough, Newton's method for the square root is this method which might be easier to explain to someone who has not taken Calculus:

    To find [itex]\sqrt{a}[/itex], which is the same as "solve [itex]x^2= a[/itex]":
    1. Choose a starting value, [itex]x_0[/itex]. The square root of the perfect square closest to a is a good starting value.

    2. Divide a by [itex]x_0[/itex]. There are three possibilities:

    a) [itex]a/x_0= x_0[/itex].
    b) [itex]a/x_0> x_0[/itex]

    c) [itex]a/x_0< x_0[/itex]

    In case (a) You're done! [itex]x_0= \sqrt{a}[/itex]
    in either case b or case c, it is easy to show that [itex]\sqrt{a}[/itex] must lie between [itex]x_0[/itex] and [itex]a/x_0[/itex]. We don't know where between, of course, so take the easiest, half way between as our next possible value for x, [itex]x_1[/itex], and do that again.

    For example, to find [itex]\sqrt{11}[/itex] we note that [itex]3^2= 9[/itex] is the closest perfect square to 11 so we take [itex]x_0= 3[/itex]. Then [itex]a/x_0= 11/3[/itex]. [itex]3+ 11/3= (9+ 11)/3= 20/3[/itex] so half way between is [itex]x_1= 10/3[/itex]. Now [itex]a/x_1= 11/(10/3)= 33/10[/itex] and half way between 10/3 and 33/10 is [itex](10/3+ 33/10)/2= (100+ 99)/60= 199/60[/itex]. So we take [itex]x_2= 199/60= 3.31667[/itex] to 5 decimal places. Now [itex]x_3= (3.3+ 3.31667)/2= 3.30833[/itex]. Continue until you have two consecutive x values equal to 5 decimal places.
     
  17. Sep 6, 2014 #16

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Yeah, they used to teach how to find the quotient of two numbers like 6789.465 / 52.5 using long division, but apparently we're too sophisticated now to learn basic arithmetic algorithms. :frown:
     
  18. Sep 6, 2014 #17
    That is still taught. Doing long division gives a student an idea about place value and the meaning of digits, so most schools (I hope all) still teach it. The algorithm here for estimating square roots does not (it seems to me) teach anything about numbers except by giving the student a goal to motivate practice of basic operations.
     
  19. Sep 7, 2014 #18
    ...from my understanding the Babylonian method which is a simplified Newton's method:

    To find the square root of N :

    1. Make a rough estimate or guess.
    2. Divide N by your estimate.
    3. Take the average of the answer from 2. and your estimate
    ....this will become your new estimate.

    (Repeat steps 2 and 3 until you reach the accuracy you want.)

    source: square root
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Easiest Method to Evaluate Imperfect Square Root up to 5 Decimals?
  1. Square root (Replies: 4)

  2. Square roots (Replies: 13)

  3. Square Roots? (Replies: 7)

  4. The square root (Replies: 7)

Loading...