Live data from Hacker News

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

shlegeris.com

91–100 of 189 posts

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

#91
post #74
post #49

Earlier quoted context omitted.

So, to state explicitly, given a list of positive integers, a_i, and coefficients, d_i \in {-1,1}, test whether \sum_i d_i sqrt(a_i) I guess there's different levels of bounds you can use (Mahler, Mahler-Mignotte, Davenporte-Mahler-Mignotte [0]) but they all involve the discriminant, the deg to the deg power (n^n) and maybe some other factors which put it neatly in a polynomial time bit representation. One bound puts…

A request: please always link to abstract pages of articles, not directly to PDFs. https://arxiv.org/abs/2005.07843

May I ask, for what reason, please?

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

#92
post #74

Earlier quoted context omitted.

A request: please always link to abstract pages of articles, not directly to PDFs. https://arxiv.org/abs/2005.07843

May I ask, for what reason, please?

Personally, I prefer not to get surprise PDFs; but that's just personal.

A better reason is that linking to the abstract page lets you navigate easily around the arXiv from there, including to the PDF if you desire; but there is no 1-click way to get from the PDF back to the abstract. (Of course, it's an easy matter of address munging, but even easier is not to have to do the munging.)

A perhaps less satisfying reason is the same reason that one doesn't deeplink directly to an XKCD image, but rather to the XKCD page for the relevant cartoon: a courteous acknowledgement of the source.

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

#93
post #74

Earlier quoted context omitted.

A request: please always link to abstract pages of articles, not directly to PDFs. https://arxiv.org/abs/2005.07843

May I ask, for what reason, please?

So people can determine for themselves whether they want to download the PDF, by reading the abstract first. This has always been a point of petty annoyance for me as well.

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

#94
post #85

I must not be understanding the problem here because this seems pretty simple. If someone told me to add two lists of numbers (the square roots) and then take the difference of the two sums and the sums were potentially too big for the computer to handle, I'd start differencing before I finished the sums. (For example find the total of sum1 - sum2. While processing values, if the running sum is positive take a number…

The issue is that the precision of the square roots needs to increase in order to guarantee a result. Consider an algorithm to generate the worst case scenario that starts with two lists that have sqrt sums that differ by D. Append to the lists numbers x and y such that |sqrt(x) - sqrt(y)| > D and append them so that the previously lesser list is now greater but also the absolute difference decreases each step.

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

#95
I wonder if comparing powers of sums would help?

Suppose one of the sequences was 3, 7, 15, 30, and consider s = √[3] + √7 + √15 + √30.

Then s^2 = 55 + 30 √2 + 6 √5 + 6 √10 + 2 √21 + 2 √105 + 2 √210.

s^3 = 159 √3 + 90 √6 + 151 √7 + 90 √14 + 135 √15 + 105 √30 + 18 √35 + 18 √70.

...

s^30 = 1679613741139712617544067791402275 + 1187666266098277047375460186425450 √2 + 750901847525954802822187362608010 √5 + 530967788407084153582901906991810 √10 + 366402251460399628674629181584238 √21 + 259085516641872377051783075481000 √42 + 163913368573924563188162165414670 √105 + 115904254449237925942667189567670 √210

and so on.

For any given finite sequence of positive integers there is a finite set of square roots of positive integers such that all positive integer powers of the sum of the square roots of the sequence members can be expressed as a linear combination of that finite square root set with non-negative integer coefficients.

With s^n if we approximate each of the square roots by first the nearest integer not larger than the square root, and second by the nearest integer not smaller than the square root, we get a lower bound and upper bound for s^n.

Suppose we do that for the sums of the square roots of the two sequences we want to compare. For each power n, that gives us two integer ranges we can compare. If they do not overlap, we can tell which square root sum is lower.

If they do overlap, we can try a higher power n, so we can try a better square root approximation than nearest integer to get narrow ranges for the n'th powers.

What I'm hoping for is that by going to higher powers we can avoid having to do high precision square root calculations, so it can be done with just large integer arithmetic and regular floating point.

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

#97
post #15

The part of this post that I find most wonderful/strange: > EDIT: I think that Edward Kmett and Paul Crowley might have figured out how to solve this problem in the comments on my Facebook post; see here. I’ll investigate further and update. > EDIT 2: actually we didn’t solve the problem, but it might still be a good direction for future research. Possibly ground-breaking math being done on comments on a Facebook pos…

I don't know if Dunning Kruger effects on Facebook posts are anything new/wonderful/strange.

This thread reads like somebody who just heard about the Collatz conjecture, and after half an hour are sure they have a solution.

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

#98
post #73

Stupid questions: 1) It seems like all the difficulty is from the fact that the representation of the square roots involves a non terminating sequence of digits requiring high precision. So don’t you have this problem with all irrational functions, not just square root? Eg logarithm, sine, exponent from irrational base. (Does it make a difference that sine is bounded?) 2) Do you have the same problem (difficulty bein…

For (1): Comparing sums of logarithms is pretty easy, since you can rewrite it as comparing products of integers. So not all sums of irrationals are hard.

For (2): Allowing inputs to arbitrary precision presumably means they are arbitrarily long bit strings? But if you measure complexity in terms of the total number of input bits, summing long bit strings is very easy.

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

#99
post #95

I wonder if comparing powers of sums would help? Suppose one of the sequences was 3, 7, 15, 30, and consider s = √[3] + √7 + √15 + √30. Then s^2 = 55 + 30 √2 + 6 √5 + 6 √10 + 2 √21 + 2 √105 + 2 √210. s^3 = 159 √3 + 90 √6 + 151 √7 + 90 √14 + 135 √15 + 105 √30 + 18 √35 + 18 √70. ... s^30 = 1679613741139712617544067791402275 + 1187666266098277047375460186425450 √2 + 750901847525954802822187362608010 √5 + 530967788407084…

Doesn't help, because if you start with the sum of N square roots you end up (in the general case) with 2^N square roots once you raise it to a power.

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

#100
> I’m going to update towards thinking that integers and square roots are much scarier, richer objects than I’d thought. I’ve updated to being more scared of real numbers than I used to be—they have all these sketchy properties like “almost none of them have finite descriptions”. Real numbers, and sets, and logical statements, have all started feeling to me like Cthuluesque monstrosities whose appearances are only tolerable because we only look at the pretty parts of them and don’t let ourselves look at the horrors that lurk below.

I don't know much number theory but whenever I poke around at stuff like the Collatz conjecture, it seems like there is something profoundly weird about the interaction of addition/subtraction and multiplication/division. Like each of those pairs defines a totally separate universe and moving between them is irreducibly hard even though the members of both are "just" numbers.

By that I mean you can have a number that you understand perfectly well one side (for example, as a set of factors in the world of multiplication). You move it to the other side and perform a trivial operation (say add one). And now you know nothing about it on the other side any more.

Maybe this is just me knowing very little about the field.

Post reply on HN