Question is attachedGenetic Algorithm C++ codes:

The following part from the codes is for running (fitness functions). I tried four objective functions to compare them and see which one give more randomization in the output keys.

Here we can change the kind of fitness

‘0’ to run – Sum,

‘1’ to run – mean,

‘2’ to run counting the maximum run of ones in a row

‘3’ to run Rosenbrock Banana function f(x,y,z)

From line 56: fitness = cal_fitness(3); you can change the code betwene 0, 1,2 and 3 to run each fitness functions

From line 92 – 171, you will find the codes for the four objective functions.

Question:

I would like you to implement the Chi-square Goodness of fit test to measure the randomness of the four objective functions applied in GA.cpp code file attached.

See the following links for more information about use Chi-square Goodness of fit test:

The following link is the Donald Knuth book. Please go to section 3.3 Statistical test pg 44

https://doc.lagout.org/science/0_Computer%20Science/2_Algorithms/The%20Art%20of%20Computer%20Programming%20%28vol.%202_%20Seminumerical%20Algorithms%29%20%283rd%20ed.%29%20%5BKnuth%201997-11-14%5D.pdf

The following links are website pages include information about Chi-square Goodness of fit test:

https://www.statsdirect.com/help/nonparametric_methods/chisq_goodness_fit.htm

Document Preview:

Genetic Algorithm C++ codes: The following part from the codes is for running (fitness functions). I tried four objective functions to compare them and see which one give more randomization in the output keys. Here we can change the kind of fitness ‘0’ to run – Sum, ‘1’ to run – mean, ‘2’ to run counting the maximum run of ones in a row ‘3’ to run Rosenbrock Banana function f(x,y,z) From line 56: fitness = cal_fitness(3); you can change the code betwene 0, 1,2 and 3 to run each fitness functions From line 92 – 171, you will find the codes for the four objective functions. Question: I would like you to implement the Chi-square Goodness of fit test to measure the randomness of the four objective functions applied in GA.cpp code file attached. See the following links for more information about use Chi-square Goodness of fit test: The following link is the Donald Knuth book. Please go to section 3.3 Statistical test pg 44 HYPERLINK “https://doc.lagout.org/science/0_Computer%20Science/2_Algorithms/The%20Art%20of%20Computer%20Programming%20%28vol.%202_%20Seminumerical%20Algorithms%29%20%283rd%20ed.%29%20%5BKnuth%201997-11-14%5D.pdf” https://doc.lagout.org/science/0_Computer%20Science/2_Algorithms/The%20Art%20of%20Computer%20Programming%20%28vol.%202_%20Seminumerical%20Algorithms%29%20%283rd%20ed.%29%20%5BKnuth%201997-11-14%5D.pdf The following links are website pages include information about Chi-square Goodness of fit test: HYPERLINK “https://www.statsdirect.com/help/nonparametric_methods/chisq_goodness_fit.htm” https://www.statsdirect.com/help/nonparametric_methods/chisq_goodness_fit.htm HYPERLINK “http://sphweb.bumc.bu.edu/otlt/MPH-Modules/QuantCore/PH717_ComparingFrequencies/PH717_ComparingFrequencies3.html” http://sphweb.bumc.bu.edu/otlt/MPH-Modules/QuantCore/PH717_ComparingFrequencies/PH717_ComparingFrequencies3.html HYPERLINK “http://www.biostathandbook.com/chigof.html” http://www.biostathandbook.com/chigof.html HYPERLINK…

Attachments:

Chi-square-Go….docxGA.cppstdc–.hChi-square-Go….docx