Solution
The correct answer is 6.25
Key PointsIn a genetic algorithm seeks to find the optimal solution to a problem, guided by the principle of survival of the fittest.
To find the fitness value of each individual in the population, we can use the given fitness function \(f(x) = x^2 - 4x + 4 \).
Let's calculate the fitness values for the individuals with the given values of x:
1. For x = 1.5:
\(f(1.5) = (1.5)^2 - 4(1.5) + 4 = 2.25 - 6 + 4 = 0.25\)
2. For x = 2.0:
\(f(2.0) = (2.0)^2 - 4(2.0) + 4 = 4 - 8 + 4 = 0\)
3. For x = 3.0:
\(f(3.0) = (3.0)^2 - 4(3.0) + 4 = 9 - 12 + 4 = 1\)
4. For x = 4.5:
\(f(4.5) = (4.5)^2 - 4(4.5) + 4 = 20.25 - 18 + 4 = 6.25\)
So, the fitness values for the individuals are:
\(\{0.25, 0, 1, 6.25\}\)
The individual with the highest fitness value is x = 4.5 with a fitness value of 6.25. Therefore, the correct answer is option 4) 6.25.