Reproduction

Construct child from 1 or n parents, perhaps with some changes.


Asexual reproduction

Parent:

  0011010110011101101
Child:
  0011010110011101101
Identical, except for occasional mutation:
Child:
  0011010110011111101




Sexual reproduction

"DNA" is instructions for how to build phenotype:

  How to build arms | How to build legs 
We want child to take the instructions from both parents:

  Father's How to build arms | Father's How to build legs 
  Mother's How to build arms | Mother's How to build legs 

Possibilities:

  1. Child takes all of both parents' DNA - But then you end up with 2 copies of the instructions. Which do you use? And what do you pass on? Does your child have 4 copies? And so on.

  2. Child takes part of father's DNA, part of mother's: Say each individual has 1 copy of instructions. Father has 1 copy. Mother has 1 copy. Father gives half and mother gives half. Problem - Need to synchronise the halves you get, so that don't get 2 copies of instructions for arms and no copies of instructions for legs.

    How could nature synchronise this? Father's sperm can't have only a half copy when it leaves his body because it may not synchronise with the egg's half copy. His sperm would have to contain full DNA and then, when it got to egg, synchronise at that point with egg DNA to ensure 1 full copy of instructions passed on.




2 copies of instructions - Nature's elegant algorithm

Nature has evolved an elegant solution as follows. Everyone carries precisely 2 copies of instructions, no more, no less. More than you need. For each instruction, you only actually use 1 copy (dominant/recessive genes).

Your father and mother both carried 2 copies also. They divided these to produce sperm and eggs ("gametes"), each containing 1 full copy. The 1-copy sperm and 1-copy egg come together to make new individual with 2 copies. Process repeats.

That's the basic scheme (not understood until 20th century, remember!)




Reshuffling along the way

It is the process of sperm/egg-production at which the first major reshuffling takes place. There are 23 chromosomes (strings) to make up the whole instruction set (for humans). Your mother/father has 2 copies:

c1,..,c23 (from grandfather)
d1,..,d23 (from grandmother)

The sperm/egg gets 1 copy of the instructions, but mixed up:

c1,d2,d3,c4,...,d23

Hence there are 223 possible combinations - massive genetic variety possible compared to asexual reproduction.

Secondly, even looking at a single chromosome string, new strings are created by crossover (there will also be mutation as well). For each chromosome   i   we have 2 copies:

ci = 0000000000000000000 (from grandfather)
di = 1111111111111111111 (from grandmother)

DNA replication:

  0000000000000000000

  0000000000000000000

  1111111111111111111

  1111111111111111111
Possibly "cross over" the instructions of adjacent ones at some point (may be multiple crossovers):
  0000000000000000000

  0000000000000111111

  1111111111111000000

  1111111111111111111
Each sperm/egg gets one of these strands, for each of its 23 chromosomes. This process produces sperm/eggs in batches of 4, each with 1 copy of instructions. (In fact, sperm are produced 4 at a time alright, but with eggs, 3 of these 1-copy "gametes" are discarded, and 1 picked for the egg.)

The second reshuffling is when the 1-copy sperm and 1-copy egg get together. Child has 2 copies. Some genes will be dominant and some recessive. Genes that were dominant in parent may be completely missing in child, and grandparent's recessive gene is expressed again. Child grows up with 2 copies. Process repeats.




Alternatives

If the only reshuffling was who you mated with (dominant/recessive) then children could be a new combination alright, but all siblings would be the same. So there is further reshuffling - every sperm and egg is unique.

Synchronisation of 2 copies happens inside the same body - easier to control. The crossover mechanism ensures that we can mix up the instructions while ensuring that each sperm/egg still has 1 full copy.

Nature could presumably have just 1-copy individuals, get the 1-copy sperm DNA and 1-copy egg DNA together, and then make sure there was a crossover as above, and pick the child from one of the crossed over segments. Would probably get a lot of clones (crossover didn't happen). Also not as much diversity (don't get grandparent's recessive genes, as above). 2-copies also more robust in terms of error correction.

Interesting to consider why 2-copies has evolved everywhere, and not 3 or more, and not 1.





50-50 ratio - Further elegance in nature

If you have sexes, how on earth do you maintain a 50-50 coin flip for the sex of the offspring? In a machine algorithm, we could use a random number generator. How can nature toss the coin so accurately so that 50 percent of population always is male and 50 percent female?

Each male carries 2 copies X, Y. Each female carries 2 copies X, X. Male produces millions of X sperm, millions of Y sperm, in proper proportions (doesn't have to count - it just takes millions of X-Y cells and splits them up). All female 1-copy eggs are X.

If a Y sperm fertilises egg, child has X plus Y (male).
If an X sperm, child is X plus X (female). And so it continues.

Interesting that ignorant men throughout history have berated their wives for producing daughters, e.g. Henry VIII, when of course it is the man's own sperm that decides the issue.

Anything we can learn from this statistical "algorithm" to ensure 50-50 ratios?




Why did sex evolve?

Sex seems to be a way of maintaining better diversity in a population, by mixing up different building blocks, as opposed to asexual reproduction, where we depend on slow mutations from a common origin. From machine viewpoint, mixing up solutions is a better search strategy. But still, once a solution is found, surely you settle down with asexual reproduction?

Yes, in fact that is true. Sex appears to be related to a (fast or slowly) changing fitness landscape. The fastest changing fitness landscape is normally that caused by fast-evolving parasites. In a changing fitness landscape, we want to keep alive a diversity of solutions, so the population can move in one of many different directions when necessary. If there's only one genotype, and the Black Death kills it, then you go extinct.

Sex doesn't just maintain diversity. It also introduces an objective, "run-time" selection of how well you are dealing with the parasites. Sexual selection (mate choice) means you get tested during your life on a basis other than pure survival: You have to have survived looking good (fit, healthy). You have to survive to adulthood, parasite-free, to be picked by a mate. It is now thought that parasites are one of the main reasons sex exists.


Crossover in Machine evolution

Machine evolution normally allows only 1 copy of instructions, because otherwise it has to get involved in defining what is dominant/recessive. e.g. 10 genes in genotype. 2 copies. Which is dominant/recessive?   210   possible choices.

We can have only 1 copy because with a machine, we can very carefully synchronise the 2 parental copies.

And following on the above discussion, we must consider if we can deal with a changing fitness landscape. Ideally, at each point one would be at a near-global optimum, yet still be able to track the shifting landscape. It seems the standard GA will be able to do this if it is memory-free, i.e. each generation has to re-prove its fitness, and they keep reproducing. Also any step size / noise / temperature must be increased again. A problem will be that instead of starting with a random scattering of individuals, we may be starting with them all concentrated in a small, sub-optimal area of the landscape.

How do you detect if the fitness landscape has changed?