Initially, We have only 4 individuals who succeeded in reaching the needle during life-time-learning of 1000. fitness = 1000 - learning number of 9 ------------------------------------------------------------------- 0 920 => 1 9 9 9 1 1 9 1 9 1 9 1 1 1 9 1 9 1 9 9 10 1 900 => 9 1 9 9 1 9 9 9 1 9 9 1 9 1 1 1 9 1 9 1 11 2 548 => 9 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 1 1 1 1 9 3 479 => 1 1 9 1 9 1 9 9 9 9 1 1 9 1 9 9 1 9 1 9 11 ------------------------------------------------------------------- --- Producing offspring from these 4 parents with one-point-crossover and mutation 329 individuals are successful ~~~ The top ten are and the lastly successful one: fitness = 1000 - learning number of 9 -------------------------------------------------------------------------------------------- offspring[ 0]( 541) => 1 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 1 1 1 1 => 996 8 offspring[ 1]( 125) => 1 9 9 9 1 1 9 1 1 1 9 1 9 1 1 1 9 1 9 1 => 994 8 offspring[ 2]( 381) => 9 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 1 1 9 1 => 992 10 offspring[ 3]( 417) => 1 9 9 9 1 1 9 1 9 1 9 1 1 1 9 1 9 1 1 1 => 991 8 offspring[ 4]( 646) => 1 1 9 1 9 1 9 9 9 9 1 1 9 1 1 1 9 1 9 1 => 991 9 offspring[ 5]( 607) => 9 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 1 1 9 1 => 990 10 offspring[ 6]( 893) => 1 9 9 9 1 1 9 1 9 1 9 1 1 1 1 1 9 1 9 1 => 989 8 offspring[ 8]( 539) => 1 9 9 9 1 1 9 1 9 1 9 1 9 1 1 1 9 9 9 1 => 985 10 offspring[ 9]( 136) => 9 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 9 1 9 1 => 984 11 offspring[ 10]( 896) => 1 1 9 1 9 1 9 1 9 1 9 1 1 1 9 1 9 1 9 9 => 983 9 ...... ............ ... offspring[ 328]( 3) => 1 9 9 9 1 1 9 9 1 9 9 1 9 1 1 1 9 1 9 1 => 1 9 ----------------------------------------------------------------------------------- try reproduction again => 446 which is more or less succeeded are created. ============================================================================================ Debug some parts and re-experiment Same success as above at the beginning 0 920 => 1 9 9 9 1 1 9 1 9 1 9 1 1 1 9 1 9 1 9 9 1 900 => 9 1 9 9 1 9 9 9 1 9 9 1 9 1 1 1 9 1 9 1 2 548 => 9 9 1 1 1 9 1 9 9 1 9 1 9 9 9 1 1 1 1 1 3 479 => 1 1 9 1 9 1 9 9 9 9 1 1 9 1 9 9 1 9 1 9 But 224 survived this time with fitness ranging from 998 to 15 Then as the 2nd generation, select two parents with roulett selection and create offspring one by one => 260 survived => fitness from 998 to 5 iterated, expecting increasing successful offspring with 9 being reduced ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => 3rd generation 323 survived from fitness from 998 to 13 => 4th generation 352 survived from fitness from 999 to 17 => 5th generation 346 survived from fitness from 998 to 12 => 6th generation 334 survived from fitness from 999 to 3 => 7th generation 346 survived from fitness from 999 to 18 => 8th generation 347 survived from fitness from 999 to 82 => 9th generation 362 survived from fitness from 999 to 91 =>10th generation 42 survived from fitness from 999 to 419 found all parents have an identical genes =>11th generation 3 survived from fitness from 976 to 894 1 1 9 9 1 9 1 9 1 1 9 1 1 1 9 1 1 1 1 9 => 13394 133 1 9 9 9 1 9 1 9 1 1 9 9 1 1 9 1 1 1 1 9 => 44262 442