Posts tagged “nature”.

Continuous computing

Disclaimer: I haven’t checked academic sources for any of the statements made in this post – all of it is speculation which may be affirmed or rejected by existing literature.

Existing computing hardware and software are based on a discrete model: the Church-Turing model. The machinery is built on digital logic, and formalisms such as lambda calculus and turing machines are also essentially discrete. But what if we were to attempt to build some kind of continuous, or non-discrete, computer?

Digital logic gives us some unique capabilities that do not seem to exist in the real world, for instance: the ability to read a value without altering it, the ability to copy a value without altering it, the ability to test for equivalence and receive a yes or no as an answer. (The whole idea of “equality” is digital/platonic in nature.)

It will not do to simulate a continuous computer in software, not even with arbitrary precision arithmetic. It seems that some properties that a continuous computer might have would be impossible to simulate on discrete hardware. At least, we would need some kind of non-digital hardware extension that produces the continuous operations.

The discrete, digital model may seem like an abstract ideal, disjoint from reality. Yet continuous, real numbers are at least as much of an ideal. Between any two real numbers, no matter how close they are, there is an infinite amount of intermediate real numbers by definition. It seems implausible that we could find this infinite amount in the real world.

Is the real world continuous or discrete? I don’t know, and last time I asked one of my friends who knows physics, the answer I got was too complicated to be reduced to yes or no, or even to “yes, mostly” or “no, mostly”, if memory serves.

What properties might a continuous computer have? Depending on how it is designed, maybe some or all of the following:

  • If we compute a value twice, there would be a level of precision at which the results appear different
  • In fact, there is no way to establish the absolute equivalence of two values, equality is reduced to a matter of precision and generalisation (as it in practice already is for computer implementations of floating point arithmetic today)
  • The simple act of reading a value might alter it slightly.
  • The more steps a value passes through (i.e. the greater the number of times it is copied), the more it deviates from the original value
  • The ability to truly move a value, as opposed to mere copying and deletion, might become important, to mitigate the above effect (digital computers cannot truly move values)

We must also ask the question: how do we model continuous computing mathematically? Is it enough to allow for numbers with arbitrary range and precision and use standard logic, simulating the destructive effects of computation somehow? (Probably insufficient). Could we generalise lambda calculus/turing machines to abandon their inherent discreteness and end up with a more general formalism?

If we accept the above list of properties, even if we concede that we cannot accurately simulate a C. computer on discrete hardware, maybe we can build a simulator that gives us an idea of what a real device might behave like. But we would have no idea what we’re missing.

Motivation? The main motivation is that it is interesting, i.e. it promises to point us in new and powerful directions, laden with potential discoveries. If something more concrete is needed: intuitively, we should be able to bridge computer software and the physical world much more easily with this kind of system, bringing benefits to UIs, simulation and modelling, etc.

Edit: After writing the above, I found out that people have investigated the idea of analog computers, which intersects with the idea of the (perhaps poorly named) continuous computing described in this post. The image at the start of this post is a diagram of the Norden bombsight, an optical/mechanical computer used in WW2.

On statefulness

Last year I made some attempts at free association around formal languages and state machines. But at that time, not much was said about the idea of a state itself; an idea which I think holds a lot of interesting uncharted territory.

To begin with, what is state really? Intuitively the word distinguishes states of an object. The key here is the plurality. A single state in itself is uninteresting. Only as contrasted with another state does the first state acquire meaning. This leads us to an interpretation: states are a way of grouping all the possible forms-of-existence, for want of a better word, that an object has, which lets us make sense of such forms more easily.

To exemplify: the light switch in my apartment can be on or off. But in physical space, the plastic switch can occupy a very large number of positions between one and zero. However, the spring mechanism forces the switch into the first state or the second state as soon as I release my finger from it, giving rise to two distinct functional states. When I was a kid, I would sometimes play with the rather old light switches in my parents’ house by keeping the switch in the middle between on and off. A humming sound would be emitted, and the lights would flicker on and off. Surely not a very good thing for the fittings, and potentially dangerous, but interesting since this broke down the abstraction – the continuum behind the discrete was exposed.

So given a physical system, then, which remains the same system even as some parts move around, electrical currents flow, etc, we use states to partition all the forms of existence of that system into meaningful ideas. “The door is open/closed”, “The engine is turned on/off”, “The engine is turned on but there’s almost no fuel left”, and so on. States have probably been with us as long as we have been able to think of binary distinctions, which is to say throughout the history of mankind – opposites such as day/night and alive/dead must have been with the human mind from prelinguistic times.

