If you take two computer programs and randomly swapped pieces from each of them. The result is not going to work. It will just be garbage. If you take two novels and randomly swapped chapters the result will be garbage too.

How is it than DNA (which is infinitely more complicated) can be combined, some from the father and some from the mother and yet it still somehow works?

Can you give a simple example?

  • 14
    $\begingroup$ Actually computer programmers can be made by randomly swapping bits of their programs around if it's set up properly, this is called genetic programming en.wikipedia.org/wiki/Genetic_programming $\endgroup$
    – Thijser
    Commented Mar 12, 2018 at 10:22
  • 3
    $\begingroup$ How exactly is DNA infinitely more complicated? It's only got a 4-character alphabet? You may argue that it is more complicated in some specific aspect, but not significantly so, let alone infinitely. $\endgroup$
    – OrangeDog
    Commented Mar 12, 2018 at 13:05
  • $\begingroup$ @Thijser. Yeah but genetic programming has never really worked that well as far as I understand for that very reason. $\endgroup$
    – zooby
    Commented Mar 12, 2018 at 14:18
  • $\begingroup$ @orangedog computer programs (for the computer POV) has a 2-letter alphabet. The claim that it is infinitely more complicated is a fallacy, but the amount of sigils in an alphabet is not a measurement of complexity. $\endgroup$ Commented Mar 12, 2018 at 14:20
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because it is based on the false premise that DNA is comparable to a computer program. $\endgroup$
    – David
    Commented Mar 27, 2019 at 19:59

5 Answers 5


One must always be careful not to stretch an analogy further than it can withstand, but since you started these analogies, I will follow up on them and explain the small mistake you've done in their representations.

The two books are not as different as you have in mind. You are not pasting the beginning of Uncle Tom's Cabin with the ending of Harry Potter but only the beginning of Harry Potter with the ending of another Harry Potter in which Ravenclaw is renamed Eagleclaw.

Also, unlike in books, there is no beginning-to-end reading frame for the entire chromosome. There are just genes randomly placed along chromosomes. The reality is that the placing is actually not that random but assuming it is can give you a sense of why it can often be fine to recombine two chromosomes and end up with still functional chromosomes.

For the computer program analogy, it would be like swapping files between branches of the same project (thanks @IronSean for his comment).

  • $\begingroup$ But what I don't understand is if the genes encode for proteins, how is it that if you have different genes the proteins still all work together? Well I guess then those genes would die out quite quickly unless they worked well with all the other proteins. $\endgroup$
    – zooby
    Commented Mar 11, 2018 at 18:31
  • 1
    $\begingroup$ Yes, selection does its job at ensuring that only alleles which phenotypic effects are well integrated within the actions of the other genes remain. Also, while there is a level of interdependence, it does not mean you cannot just modify things. In fact, you can often add a new gene in an organism and this organism may well just do fine. We might be more resilient than you would assume at first. $\endgroup$
    – Remi.b
    Commented Mar 11, 2018 at 18:35
  • 7
    $\begingroup$ Let's not forget that even after successful fertilization (merging of egg and sperm), many embryos die because of incompatibilities in the genomes. $\endgroup$
    – Thawn
    Commented Mar 11, 2018 at 20:51
  • 3
    $\begingroup$ In the Computer Program example it would be more accurate to say swapping files between branches in the same project, not randomly mixing and matching lines of code. In most cases, swapping some files between branches won't break the whole program. $\endgroup$
    – IronSean
    Commented Mar 12, 2018 at 14:58
  • 2
    $\begingroup$ @IronSean Ah nice. I could not find a good analogy for the computer programs. The one you're giving is perfect and I've added it in the post. $\endgroup$
    – Remi.b
    Commented Mar 12, 2018 at 15:50

Homologous DNA recombination does not swap parts randomly in the sense that any two bits of DNA can swap places. DNA recombination is random in the sense that it may or may not occur. In fact DNA homologous recombination is highly specific and its specificity is what it makes a great tool to study genetics in organisms like yeast by swapping a gene of interest with something else.

In your example of meiotic recombination between the sister chromatids can swap DNA between different alleles. Alleles are genes that encode for a protein with the same general function, but have some variability in sequence that gives them slightly different properties. The reason why it only occurs between alleles, is because homologous recombination requires regions of homology, in a laboratory experiment this can occur with 20 to 40 base pairs in length and the low likelihood that a 20 base pair sequence is found anywhere else in the genome is why you don't get a chaotic mix and match of genes that you suggested would happen.

  • $\begingroup$ Very interesting - and to extend the software analogy this sounds very similar to how patches/diffs work. They also require an identical section before and after the piece of code that is to be swapped with an updated version. $\endgroup$
    – jpa
    Commented Mar 12, 2018 at 14:25
  • $\begingroup$ The definition of allele here is a little misleading. An allele is a variant at a locus. Most often people consider loci that are genes but this is not necessarily the case. A sentence like "it only occurs between alleles" is a bit misleading. It would be better to say "it only occurs between variable regions". Also, just to avoid that the reader gets mislead, there are other things that affect variation in recombination rate than polymorphism. $\endgroup$
    – Remi.b
    Commented Mar 12, 2018 at 15:54
  • $\begingroup$ Another software analogy might be something like taking some program with hundreds of shared library dependencies and randomly swapping some of the library versions with versions used in a different release of the overall software. It might make certain things start crashing, or it might make that mysterious bug you started seeing in the latest version go away. ;-) $\endgroup$ Commented Mar 12, 2018 at 22:34

