Question: This assignment is to explore how Genetic Algorithm works for the given problem. Program to solve the following problem using Genetic algorithm. You can use

This assignment is to explore how Genetic Algorithm works for the given problem. Program to solve the following problem using Genetic algorithm. You can use any programming language.
Program a Genetic Algorithm to find an integer number between 0 and 31 that maximizes the
function f(x)=x2.
The initial procedure is given as below.
Population size: 10
Crossover probability: 100%
Mutation probability: 5%
Terminating criteria:
When your program produces an average of candidates is equal to or greater than29, then you can accept it as a terminating condition.
Fitness function:
You can use the function itself (f(x)=x2) as your fitness function.
Your program should print the following.
1)For the 1st generation, print the process and result of selection, crossover, and mutation operation, that is, print the corresponding integer values and bits (binary values) before and after of selection, crossover, and mutation operation. You also need to decide the
crossover points and mutation points randomly and print them.
2) From the 2nd generation, you do not have to print all results of selection, crossover, mutation operations. Print just the result of each generation along with the average value of the result.
Write a programing code in any language and share the output screen with the expected
 This assignment is to explore how Genetic Algorithm works for the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!