Monday, July 30, 2007

Of Machines and Tasks

The programmer lives in a simple world. There are machines, and tasks. The task articulates an abstract need. The machine understands only primitive instructions. Between the two is a great gulf, occupied by the programmer.

The programmer builds a bridge over the gulf from both directions. The task must be specified, and the machine's instructions must be abstracted. The former results in a specification, and the latter in a program.

Hence, "programmer."

A better understanding of the programmer's mindset requires a better understanding of both tasks and machines, of both specification and abstraction.

Imagine this simple task: picking a quince.

In terms of efficiency, climbing the tree to pick its fruit is somewhat less efficient than reaching into the tree with a fruit-picker (e.g. stick) and knocking the fruit down. Later, the fruit-picker could also be used as a back-scratcher, tick-flicker, and fire-poker. The picking, scratching, flicking, and poking are tasks the user delegates to the machine.

I mean, the stick.

The specification process starts soon after.

"No, not that apple, the other one."

"Lower, lower, lower."

"Gently!"

"Get back from that fire."

These are all kinds of specifications. They make the task more specific. The stick-as-machine obviously cannot parse these instructions directly, but fast-forward a few thousand years and see what happens as the stick develops.

The world gets along with better and better sticks until folks in the middle part of the twentieth century come up with the bright idea of a general purpose machine. These machines can not only perform calculations, but also remember the results (as well as the calculation, for that matter). In turn, they can be used to control other, simpler machines (sticks, for instance) via input and output channels.

At the most basic level, these machines understand only a single kind of instruction: an electronic signal is either present or absent. On or off. Modern machines come with a number of primitive combinations of this basic instruction, but only a handful are needed to declare a machine complete, or Turing-complete.

Programmers, in turn combine these primitives into abstractions, to meet a specification. Thus, the bridge is built.

Labels: ,


Wednesday, July 18, 2007

The Trouble With Infinity

Kronecker had no way of knowing the real trouble with infinity.

When he and Cantor were arguing about it, the geniuses who would make the first computers were still in their diapers, or nappies, or Windeln, or whatever they called them in their particular little slice in the space-time continuum.

Kronecker thought infinite sets were unnecessary. Possibly even damaging.

Well, that's putting it mildly for programmers.

The real trouble with infinity is that it's infinite. Which means that we can use it as a symbol (called incidentally, a lemniscate), but calculating anything that approaches infinity takes infinite time, memory, and processing power, which most of us lack.

If you've got an Aleph hidden somewhere under your stairs, maybe you don't care.

But I do.

Infinity sucks.

Wednesday, July 11, 2007

Sync: How Order Emerges from Chaos in the Universe, Nature, and Daily Life

Man, I wanted to like this book.

It did have its good points. It touches on a lot of interesting topics (from fireflies to Bosons). It provides a picture what's it's like to the author's kind of research- both good and bad. And it does provide a lot of jumping-off points for further reading, whether it be cybernetics, catastrophe, chaos, complexity, or other fads that start with "c".

Cellular automata, anyone?

The worst symptom of what I didn't like is on page 166: "The human brain cannot readily visualize more than three dimensions..." When something is beyond the abilities of the author's imagined audience, he resorts to metaphor and analogy. And this book contains a great deal of metaphor.

Which is to say that my main criticism is that I don't think Strogatz is a very good writer. I imagine he's a brilliant mathematician, but every time he starts an analogy, rather than clarify the topic for me, it further muddies the waters.

Okay, that last use of metaphor tried to be situational comedy, but failed.

My more substantive criticism is that Strogatz never manages to tell us what "sync" is. He points at a lot of phenomena and calls them sync, but never really leaves us with a visceral understanding of what lands them in that category. Other than the fact that some things seem to happen at the same time. Then he ends the book by telling us sync is "uniquely successful," calls it "a crucial first step," and then ultimately says he'll write more when we have a "major breakthrough in understanding."

He also takes a pot-shot that annoys me: "Others conceive the universe to be a giant computer, running a cryptic program whose discovery would constitute the end of science."

Oh, come on.

