Saturday, July 21, 2007

Time Machine

I first programmed a computer in 1977, when my best bud got a TRS-80. We had an enormous amount of fun doing this, and I owe a lot of what I do now to those days. We used the thing pretty much every day until around 1980, when he spilled a glass of orange juice on the keyboard, which is where the CPU and everything else lived.

A really neat simulator of the TRS-80 is available on the web, running as a Java Applet. So, essentially, a web page today can be what a computer was 30 years ago. You can enter and run programs in the window, which looks just like the screen of the TRS-80. I immediately wrote and ran a couple of programs I recall writing back then. It was weird, like seeing my own life simulated on a computer. Or like stepping out of a time machine. As non-descript as the TRS-80 was, it occupied a lot of mental and emotional real estate when I was 13.

One kind of funny point- the simulation runs considerably faster than the original computer did.

Thursday, July 12, 2007

Science has it all...

One of my enduring interests outside science is economics. I don't get jazzed about the stock market or exchange rates or GDP, though, which is what I used to think economics was all about until I took a fabulous Microeconomics course from Mel Borland at Western Kentucky University. I took it because I needed credits to graduate, and suspected that I would hate it less than alternatives. I loved the course, and I left the class a different human being than when I entered it.

Economics, as a social science, is about allocating resources, resources that are limited, in order to get the most out of them. The goal is to provide the most happiness, or utility, or whatever variable you decide to maximize, at the lowest cost in effort, dollars, etc. Economists in the US tend to measure things in dollars, but one can pick whatever one wishes as a basis. Dollars are just an abstraction, to quantify something that we tend to believe, with little justification, to be ineffable.

If you have ever heard of the philosophical construct 'universal acid', an acid that dissolves everything, you get a sense of how I felt when I first began to grok economics. While there is always some irrationality in human beings, analyzing actions of people (especially in groups) as rational actors, seeking to maximize gain for a given investment, is a tool so powerful that is is easy to become quite intoxicated by it. It transcends very quickly the problems about supplying widgets at a given price. It helps to understand human behavior. Buying stocks, choosing a mate, making life or death decisions, all involve this sort of calculus, and while social mores tend to obscure them, recognition of them is, to not put too fine a point on it, majestic.

It is really easy to fool yourself into thinking that you and everyone else just automatically understands this stuff. But when you find yourself thinking "There ought to be a law limiting what they charge for gasoline" you generally ignore the fact that price controls inevitably lead to shortages. Inevitably. Gasoline, apartments in New York, whatever. And price floors lead to surpluses. Inevitably. People will argue with you until they are blue in the face that the minimum wage will NOT cause unemployment, but that is generally because anyone conscious of the issues is already making much more than that, and has no direct experience.

Statistical shenannigans and outliers will be trotted out about minimum wage, because it has such a personal face, but if you substitute anything else- say, TV sets- and say "No one can sell a TV set for less than $250", would you be surprised that fewer were sold than when the price could, in fact, go lower? How much is it worth to greet people at the door at X-Mart? As soon as it isn't worth it, would you expect someone to pay for it?

There are also dangers in over-simplification, and I don't mean to pretend that Econ 101 explains everything, or that the world is not in need of lots of serious reform. But Physics 101 doesn't, either, but someone with that level of knowledge is still miles ahead of someone who lacks it. Economics is like physics- fairness and gravity are unrelated, as are fairness and what people actually do. Not what they say they do, mind you, but what they in fact do. The most sublime bridge or skyscraper must ultimately bow to the laws set out in basic physics, or tumble to the ground. Similarly, basic econ knowledge can act as a preliminary 'bullshit detector' when considering what some cobra/politician is suggesting.

Econ gets obscured in the news, largely because reportage is unburdened by even the mildest familiarity with basic econ. But there are a handful of great books available to the interest layperson. Some of my favorites are David Friedman's Hidden Order: The Economics of Everyday Life, The Undercover Economist by Tim Harford, and Freakonomics by Levitt and Dubner, though Freakonomics is probably as much sociology as econ. Harford's book is especially recommended, especially if you have ever wondered why Africa stays poor no matter how much money we pour into it. (I apologize for the lack of links. Blogger pukes when I try to insert an Amazon link, and I am not in the mood to figure out how to do it by hand.)

Not only is economics pretty much understood, it can be pretty unloved, too. Bjorn Lomberg is a statistician/economist who is completely in agreement with Global Warming theory. He is convinced the world is warming, and he is convinced humankind is responsible. But his book, The Skeptical Environmentalist, committed the faux pas of considering how our (limited) resources could be spent in mitigating all of humanity's problems, not just AGW. And his contention is that Kyoto (for instance) would do almost nothing, but would consume so much money that things like disease control, hunger, poverty, the lack of clean drinking water, etc. would need to be forgotten. At the same time, he calculates (and not just him- see the Copenhagen Consensus for more details. Denmark is not exactly a neocon hotbed) that we could pay to solve all these other problems and adapt to global warming with the same money that would have no real chance to stop global warming. Bjorn excites a lot of passion, which is unfortunate, because people see environmental issues as proxies for left/right political issues, and ignore the data.

This sort of thing brings me back to reality. Physical science, at least at the hard edges of physics and chemistry, generally will yield a definitive answer, given time, money, luck, and careful experiments. Econ, not so much. I am reminded of the words of the great sage, Principal Skinner from the Simpsons:
Ah, there's nothing more exciting than science. You get all
the fun of sitting still, being quiet, writing down numbers,
paying attention... Science has it all.

Wednesday, July 11, 2007


In his July 1, 2007, New York Times Op-Ed piece, "Moving Beyond Kyoto," Al Gore states:

Consider this tale of two planets. Earth and Venus are almost exactly the same size, and have almost exactly the same amount of carbon. The difference is that most of the carbon on Earth is in the ground - having been deposited there by various forms of life over the last 600 million years - and most of the carbon on Venus is in the atmosphere.

As a result, while the average temperature on Earth is a pleasant 59 degrees, the average temperature on Venus is 867 degrees. True, Venus is closer to the Sun than we are, but the fault is not in our star; Venus is three times hotter on average than Mercury, which is right next to the Sun. It's the carbon dioxide.

OK, look: I think Al Gore might have gotten the shaft in the 2000 election. I will give him the benefit of the doubt on the political end of Global Warming. I think he wants to do right by the planet. He is a smart guy.

But to compare Earth and Venus- Earth with less than 0.04% of its atmosphere carbon dioxide, and Venus, with an atmosphere that is 96% carbon dioxide- and to think that this comparison is relevant must be the product of abject contempt for his audience, or downright stupidity on his part.

The fishy part isn't the plain statement of fact, about the distribution of carbon. By comparing the two, though, he implies that Venus is somehow a model of how Earth could be. First, it isn't just carbon dioxide- Venus' atmospheric pressure is 90 times that of Earth, and this huge density difference matters a lot. With the projected doubling of CO2 that might happen by 2100, we'd still have less than a tenth of a percent CO2.

Gore's statement that the relative position of Earth and Venus isn't important is also suspect. It is thought that the boiling off of early Venusian seas might be responsible for the accumulation of CO2 in the atmosphere.

As nitpicking as it might seem to bitch about these points, there is something well worth bitching about: if you want to make scientific arguments, make sense. Don't overstate any effect, oversell any model, or overstate certainty. Don't hesitate-no, rather rush headfirst- to admit deficiencies, error bars, and confusion.

My darkest fear is that he knows that this is crap, but thinks that it sounds like it would be effective. As a scientist, I am offended by that thought, though I don't accuse him of it. I just fear it.

The really irksome thing to me is that I hear people beginning to conflate Al Gore with the science itself. To criticize Gore is to commit a moral wrong, equivalent to not believing 2+2=4. Well, bull-fucking-shit. One can argue that Gore is right and virtuous to lead the fight against Global Warming, to which I say, OK. But if he gets scientific things wrong, then I owe him nothing but criticism of the science.

Shrinking from direct engagement of skeptics is troubling, I think, since the data and models ought to be such that anyone properly trained can examine the data and models, and deduce the same things. But the protestation that the science must be accepted is just the thin film over something else entirely. The subtext is that the regular folks will be lulled into thinking that there is nothing to worry about, if the uncertainty is revealed. So the disbelievers have to be silenced.

The Tobacco companies are always trotted out as examples of evil, misplaced skepticism, as sowers of uncertainty and discord, as deniers. The problem with this analogy is that Big Tobacco was not beaten down by ignoring the uncertainties in the scientific study of tobacco's health effects. To the contrary, the battle was won by continuing until the evidence was overwhelming.

The much bigger worry is that people will be cowed into believing something that requires a radical response on thin evidence, and will concomitantly be brow-beaten into acting before proper cost-benefit analysis can be performed.

This last point may be lost on politicians (and non-scientists in general). Things like relativity, or evolution, or plate tectonics, do not spring fully formed, with all the details worked out, from the scientific community. Things have to be figured out. If you follow climate science, which I do only as a spectator, you can see that despite the general picture of GW being figured out, the details are very much in flux.

It is damned rare that even good understanding of problems leads, smoothly, into public policy. I, for one, am delighted that there isn't a yearly malaria epidemic in the US. That DDT was used willy-nilly to get to this point inspires less delight. The trade offs necessary to achieve huge goals are often ugly, akin to warfare. This isn't the sort of thing that I want to be driven by half-assed science.

