Generic Algorithms

This week I am a little bit lazy in terms of the homework. I wrote generic algorithms before and I knew it was a hard and time-consuming process. So I just tweaked the Shakespeare example and had fun with it.

Tweaking Population

Increasing population size would decrease the generation cycles (aka. iterations) since there's more options in each generation. The averaged iterations of 400-population size was about 120 generations, which is less than half of the iterations of 200-population size (which was 300~400 times).

Tweaking Mutation Rate

Increasing mutation rate would increase the generation cycle significantly in that there are more mutations that didn't fit the target phase. I changed the mutation rate up to 5% and the averaged generation was more than 10000 times across 4 experiments.

One experiment with a 5% mutation rate