Tuesday, October 23, 2012

The Mathematics of the Earth

Home
I watched the documentary "Home", which I found on YouTube. The initial scenes portray the balance of the planet before agriculture and the remainder discusses what happened thereafter.

I think of the planet as a massively intricate dynamic system. The physics of everything that happens on Earth is incomprehensibly complex. The atmosphere, volcanic forces, the water cycle and countless other systems interact in non-linear fashion. The Earth is one big system and it changes towards equilibria points. Consider what I mean by equilibrium point: if the rest of the universe were to vanish and the Earth were to be utterly alone without the Sun or any other source of external energy, the Earth would perhaps become a cold, dark, lifeless hulk drifting through a void. The Earth's energy would tend to escape its grasp, and disperse itself evenly across space. Energy is always fair -- it spreads itself out as equally as possible. Maybe this is one of Earth's plural of  but it is not an interesting case because we are giving the Earth a big zero -- no energy in from its surroundings. The Sun is not dead yet, so this is not an interesting case right now.

The Push of the Sun
The Sun drapes the Earth in energy from its furnace of nuclear fusion and sets the dynamic system in motion. The Sun is like a boy pushing a cart. The boy gives a big push and the cart moves quickly until friction has sucked its energy away and it grinds to a halt. The Sun fuels the Earth as the boy fuels the cart. If the universe were only the Earth and the Sun, the Earth would eternally orbit and the Sun would heat the Earth and push its systems to some equilibrium. The energy patterns create the equilibrium of the climate and the seasons are due to the Earth's tilt. All of these things are cycles: the Sun cycles in intensity and weather on Earth is chaotic over a short-period of time, but in general, the Earth is a very stable place in this scenario. I think this is how the Earth would be if it were not for life. Earth might be stable with the occasional volcano or storm raging here and there, but these would constitute no more than noise in the history of the Earth.



The Control of Life
If the system of the Earth is stable by nature, then perhaps life is its controller. Perhaps life can drive the planet to instability or to other equilibria which would otherwise be unreachable. Consider the impact of algae and their predecessors. They have completely changed the composition of the atmosphere and the climate of the Earth itself. I think life is a powerful feedback system which controls the Earth. Life is capable of taking the noisiness of the state of the Earth and shoving it off kilter. If tiny fluctuations in the climate of the Earth allow life to grow and evolve in one direction rather than another, this is like an inverted pendulum being nudged to one direction.

Early Earth had much carbon-dioxide in the atmosphere which allowed life to evolve to exploit this detail. Algae breathed the carbon-dioxide and emitted oxygen in its place. As more oxygen became available, life evolved to breathe that too. Animals breathe oxygen and emit carbon-dioxide. Thus the cycle of plants and animal respiration created itself out of the noise of the Earth. This is a grand simplification, but it is important to see how life pushed the atmospheric trend in a completely new direction.

Are Humans a Controller Capable of Instability?
If life can change the planet, then certainly we can too, being alive. The only matter is the speed of change. It took millions of years for countless algae cells to change the atmosphere of the planet. Now we are changing the planet in drastic ways too, but the only novelty is the speed with which we are doing it. If the Earth is a delicate inverted pendulum, and life pushes upon it, can it push too hard? If the cart in the picture tries to drive too quickly, the drink will certainly spill, but it is possible to move forward very slowly. Perhaps life has always moved slowly and so the Earth remained relatively stable and the drink did not spill. There have been instances in the past where life has "spilled" from changing too quickly, but we are unsure as to most of there causes. The Middle Miocene disruption, for example, may have been caused by an asteroid impact, or otherwise, -- an example of change too rapid for many species. There are many examples of rapid and widespread extinction throughout geologic history.

Life can change the world and has usually done so slowly. Are we the first lifeforms who are able to change it so quickly that we can actually destabilize the system? Imagine if we could understand the mathematics behind the balance of nature. How can a system so complex keep itself relatively stable for millions of years? Can we ever understand such a system?




Wednesday, October 17, 2012

Artificial Composers

The other day, I was listening to Tchaikovski's "Valse des Fleurs," which I find to be a particularly excellent song. I wondered, "How did Tchaikovski create this?" How did he know which notes to write down? Music is a bunch of sequences of notes which overlap in different ways. Tchaikovsky had to choose every note in every sequences and when to overlap each one. I wonder if it possible to create a machine capable of doing the same thing?

There are many possibilities of how to arrange notes. Do I start the song with an A#? How long should it last? Which note should come next? Should it begin after the A# is finished, or should it overlap? If it does overlap, by how much? How many notes should be heard at any one time?

Q-learning is a type of learning algorithm where the machine is told whether the action that it just took is 'good' or 'bad.' Usually, the machine is just given a number as feedback which is some function. For example, maybe -5 is bad, -10 is very bad, and 4 is pretty good. Over time, as the machine is rewarded and punished, it learns which actions are the wisest to take based on where it has just been and what it has done before. The machine may learn that after it turns left, it should turn right next, for example.

Might is be possible to use Q-learning to build a machine that writes music? Not just a string of sounds -- beautiful music? Let us call such a machine Beathoven.



How would Beathoven begin a new composition? It might choose a note randomly. After some random time, Beathoven chooses another note. When Beathoven chooses a note, it chooses the pitch and duration at once. We could think of Beathoven as a stream of noise. Whenever the noise spikes above a certain value, a note is produced. At any time, a listener can rate the music on some scale. Beathoven can then modify its policies based on the user feedback. Over time, Beathoven should learn how to create music pleasing to the audience.

The problem is similar to the old idea of infinite monkeys on infinite typewriters. Given enough time, they will necessarily reproduce the works of Shakespeare. Of course, "enough time" is far too long to wait. However, if the monkeys had feedback as they were writing -- we add infinite editor monkeys (1 per writer monkey) to read their work and give a thumbs up or a disappointed look. Without editors, the monkeys will explore every possible combination of letters, but editors can point out that many combinations of letters do not mean anything.

Similarly, we can tell Beathoven that certain notes make us cringe, while others may sound eerie or cheerful. We can explain, through feedback, that we like certain rhythms or melodies.

Update: It looks like somebody may be trying to implement this very idea. Apparently the notion is called "Computational Creativity".


Monday, September 17, 2012

Artificial Democracy

I am studying machine reinforcement learning for my master's thesis. Today I stumbled across a concept called "ensembles." There are many different algorithms to which can be used to make a computer learn how to do something that may be difficult to explicitly describe. For example, how do you make a helicopter hover?

You could study the motion of the helicopter and formulate precise equations to control the blades. Reinforcement learning is interesting because you can teach the helicopter that it has blades and it can spin them quickly or slowly; this way or that way. Then you teach the helicopter that falling or shaking a lot are bad. If it does either of these, you punish the helicopter. Over time, the helicopter can learn how to hover because it is trying to get the most "reward" that it can by its actions. There are several algorithms that are suitable to different types of problems. We might choose one of these algorithms and program the helicopter to "learn" by that method.

The approach that I learned about today is like an artificial democracy. Instead of choosing one algorithm under the rules of which the helicopter must learn, you choose several algorithms at the same time. Each algorithm will come up with its own policy of how to fly the helicopter to maximize its own interpretation of the "reward."



Next, the helicopter listens to all of the algorithms at once, either by taking some average of biasing towards some rather than others. It would be as if the helicopter had a group of policy advisers who would provide suggestions. I read a dissertation today which argued that ensembles of policies might actually be more robust than individual policies for certain problems. Perhaps ensembles could work well on problems which are "in-between" areas of specialization for the member algorithms or problems for which very little information is known.

This idea is very intuitive and seems very related to how living systems and human-made systems work (like democratic governments or ant colonies).

Saturday, September 8, 2012

The Girlfriend Problem

Anyone who has ever had a girlfriend knows about the problem of feedback attribution.

Perhaps you call your girlfriend to see if she wants to go on a date. When she answers, she seems upset about something, but refuses to tell you what is specifically upsetting her. A man somewhat experienced with women can (sometimes) figure out the reason why she is upset. He can think of what he has done in the recent past and make consider some of the things that perhaps he shouldn't have done. He is able to select a small group behaviors or actions from the totality of his existence that probably made his girlfriend upset and use this knowledge to determine how to apologize properly.

How is it that a man is able to figure out why a woman is mad when she refuses to tell him? Can a robot learn to do this too?

Perhaps Fred knows that his girlfriend, Sarah, usually finds out about his mischievous behavior after 14 days with a variance of 3 days. When trying to apologize to Sarah, he can assume that the she is upset because of an action approximately 14 days in the past. Fred promises not to repeat any of his actions that took place between 11 and 17 days ago, hoping that she will then forgive him.

Should can spread Sarah's disgust over his past actions in many ways to try and determine what it was that he did wrong. He can use any of the stochastic distributions to associate Sarah's frustration with the appropriate actions. Fred might try to take into account the frequency of his actions and Sarah's usual disposition to produce a better guess.

For example, Fred plays golf with his friends each week. Normally, Sarah is quite content during these weeks. Fred decides that because of how often he golfs, Sarah is probably mad for a different reason. he notices that 12 days ago was the only time he can remember when one of his golfing excursions overlapped with Sarah's birthday. It is very unusual for these two events to overlap, so Fred decides that there is a high probability that Sarah is upset about that and decides that in the future, he will either try to reschedule his golfing trip or Sarah's birthday.

An intelligent machine might function in a similar way. Consider a machine that is designed to play diplomacy. As the game progresses, the machine chooses actions that benefit its own nation. However, the machine is attacked by Russia, who had previously been very peaceful. The machine must decide why this betrayal occurred. Did one of the machine's past moves offend Russia? Did a past move hit one of Russia's allies?

The difficulty of the problem is that a machine does not know when its actions will be judged. An intelligent machine must be able to learn from the judgments (good or bad) that are bought upon it. Humans are able to ask themselves, "Why did this happen to me?" We are pretty good at determining what we did in the past to deserve our punishment or reward. From that knowledge, we learn whether to do it more or less.

Monday, April 16, 2012

The Biomimicry Taxonomy

I've become fascinated with using biomimcry (copying nature) to try and address human problems. This approach blends some of the most interesting aspects of science and mathematics. The goal is to learn from the inventions which have evolved in nature because they must already obey all physical laws (including the ones we haven't yet discovered).

The reason I'm writing today is because I came across a fascinating website in my internet wanderings. It's called Ask Nature. The idea of the website is to create a free, open source database of natural designs.

There is an image available on the website called the biomimicry taxonomy and it provides a visual for the different functions that organisms or natural processes perform.

The idea is this: if you have a problem, you usually have a main question. How can I store energy in the electrical grid? How can I make more food from the same plot of land? How can I control hazardous wastes? The website challenges you to ask these questions in a different way: How does nature store energy? How does nature produce food? How does nature recycle wastes?

The beauty of nature is that the inventions which have evolved are typically ecologically balanced. Sustainability is essential because organisms that are not sustainable become extinct. Perhaps we too can become sustainable if we learn from all of the other species which have been around far longer than us.

For example, when I navigate to energy storage techniques, there is an entry about how some bacteria use a kind of thermoplastic polyester to store carbon and energy. Learning more about these types of bacteria might inspire some inventions in biodegradable plastic.