The following figure shows a genetic algorithm. Briefly describe why the genetic algorithm should have the function 'REPRODUCE (x, y). (5pts)
function GENETIC-ALGORITHM(population,FITNEss-FN) returns an individual inputs: population, a set of individuals FITNEss-FN,a function that measures the fitness of an individual
repeat new-population-empty set for i = 1 to SIZE(population) do -RANDOM-SELECTION(population,FITNESS-FN) y-RANDOM-SELECTION(population,FITNESS-FN) childREPRODUCE(,y) if (small random probability) then child - MUTATE(child) add child to new-population population - new-population until some individual is fit enough,or enough time has elapsed return the best individual in population, according to FITNEss-FN
function REPRODUCE(,y) returns an individual inputs: ,y,parent individuals
nLENGTHxc-random number from1 to n
returnAPPENDSUBSTRING1c,SUBSTRINGc+1,n