by ColinWright · 5y ago · 0 comments
(b) The Collatz Conjecture isn't one of the Millennium problems;
(c) It's using bounded numbers in the range where the Collatz Conjecture is known to be true;
(d) It seems reasonable to say "If this routine exits then the value will be "true";
(e) None of what I say here is deep or new, so when people get excited about this sort of thing it makes me wonder what I've missed.
So ... what have I missed?
(b) the Millennium problems are not the only million-dollar prizes in mathematics
(c) part of the joke
(d) part of the joke (and part of the C++ standard)
Searching 'collatz conjecture prize' quite literally puts a prize of a bout 120MM Yen (~ $1MM) as the top result.
Thanks.
<shrug>
Thanks for finding this and letting me know, I've learned something.
But also a layer deeper, collatz() takes a uint128 as input and the Collatz conjecture has already been proven to be true for all numbers that would fit into a uint128. So LLVM arrives to the correct answer (`return true`) because of the wrong reason, mathematically speaking.
So the compiler doesn't actually need to figure out if the loop is infinite or not.
Technically, it doesn't, but it requires programs to make forward progress, which is defined as either terminating, calling I/O functions, accessing a volatile variable or performing an atomic or synchronization operation. Infinite loops that'll eventually do one of these are perfectly valid C++ and don't have to terminate.
Specifically, Collatz says "if x is even then x /= 2" but the code checks "x is odd".
It's not but there are more bounties out there than just the Millenium list. For the Collatz Conjecture specifically there's a 120M Japanese Yen prize which at this moment is a bit more than 1 million USD.
https://www.prnewswire.com/news-releases/bakuage-offers-priz...
Thanks.
The input is an unsigned __int128, and I believe Collatz has only been verified up to 2^68.
I get that it is supposed to be a joke, but it kind of falls flat because it misses the point entirely.
For instance not all languages that target LLVM will get this result. That is interesting.