- #1

- 47

- 0

Thanks in advance

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter Vorbis
- Start date

- #1

- 47

- 0

Thanks in advance

- #2

- 290

- 2

Alternately you could use newton's method

- #3

- 47

- 0

- #4

- 1,762

- 59

There is a long process similar to long division. Is that what you're looking for?

- #5

- #6

- 492

- 0

For example...

f(x) = sqrt(x)

f(1) = 1

f '(1) = 1/2

f ''(1) = -1/4

So f(x) ~ 1 + 1/2(x-1) - 1/8(x-1)^2

Check my arithmetic... ;p

A special case of this is linear approximation. In this case, and in all cases, it's good to choose a point "close to" the thing you're trying to evaluate to start from. The closer you start, the better your final answer will be.

- #7

Hurkyl

Staff Emeritus

Science Advisor

Gold Member

- 14,916

- 19

What's wrong with guess and check? It's the best method to solve lots of problems. (Assuming you don't use it in a stupid way)Is there some equation to it or can it only be done using guess and check?

- #8

Hurkyl

Staff Emeritus

Science Advisor

Gold Member

- 14,916

- 19

For example, starting from 1 will only work if you want to find the square root of a number less than 2....

For example...

f(x) = sqrt(x)

f(1) = 1

f '(1) = 1/2

f ''(1) = -1/4

So f(x) ~ 1 + 1/2(x-1) - 1/8(x-1)^2

Check my arithmetic... ;p

A special case of this is linear approximation. In this case, and in all cases, it's good to choose a point "close to" the thing you're trying to evaluate to start from. The closer you start, the better your final answer will be.

- #9

HallsofIvy

Science Advisor

Homework Helper

- 41,833

- 963

To find [itex]x= \sqrt{a}[/itex] is equivalent to solving [itex]x^2= a[/itex] which, for non-zero x, is equivalent to x= a/x. Notice also that is x< [itex]\sqrt{a}[/itex], a/x will be

Therefore: Choose x as some reasonable "guess" (or "starting value" if you don't like "guess"!) for [itex]sqrt{a}[/itex]. Calculate a/x. If that is equal to x, we are done. Otherwise we know the correct square root is between x and a/x. We don't know where, but 1/2 way is likely to be close. So use that as a new value and repeat.

For your example, a= 6, x= 2 is a good starting value. a/x= 6/2= 3 and half way between 2 and 3 is 2.5. Now a/x= 6/2.5= 2.4. Halfway between 2.5 and 2.4 is 2.45. a/x= 6/2.45= 2.449 to 3 decimal places. (2.450+ 2.449)/2= 2.4495 which is still 2.450 to three decimal places to three decimal places which is exactly what a calculator would give. If you want more decimal places, you will need to continue the calculation. This method recovers, generally, one more decimal place for every iteration.

- #10

- 47

- 0

you don't even have to start off with a reasonable guess for x. of course, a better initial guess leads to quicker convergence on the solution.

even working out something like [itex]\sqrt{3844}[/itex], taking a starting guess to be 50 takes about 6 iterations to get the correct answer. taking a starting guess to be 1 only takes 12 iterations to get the result.

even working out something like [itex]\sqrt{3844}[/itex], taking a starting guess to be 50 takes about 6 iterations to get the correct answer. taking a starting guess to be 1 only takes 12 iterations to get the result.

Last edited:

- #11

HallsofIvy

Science Advisor

Homework Helper

- 41,833

- 963

To what degree of accuracy?

- #12

- 47

- 0

using a=3844, x=1, i got (using pl/sql mind)

using x=50, i get

as i did mention though, a closer initial estimate leaders to quicker convergence. the only reason that i mention this is that sometimes, a bad initial guess can lead to chaotic results. but that doesn't seem to be the case with the method you mentioned above.

Iteration 1 = 1922.5

Iteration 2 = 962.249739921976592977893368010403120937

Iteration 3 = 483.122272423425796493169827901363303772

Iteration 4 = 245.539425166098942015664368947966959835

Iteration 5 = 130.59737609859217202871199387852836217

Iteration 6 = 80.0156759200862326716562938395764907815

Iteration 7 = 64.028131207575663904905754153984655468

Iteration 8 = 62.0321211639131491817288606001768830525

Iteration 9 = 62.0000083164105287409016192765549547645

Iteration 10 = 62.000000000000557763506494934894469636

Iteration 11 = 62.0000000000000000000000000025088720095

Iteration 12 = 62

using x=50, i get

Iteration 1 = 63.44

Iteration 2 = 62.0163430012610340479192938209331651955

Iteration 3 = 62.000002153413739767994901011000632118

Iteration 4 = 62.0000000000000373966981738746316538005

Iteration 5 = 62.000000000000000000000000000011278331

Iteration 6 = 62

as i did mention though, a closer initial estimate leaders to quicker convergence. the only reason that i mention this is that sometimes, a bad initial guess can lead to chaotic results. but that doesn't seem to be the case with the method you mentioned above.

Last edited:

- #13

jtbell

Mentor

- 15,751

- 3,948

There is a long process similar to long division.

This method (the decimal version) is probably the one I learned in high school in the late 1960s. Yes, they actually used to teach this stuff in high school! Maybe it was even in middle school, I don't remember for sure. This was before personal electronic calculators existed, of course. If we wanted to find square roots quickly, we used a slide rule or a table of logarithms.

- #14

- 662

- 1

Ah, those were the days, weren't they?This method (the decimal version) is probably the one I learned in high school in the late 1960s. Yes, they actually used to teach this stuff in high school! Maybe it was even in middle school, I don't remember for sure. This was before personal electronic calculators existed, of course. If we wanted to find square roots quickly, we used a slide rule or a table of logarithms.

No, really, I'm asking,

- #15

- 1,762

- 59

This method (the decimal version) is probably the one I learned in high school in the late 1960s.

I learned it in high school in the late 60s too.

Share: