Let the length of the string L=8, and the number of chromosomes in the population N=4.
X1=00000110
X2 = 11101110
X3=00100000
X4 = 00110010
The fitness function is defined as
F(x) = number of ones in the bit string x.
Selection Operator
Fitness-proportionate selection, i.e., the number of times an individual is expected to reproduce is equal to
its fitness fi divided by the average fitness of the population f
N₁ = f₁/f
Crossover probability pc =0.7
Mutation probability pm = 0.01
Make a run of three generations.