The mating algorithm

We have a population of animals. Each individual can be associated with a certain "value", expressing his "fit level to the environment". We want to design a simple algorithm in the animal's genes that would make the individuals to mate close to optimal.

Let's say that resulting value for the mating is the product of the "value" of the two involved individuals. We will study the case when each individual can only be involved in mating with a single other individual.

In this conditions, the close to optimum mating is reached when mating is realized between individuals with very close values. Mathematically, we have a set of positive numbers (the values) and we want to create the pairs of numbers so that the sum of products of each pair will be maximal. This happens when we sort the numbers and we pair each number with the one next to it.


On neurons and human ideation

My kid is close to 4 years and started to exhibit a very human brain process: before sleepping, he starts to remember random ideas and expresses them. Sometimes they are not only memories and plans he had over day, some are really new and original ideas - even that many are yet childish of course.

It is not something that could be related to a sudden thought association, he just has "ideas". It does not happen only before the sleep, it just happens more often then. Before the sleep it is also easier to eliminate hypothesis like "this thing remembered him about that other thing".

This process could show some light about how brain and neurons works, and possibly helping to design more human-like artificial intelligence. I would speculate that the same process that makes ideas and memories to pop up out of nothing, to be the process that permits the most amazing thought processes in humans.