In a genetic algorithm optimization problem the fitness function is defined as…
2023
In a genetic algorithm optimization problem the fitness function is defined as \(f(x) = x^2 - 4x + 4\).
Given a population of four individuals with values of x : {1.5,2.0,3.0,4.5}
What is the fitness value of the individual that will be selected as the parent for reproduction in one generation ?
- A.
2.25
- B.
6.0
- C.
0.0
- D.
6.25
Attempted by 53 students.
Show answer & explanation
Correct answer: D
Key insight: the fitness function simplifies to f(x) = (x - 2)^2. Evaluate this for each individual and choose the largest fitness.
For x = 1.5: f(1.5) = (1.5 - 2)^2 = (-0.5)^2 = 0.25.
For x = 2.0: f(2.0) = (2.0 - 2)^2 = 0^2 = 0.0.
For x = 3.0: f(3.0) = (3.0 - 2)^2 = 1^2 = 1.0.
For x = 4.5: f(4.5) = (4.5 - 2)^2 = 2.5^2 = 6.25.
Conclusion: The largest fitness among the population is 6.25 for the individual with x = 4.5, so the selected parent's fitness value is 6.25.
A video solution is available for this question — log in and enroll to watch it.