3 ms·
“Who can name the bigger number? Whoever has the deeper paradigm.” In 2001, David Moews ran a BIGNUM BAKEOFF competition on the comp.lang.c newsgroup, where ea
by robinhouston 16y ago
“Who can name the bigger number? Whoever has the deeper paradigm.”
In 2001, David Moews ran a BIGNUM BAKEOFF competition on the comp.lang.c newsgroup, where each entry had to be a C program (512 non-whitespace characters or fewer) returning a number from main(). The winner is the program that returns the largest number, assuming an arbitrarily-large int type.
http://groups.google.com/group/comp.lang.c/browse_thread/thread/1511694ab8570ccc/540218fdfa4b2ab8 http://groups.google.com/group/comp.lang.c/browse_thread/thr...
After reading Scott Aaronson's wonderful essay, you won't be surprised to hear that the contest was won by a theoretical computer scientist, Ralph Loader. (Second place was taken by Heiner Marxen, who is mentioned in Scott's article in connection with the Busy Beaver problem.)
Ralph Loader's remarkable program is at http://homepages.ihug.co.nz/~suckfish/busy/reduced.c http://homepages.ihug.co.nz/~suckfish/busy/reduced.c, and the documented and unmangled version in http://homepages.ihug.co.nz/~suckfish/busy/busy.tar.gz http://homepages.ihug.co.nz/~suckfish/busy/busy.tar.gz
David Moews' discussion of the entries is at http://djm.cc/bignum-results.txt http://djm.cc/bignum-results.txt
- tel 16y agoI find it hilarious that three people thought to return the highest possible number by underflowing unsigned ints (that are being treated as arbitrarily large ints). It's a funny hack even if it doesn't teach you anything like Loader's does.
- amalcon 16y agoMy first thought was along those lines: (int)((unsigned int)-1 >> 1)==INT_MAX
- mseebach 16y agoI don't see how that is relevant when the problem assumes an arbitrarily large int-type. It's trivial to return the largest possible value (INT_MAX) for any fixed-size int-type, but a such does not exist. Basically, many posters are missing the point that it's a mathematics challenge, not a C-challenge, which is excusable since it's posted in a C-group.
- tel 16y agoExactly, which I find hilarious.
- kd0amg 16y ago(I haven't read over the entries yet) A coworker suggests a Whitespace[1] interpreter which applies the recursion theorem and then interprets a Whitespace program embedded in the source code, characters which do not count towards the size limit. We're not sure yet whether that can be done in 512 characters. [1] http://en.wikipedia.org/wiki/Whitespace_(programming_language) http://en.wikipedia.org/wiki/Whitespace_(programming_languag... Edit: "Wait... can you make a Quine without using a string literal?"
- shasta 16y agoWhy whitespace? Just pick the simplest to interpret Turing complete language with a two symbol alphabet. Also: you're disqualified :)