Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Haven't been on Monastery grounds in a while, so I'm a little late to this party.
$ time t.pl 2of12inf.txt Done processing dict (40933 words). Candidate counts, by number of let +ters: $VAR1 = [ 0, 53, 516, 1894, 4068, 7076, 10360, 11926 ]; Done computation. Result (most words at bottom): aabdellu : 1 emprrtuy : 1 [... output truncated ...] aeginrst : 296 aelmprst : 297 acelprst : 297 aceiprst : 303 adeimrst : 305 adeoprst : 307 aeimnrst : 307 aeilnpst : 308 adeinrst : 311 aeilnrst : 311 adeilrst : 319 aeimprst : 327 adeiprst : 331 aeinprst : 336 aeilprst : 343 real 0m4.860s user 0m3.665s sys 0m0.160s

My solution:

My strategy is to aggregate up the word counts from candidates with the fewest letters to the most letters. (This approach is not thorough but is fast, see Update #2). The trick to make it fast is to realize that there is a one letter difference between candidate tiers, and to cycle through 26 letters for subset matching.

My winner is aeilprst with it being able to make at least 343 words (using all 8 letters, or a subset of that). This may not be the best answer because of the simplistic aggregation, but it points to the likely champs.

Looking at the other replies makes me question myself. What am I doing wrong?

Other results have winners that create only hundreds of words. Seems strange, given that 40k+ words were processed. Is that for words using all 8 letters only (and not a subset of the letters)?

Update: I see what's wrong now. The aggregation has to keep track of contributing counts of specific candidates. Back to drawing board.

Update #2: I have updated the script and results, which is more in line with what others have gotten. The total word counts do come up short because of the aggregation strategy. But the tradeoff in speed is significant.

In reply to Re: Challenge: 8 Letters, Most Words by repellent
in thread Challenge: 8 Letters, Most Words by Limbic~Region

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (15)
    As of 2014-04-16 20:18 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (433 votes), past polls