Appeals to scientific consensus are even more misleading, and horrific, than even goofy or misleading scientific analogies.

Consensus, indeed! For scientific revolutions to occur, after all, the consensus must be, at some point, dead wrong. It takes a while to get fairly accessible, well defined problems figured out. Climate is neither accessible nor well-defined, and the best models going ignore things like clouds and aerosols. So when Gore or the like says "the science is settled", I don't hear bright peals of scientific enlightenment. I hear the crackle of kindling, ready to burn the heretics.

Oh, and Live Earth sucked. Or so I read, because neither I nor anyone I know (a group that includes more than one rather fearsome greenie) saw any of it. I don't owe anyone any fealty for good intentions culturally any more than I do scientifically. Watching Madonna was something I last did in the early nineties, and not on purpose then.

Saturday, July 07, 2007

Gorgeous Tiny Chicken Machine Show

Has anybody else seen this?

I like it, but I am uncomfortable with it all the same. Not 'uncomfortable' meaning 'back off me with that shit', which is how I would describe how people use scare-quote "uncomfortable" in my native tongue. Or they say that they're "not OK with that", a construction so pinched and constipated I tend to forget that people actually say it. I think I might even say it by accident, occasionally, when someone else in my group says it. Apparently, the pack instinct overrules the more lately evolved sense of grammatical propriety. Hypocrisy, perhaps, comes naturally to us when we try to get along with one another. It's a social lubricant. As is overlooking it.

No, I mean it makes my skin crawl- not the show, but my inability to identify what I find compelling in it. Perhaps it is the multi-reflective nature of the comedy. Are we making fun of Japanese people (I don't think so) or are we poking fun at their picking up tidbits of American culture and making them something and misunderstanding them? That doesn't seem right, either, but as the complexity or subtlety of the explanation increases, I'm going to be less certain.

I'm a Nipponophile. No, I don't mean I dig Japanese women. At least not exclusively. I mean that I find a lot of Japanese culture compelling. Samurai and ninjas alone would have made them one of my favorites. Zen. Stuff westerners like to appropriate and use inappropriately (at least from the point of view of the originators of the culture). I know I do. Samurai rock. As do ninja. And Zen monks. A zen monk samurai ninja...

I've seen Japanese television a few times, so part of my impressions of Japanese culture is based, inevitably, on my unfamiliarity with how they roll in Japan. Just after my wife had our first kid, we lived in an apartment that came with satellite TV service. It just so happened. We never knew until we moved in.

Each day, for some short time (which I never bothered to measure- on the order of 1 hour) we got Japanese news followed by a japanese entertainment program. They were always incomprensible to me; sometime staid, sometimes frenetic. Despite my lack of understanding, I found it riveting. I didn't understand why. This is sort of a pattern.

I often encounter things that I find impenetrable. Certain parts of physics and mathematics have proven to be like that. Lots of art and music as well. In art and music, I can find accessible background to help me understand what people are up to. The same is true of science and math, too.

Sunday, July 01, 2007

Java for Chemists (and other ne'er-do-wells)

I am starting a series to introduce Java programming on another blog. I hope that I can interest science students in this- Java has become a very powerful tool for scientists because it can be used at a high enough level of abstraction that many of the low-level details usually involved in programming can be ignored. There is a performance penalty for this, but for most people not in the business of writing software for a living, this trade off is well worth it.

I am not an expert at Java. I have been programming in C and C++ for almost 20 years, though, and I know how unrewarding these can be for someone who is interested in just sitting down and getting the computer to do something, and who doesn't want to get lost in a dense thicket of details. Projects that were at the outer edge of my abilities in C++ were doable with a couple of months of experience with Java programming. It is tempting to think that this is because I had a lot of experience with C and C++. I think that this may have helped a tiny bit. But a lot of the magic of Java is that it takes care of many things that cause major hair-pulling in these other languages. If you don't know what I'm talking about, be glad. The kind of crap that one has to deal with in C and C++ is one of the reasons that most people don't think of them as part of their toolbox. Java offers most of the power and performance of these, with far, far less hassle. It says something about Java that I am willing to present it to others with less than a year's worth of experience. I won't make anyone a computer scientist, but I can help scientists get some really cool things done with their computer.

My aim is not to convert anyone to the First Church of Java. I aim to present Java as a tool for scientists and technical people, and I hope to do so with interesting and fun examples, with games as well as with simulations rich enough to offer a little insight into physical processes. I will not be exhaustive- there are many fine tutorials available, free of charge on the web, that do the job far better than I can, and I will refer to these with abandon. My job will be to hand-hold a little, point to information of value, and to show what can be done with a surprisingly small amount of effort.