Week04_Assignment04_Solution
Week04_Assignment04_Solution
111010 = 1 × 25 + 1 × 24 + 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20
which gives
111010 = 32 + 16 + 8 + 2 = 58
2. (c). After computing the corresponding fitness values of the chromosomes, if the optimization condition
did not meet, then we will check again in the order selection → crossover → mutation.
P 1 : 1001|110
and
P 2 : 1101|001
the value of offspring 1 (O1) and offspring 2 (O2) by applying single point crossover is given by
interchanging the numbers after bar(|) i.e.,
9. (d). In minimizing the function f (x), the individual with lowest functional fitness value will be the
fittest. From the given data we have,
f (x1 ) = (8 + 5) − (6 + 2) + (1 + 3)
=⇒ f (x1 ) = 9
f (x2 ) = (6 + 4) − (8 + 2) + (1 + 9)
=⇒ f (x2 ) = 10
f (x3 ) = (5 + 4) − (1 + 2) + (6 + 7)
=⇒ f (x3 ) = 19
So, the order of the individuals with the fittest first and the least fit last will be x3 x2 x1 .
12. (b). The fittest two individuals from the above found order in question no. 11 are x3 and x2 . So, after
crossing x3 and x2 using one–point crossover at the middle point we get,
x3 = 541|267
and x2 = 648|219
=⇒ O1 = 541|219
and O2 = 648|267
13. (a). The second and third fittest individuals from the above found order in question no. 11 are x2 and
x1 .
So, after crossing x2 and x1 using two–point crossover at b and e, offspring 3 (O3) and offspring 4 (O4)
will be :
ab|cde|f
x2 =64|821|9
and x1 =85|621|3
=⇒ O3 =64|621|9
and O4 =85|821|3
f (O1 ) = (5 + 4) − (1 + 2) + (1 + 9)
=⇒ f (O1 ) = 16
f (O2 ) = (6 + 4) − (8 + 2) + (6 + 7)
=⇒ f (O2 ) = 13
f (O3 ) = (6 + 4) − (6 + 2) + (1 + 9)
=⇒ f (O3 ) = 12
f (O4 ) = (8 + 5) − (8 + 2) + (1 + 3)
=⇒ f (O4 ) = 7
15. fmax = 36, range is 35.9 to 36.1. For the given data in question no. 10, by looking at the fitness
function and considering that genes can only be digits between 0 and 9, if we take 9 at the place where
we have addition and 0 at the place where we have subtraction, then we get the value of maximum
fitness as,
fmax = (9 + 9) − (0 + 0) + (9 + 9) = 36