0011010110011101101Identical, except for occasional mutation:
"DNA" is instructions for how to build phenotype:
How to build arms | How to build legsWe 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
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.
0000000000000000000 1111111111111111111Children will be identical:
0000000000000000000 1111111111111111111Or a carefully synchronised "crossover":
Diversion - How nature does itHow does nature synchronise inheriting some of father's instructions and some of mother's? This was not understood until the mid-late 20th century.
Father's part (the "sperm") can't have only 1/2 copy of instructions when it leaves his body because it may not synchronise with the mother's 1/2 copy (the "egg"). Sperm would have to contain father's full DNA and then, when it got to egg, synchronise at that point with egg DNA to ensure full copy of instructions passed on.
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:
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 1111111111111111111Possibly "cross over" the instructions of adjacent ones at some point (may be multiple crossovers):0000000000000000000 0000000000000111111 1111111111111000000 1111111111111111111Each 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.
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.
- My page on Common ancestors of all humans
- Common ancestors of all humans (using genetics) discusses this topic.
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?
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.
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?