Musings of a Software Designer

Thursday, April 20, 2006

Amongst all computer scientists who take a philosophical approach to the subject, there comes a time when a personal visit the mystical realm known as the Mandelbrot set is in order. The hope here is simply to reveal that mathematics and computer science is far from being about the dry and technical aspects that people often confuse it for, and instead show that the technical aspect is merely a means to an end, the end being a better understanding and appreciation for what it is we can know and understand about the world we live in.

The Mandelbrot set is an example of a structure that can be defined mathematically, but whose complexity and nature is such that it can not be understood using any sort of computational means. It is a prime example of how there exist incredibly strange and mysterious forms in mathematics for which we can never fully comprehend or explain using algorithms, computers, or any other kind of computation, and yet we can define it in such simple and elementary terms.

Now the notion that there exists truths that can be not explained mathematically has been understood since the 1930s, when Kurt Godel published his famous Incompleteness Theorem, and then later on Alan Turing showed how computers are also limited in what they can accomplish.

Both of those proofs were symbolic, involving rigorous equations and theorems and axioms. The Mandelbrot set is beautiful because it's an actual colourful picture. It expresses the notion in an artistic and aesthetically pleasing manner that the universe contains secrets for which we have no means of understanding using math or science.

So what is this... Mandelbrot set exactly? Some have described it as a beetle, others have said it resembles a tropical island, and yes, one individual has described it to me as an oversized ass. Don't be too intimidated by the following mathematical definition, but if you find you are, simply ignore this next section and explore the Mandelbrot set yourself in what follows.

Pick a number, any number... let's call it c. Now consider the following sequence of equations:

c
c^2 + c
(c^2 + c)^2 + c
((c^2 + c)^2 + c^2)^2 + c
(((c^2 + c)^2 + c^2)^2 + c)^2 + c

Notice the pattern? You start with the simple equation c, and then you derive the next equation in the sequence by taking the previous one, squaring it, and adding c to it.

So as an example, if we let c = 1, then it's pretty clear that this sequence of equations diverges, that is, if you keep calculating this sequence of equations, it keeps getting bigger and bigger without settling on any single number. If on the other hand, you let c = 0, you notice that this equation converges, infact it, it converges to 0.

The Mandelbrot set is the collection of all values of c such that the sequence of equations converges. So the number 0 is a member of the set, whereas the number 1 is not. It is such a simple definition and yet it has a structure so complex that it escapes any attempt at being understood.

The best that we can do is approximate how it looks like, and in fact we can understand in full how the interior of the structure looks like, the problem comes when we try to explore the very edges of the structure, the corners. The closer you zoom in on any corner, the more and more complex the structure becomes.

But now that you've made it this far, it's best to have a look at what the Mandelbrot set "looks" like:



That's a look at the set as a whole, without zooming in on any of it, a beetle? An island? An... ass? You decide for yourself. As you can see, it's made up of some bulbs, and then some "antennas" which reach away from the bulbs. It's these antennas where a lot of the complexity of the set occurs, and infact if you zoom in on one of these antennas you get the following:



That strange looking beetle reappears and this time with an even greater complexity! The set is made up of little copies of itself, and zooming in on it even more one gets:



This is some sort of incredible spiral, and strangely enough the spiral is actually made up of infinitely many copies of the so called "beetle." Where does this spiral lead to? What is at the centre of this spiral?

Unfortunately, this is just one mystery that will forever remain a secret. The closer you zoom in on the spiral, the more complicated the pattern gets, and you realize that you're no where closer to the centre of the spiral than you were just a couple of zooms ago.

The Mandelbrot set simply refuses to allow itself to be fully comprehended. It is an example of what exists outside the boundary of human comprehension and how this outside world is vastly rich and infinitely beautiful.

I have included as part of this entry a program I quickly wrote up that allows you to explore this set for yourself. Left click zooms in, right click zooms out. There are many such programs that exist on the internet for exploring this beautiful structure, enjoy!

Download it here.

Sunday, April 09, 2006

I am a great admirer of Douglas Hofstadter, author of “Godel, Escher, Bach” and indeed that book, along with “The Mind’s I” are among two of my favorites. These are both books which have been some of the most influential and most inspiring in my overall understanding of nature itself, and yet I was never able to agree with Hofstadter’s premise on the nature of consciousness.