Today, states are an essential way of turning the unmanageable analog realm into a finite, subjugated digital representation.

Nomura’s jellyfish

Nomura's Jellyfish

Nomura's Jellyfish. Picture by Kenpei at the Osaka aquarium. GFDL license.

Nomura’s jellyfish, a species frequently encountered in Japan and China, is one of the largest in the world. The body can reach a diameter of 2 m. Since they create big problems for the fishing industry, Japan has now sought China’s help on the issue. It is thought that a recent proliferation of the species, huge swarms appearing every year since 2000, originates at the mouth of the Yangtze river.

Evolution can do fascinating things sometimes. Upon reading about this, a doubtlessly romantic and delusional notion entered my mind. What if the sea ecosystem, or a subset of it, say 10-100 species, perceive the human fishing industry as a threat that needs to be defended against, and in response create an evolutionary niche where a new kind of species can thrive, a species whose only purpose is to obstruct fishing? A romantic notion since it plays off the mythical idea that human beings are at war with nature, or that nature is good and man is evil, something I don’t really believe in. But an interesting one nonetheless. Is such a development possible?

Power and rebellion in Marunouchi

Buildings and nature outside the imperial palace

In the chilly yet sunny winter afternoon, I took a walk past the imperial palace in the centre of Tokyo. I find sunny winter days refreshing.

The palace is interesting to behold. It is fronted by lots of that most precious of Tokyo commodities, open space. Supposedly, during the height of the land bubble, the land on which the palace is built was worth more than the state of California. This is in turn surrounded by some of Tokyo’s most prestigious office buildings in the Marunouchi and Hibiya districts. Tokyo station is just a few minutes away on foot.

The scene is one of juxtapositions. Open space meets tightly packed high rise buildings. Traditional Japanese architecture counters sleek office buildings. Yet this  never feels contradictory, because there is an underlying theme of restraint and control.

As you might expect from a royal residence, the public courtyard is immaculate. The grass is so well cut and even as to resemble a golf course. The trees on the lawn are of uniform height, lushness and distance from each other. The gravel is supremely even.

The office buildings are similarly controlled: shades of grey and brown, a certain minimalism and homogeneity in design that is easier found here than in Europe, the sense that unnecessary detail has been removed.

There is a sense of power in all this; a will and a shared set of ideas that have been realized to a high degree. The homogenous, flat skyscraper with a grid of windows is the triumph of human, platonic ideas over the organic and the irregular. The palace garden is man’s will taming the uncontrolled vegetation we find in nature. Yet such control is always a question of scale. We can cut and prune the trees, but we cannot control the color of their leaves or the exact angle of every branch. And we can cut and prune the buildings, but generally, we cannot control the shape of the overall skyline in detail. Something organic manifests itself in the multitude, even as some parts are controlled.

Power and rebellion, in constant struggle and symbiosis.

A couple of quick ideas

I’m currently in Sweden, enjoying the Scandinavian nature, catching up with family and a few old friends.

This time, some quick notes on a few ideas that have been brewing.

Orthopraxy is when people do things the same way: “correct” action/praxis. On Artima developer spotlight, there was a lively discussion on this in the Ruby community: is Ruby a language that is less patronizing to the programmer than many other languages? That is, does it enforce orthopraxy to a lesser extent than other languages? In very established languages such as Java, orthopraxy does not just come from language design though; it comes from the culture surrounding the language. Today it is so mature that there is a very small number of accepted styles and accepted ways of coding. This does make people more productive by easing communication, but I wonder if we could have both ease of communication and stylistic freedom…?

Garbage collection in society is the collection of discarded resources: entropy has gone so far that we banish used up objects to a heap of rubbish. Some of these may be immediately recyclable, most of them will take a long time to disintegrate fully. In software, garbage collection is about reclaiming the space used by lost objects that can no longer be used by the program. As such it’s more about recycling – all the memory is reused pretty much instantaneously. The trick here is finding those lost objects and putting the memory to use in a good way. Finally, in life, when plants or animals die, they become part of new plants and animals in a normal ecosystem. Isn’t this garbage collection on a molecular/atomic level? Maybe even as high as on the protein level.

Actor programming in Scala is something I casually started experimenting with for a text processing tool, and it turned out to be a very pleasant way of doing parallel computation. The asynchronous message queues were a much nicer way of doing things than the conventional monitor/mutex methods. I recommend trying to use it for something. In Scala they can equally easily be made threadless (usually each runs on its own thread), making support for a huge number of actors trivial.

Quantity as a success metric

I have something of an engineering background, so I easily end up thinking of success in terms of quantity. Maximizing this variable or that. Ensuring the greatest possible reward, or the smallest possible cost. But sometimes this is fallacious thinking.

As an academic, I would like to publish prestigious articles. It would be nice to publish 10 papers at second or third rate conferences, but they might all be made irrelevant by a single article at a first rate conference (or even an article in Nature or Science, say). So quality is a better measure than quantity.

I would also like to come up with new and influential ideas, but I suspect I would probably be happier if I managed to influence 10 very highly regarded people than if I managed to influence 10 000 laymen. (These exact numbers were computed using the “wild guess” algorithm and further evaluation may be needed.)

In professional life, I’ve found it dangerously easy to fall into a mode of thinking where you evaluate yourself by your income. This is true up to a point, but I’ve found that there’s a point beyond which additional income has diminishing returns in terms of how much it adds to my overall rewards from life. So beyond this point, quality is a better measure than quantity. What are my tasks, how do they force me to learn and evolve, what kind of satisfaction do I feel and why? So quality is a better measure than quantity.

User satisfaction with computer software can, to some extent, be measured using response time and latency. A snappy, responsive user interface usually produces more satisfaction than a sluggish one. But this can often be compensated for to a surprising extent by having appropriate progress indicators, animations and design features that placate the user in some way, assuring them something is being done. This is in a sense the opposite of the money situation: up to a certain point, quality makes up for quantity, after that point (when the slowness becomes impossible to mask), quantity becomes increasingly important.

What’s most interesting is perhaps the convertibility between quality and quantity. In engineering a device or a software system, quantitative metrics can be crucial tools in the construction process, but the final user experience must be qualitatively right. So quantity is a tool to construct quality. And in the real life situations where quantity is actually the best measure — bargaining, comparing, communicating, constructing, … — I think of it as a way to mask qualities. The numbers are simply easier to consider than the vast number of qualities that lie underneath.

Languages and automata, part 1

Yoyogi, TokyoComputing is very new as a science. Blaise Pascal devised a mechanical calculator in 1645, but Charles Babbage’s analytical engine, widely considered the first programmable computer, was not conceived of until the mid-19th century. However, it was never constructed (unlike Babbage’s simpler “difference engine”), and even at this time there was almost no theory to go with the invention. Today, the fundamental abstractions of computing and programming are Turing machines and Lambda calculus, described in the 1930′s. So essentially, the theory has had less than a century to mature, and is being viewed by many as a branch of mathematics.

The newness of computing means that we don’t know that much about its role or its applicability outside of devices built specifically for computing, nor do we know if today’s fundamental computing abstractions are the best ones.

Languages and automata are two of the most fundamental ideas in computing. In contrast to human languages, which are informal and rather unsystematic, in computing we often speak of formal languages. Something like the following is an example of a formal grammar:

  • Sequence-list: Sequence [ Sequence-list ]
  • Sequence: Wake up Action-list Have lunch Action-list Go to sleep
  • Action-list: Action [ Action-list ]
  • Action: Work | Answer the phone | Attend meeting | Relax

Using this grammar we can model the life of an office worker. We can generate an infinite list of potentially infinitely long “sentences”. The following are examples of valid sentences in the grammar:

  • Wake up, Work, Have lunch, Attend meeting, Go to sleep
  • Wake up, Work, Have lunch, Work, Go to sleep, Wake up, Work, Have lunch, Work, Go to sleep
  • Wake up, Answer the phone, Answer the phone, Answer the phone, Have lunch, Work, Go to sleep

A grammar such as this has a 1-1 correspondence with what is known as a deterministic finite automaton (DFA) – a very simple building block of software and hardware models. A formal grammar like the above is in a sense just a more natural way of thinking about a DFA.

What is the applicability of formal languages outside computing hardware and software?

Ferns. Kyoto, Japan

For one thing, we see them in nature, not least in ferns, which on a miniature level appear to have used the same rules as on the macro level. We see them in trees and flowers. In fact, the formal language paradigm appears to be a very good fit for many natural phenomena. One reason for this might be that formal languages allow rich structures to be constructed from a very small description.

One idea I find fascinating is trying to apply these models to human society: people and institutions. Can we describe the interactions in society as automata and formal languages, and if so, what can we learn about them?