#square roots
56 messages · Page 1 of 1 (latest)
- Wait patiently for a helper to come along.
- Once someone helps you, say thank you and close the thread with:
+close
- Feel free to nominate the person for helper of the week in #helper-nominations
- Do not ping the mods, unless someone is breaking the rules.
- If you're happy with the help you got here, and the server overall, you can contribute financially as well:
i believe you're supposed to make pairs but what do we do if theres an extra number??
Then the square root will be irrational.
Well, we have 2000 = 2^4*5^3. So:
√(2000) = √(2^4*5^3) = √(2^4*5^2*5) = 2^2*5√(5) = 20√(5)
isn't that really complex since we'll also have to get the root of 5? is there a different, simpler method?
What are you trying to get, exactly?
If you're just trying to simplify, then √(2000) = 20√(5). You can't do anything else.
Or are you trying to find its approximate value?
the value yeah
Oh, alright.
There are several methods of approximating square roots. The easiest one is Newton's method. Have you heard about it?
nope
Alright. Here's the general approach.
Suppose we want to find √(n).
First, we find the integer closest to it. Let's call it x(0).
Then we iterate:
x(k + 1) = (1/2)(x(k) + n/x(k))
The more times we iterate, the better the approximation. Convergence is quite quick.
Do you want to look at √(2000), or should I show it on another example so you can try √(2000) yourself?
another example yeah
what's k?
Index of the sequence.
Alright. Pick a number that you want to find the square root of.
Alright.
5000 is between 4900 and 5041, closer to the latter. So, the closest integer to √(5000) is 71.
We take x(0) = 71. Then we iterate. I will also calculate the step error at each term: let's stop when it hits 10^(-3).
Step 1.
x(1) = (1/2)(x(0) + 5000/x(0)) = (1/2)(71 + 5000/71) = 10041/142
Δx(1) = |x(1) - x(0)| = |10041/142 - 71| ≈ 0.29
Step 2.
x(2) = (1/2)(x(1) + 5000/x(1)) = (1/2)(10041/142 + 710000/10041) = 201641681/2851644
Δx(2) = |x(2) - x(1)| = |201641681/2851644 - 10041/142| ≈ 6*10^(-4)
We've already hit a value of step error less than 10^(-3) in just two iterations. Thus, we get √(5000) ≈ 201641681/2851644.
are 4900 and 5041 the closest perfect squares?
If you're interested, the true relative error of that result is |201641681/(2851644√(5000)) - 1| ≈ 3*10^(-11). So, just in those two iterations we've already got an approximation that is so very close.
Yes. Those are 70^2 and 71^2.
you said it was the simplest method but all those numbers are giving me a headache😭
Well, but note that even though the denominator is 7 digits long, we get 10 correct decimal digits.
So, 3 more than with a naive decimal approximation.
Note that for such round numbers you can modify the method a bit.
Notice that √(5000) = 50√(2).
So, instead, we can try approximating √(2), then multiplying the result by 50.
1.5?
The error will be slightly larger, but the numbers will be smaller.
actually no wait
Well, √(2) is closest to 1. So, we start at 1.
the root of 1 is 1 itself right?
Well, yeah. But I meant that to approximate √(2), we take x(0) = 1, then iterate.
Actually, let's try doing that.
We'll even take a smaller error margin: 10^(-5), just to account for the fact that we need to multiply the result by 50.
We are approximating √(2), so we take x(0) = 1.
Step 1.
x(1) = (1/2)(x(0) + 2/x(0)) = (1/2)(1 + 2/1) = 3/2
Δx(1) = |x(1) - x(0)| = |3/2 - 1| ≈ 0.5
Step 2.
x(2) = (1/2)(x(1) + 2/x(1)) = (1/2)(3/2 + 4/3) = 17/12
Δx(2) = |x(2) - x(1)| = |17/12 - 3/2| ≈ 0.083
Step 3.
x(3) = (1/2)(x(2) + 2/x(2)) = (1/2)(17/12 + 24/17) = 577/408
Δx(3) = |x(3) - x(2)| = |577/408 - 17/12| ≈ 0.0025
Step 4.
x(4) = (1/2)(x(3) + 2/x(3)) = (1/2)(577/408 + 816/577) = 665857/470832
Δx(4) = |x(4) - x(3)| = |665857/470832 - 577/408| ≈ 2.1*10^(-6)
We've hit the step size less than 10^(-5). The approximation we got is √(2) ≈ 665857/470832.
Thus, √(5000) = 50√(2) ≈ 16646425/235416. The relative error this time is |16646425/(235416√(5000)) - 1| = 1.1*10^(-12).
Even more than the last time.
So, we've got an approximation that gives one more correct digit, despite its denominator being smaller.
So, now care to try it for your √(2000)?
You can try approximating it as is, or using √(2000) = 20√(5).
Personally, I would do it using the second approach.
While you can take the initial approximation as anything, √(2000) is much closer to 45 than to 100.
So, I recommend taking x(0) = 45 here.
so the closer the approximation is, the closer our answer will be to the actual root?
Of course.
Note that you will eventually reach arbitrary precision with any initial approximation, but it's obviously better to take a closer initial approximation, as you will converge faster that way.