show algorithm to compute square root converge. [closed]












-1












$begingroup$


Consider the calculating the square root as follow:



Let's say we want to compute square root of $x>0$, pick a number $g_1>0$, then if $|g_1^2-x| < 0.00001$ then done. Else, let $g_2=frac{g+frac{x}{g}}{2.0}$. Show that the algorithm eventually stops. Or, $lim_{n to infty} g_n = x$.










share|cite|improve this question









$endgroup$



closed as off-topic by Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did Jan 11 at 14:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
    $endgroup$
    – Ross Millikan
    Jan 11 at 3:25










  • $begingroup$
    Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
    $endgroup$
    – nafhgood
    Jan 11 at 3:29


















-1












$begingroup$


Consider the calculating the square root as follow:



Let's say we want to compute square root of $x>0$, pick a number $g_1>0$, then if $|g_1^2-x| < 0.00001$ then done. Else, let $g_2=frac{g+frac{x}{g}}{2.0}$. Show that the algorithm eventually stops. Or, $lim_{n to infty} g_n = x$.










share|cite|improve this question









$endgroup$



closed as off-topic by Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did Jan 11 at 14:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
    $endgroup$
    – Ross Millikan
    Jan 11 at 3:25










  • $begingroup$
    Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
    $endgroup$
    – nafhgood
    Jan 11 at 3:29
















-1












-1








-1





$begingroup$


Consider the calculating the square root as follow:



Let's say we want to compute square root of $x>0$, pick a number $g_1>0$, then if $|g_1^2-x| < 0.00001$ then done. Else, let $g_2=frac{g+frac{x}{g}}{2.0}$. Show that the algorithm eventually stops. Or, $lim_{n to infty} g_n = x$.










share|cite|improve this question









$endgroup$




Consider the calculating the square root as follow:



Let's say we want to compute square root of $x>0$, pick a number $g_1>0$, then if $|g_1^2-x| < 0.00001$ then done. Else, let $g_2=frac{g+frac{x}{g}}{2.0}$. Show that the algorithm eventually stops. Or, $lim_{n to infty} g_n = x$.







recursive-algorithms






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 11 at 3:18









nafhgoodnafhgood

1,805422




1,805422




closed as off-topic by Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did Jan 11 at 14:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did Jan 11 at 14:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Xander Henderson, Lee David Chung Lin, KReiser, Cesareo, Did

If this question can be reworded to fit the rules in the help center, please edit the question.












  • $begingroup$
    Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
    $endgroup$
    – Ross Millikan
    Jan 11 at 3:25










  • $begingroup$
    Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
    $endgroup$
    – nafhgood
    Jan 11 at 3:29




















  • $begingroup$
    Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
    $endgroup$
    – Ross Millikan
    Jan 11 at 3:25










  • $begingroup$
    Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
    $endgroup$
    – nafhgood
    Jan 11 at 3:29


















$begingroup$
Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
$endgroup$
– Ross Millikan
Jan 11 at 3:25




$begingroup$
Why do you say it is slow? It is one of the faster ones, especially if you start close to $sqrt x$. If you prove the error is reduced by more than some constant factor you are there. What have you tried?
$endgroup$
– Ross Millikan
Jan 11 at 3:25












$begingroup$
Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
$endgroup$
– nafhgood
Jan 11 at 3:29






$begingroup$
Here is what I observed: $2gg'=g^2+x$, so if $g^2$ and $x$ are close enough then gg'=x. Please help! I did not say that it is slow. I meant show if that is what you meant.
$endgroup$
– nafhgood
Jan 11 at 3:29












1 Answer
1






active

oldest

votes


















0












$begingroup$

Hint: write $g_1=sqrt g+e_1$, so $e_1$ is the error of your first approximation. Let $e_2=g_2-sqrt g$. Show that $e_2$ is smaller than $e_1$ by a factor you can bound away from $1$. Then $e_n$ is smaller than $e_1$ by more than the $n-1$ power of that factor and you are done.






share|cite|improve this answer









$endgroup$




















    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Hint: write $g_1=sqrt g+e_1$, so $e_1$ is the error of your first approximation. Let $e_2=g_2-sqrt g$. Show that $e_2$ is smaller than $e_1$ by a factor you can bound away from $1$. Then $e_n$ is smaller than $e_1$ by more than the $n-1$ power of that factor and you are done.






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Hint: write $g_1=sqrt g+e_1$, so $e_1$ is the error of your first approximation. Let $e_2=g_2-sqrt g$. Show that $e_2$ is smaller than $e_1$ by a factor you can bound away from $1$. Then $e_n$ is smaller than $e_1$ by more than the $n-1$ power of that factor and you are done.






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Hint: write $g_1=sqrt g+e_1$, so $e_1$ is the error of your first approximation. Let $e_2=g_2-sqrt g$. Show that $e_2$ is smaller than $e_1$ by a factor you can bound away from $1$. Then $e_n$ is smaller than $e_1$ by more than the $n-1$ power of that factor and you are done.






        share|cite|improve this answer









        $endgroup$



        Hint: write $g_1=sqrt g+e_1$, so $e_1$ is the error of your first approximation. Let $e_2=g_2-sqrt g$. Show that $e_2$ is smaller than $e_1$ by a factor you can bound away from $1$. Then $e_n$ is smaller than $e_1$ by more than the $n-1$ power of that factor and you are done.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 11 at 3:37









        Ross MillikanRoss Millikan

        295k23198371




        295k23198371















            Popular posts from this blog

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            SQL update select statement

            'app-layout' is not a known element: how to share Component with different Modules