First go here for a background on the Genetic Algorithm process. Now go to this site for some Genetic Algorithm vocabulary 3. Study the following genetic algorithm simulation. Write a program to simulate this process for n generations. Crossover is the second genetic operator used.
Mutation is the third genetic operator used here.
No mutation occurred in the above example. Choose randomly two different strings to be mated. In the example above, with a crossing site of 4, the two strings 01101 and 11000 cross and yield two new strings 01100 and 11001. The remaining two strings in the mating pool are crossed at site 2, and the two new individuals are 11011 and 10000. Mutation is done on a bit by bit basis, choosing a random bit to alter.