Live data from Hacker News

A surprisingly hard CS problem: sums of square roots (2018)

shlegeris.com

1–10 of 189 posts

Re: A surprisingly hard CS problem: sums of square roots (2018)

#2
It is always fascinating how many problems that are simply stated are difficult to solve. Whenever I see something like this I try and think about what the repercussions would be if an efficient algorithm did exist, and that helps to understand where the complexity is. In this case I believe there would be many problems in computational geometry involving Euclidean shortest paths that would be made trivial by an efficient algorithm here.

Re: A surprisingly hard CS problem: sums of square roots (2018)

#5
It probably has been tried already by someone, but how about this: all square roots can be written as repeating continued fractions [1]. With a bit of work, continued fractions can also be summed [2] and compared. Wouldn't this take less than exponential time?

[1] http://benpaulthurstonblog.blogspot.com/2012/05/estimating-s...

[2] https://www.jstor.org/stable/1969389

Re: A surprisingly hard CS problem: sums of square roots (2018)

#8
post #5

It probably has been tried already by someone, but how about this: all square roots can be written as repeating continued fractions [1]. With a bit of work, continued fractions can also be summed [2] and compared. Wouldn't this take less than exponential time? [1] http://benpaulthurstonblog.blogspot.com/2012/05/estimating-s... [2] https://www.jstor.org/stable/1969389

In practice I think the problem is linear, in that the required precision is proportional to log maxValue, that would be enough for a certain answer.

It's just that a proof of this is considerably harder, since you can't just assume the fractional part of irrational numbers is random.

Re: A surprisingly hard CS problem: sums of square roots (2018)

#9
It reminds me of this problem. When you plot the motion of conservative dynamical systems, say this one

https://en.wikipedia.org/wiki/Standard_map

you get these chaotic areas that look like television static on the map. I was reading an 1987 article from Byte magazine that reminded me of a conversation I had when I was working on my PhD, which is that every plot like this you see is wrong because these are done with finite precision math and it doesn't take that many iterations for calculation errors to be amplified up to the first digit.

It's significant because the reason we know those chaotic regions are full of unstable periodic orbits is that those chaotic regions are also full of stable periodic orbits and that those breed unstable periodic orbits on the separatrices between them. The stable orbits form a hierarchical lattice that constrains the chaotic motion and that should appear as visible structure.

There are hints in the literature that it ought to be possible to use variable precision interval math to do parameter scans, make better images, and more accurately understand the chaotic motion. On top of that we know a lot about how the stable periodic orbits relate to each other which would help in making that kind of image.

I haven't seen any evidence that it's been done and I know one reason it is hard is that the scaling of the algorithm would be worse than the usual way of doing things for the same reason the above problem is hard.

Re: A surprisingly hard CS problem: sums of square roots (2018)

#10
post #5

It probably has been tried already by someone, but how about this: all square roots can be written as repeating continued fractions [1]. With a bit of work, continued fractions can also be summed [2] and compared. Wouldn't this take less than exponential time? [1] http://benpaulthurstonblog.blogspot.com/2012/05/estimating-s... [2] https://www.jstor.org/stable/1969389

Without looking into the details, the problem might be that two n-bit numbers x and y might have continued fractions for sqrt(x) and sqrt(y) which differ very far along. Also, the continued fractions themselves can get more and more expensive to compute as you go along; possible exponentially more, but I'm not sure.

Also, two continued fractions are not necessarily easy to compare. It's not a positional notation like decimal or binary.

Post reply on HN