A chromosome is one possible set of N parameters, each of which is a gene. A mutation is a single bit change in the value of a gene, and a crossover results in a copying of bits from one set of parameters to another. Let's look at a specific example, and see how the analogy would apply to finding the minimum of the function above as the objective function. When using a genetic algorithm, the parameters are represented as bit strings, and so the length of the string as well as the possible bounds on the parameter must be specified. Some function to perform the mapping between integer and bit string must exist, and will be called encode .
Reproduction begins by selecting one of the best parameters at random.
It is during reproduction that variation is introduced into the population. Mutation is implemented as a single bit change to the chromosome, which occurs with a predefined probability. The second, and more important, way that variation is added to the population is by crossover. When applied to two bit strings, the crossover operation first selects a location at which to cut the two chromosomes involved. The remaining, un-copied, parts of the chromosomes are also copied into a second new chromosome.