EC Crossover and Mutation On A Giving Functions
EC Crossover and Mutation On A Giving Functions
Quiz # 1
Marks : 10 Time:40 min
• Initialization
• Evaluation
• Selection
• Crossover
• Mutation
• Survivor Selection
• Termination.
b) What are the advantages of Tournament Selection over Fitness Proportion Selection?
A suboptimal solution is one that is not the best possible outcome but is still
acceptable. It occurs when an algorithm finds a solution that is better than others but
not necessarily the global optimum.
Premature convergence occurs when a population loses diversity too soon and gets stuck in a
local optimum rather than exploring better solutions. This can result from excessive selection
pressure, low mutation rates, or overly exploitative search strategies.
Question #2:
Let f(x)= x2 be the function that we want to maximize
a. Initialize population with x= {3,5,2,1,9,7} . Represent it in binary.
3=0011
5=0101
2=0010
1=0001
9=1001
7=0111
0.2 → 5
0.4 → 9
0.12 → 3
0.6 → 9
0.33 → 9
0.9 → 7
New selected population: {5, 9, 3, 9, 9, 7}
Binary representation: {0101, 1001, 0011, 1001, 1001, 0111}
0101 → 0001
1001 → 1101
0001 → 0100
1011 → 0011
1011 → 0011
0101 → 0001
Mutated population: {0001, 1101, 0100, 0011, 0011, 0001}
Sort individuals based on fitness and retain only the best ones:
f(0001)=1,
f(1101)=169,
f(0100)=16,
f(0011)=9,
f(0011)=9,
f(0001)=1,
f(0001) =1
Sorted order: 1101, 0100, 0011, 0011, 0001, 0001
After truncation (keeping the top 4 individuals):
Final population: {1101, 0100, 0011, 0011}
e. Write down the population that survives for the next generation.
Good Luck