A way of implementing this is to reproduce each string with probability equal to its percentage of contribution to the total fitness of the population. Hence, Once the size of the mating pool has reached the fixed size of the population, members of it are selected at random for mating. It is during this stage that crossover occurs. A mutation occurs when a random bit in a string changes value. Mutation serves to introduce beneficial genetic material into the population and to guard against the permanent loss of useful material in a particular bit position.
Mutation definitely plays a minor role when compared to crossover, however.
Empirical studies have shown that a suitable mutation rate is one mutation per thousand bit transfers. After the crossover and mutation operators have been applied to the mating pool, the resulting set of strings becomes the population for the next generation. The algorithm continues until the population has evolved through a specified number of generations. The fittest value of the best string encountered during the process becomes the proposed optimal solution. We can now sketch a simple genetic algorithm.