Modeling the evolution of situations in which randomness is present is one example of this kind of problem, and it is an example of the type of problem that genetic algorithms serve to address. Genetic algorithms are programming constructs that are designed to simulate the evolution of a situation based upon a function that determines the fitness of the various possibilities presented. An initial situation, consisting of some number of bit strings of a certain length, is randomly generated. These strings, just like chromosomes, are then evaluated according to the fitness function. Some strings that are determined to be unfit are then eliminated from consideration, while the fit strings are recombined via crossing-over to create progeny from the parent strings.
Crossover is used in hopes of creating a second generation with superior characteristics.
Though it would be desirable to create offspring with only these superior distinctions, this would in the end limit possible solutions, since a population may tend to a local maximum or minimum of the fitness function, and never have a chance to go toward the real maximum or minimum. The mutation probability is used to generate realistic situations and outcomes, and increase the diversity of the population. A factor that must also be incorporated into the algorithm is population density. Using a fairly small population creates a larger crossover probability, limiting possibilities. On the other hand, using an extremely large population deteriorates the efficiency of time.