3 ms·
I wonder how using Levenshtein distance as a fitness metric would affect the speed of progress: https://en.wikipedia.org/wiki/Levenshtein_distance https://en.w
by vanderZwan 10y ago
I wonder how using Levenshtein distance as a fitness metric would affect the speed of progress:
https://en.wikipedia.org/wiki/Levenshtein_distance https://en.wikipedia.org/wiki/Levenshtein_distance
OP, if you want to experiment, here's a gist with a JS implementation that I found after some googling:
https://gist.github.com/andrei-m/982927 https://gist.github.com/andrei-m/982927
How the cost function compares to how you mutate probably also matters here.
- TomNomNom 10y agoI used Levenshtein distance for a similar thing some years ago: https://tomnomnom.com/posts/methinks-it-is-like-an-incestuous-weasel https://tomnomnom.com/posts/methinks-it-is-like-an-incestuou... It worked very well!
- vanderZwan 10y agoVery nice and simple example! > The phrase METHINKS IT IS LIKE A WEASEL is 28 characters long, and has 27 possibities for each character, making for 27^28 (about 10^40) possible combinations. To put that into perspective: it's reckoned that there's about 10^80 atoms in the visible universe. Even if the monkey could try millions of combinations per second, he would almost certainly never get there - and that's assuming he never repeated a combination. > So it would take a very long time for the monkey to hit the right keys at random, but what about if it weren't completely random? Dawkins suggests a computer program to simulate the monkey, only using something akin to evolution to form the phrase instead of complete randomness. That is: randomness would still be involved, but in a slightly more predictable capacity than the virtual equivilent of a monkey bashing its head against a keyboard. Funny you should mention that, because one of the unsolved questions for the theory of Evolution is that even with our current understanding of evolution, life evolves faster than one would expect based purely on DNA mutations alone. A few issues back Nautilus had a excellent article on the problem, and the current work being done to solve this problem: http://nautil.us/issue/20/creativity/the-strange-inevitability-of-evolution http://nautil.us/issue/20/creativity/the-strange-inevitabili...