Showing posts with label evolution. Show all posts
Showing posts with label evolution. Show all posts

Wednesday, February 18, 2015

A4



I have a little trade secret to share with you. Whenever I need to communicate my ideas on a printed medium, I use a single sheet of A4 page, and only on one side.

The most frequently used paper size is A4 measuring 210 by 297 millimetres.

The significant advantage of A system is its scaling: Folded brochures of any size can be made by using sheets of the next larger size, e.g. A4 sheets are folded to make A5 brochures.

But there is something else in A4.

A4 is a meme, it simply evolved with modern human.

In addition to scaling advantages I think A4 evolved to be the most frequently used paper size, because a single sheet of it is the most efficient medium to convey ideas.

Not too big, not too small, elegantly scaled.

Next time you have an idea, try fitting it into an A4 sheet, and I guarantee you it will be read by majority of people.

Exceed an A4 page by one line, or use a different paper size, you will have less people reading it.

I call it Natural Selection.

Sunday, December 22, 2013

Sudoku

Remarkably the evolutionary algorithm I developed for Eight Queens problem worked without modification for sudoku problem. The only differences were array size (DNA) and the fitness function.

This is perhaps not so surprising considering how evolution creates vastly different species (solutions) for different environmental conditions (problems).

Here is the pseudo-code of Evolutionary Algorithm:


Here is a diagrammatic representation:


It is simple really. You have a pool of population which is made of many solutions. At each iteration select fit parents, recombine their genes and allow mutation to make 2 distinct children. Sort the population by fitness score. Let the worst 2 die, and continue iteration until the best fit is found.

In the Eight Queens problem, from the chess-board, the array size is 8x8 = 64, whereas in Sudoku it is 9x9 = 81.

The fitness function calculates a positive number which increases with the level of fitness.

Usually the worst fit solution is calculable. In the case of Sudoku this is one of the worst solutions:

