Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Self-Documenting Pangrams

 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Task: Find a Self Documenting Pangram that includes your name in the "prefix"


Garrett Rowe found a pangram with six a's, one b, one c, three d's, thirty-four e's, seven f's, three g's, seven h's, nine i's, one j, one k, two l's, two m's, twenty-one n's, fifteen o's, two p's, one q, eleven r's, twenty-five s's, twenty-two t's, three u's, six v's, ten w's, three x's, five y's, and one z.


Your turn!
 
Ryan McGuire
Ranch Hand
Posts: 1061
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the linked page:
> Interestingly, it seems that some inputs never resolve to a solution. I have not investigated this too deeply, but multiple quiz solvers reported the same issue.

It would seem to me that there are some seed sentences that have have no stable solution. Let's say the entire rest of the seed sentence had no 'e's in it and the 'e' count was randomly set to 4: "four e's". After one correcting pass, that would become "one e". That would then have to be corrected to "two e's". Then back to "one e". Then "two e's". ...

These loops could of course involve many letters and have a fairly large loop size.


 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan McGuire wrote:From the linked page:
> Interestingly, it seems that some inputs never resolve to a solution. I have not investigated this too deeply, but multiple quiz solvers reported the same issue.

It would seem to me that there are some seed sentences that have have no stable solution. Let's say the entire rest of the seed sentence had no 'e's in it and the 'e' count was randomly set to 4: "four e's". After one correcting pass, that would become "one e". That would then have to be corrected to "two e's". Then back to "one e". Then "two e's". ...

These loops could of course involve many letters and have a fairly large loop size.




That's true. Although 'e' is a bad example since it is probably the most common letter. You could put a check in the program for cycles like this. I used the "Random Robbinsonizing" technique which has the advantage that you don't have to check for cycles, but theoretically you could never zero in on a solution given a certain prefix. Incidentally, I just found another one:

Garrett Rowe's Scala program found this pangram which has nine a's, one b, three c's, three d's, thirty-nine e's, seven f's, six g's, fourteen h's, twelve i's, one j, one k, three l's, three m's, twenty-two n's, fourteen o's, three p's, one q, eighteen r's, twenty-nine s's, twenty-four t's, six u's, four v's, eight w's, three x's, five y's, and one z.
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since all good things come in threes, I'll do one more 'classic'

Only a fool would check that Garrett Rowe's computer generated sentence has seven a's, one b, five c's, four d's, fourty-one e's, seven f's, five g's, nine h's, eleven i's, one j, two k's, six l's, two m's, twenty-two n's, eighteen o's, two p's, one q, eleven r's, thirty s's, twenty-three t's, five u's, eight v's, nine w's, three x's, six y's, and one z.
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting cocky now. I've made some optimizations to my algorithm and now I'm on a roll. This is my last one.
This self-documenting pangram for the JavaRanch Meaningless Drivel forum contains nine a's, one b, four c's, four d's, thirty-seven e's, twelve f's, five g's, eight h's, nineteen i's, two j's, one k, six l's, five m's, twenty-nine n's, fifteen o's, two p's, one q, eleven r's, thirty-one s's, twenty-one t's, five u's, ten v's, six w's, three x's, five y's, and one z.


Found it after a mere 233,890 iterations.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic