# why we apply mutation after getting offspring in genetic algorithm?

When we get the offspring and fitness so why we prefer to apply mutation in genetic algorithm?

• to get some randomness in the process. Also, genetic algorithm are inspired by evolution, and it's how evolution works, some genes can be mutated – Jérémy Blain Nov 28 '18 at 14:18
• @JérémyBlain: That seems to be the start of an (correct IMO) answer - do you have time to write that in slightly longer form? – Neil Slater Nov 28 '18 at 14:36
• actually I am not sure that this is the only reason ? Maybe there is more scientific or mathematical reason for this pattern ? – Jérémy Blain Nov 28 '18 at 14:40

Mutation is (usually) needed to introduce new genes not found in the population. Suppose that you have 4 possible genes $$A$$, $$B$$, $$C$$, and $$D$$, and that your chromosomes have a non-binary encoding. In that case, if no member of your population has gene $$D$$, then no amount of crossover operations will result in the introduction of that gene.