You see, Hofstadter is a functionalist; in simple terms, that means that he believes that the nature of consciousness is strictly the act of carrying out an algorithm regardless of the physical makeup of the action. That’s a fairly technical description and so the following illustration should help to better clarify what it is a functionalist believes.

As you likely know, your brain is made up of trillions of atoms; furthermore, the atoms that make up your brain today are not the exact same atoms that made up your brain even 2 minutes ago, a very small number of them will be replaced or swapped out by other identical atoms. Most people, however, would agree that they are the same “consciousness” now as they were 2 minutes ago, despite the fact that their physical composition has changed. Indeed, over the course of no more than 7 years, ones entire brain will consist of entirely different atoms, despite the fact that one would nevertheless argue that they are the same consciousness. Thus consciousness, it is argued, has nothing to do with physical composition.


The atoms of a human brain and of the nervous system in general are organized into cells called neurons, and these are the most fundamental cells responsible for transmitting information around your body. Neurons transmit information such as pain, vision, hearing and all other senses to your brain; furthermore neurons transmit information from one part of your brain to another.

Now assume that a Bob was selected for a long term experiment where the first phase of this experiment was to just replace a single neuron in his brain with a very tiny mechanical unit, like a silicon chip. The unit would act in a manner indistinguishable from that of the original the neuron, but the unit was instead created inside of a laboratory by a team of scientists rather than from naturally occurring biological means. The functionalist would argue that in the same way atoms in the brain get replaced by new indistinguishable atoms all the time without any change of consciousness occurring, no change of consciousness would occur at all by replacing a biological neuron with a mechanical neuron. That is, so long as the mechanical neuron can carry out its action in the same manner that the biological neuron can, no change in consciousness occurs.

Alright, so let’s say that after 7 years, all of Bob’s biological neurons had somehow been replaced by mechanical neurons. The argument is that even though Bob is now composed entirely of silicon chips, he will nevertheless be conscious, and that in fact his consciousness is the same Bob today as it was 7 years ago.

The absurdity of functionalism occurs when lifting the restriction, as we have imposed on ourselves, of limiting consciousness to the confines of a human brain. As is pointed out in the famous thought experiment by Ned Block, neurons are incredibly simple cells to understand, there is nothing magical or mysterious about an individual neuron. The description of how any individual neuron behaves and interacts can be described entirely in less than a single page. Since it is believed that the human brain has about 1 billion neurons, and the population of China is roughly equal to 1 billion, let’s assume that instead of replacing all of Bob’s neurons with silicon replicas, we just create a copy of Bob’s neurons one by one, by writing out the description of each individual neuron on a sheet of paper, and giving that sheet of paper to a single Chinese inhabitant. After 7 years, every citizen of China will have a piece of paper describing some very simple rules and instructions that correspond exactly to a single neuron in Bob’s brain.

Is China now conscious? Is China now Bob? What is the difference between replacing all of Bob’s neurons with silicon chips, and replacing all of Bob’s neurons (or in our case duplicating them) with the citizens of China?

Visualizing this reminds me of the Matrix Revolution’s when Neo confronts Deus Ex Machina. The consciousness behind Deus Ex Machina is the all powerful Architect, and to manifest himself physically outside of the Matrix he simply brings together an entire swarm of Sentinel’s to form a face, where each Sentinel acts as a tiny cell of Machina’s being. The concept works elegantly for the movie, but in reality there seems to be something rather dogmatic about the assertion that since all of China is carrying out the actions performed by Bob’s brain, that somehow China is a conscious being.



I do not mean to trivialize functionalism, on the contrary it is certainly difficult to argue that if one replaces biological neurons with something artificial, that the artificial being will not act and behave as the original. The argument against functionalism is that this artificial being would lack the comprehension of its actions, in much the same manner that a chess playing program lacks any sort of understanding of what it’s doing even though it might end up defeating a human Grandmaster chess player. Functionalism can not account for what I believe is the most crucial aspect of consciousness; that is the self-awareness component. Deep Blue, the IBM computer mainframe that defeated International Grandmaster Gary Kasparov at chess, while perhaps very similar in behavior and in action to Gary Kasparov at chess, lacks the self-awareness of its own actions.