Can you give a simple example?

Yes. A mother is an entire codebase of Android OS, that boots with a dark blue background and where initial language is set to English (US).

A father is an entire codebase of Andoroid OS, that boots with a dark green background and where initial language is set to English (UK).

Other than that their codebases are exactly identical line-to-line. Recombination: each code line has a chance to be swapped to the code line at the same position.

A child might have a dark green background and English (US) and it will work mostly flawlessly.

You grossly overestimate how different the humans are from each other. (You're biased because you are a human.) Any single species is a group of nearly identical individuals. If the codebases are not very much identical, yes, the result will be garbage, both in programming and in biology. Exactly the same as trying to recombine rabbit's DNA with ant's DNA.

Rabbit and ant are considered different species not because they look differently; but because the codebases after recombination do not work at all.

(Another thing - the codebases over the generations evolved "programming patterns" that made them vastly more tolerant to glitches that typically happen during the recombination. A very very defensive kind of programming, that is really ugly and nearly impossible for a human to read or understand.)

  • 1
    $\begingroup$ I'd also add that large swaths of the code is functions that are dead and non-functional. So if the flip-flop happens in them (and they make up the majority of the file), the working functions are intact. $\endgroup$
    – swbarnes2
    Commented Mar 27, 2019 at 18:07

The English language has 26 letters which can be rearranged in combinations of open-ended length, giving colossal variability. According to the Oxford English Dictionary, there are about 170,000 words in current use.

Programming languages are based very loosely on human language structures. Although the pool of "words" is much smaller, they are also open-ended in the sense that the programmer is free to create words or function names.

Both are also sequential - if you do anything other than follow them in the order they were designed to work, you will get gibberish.

Although DNA can be understood as a language it is much simpler than your other examples. It has four letters and all of its words are 3 letters long. That gives you a hard maximum of 64 words. In point of fact, nature only uses 21 of these words, and there is a great deal of redundancy built in.

A "book" in DNA sense is a single gene. The length of a gene varies enormously but the average is about 480 "words". Although the DNA in a book does need to be read sequentially, all the "books" in a chromosome or a genome do not. So long as each "book" is read in order, the "books" themselves can be read individually and still make sense.

So: all recombination needs to do is ensure that the combination occurs in a break between two "books", and everything will work fine. As @user40949 mentioned above, there are processes to ensure that recombination does indeed occur within specific regions between "books". And even if it didn't, a failure would only invalidate a single "book".

  • $\begingroup$ perhaps the analogy would be improved by having gene = paragraph, chromosome = chapter, and genome = book? $\endgroup$
    – JCRM
    Commented Mar 12, 2018 at 13:47
  • $\begingroup$ @JCRM I went with book = gene because the OP was specifically making a comparison about rearranging a book and it making sense. You can't rearrange a gene and have it make sense, but you can certainly rearrange genes on a chromosome and have them still readable, providing there aren't multiple reading frames. $\endgroup$
    – Bob Tway
    Commented Mar 12, 2018 at 14:27
  • 1
    $\begingroup$ you're absolutely right, I'd forgotten the precise question by the time I'd finished your answer. $\endgroup$
    – JCRM
    Commented Mar 12, 2018 at 14:38

Genomic structure, gene structure, and the structure of human culture are quite plastic, and when parts of it get messed up there is usually excess capacity somewhere that keeps the system operating.

  1. Stories, books, tales, songs, etc. are both mutable and recombinable. From the party game of "telephone" to the creation of new works of art, sections of one work are replaced intentionally or by accident either with original contributions or with pieces from other works. These new works are then selected for fitness for the intended purpose by the creator or by other social mechanisms. The only ones you ever observe are not complete failures by those criteria. This is a pretty good analogy for the type of recombination you are talking about.

  2. If a genetic recombination event ends up making a gene that no longer serves its original function, that is usually OK and the organism will have another way to survive. It may even be more fit (always in a particular context) without the working gene. The non-functional gene may acquire a new function (by further recombination or mutation) over generations. [a paper of mine where we show, that many genes reduce fitness https://www.ncbi.nlm.nih.gov/pubmed/23990803 in particular environments]

  3. You absolutely can "rearrange a gene", some genes anyway, and have it make sense. One example: many genes can be "circularly permuted", the beginning (N-terminus) of the protein can be moved to various positions. [a paper of mine where we do that: https://www.ncbi.nlm.nih.gov/pubmed/12149462]


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .