Ah, never mind, that is a genetic algorithm.  I was on my phone, so couldn&#x27;t read through your code easily. Expressions are more often evolved using a technique called genetic programming, where the &quot;DNA&quot; is a tree structure, and operations like crossover are done via swapping subtrees among different members of the population. Check it out, it&#x27;s cool stuff. It gets used often when you&#x27;re evolving programs, rather than something with a more fixed genome.<p>Since I&#x27;m on a phone (again): how do you deal with malformed expressions, and changing the length of the genome?