IBM Ponder This 12-15 Solved

Credited with a solving this puzzle.  Tricky one, only a couple solutions in the world submitted:

Ponder This Challenge:

Last month, Gene Amdahl, an IBM fellow who was the chief architect of the legendary IBM 360 system, died at age 92.
In memory of his work, this month’s challenge focuses on the IBM-360 character set (EBCDIC):
Find a formula to convert the 52 EBCDIC letters into ASCII using no more than 4 operators.
See http://www-01.ibm.com/support/knowledgecenter/SSGH4D_15.1.0/com.ibm.xlf151.aix.doc/language_ref/asciit.html?lang=en for the ASCII and EBCDIC character sets.

Supply your answer as a mathematical expression. For example, one can switch from lower-case ASCII to uppercase ASCII (and vice versa) using a single operation: f(x)=x xor 32.

You can use any reasonable operation (even trigonometric functions). Use at most 4 operations, not 4 operations types. For example, the function x-floor((x>>4)*7.65-29), which correctly converts the lower case letters, uses five operation (2 subtractions, shift, multiplication, floor).

Here was how I, in my opinion, slightly bent the spirit of the rules to pack the answer into a large number that acts as a sort of cheat sheet dictionary, here is how I described it in the answer I submitted to the judges:

I really tried hard to do this nicely but the best I could get down to was 6 operations so what I ended up doing is admittedly a little sneaky but I think complies with the rules.  I concatenated all the ASCII binary values in descending order of EBCDIC values with accommodations for the gaps in continuity in the EBCDIC values; This large number acts as a sort of cheat-sheet.  I can then lookup the answer by shifting this cheat-sheet by the EBCDIC value (-129 because the first value is EBCDIC=129 and *8 because they are stored in 8 bit blocks) and reading off the last 8 bit block (via mod 128).
F(x) = (2587496451248303921104540382248504673932757390588080524989531327203702217835457716547433516651331736727458203478076738176447229220385054531888922987649644777701648928904632004077071927687431265827553592082823571245745978298470182367285617107519578268257>>((x-129)*8)) MOD 128
2587496451248303921104540382248504673932757390588080524989531327203702217835457716547433516651331736727458203478076738176447229220385054531888922987649644777701648928904632004077071927687431265827553592082823571245745978298470182367285617107519578268257
=
 010110100101100101011000010101110101011001010101010101000101001100000000000000000000000000000000000000000000000000000000000000000101001001010001010100000100111101001110010011010100110001001011010010100000000000000000000000000000000000000000000000000000000001001001010010000100011101000110010001010100010001000011010000100100000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111101001111001011110000111011101110110011101010111010001110011000000000000000000000000000000000000000000000000000000000000000001110010011100010111000001101111011011100110110101101100011010110110101000000000000000000000000000000000000000000000000000000000011010010110100001100111011001100110010101100100011000110110001001100001
=
 01011010-01011001-01011000-01010111-01010110-01010101-01010100-01010011-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-01010010-01010001-01010000-01001111-01001110-01001101-01001100-01001011-01001010-00000000-00000000-00000000-00000000-00000000-00000000-00000000-01001001-01001000-01000111-01000110-01000101-01000100-01000011-01000010-01000001-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-01111010-01111001-01111000-01110111-01110110-01110101-01110100-01110011-00000000-00000000-00000000-00000000-00000000-00000000-00000000-00000000-01110010-01110001-01110000-01101111-01101110-01101101-01101100-01101011-01101010-00000000-00000000-00000000-00000000-00000000-00000000-00000000-01101001-01101000-01100111-01100110-01100101-01100100-01100011-01100010-01100001-00000000
=
90-89-88-87-86-85-84-83-0-0-0-0-0-0-0-0-82-81-80-79-78-77-76-75-74-0-0-0-0-0-0-0-73-72-71-70-69-68-67-66-65-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-122-121-120-119-118-117-116-115-0-0-0-0-0-0-0-0-114-113-112-111-110-109-108-107-106-0-0-0-0-0-0-0-105-104-103-102-101-100-99-98-97
=
the ASCII answers offset by the (EBCDIC value – 129) * 8
Later I noticed I could actually compress this down ever further to 7 bit blocks, but same approach:
F(x) = (
128070057299329029160532366382272698949585254017520505683907880651646113246781241152679941017683347871075183590519290884983803160004046129591512841711163006043377726987594721792580029335665027593265100616888290430988906849>>((x-129)*7)) MOD 128

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.