2 ProblemDescription

2.1 Objective

2.2 Design

Inafilenameddesign.pdf,describehowyouaregoingtosolvetheproblemandtest your implementation with the test cases you designed based on the stagesbelow.

Testing Hint: it’s easier if you test things as a small piece of code, rather than building a giant lump of code that doesn’t compile or run correctly. As part of your design, you should also sketch out how you are going to build and test the code.

2.3 Problem

DNA contains the genetic code that defines the structure of every organism on Earth. TheinformationinthisDNAiscopiedandinheritedacrossgenerationsfromindividual toindividual,butmaychangeovergenerationsduetocrossoverandmutation.Amore

Evolutionarycomputationhasbeenusedtosolveanumberofproblems,includingmak- ing virtual creatures, reducing race time for athletes, designing strategies for satellite coverage,designingturbines...thelistgoeson.Thefollowingarticlesprovidesomekind of overview on evolutionary algorithms. Please have a read if you areinterested.

BitFlip: The mutate function in this class “flips” the k-th binary digit. If k is greater than the length of the list, we will count in circles. For example, if the length of the list is 10 and k = 12, then the mutate function will flip the second digit.

Rearrange:Inthisclass,themutate functionrearrangesthelist.Thefunctionwill select the k-th digit in the bitstring (again, counting in circles). This digit and all digits after it (all the way to the tail) will be moved to the start of the list. For example,if you wererearrangingthelist(a,b,c,d,e)andk=3,thefunctionwould returnanIndividualwiththelist(c,d,e,a,b).

withindexk1andk2respectivelythroughexecute function.Theoutputofyourmain functionshouldbethetworesultingbinarystringandthelongestconsecutivesequence of 1-bits of the second offspring. k1 and k2 are both positive integers. Please separate the results using onespace.