Question: You are not allowed to use advanced data structures such as lists, Tuples, Sets, Dictionaries, Classes, etc. Use of these prohibited concepts earns zero points

You are not allowed to use advanced data structures such as lists, Tuples, Sets, Dictionaries, Classes,
etc. Use of these prohibited concepts earns zero points for the whole project. The goal of this project is to implement a simple genetic algorithm. We call it GeneticGuess Sentencer.
GeneticGuess Sentencer utilizes a basic genetic algorithm to... guess sentences! The user will enter a sentence,
a string composed of lowercase-letters and spaces. Then, it will use strategic randomization to get the users
sentence from several random strings. You will implement the basic genetic algorithm structure, including
several short (but important) functions. The basis of this project can be reused for other problems if you are
interested in it! D5.1.1 Genetic Algorithm Basics
Genetic algorithms work similar to real-life genes and evolutionary principles. You begin by creating a
population. This population will crossover and mutate with one another by selecting individuals with high
fitness. The result of this process leads to a new population, or a new generation. The process works like this:
There are multiple ways to implement the population, fitness, selection, crossover, and mutation. We will focus
on one method of each.
5.2 Population
The population is a large number of individuals. We have set the population size in the variable
NUM POPULATION. The entire population will be stored in a string of length NUM POPULATION
times the length of each individual. The length of each individual will be the length of the target sentence,
provided by the user. As the program continues through several generations, the population will collect
individuals that look more and more similar to the target string. To create an individual, use
random. choice () with a string of lowercase letters and a space (defined as ALPHABET in the starter
code). Do it in this order so your results match the testcases!
Do not separate the individuals by a space. You have the length of the target sentence, so you know where
to split the string for each individual.
For example, try this code:
import random
random. seed (10)
x- "welcome"
print (random.choice (x)) to
print (random.choice (x)) iw
Example
NUM POPULATION =2
Target = "hello workl"
population = "haskd als ajs foj oa j]
*each individual is highlighted
 You are not allowed to use advanced data structures such as

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!