0% found this document useful (0 votes)
60 views4 pages

Given A Fitness Function

The document describes performing 5 iterations of a genetic algorithm to find the maximum value of the fitness function f(x) = x^2 + 1 over the range [0,53]. In each iteration, 5 binary numbers are randomly selected and mutated using either bit inversion or order changing to produce the next generation. The maximum fitness value found increases with each generation, reaching a value of 3601 in the fifth generation.
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)
60 views4 pages

Given A Fitness Function

The document describes performing 5 iterations of a genetic algorithm to find the maximum value of the fitness function f(x) = x^2 + 1 over the range [0,53]. In each iteration, 5 binary numbers are randomly selected and mutated using either bit inversion or order changing to produce the next generation. The maximum fitness value found increases with each generation, reaching a value of 3601 in the fifth generation.
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/ 4

✏ Given a fitness function { f(x) = X2 + 1 } in the searching range of [0, 53], find the maximizing value

of the fitness function for three iterations/generations. Use the bit inversion as the mutation operator
when generating the offspring.

Note: here you should apply the mutation operator instead of the crossover to find the
offspring for next generations

5 mutations for 5 genetrices, Draw maximum fitness Binary Numbers Decimal


(Randomly selected)
First Generation 001111 15
No. 1st X Fitness function 011000 24
(decimal) f(x) = x 2 + 1 100100 36
1 001111 15 226 001000 8
2 011000 24 577 010100 20
3 100100 36 1297
4 001000 8 65
5 010100 20 401

bit inversion (3)


Second Generation
nd
No. 2 X Fitness function
(decimal) f(x) = x 2 + 1
1 000111 7 50
2 010000 16 257
3 101100 44 1937
4 000000 0 1
5 011100 28 785

bit inversion (4)


Third Generation
th
No. 3 X Fitness function
(decimal) f(x) = x 2 + 1
1 010111 23 530
2 000000 0 1
3 111100 60 3601
4 010000 16 257
5 001100 12 145
bit inversion (2)
fourth Generation
No. 4th X Fitness function
(decimal) f(x) = x 2 + 1
1 010011 19 362
2 000100 4 17
3 111000 56 3137
4 010100 20 401
5 001000 8 65
bit inversion (1)
fifth Generation
th
No. 5 X Fitness function
(decimal) f(x) = x 2 + 1
1 010001 17 290
2 000110 6 37
3 111010 58 3365
4 010110 22 489
5 001010 10 101

4000
3500
3000
Fitness Function

2500
2000
1500
1000
500
0
0 1 2 3 4 5 6
Generations
✏ Given a fitness function { f(x) = X2 + 1 } in the searching range of [0, 53], find the maximizing value
of the fitness function for three iterations/generations. Use the Order Changing (Swap Mutation) as the
mutation operator when generating the offspring.

Note: here you should apply the mutation operator instead of the crossover to find the
offspring for next generations

5 mutations for 5 genetrices, Draw maximum fitness


Binary Numbers Decimal
(Randomly selected)
First Generation 001111 15
st
No. 1 X Fitness function 011000 24
(decimal) f(x) = x 2 + 1 100100 36
1 001111 15 226 001000 8
2 011000 24 577 010100 20
3 100100 36 1297
4 001000 8 65
5 010100 20 401

Order Changing (2➔4)


Second Generation
st
No. 2 X Fitness function
(decimal) f(x) = x 2 + 1
1 011011 27 730
2 001100 12 145
3 110000 48 2305
4 001000 8 65
5 010100 20 401

Order Changing (5➔0)


Third Generation
th
No. 3 X Fitness function
(decimal) f(x) = x 2 + 1
1 111010 58 3365
2 001100 12 145
3 010001 17 290
4 001000 8 65
5 010100 20 401
Order Changing (2➔1)
fourth Generation
No. 4th X Fitness function
(decimal) f(x) = x 2 + 1
1 111100 60 3601
2 001010 10 101
3 010001 17 290
4 001000 8 65
5 010010 18 325
Order Changing (1➔0)
fifth Generation
th
No. 5 X Fitness function
(decimal) f(x) = x 2 + 1
1 111100 60 3601
2 001001 9 101
3 010010 18 325
4 001000 8 65
5 010001 17 290
4000
3500
3000
Fitness Function

2500
2000
1500
1000
500
0
0 1 2 3 4 5 6
Generations

You might also like