Self-awareness is, in fact, what put an end to the ideal that the foundation of mathematics could be put on a solid footing. As Kurt Godel showed, whenever a system even so much as hints at the possibility of a self-referential theorem, that system is subject to either inconsistencies, a property most dreaded by mathematicians, or incompleteness, a property which denies any sense of complete satisfaction to mathematicians. And yet we, as conscious beings, allow for and even ourselves make self-referential statements constantly without breaking down. The fact that we can accommodate this should suggest that our consciousness is performing something that can not be replicated functionally. It is thus the breakdown that occurs when self-reference is introduced into a mathematical or computational system that I feel makes both of these fields unsuited to understanding consciousness. We may, and in fact I firmly believe will, manage to construct artificial beings that can very accurately mimic the actions of actual biological entities, yet I maintain that actually getting these entities to become conscious and actually aware of their own existence to be a feat wholly impossible using mathematical or computational methods.

Thursday, April 06, 2006

Software design is a pretty strange thing when you think of it. You know what it is you want the computer to do, you can describe it to yourself and to your friends, but it becomes such a difficult and sometimes frustrating task to properly tell that same thing to a computer. Granted some of the difficulty is a result of the vagueries of normal conversation, but that's mostly a minor problem.

The biggest problem with software design today is the lack of an appropriate means of communication between a human being and a computer. The most popular languages available to us today are C++, Java, and Python. These languages are all just minor variations of one another, and as such they all suffer from the same fundamental flaw, they lack a level of expressiveness and flexibility that humans beings desire when they talk to one another.

Think of writing an essay... does it ever occur to you while writing one how restrictive the English language is? Do you ever write an essay, stop, and think to yourself, "Oh darn, I can't quite explain this concept elegantly in English. If only I could write it in Russian, or Japanese, or Arabic I would be able to clearly say what it is I want."

Assuming you were an incredibly fluent speaker of every human language, it's highly unlikely you would find that some things are easier to express in one language while being incredibly difficult in another. Yet, software designers face this problem all the time, trying to find just the right language they need to get the computer to do the task they want it to.

The root of problem is largely historical. During the 50s, the sole task of a computer was to take a mathematical formula, and calculate a precise and correct answer to it. Essentially a computer was just a really big calculator that engineers could use to find solutions to their highly complicated equations. This was a very complicated and infinitely frustrating task as the only way to communicate to a computer back then was by punching holes into a card, with the pattern of holes determining what equation to calculate. To simplify this task, the very first high-level programming language was developed, FORTRAN (Formula Translator). Boy did it make life easier... for the first time in computing history, someone could input to the computer an equation like:

x^2 + 5x + 6 = 0

And the computer would almost instantaneously solve it. Life was good for the engineers, they had a great tool at their disposal to do all the mechanical work for them while they focused on the design.

Surely, while one can appreciate the power FORTRAN has for solving equations, one can only imagine how difficult it would be to express the game of Chess, Gemstone IV, or even The World of Warcraft as a series of equations. And so for the next 50 years, all software designers have done with respect to the design of computer languages was to add new constructs, new features to the language. Basically taking FORTAN, a special purpose language, and adding a new feature to it that makes it easier to do some other specific task, and adding a new feature later on, and so on so forth...

This, in my opinion, has proven to be a flawed approach in the pursuit of a general purpose computer language. C++, Java, and Python are not general purpose languages, they are just examples of languages that have many purposes that are of practical importance today. This has held back the potential that computers can have since before the use of a computer can expand to new, uncharted territory, these languages have to be updated with new features to accomodate the new problems that are faced. Of course it would be a miracle if human beings could come up with a genuinely general purpose language that would allow humans to easily communicate with a computer after only 50 years, but we will be far from such an ideal language if we continue down the same path we've been on.

The best path we have towards the ideal language is one that was also discovered 50 years ago, but unfortunately was almost all but abandoned shortly after. That path begins with a language called Lisp, and its other dialect, Scheme. Perhaps I will go into detail as to why these two languages lay the true foundation for an ideal language, but that will have to wait for another day.