Before I leave this promised review on that sour note, I would like to give it a non-arbitrary 338 out of 641 stars. The book has 338 pages in hardcover, and 641 is Douglas Hofstadter's favorite prime, or at least the one he seems obsessed with in his latest book. Hence the non-arbitrariness.

Monday, July 9, 2007

Of Axiom, Theory, Practice, Belief, and Silliness

The slew of pop-science books I've read recently has wreaked havoc on my Amazon.com recommendations (while I didn't actually purchase these books from Amazon, I did claim ownership of them). Suddenly, they are convinced I want to be an atheist, and are recommending Letter to a Christian Nation, The God Delusion, God is Not Great, and God: the Failed Hypothesis. Huh.

Leaving aside the notion of whether I am a good scientist, or whether I am a good Christian, I'll make some sweeping statements that may sound like neither, depending upon the audience. God is not anathema to good science. Evolution is not anathema to God. Logic and belief may coexist peacefully. Theory and practice have a place alongside one another. Placing them on opposite sides of some scale, demanding that only one may be picked, is kind of silly.

Where to begin?

Axiomatic systems like logic, statistics, and mathematics rely on a priori knowledge. On propositions. We make some foundational statements (propositions), and we combine these statements to make other, hopefully more powerful statements. The belief involved in this kind of system is dependent upon the belief in the propositions, and the belief in the axiomatic systems themselves. The practice is generally called "proving".

Science is another kind of practice, also with an underpinning of belief. In the practice, one forms a hypothesis, conducts an experiment, and refines the hypothesis. The underpinning beliefs are that this system will yield better hypotheses and that the simpler the hypothesis, the better. I'm no Karl Popper, but I'm sure someone who is will email me important clarifications.

Practice is, simply put, repeated action. It may involve a purpose. For instance, I may write often in the hopes of becoming a better writer. This purpose could be thought of as a hypothesis, but it's not scientific, because it is neither falsifiable nor repeatable. Practice may also result from an authoritarian dictate- such as a child's daily regimen of piano "practice." Eventually, practice may result from habit. Where habits come from, I wish I knew.

Last, but not least, belief. Belief, I believe, is inevitable. I don't really even know how to describe it without using tautology: one believes something if one considers it truth. One can believe in a proposition, a hypothesis, a causal link, a method, practice, a truth, a falsehood, and even a practice. In some cases, belief may even be arbitrary- such as my belief that what has happened in the past will happen in the future.

There are obvious problems with each. We've known since Gödel that axiomatic systems only have two flavors: incomplete and inconsistent. The scientific method is refinement of hypotheses, and as such is dependent upon the quality of input. Practice, while comforting, is little else on its own. And belief- to a non-believer- is arbitrary and capricious.

But in the end, it is the mis-application of one to another that yields the conflicts described above. Christianity is, in the end, neither an axiomatic nor a scientific system. Using axiomatic logic to prove or disprove belief and practice is, as I stated previously, kind of silly. Same goes for the scientific method. Conversely, applying religious belief or practice to axiomatic or scientific inquiry is equally silly. It's like trying to use statistics to disprove Karate.

Kind of silly.

Cosmological Detour

I have recently read a number of enjoyable books with some cosmology in them. I'll post the review for the most recent one in a few days. In the meantime, this month's bibliography:
Emergent chaos and order are something of an obsession with me, so if I've seen similarities that aren't there, forgive me. I bought them at the same time from Trover, and read them all the same week. Coincidentally, I finished Decoding The Universe first, followed by Chaos, followed by I am a Strange Loop, and I'm just now finishing Sync.

The overlap between the ideas in these books is extraordinary, and reading them all together yields some insight not to the actual structure of space-time, but rather to the myriad possibilities that we might not completely understand.

The first insight is one that plenty of other writers have already commented upon, but it bears repeating: both simplicity and complexity can (and do) result from very simple systems. In fact, many (most?) systems have aspects of both. E.g. Paired oscillators, cellular automata, Lorenz attractors, and (yes, yes) any system sufficiently powerful to allow self-reference (e.g. strange loops).

