CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Threaded View

  1. #3
    Join Date
    Apr 2009
    Posts
    38

    Re: General Programming Question - Self Enumerating Pangrams

    Thank you for the monte carlo suggestion, I'll have a read about it

    I'm using a sort of hybrid technique, I'm getting *really* close now, only 1 number is off, but still no solution.

    What I'm doing is choosing a random number, and setting every letter to that number. Then I update the pangram with the actual count. I keep updating the pangram for 5 seconds, if no progress is made, then it is stuck in a loop, so I mutate it 15000 to 1000000 times, updating the pangram between mutations. (I choose this figure before running the program). If no improvement is made from the mutations, I revert back to the previous best and start mutating again.

    I'm trying to find the right balance between mutations and updates. If I update too often I get stuck in a loop, if I mutate too much I might miss a potential solution.

    I've turned my spare room into an oven, running this on two poweredge servers :P

    EDIT: Solution Found!

    It turns out that the string you use to start your pangram determines whether it is solvable or not. I changed the base string, and within minutes had a solution

    After much tribulation, Sam Kennedy made this pangram which contains: nine a's, two b's, four c's, four d's, twenty nine e's, nine f's, two g's, seven h's, fifteen i's, one j, two k's, two l's, five m's, twenty nine n's, sixteen o's, two p's, one q, ten r's, thirty one s's, twenty four t's, seven u's, four v's, ten w's, three x's, six y's, and one z.
    This is a really interesting exercise if anyone is ever bored and wants something to do!
    Last edited by SamstaUK; July 4th, 2012 at 06:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured