/infinite-monkey

Genetic algorithm for the infnite monkey problem

Primary LanguagePython

infinite-monkey 🐒

Genetic algorithm for the infnite monkey problem

What is Infinite Monkey problem?

The infinite monkey theorem states that if a monkey starts hitting keys at random on a keyboard for an infinite amount of time, he will almost surely type a given text, such as the complete works of William Shakespeare. In fact, the monkey would almost surely type every possible finite text an infinite number of times. However, the probability of this event is so tiny that it will require more time than the estimated age of the universe, but chances of occurrence of this event is not zero.
Check this for more information - https://en.wikipedia.org/wiki/Infinite_monkey_theorem

Using genetic algorithms to solve the problem

I have tried to solve the problem by using genetic algorithms.

Running the code

  1. Set variable 'target_string'
  2. Set mutation rate and initial population size
  3. run>
    python ga.py