[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
 
This is not even a legal acceptable final solution is Sudoku. But any solution in evolutionary landscape is legally born. When an individual solution's fitness is calculated it may or may not survive the next run (generation).

A perfectly fit Sudoku solution is achieved when all 1-9 digits present in 3x3 matrices along with no-clashing digits present across rows or columns.

Therefore in Sudoku the unfitness score is a number calculated by counting number of times a given digit is repeated across a row or a column and also adding the missing set of digits in all 3x3 sub-matrices.

The resultant fitness score is normalised form of unfitness score, i.e. fitness score is calculated by subtracting the calculated unfitness score from the maximum unfitness score (378).

Two runs from a typical output are given below:

-----------------------------------------
Run: 1
Best score 378
Found best '1' in 3540 iterations.
[4, 1, 3, 9, 8, 6, 2, 5, 7]
[7, 2, 9, 5, 3, 4, 8, 1, 6]
[6, 5, 8, 2, 1, 7, 3, 9, 4]
[2, 3, 7, 4, 5, 8, 9, 6, 1]
[8, 6, 4, 1, 2, 9, 5, 7, 3]
[1, 9, 5, 6, 7, 3, 4, 2, 8]
[9, 4, 2, 8, 6, 1, 7, 3, 5]
[3, 8, 6, 7, 9, 5, 1, 4, 2]
[5, 7, 1, 3, 4, 2, 6, 8, 9]
-----------------------------------------
Run: 2
Best score 378
Found best '1' in 8636 iterations.
[2, 7, 5, 3, 9, 4, 8, 6, 1]
[8, 1, 3, 5, 2, 6, 7, 9, 4]
[9, 6, 4, 8, 1, 7, 2, 5, 3]
[4, 2, 6, 9, 8, 3, 1, 7, 5]
[1, 8, 7, 2, 4, 5, 9, 3, 6]
[3, 5, 9, 6, 7, 1, 4, 2, 8]
[5, 4, 1, 7, 3, 2, 6, 8, 9]
[6, 9, 2, 1, 5, 8, 3, 4, 7]
[7, 3, 8, 4, 6, 9, 5, 1, 2]
...

I still have to tune the program for better performance. I may try different mutation or recombination strategies, play with population sizes and selection strategies to shorten the time required to create a sudoku solution.

The prototype was written in Python. Eventually I would like to port the algorithm to IOS 7 for creating the sexiest sudoku app ever.

The Evolutionary Algorithm I used was from the book Introduction to Evolutionary Computing1.

References:
1. Introduction to Evolutionary Computing, Agoston E. Eiben, J.E. Smith, Springer, 01/01/2003
2. Sudoku - Wikipedia
3. Eight Queens - Wikipedia

Monday, August 20, 2012

On Transhumanism


Two years ago in 2010 for curiosity I immersed myself into a small computing project to study how evolution by natural selection works. As a result of this exercise the attached paper “Eight Queens with Evolutionary Computing” (aka Evocom) emerged. I wrote a program in Python language to solve Eight Queens problem using evolutionary computing. In due process I learned a lot about mechanics of natural selection. I could for instance simulate genetic drift by way of varying certain parameters; similarly I could study the effects of varying mutation probability and so on.

In this article I would like to demonstrate why Transhumanism would fail expectations if the lessons we learn from Nature is disregarded.  I am not going to analyse ethical implications, which is strictly out of my scope. I would like to propose a model in stead for being a precursor of further analysis in the area. I would like to draw our attention to population genetics.

Richard Dawkins makes a compelling argument in his debut, The Selfish Gene, stating we are mere vehicles of gene coalitions that use us as replicators. Genes themselves do not have consciousness but the net effect of them being cooperating in evolutionary scale certainly appears to be as such. So we are already robots, from an earthworm to humans.

Everyday more replicators are being created; the idea is to keep thriving in other bodies, until useful lifespan of the individual inevitably surrenders to entropy; the most fundamental property of our universe that is far grander and dominant than the natural selection.

Entropy (aka disorderedness of information) rises irreversibly and universally. Oddly enough life emerged as if to challenge and work against entropy. Each living being born is packed with densely ordered information. However almost instantly as the first cell division takes place, entropy starts rising until the death of the individual. In the end entropy wins.

So ultimately death is a necessity, or rather for the Selfish Gene a necessary compromise to cope with entropy. The Selfish Gene essentially buys time from irreversible entropy via replication. Consequently genes survive far longer than their carriers, albeit inevitable modifications due to copy errors or mutations of other origin.

Life is as much as about death as it is about life itself. There is a lot to be said in this area. For now it should suffice that extending the human lifespan without useful contribution to population would probably have an effect of pushing your limits against a proven model.

The most remarkable feature of evolution by natural selection comes from the fact that re-combination of genes and mutations occur in random fashion when a pair gives rise to an offspring. Randomness increases robustness of the algorithm and accelerates evolutionary process. However this is not sufficient for a given population to reach to a stable fitness peak. You also need diversity of genes in the gene pool, a sufficient initial population size where pairs are selected to breed, and number of generations participating a given evolutionary process spanned across time. Environmental conditions, distribution of and capabilities of predators and preys do not affect offspring selection, they merely affect survivor selection. This is explained in my attached paper to some extent.

For our purpose I would like you to focus on this simple picture, the model of evolution by natural selection.

I should confess I have not made an exhaustive analysis on theories surrounding Transhumanism, so my knowledge in the area is limited. However I have made some observations to convince me that they and we as humanity are not heading in the right direction.


Evolution by Natural Selection



Here are the fundamental problems I see in the light of what I learned about natural selection.  Please use the diagram I provided in relation to arguments given below.

1- Transhumanism focuses on architecture/charactersitics of a given individual. Whereas evolution acts upon populations not upon individuals. The individual is not selected by itself or for itself, it is selected from a population (see survivor selection branch in the diagram).

Note: strictly speaking for our species survivor selection has a broader meaning than life vs. death. It may mean for instance “become sufficiently successful in business despite GFC”.

2- Transhumanism invariable erases the randomness from recombination and mutation phase. This is problematic in terms of population genetics as it will create a major obstacle for stability. Random recombinations and mutations are essential ingredients for species’ long-term survival.  So far I have not seen anyone grasped this notion. Most Transhumanists seem to be fire dancing for the wrong reason.

3- Due to profit concerns Transhumanism will likely to create a heteregenous gene-scape at the very beginning. Islands of genetic pools will emerge, an island of “creative” genetic pool, and island of “martian” genetic pool (for manufacturing people who can withstand harsh environmental conditions) and so on. This sort of genetic fragmentation shall inevitably promote genetic drift, in other words it may push those islands to loose other genetically essential traits rapidly.  This will likely to happen because a genetic pool in its entirity has NP complexity. Regardless of your computational power there is no mathematical proof so far that NP-complex problems can be solved rapidly compared to the rate of problems emerging in such systems. For instance you may see a relatively sudden rise in Albino in “cerative” pool. Transhumanists may argue, those anomalies can easily be “patched up”.  But I doubt “patch management” will be a sustainable strategy for the long term success.

In summary I see Transhumanism as a failure of some sort if lessons learned from natural selection are not sufficiently factored in. I think the scientific community has an obligation to urge governments that policies must also include proper risk analysis of population genetics and its dire implications, should sufficent emphasis is not given into the matter, in addition to ethical concerns.

There is room for success if we control our indulgence for profit and focus on useful and sensibly limited areas, such as curing certain diseases and solving energy crisis.


References:

Evocom (my paper)
http://members.iinet.net.au/~coruh/evocom/Home.html

NP Complexity
http://en.wikipedia.org/wiki/NP_(complexity)

The Selfish Gene
http://en.wikipedia.org/wiki/The_Selfish_Gene

Wednesday, January 25, 2012

Say NO to Indoctrination




Please don't indoctrinate me with religion. Teach me to think for myself.

I would like to draw your attention to the word indoctrinate. Indoctrination is filling a child’s mind with one-sided subjective opinions that do not rely on facts. I guess we may reach an agreement to qualify those opinions and where they originate from as non-factual, mystical, spiritual or supernatural. I don’t mean necessarily they are bad or evil please note.

Influencing someone with non-factual opinions may not always be harmful. If someone believes fairies that glow at night in their backyard, or they believe star signs, or they believe a soul, or a spirit to grant everlasting life these seem pretty harmless and we should tolerate them.

Also if someone takes only peaceful messages from a religion and ignores the evil parts such as disrespecting or killing others, then perhaps pains religions inflicted in human beings throughout history may be set aside; we then may consider such benign realisations as cultural nuances, embrace those individuals, say “good for you”, and move on.

But it is one thing that a child believes in Santa Claus, it is another thing if you teach them other religions are evil and he should one day blow himself up and kill as many as possible from the other side for reserving a good seat in heaven.

Or it is one thing to teach peaceful attributes of a religion and respect for others and it is another thing to inflict hostility in the heart of an innocent child by labelling all other religions as fake and their believers inferior.

Or it could be another thing to teach a child all religions and atheism in the context of ethics and objective history along with science and theory of evolution, and eventually let them decide whichever religion to believe or not to believe anything at all.

The issue here is not about legislating how parents should raise their kids but whether world nations should any longer endorse religious indoctrination through publicly or privately funded faith schools.

In Britain recently the UK Government passed a law to abolish public funding of faith schools. This is an important step if we want to build peaceful democratic societies.

This is also a clear message from a Western government on the dangers of sponsoring faiths schools, which often singlehandedly indoctrinate kids with hatred and cause painful segregation inside the larger civil society they breed within.

Hence this is in my opinion the way the message on the billboard should be read.

Children are pillars of our future. Can we afford to let them be raised in intolerance?

Put another way do we need to tolerate the intolerant?

Just as we don’t indoctrinate children with racism and holocaust denial we should not indoctrinate them with subjective one-sided religious thinking, fear mongering, bigotry and hatred for others.

It is wrong.

I think anyone with common sense, religious or non-religious alike, would see merits of these arguments.

Wednesday, September 21, 2011

Aquarium

The impression I get from Turkish public is:

“We vote in general elections every 4 years; the elected pro-Islamic government may do whatever they wish as they see fit during their term; including imprisonment of over 80 journalists without trial. Everything goes as they have mandate from the people.”

Turkish public is on the verge of forgetting about what democracy meant and should mean for a civilised society. In essence popular opinion over the last decade or so reflects wide-scale public ignorance on the necessity of executing democratic rights and responsibilities of individuals between elections, not just during elections. Citizens to a large extent lack democratic consciousness regarding fundamental human rights and individual liberties. 

The current AKP (Justice and Development Party) government exploits what has always been lurking in Turkish population like an epidemic, a reminiscent of Ottoman legacy: “do not challenge authority”. 

I am sitting in a pub, listening to rock music, and having a glass of cold dark beer. I see myself sitting before a laboratory. You have an aquarium in front of you and there is a red button with 1984 printed on it. 

True. What I hear are stories. I may not have journalistic wisdom nor hard evidence. I sometimes don’t have patience. But overall I am not too bad in predicting what is about to come.

I left the country I was born 22 years ago. I knew what was coming. I knew what today was going to look like.

There was a guy whom I worked together in TEK some 30+ years ago (a government office I worked once). He was quite intelligent, an engineer, like me he graduated from the same school that captured top 0.01% of high school graduates. 

He was a devout Muslim who knew Shiatsu massage and who also regularly swallowed books in NY libraries during his Master's programme. As an Atheist generally I consider talking to Muslims on divine matters, a hopeless endeavor.  Nevertheless I found him interesting and pleasant to have conversation with. It still puzzles me why and how on earth a person as intelligent as him became a follower of a religion full of Abrahamic bullshit. Surely it appeared he had great deal of grey material. I remember we had a long discussion about whether good art may emerge from Islam. I questioned him about lack of asymmetry in Islamic Art and esthetical problems associated with it. He seemed to be quite convinced that you would not need to go beyond symmetry. You know, all those boring hypnotising Islamic tile designs, carpet designs and so on. That’s what I was talking about. For me asymmetry is a fundamental cognitive element that makes art interesting and pleasant.  

Anyway, he told us (people in the office) at the time we were all missing the point and Turkey would one day become an Islamic Republic. We went outside for lunch, and later I saw him leaning forward in Namaz position prostrating himself against a God he cannot see nor anyone has seen evidence of on a narrow pavement in a busy street near the office at the back of other prayers stretching from a mock Mosque built inside a small shopping centre.

How naïve I was. I laughed about this. But at the same time I had an eerie feeling about it. There were indications already. The military quo of September 1980 largely favoured the Right; during my military service I was ordered to escort one of my former uni classmates, who was a communist, to prison who was later tortured among others in a civil prison. I heard his story later when I met him during a business conference in 1986.

I am now sitting in Kuğulu Park trying to come around.  There we go; we see evidence of Darwinian Evolution here as well. The pigeons grew in number and adapted to grey surroundings of cityscape thanks to men who sell grains to satisfy people who believe they are feeding animals for the good. Most interestingly these pigeons are shameless. They evolved to ignore my attempts to scare them off. I step firmly on the ground; they don’t seem to bother; they take one or two small steps and come back to pick stuff from the gaps of cobblestones. 30 years ago they used to keep away or fly away farther.

85% of Turkish people think that humans have evolved from Adam and Eve. 

Gray pigeons adapted to favourable conditions grain salesmen and park dwellers created. It is so obvious. People would like to feel good about themselves, perhaps a DNA reminiscent of their gatherer ancestors who cultivated land and breed animals. So they are inclined to feed pigeons that are in reality slightly more dignified than rats and only in appearance. Home Sapiens salesmen appeared in the city to exploit such a weakness. They started to sell grain to park-dwellers.  In the end the most aggressive and shameless pigeons evolved to breed in high numbers and managed to disturb my peace. I now escaped to Gloria Jeans across the road.

It is not easy to understand why a larger proportion of a human population cannot see Darwinian evolution in action. The definition of stupid has always been a puzzling concept for me.  Are these people simply stupid not to see vast evidence for Darwinian Evolution that is taking place, or should we blame the education system or powerful memes of Islamic traditions that deluded them?

Anyway I am too little too less to change this. I elect to remain outside the aquarium. 

Sunday, June 5, 2011

The scope of survival

This news is from Canberra Times, dated 4 June 2011:
“Australian National University has confirmed it moved several high-profile climate scientists, economists and policy researchers into more secure buildings, following explicit threats to their personal safety….
More than 30 researchers across Australia ranging from ecologists and environmental policy experts to meteorologists and atmospheric physicists told The Canberra Times they are receiving a stream of abusive emails threatening violence, sexual assault, public smear campaigns and attacks on family members.”

As bitter truths about our approach to the tipping point in climate change are unveiled by scientists, and governments sluggishly but nevertheless close in to intervene, the carbon lobby is becoming more aggressive in their tactics.

Regardless of how bitter confrontations are going to be, there is no escaping from science. Science is telling us by as close as 2100 our planet will be warmed up by 2-4°C. 2°C rise is certain regardless of what we do now.

The consequences are dire. There are various scenarios depending on timing of intermittent tipping points such as effects of release of CO2 from the vast permafrost of Siberia, driven by temperature rise in Arctic, which at nearly 4°C is three to for times than the average. For example, a 4°C rise would kill off 85% of the Amazon rainforest, a 2°C rise now seen as inevitable would kill of 20-40%. Sea levels can rise up to 70 meters.

These things will happen.



Our genes copy themselves. The quality of being copied by a Darwinian selection process is what drives life on Earth. Life has a sense of space and change. Sense of change led to emergence of concept of time in humans. Our gene setup endlessly reconfigures itself; generations who can better exploit the information gained by knowing space and time, survive best.

“If that vast fire over the far mountain range isn't likely to effect my tribe now, I should probably not worry, and go by my everyday business of hunting. Only if the fire seems to be closing in I should think about moving, but then this hunting ground and nearby water seem too good to give up so perhaps I should stay.”

There is always room for failure in judgement of space and time. The fire could be advancing much faster than our humanoid ancestor thinks. In that case his tribe will be engulfed in flames.

When our humanoid ancestors walked in savannas of Africa 2.3 - 2.4 million years ago, their genes’ scope of survival was limited to their immediate vicinity, perhaps within a diameter of tens of kilometers for each group.



Today our capacity to comprehend space and time is much widened. We now know what is going on in every part of the world. We started to make sense of what made us, we look at skies and our universe’s distant past. With science our capacity to accurately reflect on future and farther increased.

Despite these advancements our judgements about survival strategies are still largely affected by selfish interests.

Humanity now is divided roughly in two. Those who think “Well, it’s not going to happen in my lifetime, so I don’t care”, and those who worry about their grandchildren and their grandchildren’s future.

People in the first group think much like our ancestor watching the fire in distant mountain range. People in the second group are super humans who have the capacity to extend humanity’s survival beyond stars.

References:

Requiem For A Species - Clive Hamilton

Canberra Times - News

Friday, May 6, 2011

The Why Question and Arrow of Time

I have a mechanical engineer friend who is often called to diagnose and deal with problems at various sites across the country. He works for a recycling company which has plants in various locations. I am on the other hand a software engineer. We are both experienced folks who have some quarter a century experience in our pockets. We often have lunch together and exchange stories about engineering.

The business my friend works for is specialised to process scrap material obtained from breaking vehicles (cars, trucks etc) into pieces. They have sophisticated equipment to separate and sort scrap material according to their type (aluminum, steel, plastic) and weight.


Recently I have realised emergence of a remarkable pattern between his stories and mine. My friend mentioned he had been called on to diagnose a problem which was about a conveyor belt malfunction. Apparently the conveyor belt in question had excessive dirt cumulated on it. The foreman and workers rather than investigating the origins of the problem (why excessive dirt appeared at the first place), devise instead patch up solutions to clean up the dirt and this caused other structural problems on the belt.

In software engineering too when we have a tough problem, a crash without a stack trace, or an odd looking problem such as identical pointers appearing twice in a hash table thereby causing an infinite loop, some engineers cannot just wander off from their conventional comfort zones but instead remain stuck in the area where they first observed the problem. They automatically think an infinite loop is indicative of a problem right there. Similar to conveyor belt problem adjusting the hash algorithm to detect identical objects and handling the error at that point will not fix the originating problem. This approach will also make the algorithm needlessly complex and perform poorly.

Patch up fixes without understanding the root cause often result in expensive technical debt to cumulate which will cause more problems down the track.

Lateral thinking is a mindset, it is about asking the question ‘why’ and it is about the courage and ability to reverse the arrow of time.

The problem with the conveyor belt is not the dirt cumulated it is ‘why’ the dirt cumulated.

The problem with two identical pointers stored in a hash table is not an error with hash algorithm, it is ‘why’ the same object stored twice further back in history.

Lateral thinking is about going back in the history (time) and locality (belt’s location, program’s stack trace) and replaying cause and effect game in reverse direction.

Perhaps going back against the arrow of time is counter intuitive for most. Perhaps humans have evolved to go along with the arrow of time for pragmatically solving immediate problems with high survival value and only few have capability to rewind their thoughts back in history.

Could this be the fundamental reason why so many people find it hard to understand evolution. Reluctance, lack of resilience or inability to ask and track back the ‘why’ question.

Friday, April 22, 2011

Conjecture

In recent years a new breed of urban muslim prototype emerged who sometimes call themselves “purists” (eg. “only-koran” movement in Turkey). They refuse late day interpretations of Koran (hadis-i sherif), claim Koran is highly metaphoric and shouldn’t be taken literally in today’s terms.

Rather than questioning validity of their own religious belief system they conjecture and henceforth seek wider acceptance in intellectual and academic circles of urban societies they are part of. Elbow to elbow with intelligent design movement in the West, their retrofitting of god and religions on the facts of evolution should be seen as last minute desperation of saving what has already been lost, religions' credibility.


Living species evolve not as a result of design but via natural selection on random (probabilistic) variations. It does not make sense for a deity to press the button in a stochastic process.

Every human being starts their life with approximately 50 of 3-billion base pairs in their genome mutated randomly. It is preposterous to think that an intelligence could have foreseen, and controlled evolution of 3-billion base pairs of human genome from its single cell origins over billions of years and over entire generations of species they evolved from.

Even if you insist that there lies a super computer that designed "evolution", you should philosophically ask "what for?", "is it you say in order to create us, carbon-obsessed species which emerged from single cell organisms eventually falling into each other's throat for they can't agree on which one of them deserves the never-seen super computer's attention?". And undoubtedly your next question should be "who designed the super computer and why?"

There is nothing remotely special about us humans nor there is a universal reality we can attach our existence onto. There is no evidence that there is more to our physical existence. Believing that we have 'soul' beyond our physical capacity is nothing more than wishful thinking. Our consciousness evolved to make different models, in order to make sense of what is surrounding us. We have not one but many models and related definitions of realities. At times human beings made models of presumed realities -fantasies- that do not exist or cannot exist.

Whereas many of our scientific models, the theory of evolution, special relativity, gravity, quantum mechanics are working, supported and tested by evidence i.e. they allow us to make useful predictions about respective realities, religious models do not propose testable realities but instead they conjecture our existence upon insensible fantasies including the delusion that they can be compatible with science.

Friday, March 11, 2011

That little box

Our brain’s wiring is changing.

I am a programmer.

Early in my career back in mid-eighties nineties when we were confronted by a problem and needed information, we had no option but seek documentation, read lengthy manuals, and sometimes pay truckloads of cash to ‘consultants’.

When we needed to learn a new programming language or grasp a new technology such as a new API or operating system we had no option but to read thick manuals and sometimes attend courses.

Our brain pretty much operated on its own with input mostly taken from static material. This was after all how our brain was wired through education systems of pre-Internet era.

We were used to the idea that our consciousness is unique and isolated. It seemed the best way our mind’s clockwork could operate was when we were in complete solitude provided that we had every material we need in front of us.



Nowadays I hardly open a book for solving problems. In the past few years I learned three computing languages (out of seven) through Google.

At work every other second my mind reaches out and extends its memory through that little box, Google search.

That little box almost became a cyber-extension of my brain. It seems all I need is a well functioning short-memory from my biological end and whatever my frontal lobe is capable of.

My thought process is no longer driven by a static, hardwired and error-prone organic memory which is subject to birth, physical and age related weakness, but by a more dynamic, accurate, ageless and colossal machinery.

That little box makes me smarter, I make better judgements, I think faster, and I can reliably test my assumptions at a much faster rate. Despite my age my productivity at work increased in several orders of magnitude.

I am no longer Homo Sapiens. I am remade as Cyber Sapiens.

These are exciting times for our generation. We are lucky enough to witness the best of both worlds and we are representing a generation at the dawn of post-Internet human brain evolution.

Sunday, February 6, 2011

Patchwork

Human body is full of evidence indicating it is not an elaborate form of design by a supernatural force but more of a jumbled patchwork shaped by evolution.

Vestiges are structures, anatomical configurations that has lost or nearly lost its primary function. If it has any current function, it is either a persisting secondary function, or a function gained sometime after the loss of primary one. This process is called exaptation or co-opting.

Examples of vestiges are plenty.

The middle ear bones of mammals are derived from former jaw-bones (Shubin 2007).

Early tetrapod limbs were modified from lobe-fins and probably functioned in pushing through aquatic vegetation; at some point, they became sufficiently modified to allow movement on to land (Shubin et al. 2006).

The vestigial hind limbs of boid snakes are now used in mating (Hall 2003).

But the most impressive of all, my personal favourite, is evolution of gonads –a gonad is an organ that produces gametes; a testis or ovary-.

The gonads of sharks, other fish, and even humans develop in same place, the chest. This works well for sharks, since they stay there, but in human males, as the embryo grows the gonads need to travel all the way down into the scrotum to keep cool. This causes an unnecessary looping of the spermatic cord, which causes a weakness in the body wall, leaving them prone to developing a hernia (Shubin, 2009). This is consistent with descend with modification from an ancestor we share with modern fish.

Click to enlarge
Evolution presents countless examples of co-opting. Whether you like it or not the theory of evolution is strongly supported by empirical evidence and scientific studies including DNA analysis that weren’t known in Darwin’s time.

There is mountain of strong evidence for evolution, and each day research laboratories around the world conduce more. At the same time the case for designer god is weakening.

The next question to ask is if it wasn’t design what is god for?

Resources:


Original Scientific American article by Neil H. Shubin (PDF):
http://www.mukto-mona.com/Special_Event_/Darwin_day/2009/english/SA_old_bodyShubin.pdf

Vestigial evidence:
http://www.evolutionarymodel.com/vestigialevidence.htm

Sunday, September 6, 2009

Human Skin

Natural Selection does not produce perfection. If your genes are good enough your offsprings will make it to the next generation. This is obvious in the populations around us. Individuals may have genes for genetic diseases, or they may not have genes to survive adverse conditions. No population or organism is perfectly adapted.

Dr. Nina G. Jablonski, who heads the anthropology department at Pennsylvania State University said:
"There was a tremendous takeoff in human evolution about two million years ago when primates who could no longer be called apes appeared in the savannahs of East Africa. These early humans ran long distances in open areas. In order to survive in the equatorial sun, they needed to cool their brains. Early humans evolved an increased number of sweat glands for that purpose, which in turn permitted their brain size to expand. As soon as we developed larger brains, our planning capacity increased, and this allowed people to disperse out of Africa. There’s fossil evidence of humans appearing in Central Asia around this time.."
"Skin color is what regulates our body’s reaction to the sun and its rays. Dark skin evolved to protect the body from excessive sun rays. Light skin evolved when people migrated away from the Equator and needed to make vitamin D in their skin. To do that, they had to lose pigment. Repeatedly over history, many people moved dark to light and light to dark. That shows that color is not a permanent trait."
This illustrates neither darker nor lighter skin coloured populations are perfectly adapted to climate variations in different parts of the world. In winter an African American living in Northern USA must expose her skin to sun rays for much longer periods in order to have adequate vitamin D absorption. Similarly lighter skin coloured individuals who live in sunny climates are less protected against harmful UV radiation due to their skin's increased light absorption capability.

References:
evolution.berkeley.edu
nina.jablonski.nytimes.interview.2007
nina.jablonski.ted.video

Friday, September 4, 2009

Security and Evolution

In software development there seems to be an inherent 'arms race' around security. External predator software to breach software's security holes is in constant 'arms race' with the software's capacity to repel them. This kind of tense relationship recalls eternal struggle between prays and predators in nature. The pray develop a defense mechanism and survive better and longer say with a camouflage, then the predator develops a counter-measure and the arms race continues indefinitely (people will always attack browsers, browser vendors will always have to deal with them).

Wednesday, September 2, 2009

Junk Code

The human genome contains three billion base pairs, the DNA letters in which the code of life is written. Yet only a tiny proportion of these letters -no more than 2 per cent- are actually used to write our 21,500 or so genes. The remainder, which makes none of the proteins that drive the chemical reactions of life, has long been something of a mystery. Its apparent lack of function has led it to be dubbed 'junk DNA'.

Much of our junk DNA has origins that have been relatively simple to establish. A very large part of it belonged originally to viruses, which have incorporated their own genetic codes into our genome in order to reproduce.

The legacy of our viral ancestors can also be seen in so-called retrotransposons. These repetitive chunks of DNA, which were originally deposited by viruses, have the ability to copy themselves into the human genome again and again, using an enzyme called transcriptase.

In some ways, the continued presence of this junk DNA is not surprising: DNA is 'selfish', and will replicate itself regardless of utility to its host organism. But for it to withstand natural selection, some of it must surely be functional.

Software made by humans is like synthetic DNA. Remarkably junk code also exists in software systems made by us. In fact in evolutionary design methodologies such as Scrum it seems more likely that imperfect code being copied to incoming generations of software.

Scrum sprints typically follow a short 4-6 week iteration pattern. In Scrum the focus is on delivery, therefore junk code may get more chance of being copied compared to quality focused methodologies.

I don't think however junk code makes evolutionary methodologies less successful. The advantages of being agile has more survival value than less adaptive quality driven methodologies.

Consider this real life example:

Sprint1 in Project P ends, the architect A approaches the developer D.

A- Hey.. Something drew my attention, you guys hard-coded the magic-token in your module. Whereas there is a common function in our library which you should have used to retrieve the magic-token. How come this happened?

D- Oh. We've just cut and pasted the code from project Q. They also used the hard coded magic-token.

A- Ahh. I see. Damn. They should have used the library too. I wonder how we may clean up this mess.

D- I can fix this easily now in project P.

A- No, wait.. Fix it in the next sprint. I'll talk to other teams see if I can get them fix their code too.

As you probably guessed the hard-coded magic-token in this example is junk code. Like Junk DNA it possesses a powerful intrinsic ability to get itself copied into other projects/sprints i.e. other generations of code (perhaps because people find it more reassuring to use magic-tokens than using functions returning them). It seems despite A's intention to clean up the code once and for all, in practice it may be logistically not viable and quite expensive to clean up dozens of other projects' code across all versions from this viral but relatively harmless junk code. So it is likely that the fix will only be made in project P (provided that it is remembered in sprint2), and the viral code will continue to survive.

Evolutionary design in software systems is remarkably similar to evolution by natural selection. More importantly in software projects aiming at perfect design would almost certainly limit software's adaptive power and consequently diminish its competitive value.

References:
50 Genetic Ideas, Mark Henderson
Parasitism, Wikipedia
Agile Software Development, Wikipedia
Agile/Scrum Development, Wikipedia

Saturday, August 29, 2009

Imperfect Design

Is there such a thing called perfect design?

Time and time again the global software industry failed to deliver designs that worked in good order, delivered on time and within budget. Many projects failed either because they performed poorly, did not meet user expectations or they could not catch up with technological momentum.

There are historical reasons why software engineering projects failed more often than other types of engineering projects. In the past thirty years immense market demand on software as a result of exponential growth of cheaper synthetic memory availability (Moore's Law) created an avalanche effect known as the PC revolution. The tidal wave effects of the PC Revolution was immense and widespread. It did not stop at households. The collapse of the Mainframe Computer and consequent emergence of vast IP networks in the corporate landscape quickly followed. On top of that the Internet Revolution that emerged in the last two decades pushed competition to unprecedented levels.

Historical developments aside software engineering is also very different by its nature. Most notably software engineering blueprints are thousands sometimes millions of lines of code that can easily be erroneously constructed or ill-configured, inducing defects with much less chance of being detected due to difficulties of human brain comprehending code as opposed to say a suspension bridge blueprint. In addition there are vast number of mathematical possibilities in which you can construct a software program. It is like infinitely many and sometimes irregular ways of cutting a jigsaw puzzle, then recycling the pieces to make more puzzles.

So software engineering is a difficult discipline. Due to the factors we described above standard development and management practices of other engineering disciplines did not work out well when applied to software development. This led to emergence of the Open Source movement, and more dynamic development methodologies such as XP (eXtreme Programming) and Agile in the past decade or so.

What is common in these novel practices is that products are collaboratively, adaptively and continuously designed, developed and deployed in iterative cycles. Design evolves over time similar to biological evolution of species by Natural Selection.

In Nature no species is perfect at any given time. In successive and many generations species simply adapt to changing conditions or fail to adapt and become extinct. There is no perfection that warrants indefinite survival but a continuum of struggle we call survival by adaptation. There is no concept of an upfront design or designer yet alone a perfect one, in fact there is no beginning or end in the design process, design evolves indefinitely so long as it survives Nature's scrutiny.

Similarly in many Open Source projects there is no centralized vision of design (akin to Blind Watchmaker analogy). The design evolves by itself without a designer. Everyday thousands of coders worldwide collaborate on different parts of hundreds of software products similar to gene coalitions established within our cells. There is no seek for perfection, akin to the fact that perfection does not exist in Mother Nature. Resources can be deployed and utilized more efficiently by allowing mistakes rather than chasing an impossible Platonic vision of perfect design. In return product versions are released at a much faster rate with greater chance of seizing survival opportunities when they are exposed to users' scrutiny. This process is called Evolutionary Design.

To show my point lets look at Mother Nature's design process and see how imperfect it can be. The following is one of countless examples of faulty designs we inherit from our vertebrate lineage.

In this extract from The Blind Watchmaker, Richard Dawkins talks about how imperfect our eyes are from design perspective. Somewhere along the evolution of vertebrates a group of genes might have been copied in error but in a way not enough to jeopardize emergence of our species millions of years later.

"My second example of an evolutionary progression ... concerns the retina of our eyes (and all other vertebrates). Like any nerve, the optic nerve is a trunk cable, a bundle of separate 'insulated' wires, in this case about three million of them. Each of the three million wires leads from one cell in the retina to the brain. You can think of them as the wires leading from a bank of three million photocells (actually three million relay stations gathering information from an even larger number of photocells) to the computer that is to process the information in the brain. They are gathered together from all over the retina into a single bundle, which is the optic nerve for that eye.

Any engineer would naturally assume that the photocells would point towards the light, with their wires leading backwards towards the brain. He would laugh at any suggestion that the photocells might point away from the light, with their wires departing on the side nearest the light. Yet this is exactly what happens in all vertebrate retinas. Each photocell is, in effect, wired in backwards, with its wire sticking out on the side nearest the light. The wire has to travel over the surface of the retina, to a point where it dives through a hole in the retina (the so-called 'blind spot') to join the optic nerve. This means that the light, instead of being granted an unrestricted passage to the photocells, has to pass through a forest of connecting wires, presumably suffering at least some attenuation and distortion (actually probably not much but, still, it is the principle of the thing that would offend any tidy-minded engineer!)."
Evolutionary Design will continue to change the software engineering practice in a profound way. We will see fitter and better products emerging, satisfying complex and varying needs of demanding consumers.

On the other hand today software engineers must come into terms with the concept of imperfect design or design without a designer. This is a completely novel mindset that developers need to understand and adapt. In the Evolutionary Design era catching up adaptation cycles and focusing on delivery is far more important than chasing up an ideal design that warrants failure.