0% found this document useful (0 votes)
13 views2 pages

Answer: H-Fixed-Length-Eight-Genes-G-Q120961572

The document details the process of using a genetic algorithm to evaluate and improve fitness through crossover operations on chromosomes. It calculates the fitness of various individuals, performs one-point, two-point, and uniform crossover, and concludes that the optimal solution cannot be reached without mutation. The maximum fitness achievable is 36, and the order of fitness from highest to lowest is X2, X1, X3, and X4.

Uploaded by

peyerak310
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Answer: H-Fixed-Length-Eight-Genes-G-Q120961572

The document details the process of using a genetic algorithm to evaluate and improve fitness through crossover operations on chromosomes. It calculates the fitness of various individuals, performs one-point, two-point, and uniform crossover, and concludes that the optimal solution cannot be reached without mutation. The maximum fitness achievable is 36, and the order of fitness from highest to lowest is X2, X1, X3, and X4.

Uploaded by

peyerak310
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Question

https://www.chegg.com/homework-help/questions-and-answers/suppose-genetic-algorithm-uses-chromosomes-form-x-b-c-d-e-f-g-
h-fixed-length-eight-genes-g-q120961572

Answer

Step 1
First, let's solve the equations.

(i) X 1 = 6 5 4 1 3 5 3 2

f (x1) = (6 + 5) − (4 + 1) + (3 + 5) − (3 + 2) = 9

X2=87126601

f (x2) = (8 + 7) − (1 + 2) + (6 + 6) − (0 + 1) = 23

X3=23921285

f (x3) = (2 + 3) − (9 + 2) + (1 + 2) − (8 + 5) = −16

X4=41852094

f (x4) = (4 + 1) − (8 + 5) + (2 + 0) − (9 + 4) = −19

The order of the fittest to the least fit is X 2 , X 1 , X 3 , X 4 .

Explanation:

From the given formula f (x) = (a + b) − (c + d) + (e + f )−)g + h) , we have calculated the fitness of each individual .

Step 2
ii) Perform the following crossover operations:

a) Cross the fittest two individuals using one–point crossover at the middle point. Answer: One–point crossover on X2 and X1 : X 2 = 8 7 1 2 6 6
0 1 ⇒ O 1 = 8 7 1 2 3 5 3 2 X 1 = 6 5 4 1 3 5 3 2 ⇒ O 2 = 6 5 4 1 6 6 0 1 b) Cross the second and third fittest individuals using a two–point crossover
(points b and f). Answer: Two–point crossover on X 1 and X 3 : X 1 = 6 5 4 1 3 5 3 2 ⇒ O 3 = 2 3 4 1 3 5 8 5 X 3 = 2 3 9 2 1 2 8 5 ⇒ O 4 = 6 5 9 2 1 2 3
2 iii) Cross the first and third fittest individuals (ranked 1st and 3rd) using a uniform crossover. Answer: we may swap genes at positions a, d
and f of parents x2 and x3: X 2 = 8 7 1 2 6 6 0 1 ⇒ O 5 = 2 7 1 2 6 2 0 1 X 3 = 2 3 9 2 1 2 8 5 ⇒ O 6 = 8 3 9 2 1 6 8 5

Explanation:

e get new offspring in these cross combination with name as O 1 , O 2 , O 3 ,O 4 ,O 5 ,O 6 .

Step 3
(iii) From the last created part we get 6 offspring.

O1=87123532

O2=65416601

O3=65921232

O4=23413585

O5=27126201

O 6 = 8 3 9 2 1 6 8 5.

Now calculate new fitness using the formula.[ f (x) = (a + b) − (c + d) + (e + f ) − (g + h) ]

f (O1) = (8 + 7) − (1 + 2) + (3 + 5) − (3 + 2) = 15

f (O2) = (6 + 5) − (4 + 1) + (6 + 6) − (0 + 1) = 17

f (O3) = (6 + 5) − (9 + 2) + (1 + 2) − (3 + 2) = −2

f (O4) = (2 + 3) − (4 + 1) + (3 + 5) − (8 + 5) = −5

f (O5) = (2 + 7) − (1 + 2) + (6 + 2) − (0 + 1) = 13

f (O6) = (8 + 3) − (9 + 2) + (1 + 6) − (8 + 5) = −6 The overall fitness has been improved by using the crossover operations.

Explanation:

The overall fitness has been improved from the previous fitness .

Step 4
d) The optimal solution should have a chromosome that gives the maximum of the fitness function.

max f (x) =max [(a + b) − (c + d) + (e + f ) − (g + h)].

Because genes can only be digits from 0 to 9, the optimal solution should be:

Xoptimal = 99009900, and the maximum fitness is:


f (xoptimal) = (9 + 9) − (0 + 0) + (9 + 9) − (0 + 0) = 36

Explanation:

The maximum fitness can reach only upto 36 . and minimum can be as low as 0.

Step 5
V ) No, the algorithm will never reach the optimal solution without mutation. The optimal solution is xoptimal = 99009900 . If mutation does
not occur, then the only way to change genes is by applying the crossover operator. Regardless of the way crossover is performed, its only
outcome is an exchange of genes of parents at certain positions in the chromosome. This means that the first gene in the chromosomes of
children can only be either 6, 8, 2 or 4 (i.e. first genes of x1, x2, x3 and x4), and because none of the individuals in the initial population begins
with gene 9, the crossover operator alone will never be able to produce an offspring with gene 9 in the beginning. One can easily check that
a similar problem is present at several other positions. Thus, without mutation, this GA will not be able to reach the optimal solution.

Final Answer
The all the steps are explained brifely in the above steps .

1) The order is x2, x1, x3 and x4.

2) One–point crossover on x2 and x1: x2 = 8 7 1 2 6 6 0 1 ⇒O1 = 8 7 1 2 3 5 3 2 x1 = 6 5 4 1 3 5 3 2 ⇒O2 = 6 5 4 1 6 6 0 1

Two–point crossover on x1 and x3: x1 = 6 5 4 1 3 5 3 2 ⇒O3 = 6 5 9 2 1 2 3 2 x3 = 2 3 9 2 1 2 8 5 ⇒O4 = 2 3 4 1 3 5 8 5

we may swap genes at positions a, d and f of parents x2 and x3:

x2 = 8 7 1 2 6 6 0 1 ⇒O5 = 2 7 1 2 6 2 0 1 x3 = 2 3 9 2 1 2 8 5 ⇒O6 = 8 3 9 2 1 6 8 5

3) The overall fitness has been improved.

4)The maximum fitness is 36.

5) No, the algorithm cannot reach the optimal solution without the mutation operation.

You might also like