Daar word op die oomblik in die kerk meer gepraat oor self-ontplooiing as oor self-opoffering.-Anon.......As ‘n kerk haar woorde begin devalueer, dan word die kerk ‘n ramp vir die volk. - K Schilder


Evolution for Programmers

Warning, article quite technical, but not impossible for non-programmers.

Consider the following piece of Java code.

// HelloWorld.java
// Very simple Java program

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello, World");


I wanted this code to be as simple as possible, maybe Java wasn't the best choice for simple. This file, HelloWorld.java is 173 characters in size on my Unix based OS, incl. EOL characters.

We could do this with any other Programming Language or Scripting Language like C, C++, C#, Visual Basic, Perl, bash, etc. But for now, allow me to stay with Java.

Now allow me to do a little thought experiment. I'll compose a simple recipe, call it an algorithm if you like.
  1. Rename this file to HelloWorld.orig.java
  2. Make a copy of HelloWorld.orig.java, name this copy HelloWorld.java
  3. Use your favorite random number generator to get a number from 1 to 173 (the size of the file). The simplest way is to pick a number in your brain from 1 to 173. Let's call this number PLACE.
  4. Now look at the keys on your keyboard and pick a printable character, maybe even pick if you want upper or lower case. Let's call this NEW. (NEW can be anything in the range [a..z,A..Z,0..9] and if you're adventurous, it can even be punctuation like !@#$%^&, etc.)
  5. Now start at the first character of the new file, HelloWorld.java and count the number you got from step 3, called PLACE, and replace it by the random character you got from step 4, called NEW. (E.g. if you picked number 4 and say character "Y", the first line will read something like:"// YellowWorld.java")
  6. Now use your favorite Java compiler (mine is build-in javac) to compile the mutated HelloWorld.java.
  7. If the compiler fails to compile HelloWorld.java due to some error, e.g. a syntax error, your program dies a premature death and you'll need to try again from Step 2.
  8. If the program successfully compiles to a .class file, your program has been (un)Naturally Selected to survive. You may now make this your original file for Step 1. and repeat the process.
For the less Programmingly inclined, here is a short, simple version of the recipe. We pick one of the characters in the file randomly and then replace it with a random character represented by one of the keys on your keyboard. We then check if this mutated program is still good enough to go through Java's programming rules. If it does, we repeat the experiment, starting with this new mutation, else the mutated file is discarded and we start with the last one that succeeded.

I trust the recipe detailed above is simple enough to understand, if not, perhaps reading it a few more times will help, I hope. (It's easy for me to understand, I wrote it. Maybe less easy for me to convey what has been brewing in my mind for some months now.)

Now I would like to ask a few questions which I would encourage the reader to ponder on and if you feel the need, kindly answer in the comments section.

If we repeat this recipe many many many times, what are the chances of this program becoming something like Microsoft Word? Or some fancy graphics rich game?

Think about many many many as getting hold of the biggest super computer today and running through trillions and trillions of iterations, many in parallel. Even get together all the top 1000 super computers today and let them all churn away at the problem.

How likely do you think we are to produce Microsoft Word?

According to my calculations, zero, nil, nada. There is no chance at all. Because I cannot squeeze all the complexity of Microsoft Word into 173 characters.

Now, for my actual purpose of this posting. How much different is this to the problem of Abiogenesis, i.e. the theory that biological life arisen from inorganic matter through natural processes (apparently in some primordial soup?

Now I can almost immediately see emotions being triggered and brains starting to spin to dig up arguments against what I tried to illustrate. I would like to hear about them in the comments. But for now, let me say this. I am convinced that to expect me to believe Abiogenesis actually happened, is the same as believing the above scenario will render Microsoft Word. Life is incredibly complex, even the simplest of life forms. How is it possible that simple non-living macro molecules comes alive and start reproducing?

I'll continue in the comments section.


Danie Loots said...

One of the problems with the above is that we started with some clearly intelligently designed information. I still need to understand how non-information turns into information by random processes.

So to be fair, I could argue that we would have had to start with 173 spaces and then get them into a Hello World app by random processes AND then randomize it until we get to Microsoft Word.

Danie Loots said...

One of the biggest problems to get by is the increase of information.

As we would probably agree, my 173 byte program is never going to turn into Microsoft Word while it stays 173 bytes. It needs to increase in size to get to the millions of lines of code to reproduce MS Word.

THAT is something someone still needs to explain to me as well. If Fish evolved into Fisherman, where the heck did all the information come from to make DNA that will produce Homo Programmus, better known as Homo Sapiens Sapiens employed as a Programmer?

Lots more reading under Information Theory Q&A.

Danie Loots said...

Now let's say I loose the argument to keep the HelloWorld.java to 173 bytes.

I'll leave it to the reader to devise an algorithm to randomly add characters to HelloWorld.java and importantly, to only let only mutations survive that can actually compile.

Now gather in your imagination all the computing power you need to let this program mutate trillions of generations.

Do you have somewhere in your believe system place to believe that this HelloWorld.java program can mutate into Microsoft Word?

Let's say you do. Now the software piracy police and a representative of Microsoft stumbles onto your HelloWorld.class file that looks identical to Microsoft Word. What are your chances of convincing them that this is not an illegal copy, that this happened by random processes, not intelligence required?

What are your chances of convincing a Judge that you are not guilty of Software Piracy?

Who, knows, you may use Abiogenesis as an argument, since chances are the Judge will believe it.

Danie Loots said...

Some people may attribute all manner of characteristics for my unwillingness to believe in Frog-to-Prince evolution. Some may call me a fundamentalist, some a religious fanatic, some may call my faith a blind faith.

Perhaps I just don't have the mental capability, but I cannot even begin to comprehend how random processes turns dead things into intelligent human beings.

I do clearly understand how one kind of animal looses some characteristics and by chance this mutation (i.e. incorrect copy) may give the organism a better chance to survive and/or reproduce than its less mutated (i.e. better copy) sibling.

But how this will lead the given organism's descendants to GAIN genetic information and turn into a more complex organism requires a whole lot more faith than I can muster.

Looking forward to read some intelligently designed arguments and comments.

Henrietta said...

Hahahahaaa... Hoe sê die jonges? LOL, nee, eerder ROFL . . . Roll On Floor Laughing!! Dis die komper-nerd weergawe van vliegtuig-uit-skrêpjaart antwoord vir evolusioniste. Dankie Danie, ek wag ook, oor teen die êf-êm-pie...

Gideon said...

Danie, ek het goeie nuus vir jou met al jou vrae. Louis sal vir jou kan verduidelik: Jy VERANDER net jou 173 karakters sodat dit NUWE inligting gee, maar niks het VERMEERDER nie!! En siedaar, naderhand het jy 'n kompleet MS Word of beter. Dis baie maklik - "after all" - rekenaartaal bestaan net uit nuletjies en enetjies, en kyk wat kan die ou blikbrein alles doen!!

Yf said...

http://stackoverflow.com/questions/3883410/applying-darwinian-evolution-to-programming wat Danie dalk kan verduidelik

Danie Loots said...


Ek moet bieg, ek ken nie baie van Genetic Programming, ens. nie. Ek het al een jong kollega wat net klaar studeer het, opgewonde daaroor hoor praat en 'n baie ervare programeerder gehoor genoem dat dit nie baie suksesvol en bruikbaar is nie.

Maar, buiten hierdie moontlik subjektiewe menings, is my verstaan dat hierdie metode op sy beste probeer om 'n seker probleem beter op te los deur klein veranderinge te probeer maak aan die oorspronklike program. Maar, belangrik, die program bly min of meer dieselfde, dit probeer steeds dieselfde probleem oplos, net met effens ander parameters.

Sover ek kon agterkom, ook maar met min of meer dieselfde algoritme.

Dus die resultaat sal dalk verskeie variasies van programme oplewer, maar nie 'n heeltemal ander program nie.

Dus, 'n self muterende rekenaar virus, gaan `of 'n self muterende virus bly `of uitsterf, maar dit gaan nie muteer in 'n nuwe MS Word nie.

Die verskillende mutasies van die program gaan dus meestal dieselfde wees, maar nie 'n heel ander program word nie.

NETSO, noem die ouens, wat glo Partikel-na-Professor Evolusie is 'n geloofwaardige moontlikheid, gewoonlik Natuurlike Seleksie en Evolusie in dieselfde sin, of voer Natuurlike Seleksie aan as 'n bewys vir Evolusie.

NETSO, kan 'n lewende organisme bevoordeel word in sekere omstandighede, en dus beter voortplant, maar my verstaan van bg. probleem is juis dat die organisme nog min of meer dieselfde ding bly, met net veranderinge wat dit bevoordeel, maar dit word nie 'n heel ander organisme na 'n klomp geslagte nie.

Danie Loots said...


Verder bly die kernsaak rondom Information Theory, ook steeds hoe lukrake mutasies (Random mutations) nuwe Genetiese inligting kan voortbring.

As jy na my Hello World app kyk. Indien iemand hierdie program op 'n stukkie klip op Mars kry, hoeveel mense gaan bereid wees om te glo dat dit a.g.v. lukrake gebeure daar gekom het, gee inteligensie nie?

Of kom ons kyk na 'n ander scenario. Indien die programmetjie gekry word op Aarde op stukkie papier getik, wat is die kanse dat enige iets anders as 'n mens dit getik het?

Nou die belangriker vraag. Hoe meer lukrake veranderinge jy aan daardie stukkie kode maak, hoe minder gaan dit lyk na 'n mens wat dit getik het en hoe groter is die kans dat bv. 'n sjimpansee die hele ding lukraak getik het.

Netso, soos ek dit verstaan, het DNA geweldig baie inligting, baie kompleks en baie presies. Mutasies verwoes egter hierdie inligting en maak die algemene gesondheid van die organisme swakker, omdat lukrake veranderinge ooral in die natuur, behalwe in Evolusioniste se gedagtes, inligting verwoes.

Indien jy egter daardie selfde program

Yf said...

Hallo Danie,
Ek het net gewonder oor hierdie veranderende parameters. Wie besluit daaroor - is dit ook 'n algoritme of 'n mens. Al wat gebeur is dat die oorspronklike oorsaak net verder terug geskuif word - selfs al kan 'n Von Neumann masjien dit self doen lê die se oorsprong ook by 'n eerste oorsaak.

Kennith Poppe het is sy boek - Exposing Darwinism's weakest link ook 'n hooftuk oor inligtingteorie. Hy sê basies dieselfde as jy. Nog iets wat hy uitwys is die wetmatigheid dat inligtingverspreiding teen 'n prys kom - die prys is die verlies van kwaliteit van die inligting. In biologie is dit net so geldig soos in elektronika. Norman Geissler (en ander) maak die punt dat indien 'n mens 'n beeldende kunswerk in die veld sou ontdek, van 'n kleipot tot 'n standbeeld, sal mens aanneem dat dit 'n maker moes gehad het al is daar geen fisiese bewyse daarvoor nie want geen regdenkende mens sal aanvaar dat die natuur so iets kan voortbring nie. Tog is dit presies waaraan evolusioniste vasklou - dat die herskepping van meer gevorderde samestellings van elemente (lewe) vanself uit minder gevorderde samestellings van elemente voorgekom het.

Ek soek nog na die verklaring dat inligting in die gene kan vermeerder. Een gene, of een gene in 10 stukkies se totaal van inligting bly nog steeds een gene. Dus bly die struikelblok - hoe kan meer gevorderde lewe uit eenvoudige lewe voorkom. Devolusie met inligting wat verlore gaan kan ek nog verstaan, maar andersom?

Vrede daar.

Yf said...

Ek het 'n verkoue en ek sit nou net hier en dink oor virusse. Dis stukkies genetiese materiaal wat op hulle eie nie eers lewe is nie. So hoe is dit dan dat deur al die tyd hierdie stukkies genetiese materiaal in die ideale omstandighede (in die gasheer) nie tot selfs net die eenvoudigste vorm van lewe, soos 'n bakterium evoleer nie? Al ontwikkel dit oor erge weerstand teen medisyne bly 'n kiem nog steeds maar net 'n kiem. Ek het al iewers gelees dat syfilis in die 13de eeu 'n dodelike siekte was, maar dat die virus homself so aangepas het dat hy nie meer sy gasheer doodmaak nie. Dus 'n verswakte virus. Ons sit nou met die situasie dat die bes aangepastes (die sterkste virusse = survival of the fittest) hulle gashere doodgemaak het en dat die verswakte virusse eintlik die bes aangepaste is, want hulle maak nie hulle virusse dood nie. Lyk vir my al te veel na 'n bietjie van 'n kontradieksie. Dit maak geen sin dat die "selfish gene" wat sy eie beste belang soek sy gasheer sou doodmaak nie, so hoe het daai goed aanvanklik begin?

Nog meer vrede

Henrietta said...

Let me first say, my knowledge about programming is very very elementary. Long ago I heard this saying in connection with computers: GIGO (Garbage In , Garbage Out)- meaning that the person doing the programming really had to know what he was doing in order for a programme to run successfully and not spew out nonsense.

Can you computer-boffins please explain this to me: Are there COMPUTERS that can start from scratch and develop complex programming, for instance programme other computers with new information, or is the "human hand/brain" necessary?

Danie Loots said...


The more I started thinking about this, the more I actually realize that if one could believe in mere random mutations plus natural (or unnatural) selection could somehow create information out of nothing, such individuals should start one amazing Software company.

We'll create a piece of software that will do just that, it will make copies of itself, and randomly makes copy mistakes, i.e. corrupts some information. Believing as they do, we should be able to generate all sorts of wonderful software, without even having to hire expensive programmers, developers, etc.

Maybe they should approach Microsoft for some venture capital. Wow, I almost got myself excited. Just imagine the possibilities. We can randomly create the most fantastic software.

Pitty though I don't have enough faith in the pair of gods called "Billions of Mutations" and "Natural Selection".

Maybe, I'll find it easier to believe in an Intelligent Designer, even more so if I experienced His love. Ja, maybe I'll rather trust Him with my life. I heard even the birds don't have to worry about life, because He cares for them. I even heard He died for my mistakes so I don't have to bear the consequences.

And here some of us are, rather believing in some lifeless, unloving process, that daring to open their hearts to the God they fear and hate so much.

How sad.

(Vrede vir jou ook Yf)

Danie Loots said...

A Bible Believing brother, Bruce, sent me the following email with regards to this post:

"To believe that and even a rudimentary Microsoft Word could come from this recipe is far fetched. I would certainly parallel it very closely to the blind faith that is required to believe that any information could come from nothing to produce "simple" life forms, let alone us. The only conceivable reason I could imagine believing that random processes could produce (MS) Word, would be the notion of not wanting to believe that a programmer of such intellect could exist. Our genes are far more complex than (MS) Word and our programmer loves his creation. He wants to fix all the messes that we have pick up along our history."

(MS) added by myself.

- Thanks Bruce.

Danie Loots said...

Two quotes from The diminishing returns of beneficial mutations

"Beneficial mutations are often seen as the engine of evolution (Mutations: evolution’s engine becomes evolution’s end!). However, beneficial mutations by themselves don’t solve the problem (see Beetle Bloopers). Mutations not only have to be beneficial, but they have to add biological information, i.e. specified complexity. However, practically all beneficial mutations observed have been losses of specified complexity (The evolution train’s a-comin’), with only a few disputable examples of mutations increasing information ever found (e.g. bacteria that digest nylon, citrate or xylitol)."

"However, mutations need to be more than beneficial and information-increasing to produce new coordinated structures and systems, as microbes-to-man evolution requires. Mutations don’t act alone; the effect of a mutation on an organism’s phenotype depends on other genes, and mutations in those genes, in the genome. This is called epistasis; it is an important consideration for evolution because how mutations interact will determine if they could possibly build new structures in a stepwise manner."

Danie Loots said...

Laaste kommentaar se skakel moes gewees het: