Author of Grokking Artificial Intelligence Algorithms

When we look at the world around us, we sometimes wonder how everything we see and interact with came to be. One way to explain this is the theory of evolution. And it's useful in solving computational problems in AI.

The theory of evolution suggests that the living organisms that we see today did not suddenly exist that way, but evolved through millions of years of subtle changes, with each generation adapting to its environment.

This implies that the physical and cognitive characteristics of each living organism are a result of best fitting to its environment for survival. Organisms evolve through reproduction by producing children of mixed genes from their parents.

Given the fitness of these individuals in their environment, stronger individuals have a higher likelihood of survival. We often make the mistake of thinking that evolution is a linear process, with clear changes in successors.

In reality, evolution is far more chaotic. A multitude of variants of species are created through mixing of genes. Noticeable differences in a species could take thousands of years, and only be realized by comparing the average individual in each of the time points.

Charles Darwin proposed natural selection. The concept that stronger members of a population are more likely to survive due to being more fit for their environment, which means they reproduce more and carry traits that are beneficial to survival to future generations.

A classic example of evolution for adaption is the peppered moth. The peppered moth was originally light in color, which made for good camouflage against predators as the moth could blend in with light-colored surfaces in its environment.

Only around 2% of the moth population was darker in color. After the Industrial Revolution, around 95% of the species were of the darker color variant.

One explanation is that the lighter-colored moths could not blend in with as many surfaces anymore because pollution had darkened surfaces; thus lighter-colored moths were eaten more by predators because those moths were more visible.

This theory is harnessed in algorithms like genetic algorithms. A solution is represented as a data structure, measured, and mixed with other solutions within certain rules. This repeats for many generations, and sometimes finds great solutions with less computational overhead.

If you want more details about this algorithm, see Grokking Artificial Intelligence Algorithms with Manning Publications:, consider following me - @RishalHurbans, or join my mailing list for infrequent knowledge drops in your inbox: