Archive for the ‘misc’ Category

Consciousness vs. efficiency

Thursday, June 25th, 2009

Imagine a computer stored in a box with a single small hole connecting it to the outside world. We are able to run programs inside the box and receive the results through the hole. In fact, in a sense results are all we can see; if the program makes efficient use of the hardware inside, the size of the hole will prevent us from knowing exactly what went on inside the box (unless we simulate the workings of the box somewhere else, but then the box is useless).

The human brain is a good example. To an outside observer, the hole is speech; other people can’t know what you’re thinking any faster than you can say it. However, speech is also the hole to ourselves. As I write these words, I am only fully aware of them as they appear on the screen in front of me. Until then, I do not consciously know what they are. I can choose to become conscious of them if I say the words to myself internally, but I must slow down in order to do this. The reason is that I am capable of being fully conscious of only one thing at a time, and it is more efficient to be conscious of the words visually on the screen rather than as I “think” of them.

Thus, we have a trade-off between consciousness and efficiency. In order to be fully aware of our thoughts, we must slow them down until they fit through the hole of consciousness. Conscious thought is necessary in order to correct mistakes in our thinking, remember our conclusions, and communicate with others. However, since our brains are internally structured as a massive parallel computer, the only way to use our brains efficiently is to not be aware of what we’re thinking.

This trade-off applies to thoughts of all kinds, and most areas of human endeavor require carefully switching between the different modes. For example, working out a mathematical proof is often said to require intuitive “leaps” of thought. The reasons these appear as leaps is not because they are actually sudden; our brain does not sit around doing nothing and then suddenly have the idea. Rather, our unconscious mind is considering various different avenues of thought in parallel. If an avenue appears fruitful, the unconscious part will make it available to the conscious part, and it seems to “pop into our minds”. Similarly, it is very difficult to consciously try to remember a particular fact. If you let your mind wander, the unconscious part is better able to search around for what we need in a massively parallel fashion, providing us with the answer asynchronously.

Movement is the same. When you dodge a ball thrown at you, your unconscious sees the ball and moves out of the way before there is time to articulate what is happening. Soon afterwards, your brain retroactively explains what happened: “If anyone asks, say we saw the ball coming towards us and dodged.” One of my hobbies is swiveling to fit through doors as they close without touching them. The last time I did this, I had a vague memory of my vision dimming during this motion, almost as if I was passing out. I think this effect was my consciousness temporarily shutting down to avoid interfering with the reflexive motion.

The same trade-off applies to computers and algorithms. Consider the problem of checking a C++ program for type errors. Current compilers do this by running full template instantiation, which generates code for each instance of the template. In other words, the compiler is “conscious” of the entire process. If we all want is the type errors, it would be much faster to use a specially tailored algorithm that checked for errors only, remembering only enough of the results to speech up the rest of the error checking process. It would be even faster if want to know only whether errors exist, not what they are, since the program could forget line numbers and other details. The cool part is that it is possible to combine the different approaches to get the best of all words: we can running error checking before code generation to reduce the latency of reporting errors back to the user, and we can speed up error checking by first running the stripped down yes/no algorithm and reprocessing any portion that has an error. In a decent programming language, all three variants can be generated from the same source using partial specialization.

This last point is very important, since it means that the trade-off between consciousness and efficiency can often be eliminated; we can start with “fully conscious” code (which remembers everything it does) and apply various “forgetfulness” transformations to shift towards the efficiency side. The different versions can be seamlessly interleaved so that it looks from the outside as if the fully conscious version is operating at the speed of the fastest version; the missing detail is recovered only when we need it. This is similar to human vision; any object we look at appears sharp, so we generally imagine that we see with uniformly high detail. What is actually happening is that almost all of our visual field is blurry, with one high resolution point in the center. We can shift this high resolution point to anywhere we wish, so we get the illusion of uniform sharpness for free.

Taking full advantage of this trade-off to speed up programs will require languages that combine low level and high level features and make it easy for the program to inspect and transform its own code. I’ll write more about this later.

The event horizon is near

Wednesday, June 17th, 2009

It occurred to me that Kurzweil’s singularity might be better characterized as an event horizon. The difference is that a singularity is where something actually infinite happens, while an event horizon is a surface beyond which one can never know anything. An event horizon looks like a singularity from the perspective of a fixed external observer, but from the perspective an observer falling it in always appears to be further down.

Of course, in the case of a black hole anyone who gets near the event horizon is ripped apart by the massive gravitational gradient. Hopefully this won’t happen in the Kurzweil version.

Many fewer books

Sunday, June 7th, 2009

As part of moving, I just got rid of these:

Science cannot tell us what is ethical?

Thursday, June 4th, 2009

I’m in the middle of listening to this, and had to take a break to rant for a minute. They’re currently interviewing Alister McGrath, who has written two books complaining about Dawkins. Here’s a quote (emphasis mine):

