r/HomeworkHelp • u/Biruk_exp • 6d ago
Answered [High-school math:] Is it possible to recover exact radical expression from high precision decimal approximation
Suppose I found this using Newton's method. How can I recover it to radical form
5
Upvotes
6
u/LetTraining8934 6d ago
Your number is 3 - √2.
If you look at the decimal part (.5857864376...), 1 minus that is .4142135623..., which is the fractional part of √2. So x = 2 - (√2 - 1) = 3 - √2.
More generally, if you get a high-precision decimal from Newton's method and want to recover the exact radical form, there are two main ways to do it depending on how complicated the expression is:
Since the repeating tail y = 2 + 1/y solves to y = 1 + √2, you just plug that back up the chain: x = 1 + 1 / (1 + 1 / (1 + 1 / (1 + √2))) = 3 - √2.
2. Finding the minimal polynomial (for cube roots, sums of radicals, etc.) If the continued fraction doesn't repeat, the number might be a root of a higher-degree polynomial (like ∛2 or √2 + √3). You compute powers like x2, x3, x4 to high precision and look for a small integer combination that adds up to 0. Even here, x ≈ 1.5857864376 and x2 ≈ 2.5147186257. Notice that 6x ≈ 9.5147186257 has the exact same decimal part as x2, which gives x2 - 6x + 7 = 0, and the quadratic formula gives 3 - √2.
For higher degrees, doing this by hand is painful, so people use lattice reduction algorithms like LLL or PSLQ (which is what WolframAlpha, SymPy's nsimplify(), and the Inverse Symbolic Calculator use behind the scenes when you paste a decimal into them).
One small caveat: strictly speaking, a truncated decimal can never guarantee an exact closed form on its own without knowing the equation you started with (you could always tweak the 50th digit), so you're really just finding the simplest algebraic expression that matches all the digits you have.
2
u/GamingWithAlterYT University/College Student 6d ago
if u look at root 2 u get 1.414... it matches up to 3 so u can do x = 3 - root 2
most of these types of questions are gonna be simple and so u just have to find patterns
1
u/fermat9990 👋 a fellow Redditor 6d ago
See if this helps:
"To find what number has a square root that rounds to 0.3224, square the bounds of the rounding interval:
Any number that rounds to 0.3224 at 4 decimal places must fall between
0.32235 and 0.32245.
Squaring both ends gives the target range:
Lower bound: 0.322352 = 0.1039095225
Upper bound: (0.322452 = 0.1039740025
Exact center: 0.32242 = 0.10394176
So, 0.3224 is the 4-decimal-place approximation of the square root of any number between 0.10391 and 0.103974."
1
u/Daniel96dsl 👋 a fellow Redditor 5d ago edited 5d ago
I had the same question a while back and it turns out that the answer is by using the Lenstra—Lenstra—Lovasz (LLL) algorithm. It finds a polynomial (of user specified order) with integer coefficients of minimum length which has a root that numerically agrees to your number to within some tolerance.
Length (𝐿) in this instance is defined as the square root of the sum of the squares (root sum square or RSS) of the polynomials coefficients; i.e., the polynomial
𝐴𝑥² + 𝐵𝑥 + 𝐶 = 0
Has length
𝐿 = √(𝐴² + 𝐵² + 𝐶²).
As an example, using your number, the script I wrote find several answers:
x² - x - 1 = 0
error: 2.0×10⁻²
x ≈ 1/2 + √(5)/2
≈ 1.618033988749895
5x² - 8x = 0
error: 8.9×10⁻³
x ≈ 8/5
≈ 1.6
4x² - 7x + 1 = 0
error: 4.5×10⁻³
x ≈ √(33)/8 + 7/8
≈ 1.5930703308172536
12x² - 19x = 0
error: 1.5×10⁻³
x ≈ 19/12
≈ 1.5833333333333333
9x² - 13x - 2 = 0
error: 7.0×10⁻⁴
x ≈ 13/18 + √(241)/18
≈ 1.5846763720144457
x² - 6x + 7 = 0
error: 1.4×10⁻¹⁶
x ≈ 3 - √(2)
≈ 1.5857864376269046
… you may want to filter out rational solutions, but they are technically valid answers within the constraints of the problem nonetheless.