Yeah, it isn't (IMO) a letter-sum puzzle (aka crypto-sum) if the solution isn't unique.

If I require the leading digits to be non-zero, then adding two N-digit numbers gives us the following odds:

Digits Unique Equations Odds 1 2 81 2.47% 2 76 8100 0.94% 3 5,112 81e4 0.63% 4 1,222,504 81e6 1.51%

There is only a single solution to each of "a + b = ac" and "a + b = bc" so those are the only two 1-digit letter-sum puzzles (where you can replace abc with any three unique letters) -- note that I consider a+b different from b+a for several reasons. (There are 32 solutions to "a + b = c" and 30 solutions to "a + b = cd" and no solutions to "a + b = ba", to give a few examples of unacceptable puzzles.)

Of the 8100 (90*90) 2-digit + 2-digit sums that can be selected at random, only 76 result in a unique pattern of repeated digits such that transforming it into a letter-sum puzzle will give you one with a unique solution. So randomly selecting two 2-digit numbers only has a 0.94% chance of producing an acceptable letter-sum puzzle.

So the vast majority of 4-or-fewer-digit puzzles are unacceptable and would not be published in any of the places where I have seen letter-sum puzzles published.

I'm pretty sure that the odds steadily increase with the number of digits from this point on. And I haven't taken the time to run / optimize the code to precisely calculate those odds (nor to write the code to check whether a single puzzle has duplicate solutions which would then allow me to use random sampling to estimate the odds for larger numbers of digits).

Those are much more interesting challenges to me than golfing something that mostly produces invalid letter-sum puzzles. So thanks for that diversion.


In reply to Re^2: Golfing cryptosums by Anonymous Monk
in thread Golfing cryptosums by ELISHEVA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.