Well I think one very important point here is simply that it’s fairly clear that science is limited in terms of what it can tell us. It is marvelous in clarifying the relationship between entities and forces in the material world, but when it comes to questions of value or meaning it isn’t really quite so good. In fact Dawkins and I disagree on many things but on that point I think we are agreed: science cannot tell us what is ethical, but for me and I sure everyone who is listening I’m sure what is ethical is actually enormously important.

And here’s a Dawkins’ quote from the same program, which I’m going to pull out of context:

Bullshit.

The idea that “science cannot tell us what is ethical” is either absurd or a meaningless tautology. In the quote he explains that science is great at telling us about the material world (or as I like to call it, the world). What he’s arguing is that science is limited to studying physical properties. This is like saying that biology isn’t a very good way of studying general relativity; if he’s trying to separate science from logic and reason, his statement is a meaningless tautology.

Or not: maybe he’s really saying that logic and reason can’t determine what is ethical. Has he heard of philosophy? What does he think all those famous theologians spend their time doing? They start with some basic premises, and working out most of the rest using reason. Arguing that science has nothing to say about this subject is absurd.

What can science say about the basic premises? An endless amount: since logic and science help us explore the consequences of basic assumptions, they help us judge whether the basic assumptions are reasonable. For example: why is being nice to people more ethical than wandering around killing everyone in sight? Because if you wander around killing everyone in sight, people will be frightened and miserable, and will probably come after you and stop you. It’s just not a sustainable way for the majority of people in a society to behave.

End rant. Back to packing…

A Wikipedia-Style Proof

Friday, April 3rd, 2009

We wish to show that for small x, 1 +x1 +x2 To derive this formula, we use the well known fact that (1 +x) α= n=0 x nn! k=0 n1 (αk) The result follows by substituting α=1 /2 and truncating the series after two terms.

Wow

Thursday, March 26th, 2009

http://www.ted.com/talks/eric_lewis_strikes_chords_to_rock_the_jazz_world.html

The energy and momentum of the ground

Tuesday, March 17th, 2009

Imagine that you throw a ball in the air, and lands on the ground and stops (i.e., the collision is inelastic). What happened to the energy and momentum? The answer for energy is completely different from that for momentum, which is a trivial but interesting illustration of the differences between them. Also we get fun with infinities.

Assume a ball of mass m and velocity v hits the ground and stops. Before it hits, it has energy 1 2 mv 2 and momentum mv. After it hits, the energy and momentum of the ball are both zero, so by conservation they must have gone elsewhere.

Momentum is easy: the momentum went into the ground. This is possible without the ground having noticeably moved, since the ground’s mass is some huge value M. The resulting velocity of the ground is the minute mv/M0 , but this zero is canceled out by the huge mass to get the finite momentum Mmv/M=mv. Thus, it is perfectly consistent to model the ground as a rigid body with infinite mass, zero velocity, and nonzero momentum p. Only 3 new variables are required to account for this ground momentum and make our system closed with respect to conservation of momentum.

Energy is different: it is impossible to transfer energy to a large, rigid object. The kinetic energy of the ground after the impact is 1 2 M(mvM) 2 =m 2 v 2 2 M0 In other words, M= and V=0 give 1 2 MV 2 =0 0 =0 since the zeros outnumber the ones. It is impossible to store energy in the ground by moving it as a whole.

What happens instead is that the energy goes into smaller scale phenomena, typically sound waves or heat. Both cases involve small amounts of matter moving extremely rapidly, which we can roughly characterize as mass 0 , velocity . The key is that we can store as much energy as we like in these tiny phenomena without ever making a dent in momentum, since 0 =0 .

We can summarize this situation as follows:

  1. It is possible to hide momentum in a large, motionless object without expending any energy.
  2. It is possible to hide energy in a bunch of small objects without using any momentum.

The fact that energy hides in small places makes it harder to deal with in general; there a lot of small places, which is why the law of conservation of energy has been modified many times to account for new terms no one had previously noticed. Momentum is simpler: if you lose some momentum, all you have to do is look around for the gigantic object (e.g., the Earth).

Rmvng ll vwls

Wednesday, January 7th, 2009

whl g w wr dscssng th vrs trnsfrmtns y cn pply t txt wtht mkng t nrdbl.  Fr xmpl,  sm t rcll xmpls shwng tht txt wth ll bt th frst nd lst lttr f ch wrd rrrngd s stll rdbl.  Smn ls rclld sng rdbl xmpl wth ll vwls rmvd, bt thght t mght hv bn spclly cnstrctd fr tht prps.  Thrfr,  md  nt t try strppng th vwls t f  lrg blck f txt.  Ths s tht txt.

Cnclsn: nt vry rdbl t ll.

Christmas Tree

Friday, December 19th, 2008

This is pretty sweet. It took me a bit to register that this was a real picture and not a photoshop trick. Nicely done, Mom.

In the past we’ve always picked a tree the correct way, by searching through the woods and cutting one down (one year the tree was the top of a large tree removed from the edge of the yard). Mom claims we’ll fix it, but if we have to resort to buying one to do that the virtual tree might be a cooler alternative.