The Computational Beauty of Nature — Spring 2020

Problem Set 5: Genetic Algorithms

Due by class time Thursday, April 9

For these exercises, please write up your answers in the form of a PDF or Microsoft Word document.

Reading

Written Exercises

  1. Include your answers from questions 7-11 of Lab 6 (Robby the Robot).

  2. Consider a genetic algorithm with the population of genomes shown below, and a fitness function that counts the number of 0's in a genome.

    A: 1010010101
    B: 0011111011
    C: 0110101101
    D: 1111110111
    E: 1100000001
    F: 0101010101
    
    1. Show the fitness values that would be assigned to each of the above genomes. What is the average fitness of the population?

    2. For each genome, calculate the probability of its being chosen for reproduction, assuming that fitness-proportionate selection is used to select genomes. Express each probability as a percentage in the range 0%-100%.

    3. Suppose that the next generation contains the genomes 0011111111 and 1000000001. Explain exactly how these particular genomes could have been produced from the previous population using only the crossover operator (no mutation).

    4. Without the mutation operator, would it be possible for the highest-fit genome 0000000000 to ever be produced from the above population? Explain why or why not.

  3. Suppose Robby the Robot has a score of 0 in the environment shown below:

    Suppose he is following this strategy (here showing only the relevant situations):

    North   South   East    West    Here          Action
    Empty   Can     Empty   Empty   Can         Pick Up Can
    Empty   Can     Empty   Empty   Empty       Move South
    
    1. After following this strategy for three steps (and performing three actions), what does Robby see as his current situation?

    2. What is his current score?

    3. Suppose the mutation rate is 0.05. How many mutations would be expected in a single strategy of length 243?

    4. How many mutations would be expected over an entire population of 100 strategies (each of length 243)?

  4. Suppose we add memory to Robby's abilities. That is, suppose that in addition to perceiving his current situation (the contents of the five surrounding grid cells to the North, South, East, West, and Here), Robby is also able to remember the contents of his situation from the previous time step, and to use this memory in his strategy. Describe how the "string-of-digits" genome representation for Robby's strategies would have to be modified. How long would the genome representing a strategy need to be in this case?