Tagged: Python Automation
22nd February 2021 at 3:48 pm #53294MadnessParticipant
@Mattyrat2027, there is a really good exposition of fitness functions at
I couldn’t explain it any better.
(Before anyone asks, I am not connected in any way to that website.)
The hill-climbing attack on the Pollux cipher goes like this:
The fitness function is based on 10-gram (dekagram) frequencies of English that has been encoded with Morse.
In other words, I took a big block of English text and encoded it, then I counted up how many times
………. occurs, then how many times ………_ occurs, etc., up to xxxxxxxxxx. There are 3^10 entries in
the table. The fitness function is otherwise the same as in the practicalcryptography.com example.
To climb the hill, it starts with a random key, which is a string of 36 dots, dashes, and x’s. At each step, it
changes one of these symbols to something else. If that results in a better fitness, it keeps the change and
continues. If not, it tries changing a different symbol in the the key. To avoid getting stuck in a local
max, the algorithm allows a downward step about 5% of the time, if the step is only a little bit downward.
When the fitness cannot be improved any longer, it spits out the key.
(Again, don’t assume that I invented this trick; I did not.)
@F6exb, could you please rephrase the question? I don’t understand what you are asking.22nd February 2021 at 6:09 pm #53295F6exbParticipant
In your example of hill climbing, there is a lot of “-” “x” and “.”
Can you explain the meaning of these patterns ?23rd February 2021 at 9:08 am #53296
- You must be logged in to reply to this topic.