This notion is not entirely dissimilar from some points Wolfram made in his grand opus A New Kind of Science, though this was not the first place such insight was noted (not even Wolfram's own first time noting the behaviors).

The second insight might be obvious to some, but still bears stating: behavior of low-level components of a system are not predictive of the system's high-level function, and vice-versa. E.g. neurons do not explain thought, thought does not explain neurons.

I would like to draw the attention of particle physicists to this second insight. Just because a system behaves in a manner that seems statistically predictable does not mean that the lowest-level components of that system should be modeled as random little statistics engines. There are plenty of different kinds of (far simpler) systems that produce statistically predictable behavior at the high level without a corresponding reduction in the Kolmogorov complexity of the output as a whole.

The third insight is possibly my favorite, and Hofstadter had my favorite way of describing it: at sufficient scale, systems with rules do Strange things.

I think the third insight follows from the second, which follows from the first, and I think all three follow from nearly any of these books, and some others (e.g. Wolfram's). The universe is strange and wondrous. Our mysteries are still largely unsolved, our collective imagination is still largely untapped, and and we're on the brink of discoveries that will make the past sixty years of computation and theory seem like but a precursor.

My last point of note is this: the world needs fewer specialists, or possibly more specialists with less specialization. Each of these books describes broad insight that overlaps fields of study that are not generally overlapping (at least not as taught to me).

Thursday, July 5, 2007

Chaos, the Making of a New Science

In case you can't tell, I'm reading a lot of pop-science right now. Chaos, the Making of a New Science was humbling backfill.

In the mid-eighties, I suppose there was good reason to be optimistic that Chaos (TM) was going to solve a bunch of mysteries of the universe. And now, two decades later, it probably has. But none of them were the mysteries we were hoping for.

Random walks are still random. Strange attractors are still strange.

Which actually brings me to my big point about this book. I read it at the same time as Douglas Hofstadter's new book, and the two seem to have their own strange, loopy attractor, which is the word strange in the way they use it.

I like the word strange. The words "random", "chaos", "simple", "complex", and their friends have always bothered me. And for the record, Hofstadter says in his end-notes that I'm allowed to put the comma outside the quote marks in that last sentence, so la-di-frikkin-da, in the words of that immortal genius Chris Farley.

Strange (in terms of attractors, loops, quarks, etc.) means something particular, which is best described verbally by the word "strange" before them.

But on to the point that makes the book humbling.

Chaos theory was supposed to be awesome-er than it turned out to be. And we should all take that as a moral lesson when we're trying to figure out how awesome some New Kind of Science is. If you catch my drift.

Anyhow, good book, worth the three days and the fifteen bucks. I give it an arbitrary nine out of an arbitrary thirteen.

I am a Strange Loop

I haven't read Godel, Escher, Bach, but I'm sure going to.

I am a Strange Loop was casually brilliant, disarmingly humorous, bitingly critical, glaringly obvious, and luminously revolutionary. All at the same time.

Douglas Hofstadter is, from what I can tell, a blue blood and a wunderkind. He's got all sorts of examples in the book that read like Thurston Howell the Third describing golf, probably to the Professor, who is plenty smart to see his point, but requires a lot of explaining on some of the finer points.

Now, lest either term be taken derisively, I should clarify. I found most of his stories irritating (with the exception of the ones about his family, which nearly made me cry), and I suspect other people will as well. That being said, I also acknowledge the likelihood that minus any of those experiences, this book would have been less than it is.

The only one of his little tics I think the book could really have done without is the phrase "dear reader." It reads so much like John Bunyan's conclusion in the Pilgrim's Progress that I had a hard time choking it down. Dear writer, please stop!

Having laid out every one of my complaints, I'll now lavish praise in equal measure. This book offers a brilliant alternative to dualism. It's been lovingly set down by an author who is clearly passionate about his topic, and made me passionate as well.

I read the book in a week, though I suspect re-reading it may take a bit longer, I found myself unable to stop on this first reading. Truly a page-turner.

It made me want to go find everything Douglas Hofstadter has ever set down in pixels or paper, and to read it twice.

I give this book an arbitrary five stars out of an arbitrary five. Wow!

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]