I want a Tesla

According to data provided on this page, a Tesla Roadster requires about 177 Watt-hours to travel one mile. Assuming that on average, the efficiency of electricity generation in the US is 30%, the Tesla requires 2.1 MJ of primary energy to travel one mile (surely there is a dependence on velocity, but that information is not provided).

My Honda Element gets 24 miles to the gallon, so it requires 0.0417 gallons of gasoline per mile. One gallon of gasoline contains 131.9 MJ, so my car consumes 5.5 MJ of primary energy to travel one mile.

A conventional vehicle would have to get 62 miles per gallon to consume the same amount of primary energy per mile as the Tesla Roadster.

I drive about 17,000 miles per year. At 24 miles per gallon and fuel costs of $1.80 per gallon, I spend about $1,275 per year for gasoline.

An electric vehicle that requires 177 Wh per mile would use 3009 kWh to travel 17,000 miles. At 7.5 cents per kWh, that amount of electricity would cost $226 — about 17% of the cost of a gasoline-powered vehicle. I could save over $1000 per year.

However, a new Tesla costs $98,000 — which means the simple payback would be just shy of the century mark.

I’m tired of disaster porn

…Economic disaster porn, that is: articles full of gloomy statistics and jagged lines all trending downward. In their zeal to repudiate the irrational exuberance of the recent past, many writers seem focused exclusively (and obsessively) on bad news. It’s as if like jilted lovers, they seek to wallow in their grief.

The original of this graphic is said to have appeared in print with the caption “if the decline was fast, the recovery took a considerable time”. Apparently one is supposed to look at it, notice the similarity between the current downturn and the Great Depression, and say “hmmm, we’re in big trouble”.

Others have criticized the graph’s construction: the lack of a label on the y-axis, the arbitrary shifts in the scale of the x-axis. All of that is true, but there’s something even worse going on here. There is no theory behind the idea that “if the decline was fast, the recovery took a considerable time”. It’s just a graph someone put together and published because it looked scary. It’s disaster porn, pure and simple.

I’ve seen crap like this before. In the run-up to the big stock market boom, investment firms mailed out glossy brochures to convince investors that the good times were here to stay. “Sky’s the limit,” they all said. “Can you afford not to invest?” Back then the jagged lines were all trending upward. No way would they ever come back down, or so it seemed. But buried in amongst the hype, these brochures included at least one true statement — a disclaimer, probably put there to satisfy the lawyers: Past performance is not necessarily indicative of future results.

Does the fact that it took 22 years for the economy to come out of the Great Depression have any bearing at all on today’s situation? Who knows. There isn’t an economist alive who understands what’s going on in the current crisis, or who really knows what to do about it. But there’s one thing I’m certain of: by convincing people to ignore financial risks, pretty graphs and simplistic analyses played big a role in creating the mess we’re in. Why should we pay attention to them now?

Strange random number generator

A random number generator outputs a sequence of n random numbers {r1, r2, … , rn} from a uniform distribution on (0,1). This sequence can be used to define an integer p with n-1 binary digits according to the following algorithm:

     for (i in 1:(n-1))
        if (r[i+1] > r[i])
           then set bit i of p equal to 1
           else set bit i of p equal to 0

Let’s call p the pattern of the sequence. For example, the sequence {0.5703, 0.1617, 0.2629, 0.5404, 0.3860} has pattern 0110; the sequence {0.6441, 0.6715, 0.0802, 0.8980, 0.5447, 0.4748, 0.5214, 0.0110} has pattern 1010010. Since a set of size n corresponds to a pattern of n-1 binary digits, the number of possible patterns is 2n-1.

What does the distribution of p look like? For a fixed n, the probability that a set of n random numbers will correspond to a particular pattern p is given by:

(-1)^w \int_0^1 \int_{p_1}^{\tau_1} \int_{p_2}^{\tau_2} \cdots  \int_{p_{n-1}}^{\tau_{n-1}} d \tau_n d \tau_{n-1} \cdots d \tau_2 d \tau_1

where w is the Hamming weight of p (i.e., the number of 1s it contains).

Here is some Mathematica code to generate the distribution for a given value of n:

n = -1;
While[(n < 1) || (n > 12),
  n = Input["Enter number of binary digits: "]];
func = {1};
ProgressIndicator[Dynamic[pr], {1, n}]
For[i = 1, i ≤ n, i++,
  pr = i;
  fl = Integrate[func, {x, 0, x}];
  fr = Integrate[func, {x, x, 1}];
  func = Join[fl, fr];];
freq = Integrate[func, {x, 0, 1}];

Here is a barchart of the frequency distribution with n=6. The x-axis runs from 00000 to 11111.

The distribution is self-similar, which I guess makes it a fractal.

A Review of VMware Fusion

I use Parallels on my iMac at work, and have had a few problems with it: the display sometimes flickers when I’m running Windows, and once I lost the Windows partition altogether and had to reinstall. So when I purchased a new Mac mini for use at home, I decided to try VMware Fusion. I have not been disappointed.

Based on recommendations I read on the web, I chose to install Windows XP using BootCamp, then installed Fusion and set it to use the BootCamp partition. The main advantage to this arrangement is that the machine can be booted directly into Windows, bypassing Fusion altogether if need be. The disadvantage is that you cannot suspend a Windows session.

The manual warned that when installed this way, Windows would have to be reactivated the first time it was booted under Fusion. Although it was a bit scary to see XP “broken” — I had just paid $180 for it, after all — the reactivation process was relatively painless: I called Microsoft via a toll-free number and read the product code to their voice-recognition system. An automated voice read out a new code, which I copied down and entered into my computer. With this new code, Windows booted up without a hitch, and has been running well ever since.

My impression is that Windows “feels” snappier under Fusion than under Parallels — this despite the fact that I’m running Fusion on a mini, which is a slower machine than the iMac at work where I run Parallels. Fusion also seems to be more stable. Using it, I have never had Windows lock up, and there have been no problem with display flicker, regardless of whether I’m running Windows in full-screen mode or in a window. All in all, I think Fusion is a great product and worth the money. One of these days I may even decide to install a version of Linux on my mini.

Personality: nature or nurture?

It looks like “scientists” have finally discovered what every parent knows: that personality is something we’re born with. True, it can take a while for that personality to become evident: it’s difficult to get to know someone whose only interactions with the world are through screaming and crapping. But even before your child begins to talk, you discover the kind of person he or she is.

Again with the Shroud of Turin

Radiocarbon tests performed in 1988 showed that the cloth used in the Shroud of Turin was produced sometime in the 14th century. This is in keeping with the fact that the object makes its first appearance in the historical record in 1357, when the widow of the French knight Geoffroi de Charny had it displayed in a church at Lirey, France.

But according to Ray Rogers, a chemist from the Los Alamos National Laboratory in New Mexico who helped lead the 1988 study, the threads used for radiocarbon dating were unlike those in the rest of the shroud, and may have come from a repair made during the Middle Ages.

I am somewhat suspicious that the article in which I learned this is dated April 11, the day before Easter. TV specials about the shroud tend to get high ratings, and I suspect there is another one coming up.

Erika Hert of Science Blogs is skeptical too. In this post she provides an excellent background on the science of radiocarbon dating as it relates to the Shroud of Turin.

Baseball simulation

Interesting article in the Times the other day about using simulation to answer questions of strategy in baseball.

Under what conditions is bunting advantageous? When does trying to steal make sense, and when does it decrease the chances of scoring? Questions like these turn out to be ideally suited to computer programs through which millions of iterations can smooth out the peaks and valleys of randomness, and converge toward a reliable approximation.

They mention a simulation program called Diamond Mind that can be used to answer such questions.