Elizabeth Pisani, The Wisdom of Whores: Bureaucrats, Brothels, and the Business of AIDS

slaniel | Wisdom of Whores, The: Bureaucrats, Brothels, and the B | Monday, June 23rd, 2008

Cover of _Wisdom of Whores_: stereotypical 'gritty city street' background with red lights reflecting off the wet blacktop'; title and author's name in some 'gritty' font The subtitle certainly captures what this book is about more than Patent Failure‘s did. For sheer accuracy of synopsis, maybe the subtitle ought to be “Practical Epidemiology, What We Know About Solving the AIDS Crisis, and How the Politics of International Aid Complicate Matters.” Though Pisani probably wants to sell a copy or two.

The Wisdom of Whores is one of the few books I’ve read that actually lives up to the jacket blurbs. One author describes it as not only a work of science, but also a page-turner. And indeed it is. Pisani holds a Ph.D. in epidemiology, and you can tell from reading The Wisdom of Whores that she has the chops to do serious data analysis. It’s data analysis in the service of a practical end, namely figuring out the most efficient ways to stop AIDS. Pisani has been on the ground interviewing prostitutes and junkies for a couple decades now, so she’s learned a bit about how the disease actually spreads.

Part of the answer is just common sense: HIV spreads when an infected person’s blood comes in contact with an uninfected person’s blood. When heroin users share needles, the risk of HIV’s spreading rises. Unprotected sex is riskier than protected sex. Unlubricated sex is riskier than lubricated sex, because the risk of causing tears is higher. Uncircumcised men are at higher risk than circumcised men. Prostitutes and their johns are at higher risk than non-prostitutes, because they have more partners.

This much should be common sense; the fact that this common sense often doesn’t translate into policy is where the “bureaucrats” in the subtitle come in. The Bush administration and many other nations have changed the conversation: we don’t talk about the actual mechanics of sex and drug use, in part because prostitutes and drug users are considered wicked, and it helps no politicians to aid the wicked. From a public-health perspective, most of our effort ought to be focused on the populations that are most at risk: addicts, gay people, and prostitutes. But that doesn’t sell. What sells is to talk about “neutral” topics: pretend that consumers of prostitution come home to their innocent wives and unwittingly give them the disease, which then spreads to their kids. When you frame the issue as “AIDS hits everyone,” surely you can get votes. Likewise with international aid: if you tell your voters that “poverty and gender disparities” cause AIDS, you can sidestep the icky topics of sex and heroin injection.

Once the money flows, there’s a great risk of corruption and waste. Fortunately, Pisani tells us, there are a lot of people on the receiving end of that money who are really trying to do right by the world’s taxpayers. And there are organizations like the Bill and Melinda Gates Foundation that seem to disburse funds more efficiently and measure programs’ effectiveness better than a lot of governments do. And the governments are learning from their mistakes, in no small part because the epidemiologists on the ground are pushing back on them. Pisani never takes the step that a lot of libertarian fanatics do, namely jumping from the observation that foreign aid can be wasteful to the conclusion that all foreign aid should end. That’s because Pisani isn’t a libertarian fanatic. She’s a hardworking, nose-in-the-details scientist who, like a good disciple of Herb Simon, tries to assume as little as she can before she starts gathering data.

Indeed, the big takeaway from The Wisdom of Whores is that reality is complicated, and that the only way to actually help solve the AIDS epidemic is to dig into the details and be honest about how the disease actually spreads. Don’t let ideology, for instance, blind you to the virtues of free condom distribution. Don’t let ideology stop needle-exchange programs. At the same time, don’t let ideology convince you that needle-exchange programs always work: look at the data first. This book is what happens when a truly scientific worldview merges with the passion of an activist.

Thanks to Alex Tabarrok for recommending this book, and thanks to Chris Blattman for picking up Tabarrok’s recommendation. I heart the web.

The MBTA this weekend

slaniel | MBTA | Saturday, June 21st, 2008

Anyone who happens to be in Boston this weekend and is not familiar with how the subways work, would be well-advised to note the following: the T will not be going over the Longfellow Bridge that connects Cambridge (in the MIT area) with Boston (near Beacon Hill). They will be running buses between Kendall/MIT and Park Street.

What this means is that you just basically shouldn’t be taking the red line if you’re under any time pressure, or if you’re carrying any heavy bags with you: you’ll get on the red line, get off at Park, walk outside (up several flights of stairs), get on a bus, take it for 10-15 minutes, get off at Kendall, lug your bag down some more stairs, and take the red line to your destination.

See, for instance, directions from my house to the Clear Flour bakery in Brookline (where I’ll be meeting a friend shortly). It says that the trip takes 48 minutes. That is false. It may take 48 minutes regularly; that’s with a perfectly functioning red line. Without such a red line, it’ll take closer to an hour an a quarter or an hour and a half. The walking distance between those two points is 2.2 miles, which I can cover in about 40 minutes.

Moral: taxis or walking are your friends this weekend.

This has been a public-service announcement from me, Steve Laniel.

Antibiotics Horrorshow

slaniel | My Life and My Friends | Friday, June 20th, 2008

Quick synopsis of my bacterial experiences of late:

  • Got a tooth removed and braces put on on May 31.

  • Was supposed to go to a friend’s wedding in deepest Virginia on June 1. Ended up instead confined to bed for 24 hours after developing an infection during the aforementioned dental love.

  • Stayed on penicillin for 10 days, more or less, after June 1.

  • Ended the penicillin, developed an ear infection, went on ofloxacin for that. (Next step after penicillin. Normally I think cipro is that second step; for whatever reason, my doctor didn’t choose that.)

Well, wouldn’t you know it: 1% to 3% of ofloxacin patients develop nervousness and/or sleep disorders. Which is precisely what happened to me: I’ve been nervous and sleepless for a few days now. The anxiety has been so bad that it’s prevented me from running: I tried my now-standard three-mile loop, but couldn’t do it: my body felt rubbery, and I was shaking far too much. And also sweating way more than normal. As a generally non-anxious person, this was vexing to me.

So today I switched, on the doctor’s recommendation, to azithromycin. A bit of reading suggests that nervousness and so forth are unlikely. I hope to god so. I also just hope to be off meds Real Soon Now.

The tiniest shred of silver lining in today’s sham FISA “compromise”

slaniel | Foreign Intelligence Surveillance Act and its routine v | Friday, June 20th, 2008

Amidst the awfulness of today’s FISA decision (Greenwald’s synopsis is as good a place as any to read about our national shame), I take solace in one fact: every blessed member of the Massachusetts delegation — all ten — voted against the “compromise”.

A coworker pointed out that in the 1972 presidential election, where Richard Nixon destroyed George McGovern … well, I need to let the Wikipedia image (cached) speak for itself.

Another coworker chimed in that California, New England and New York should secede and form their own awesome country. That sounds about right.

Salman Rushdie, The Enchantress of Florence

slaniel | Enchantress of Florence, The | Monday, June 16th, 2008

Cover of _The Enchantress of Florence_: beautiful script on an orange-and-gold background. In the background is also a beautiful woman, perhaps reclining regally, with her arms crossed above her head Rushdie has often been torn between two opposing interests. On the one hand, he often has a moral that he wants to impart. Midnight's Children was about the dissolution and insanity of India; Shalimar the Clown was an overwrought, heartbroken thing about Kashmir; The Moor's Last Sigh was an impassioned story of a writer on the run from a death sentence — an obvious allusion to the price that the government of Iran had put on his head. (That death sentence was, itself, in retaliation for The Satanic Verses, which is Rushdie’s worst novel. If you’re going to be sentenced to death, I say, be sentenced to death for a great work of art.) On the other side, he wants to just tell a good story, with or without a moral.

Sometimes, like in the case of The Satanic Verses — and to an extent in Midnight's Children — Rushdie loses all discipline. He’s self-consciously creating a phantasmagoria, which is the danger of someone who writes in the magical-realist tradition of García Márquez: rather than injecting bits of magic into the daily lives of your characters, sometimes you dive off the deep end and create a work of fiction that really wants to be a fantasy work. This was the trouble in The Satanic Verses. Finally, Rushdie sometimes wants to paint the world as a carnival, and the brushstrokes lose all control. (Think here of the films of Federico Fellini.) Midnight's Children almost suffered from this, but Rushdie reined it in.

All of which is prologue to The Moor's Last Sigh and The Enchantress of Florence. These are Rushdie’s masterworks. They inject fantasy where it’s necessary, tell a captivating story, keep Rushdie’s frenetic intelligence in check, and never let a moral overpower the novel’s own momentum.

Structurally, the story is similar to the 1001 Arabian Nights, though it doesn’t recurse as deeply as the Arabian Nights does. The story begins at a beautiful oasis of a city, presided over by an emperor who — at least according to his PR — possesses all the virtues and none of the faults of ordinary mortals. He is the living Truth itself. He refers to himself as “We,” inasmuch as he embodies the people themselves.

Into this city, and directly to this grand emperor, comes our hero (sort of — remember that there are stories within stories, so there are several heroes) with a vast secret to tell. He’s a magician of sorts, wearing a strange coat in which endless objects can hide. Where has this strange man come from? What does he have to tell the emperor? How will he get through the many walls surrounding His Majesty?

This is the stuff of great fun. I don’t think I’m giving away much if I tell you that he does make it through to the emperor, through the use of magical potions of a special sort. Every time Rushdie could stop and tell a little story — say, about how the potions were made, or what they contain — he does, and each time he does I got tickled. These are terrific stories.

Our hero himself has a story to tell the emperor. That story constitutes more or less the entire book. Most of the time we forget that we’re inside the inner stories; Rushdie has wrapped us up completely within it. The inner story is where we hear about the character in the title: the Enchantress is the most beautiful woman in the world, the most beautiful woman anyone has ever seen or ever will see. Her mere presence causes otherwise stoic men to fall to their knees and either pray for her or pray for themselves (even the men themselves aren’t clear which it is).

And so forth. The storytelling here is without peer. Knights with skin as white as death, court intrigues, epic battles … this is a throwback to an earlier kind of storytelling, and what a skilled throwback it is.

At the same time, it’s a history piece. The grand emperor with whom we started is Akbar the Great (which, Rushdie reminds us, is redundant: “Akbar,” or some part of it, means “great”). Akbar’s ancestors, it turns out, were connected in various ways with Niccolò Machiavelli and Sandro Botticelli and Amerigo Vespucci. Did these connections actually happen? How about the court intrigues: were there any parallels to them in the real Ottoman Empire? There’s material enough in the historical bits alone to fuel research for years; Rushdie himself must have spent years just on that part. It’s great fun.

Then there’s the meta part of The Enchantress of Florence — the part that deals with the power of storytelling itself. We learn early on, for instance, that Akbar has brought a queen into existence using only his mind. His force of will is such that she becomes real, and the city eventually sees her as well. When Akbar leaves on a military campaign, he returns to hear his queen relate what has gone on in his absence. He makes love with his imaginary queen. (The creation of a real living human from sheer force of will is, I suspect, a hat tip to Calvino’s Nonexistent Knight. Rushdie does cite Calvino’s Italian Folktales collection in the bibliography, for what it’s worth.) This idea recurs throughout The Enchantress of Florence, but again: never enough to get in the way of the story itself, which is magical without being fantasy.

The Enchantress of Florence is a treasure.

Initial thought on Rushdie’s Enchantress of Florence

slaniel | Enchantress of Florence, The | Saturday, June 14th, 2008

If this book keeps going the way it’s been going, it will be the best Rushdie book I’ve ever read. It will combine the best of the 1001 Arabian Nights, Philip Roth’s Operation Shylock, Rushdie’s earlier The Moor's Last Sigh, and Gabriel García Márquez’s Love In The Time Of Cholera. It will be a masterpiece.

I worry. Rushdie’s book Shalimar the Clown was a tremendous disappointment (from the beginning, actually, if memory serves). Roth’s Plot Against America started with his standard effortlessly brilliant character portrayal, then didn’t have the courage of its convictions and unraveled into a happy story that the rest of the book never justified. And don’t get me started on Jonathan Safran Foer’s Everything is Illuminated, the It book of 2002, which starts hilariously and just collapses by the time it’s done. (I may be one of only two people in the world who think this, along with my friend Liz. We comprise a majority of two.)

So my fingers are crossed that it will live up to its promise. If it does, it is a jewel.

Identifying a number as the difference of two squares

slaniel | Mathematics | Thursday, June 12th, 2008

Imagine I have some number n that I’d like to factor, or whose primality I’d like to test. If I can show that n is the difference of two squares, then I’m done: if n = a2-b2, then n = (a-b)(a+b).

Determining whether a number is the sum of two squares is straightforward. Suppose I want to figure out whether 111 is the sum of two squares. Start with the smallest square, namely 1. If 111 is the sum of two squares, one of which is 1, then the other must be 110. 110′s not a square, so continue: try 4+107. Then 9+102, 16+95, 25+86, 36+75, 49+62, 64+47,81+30, and 100+11. None of the second numbers in those added pairs are squares, so we conclude that 111 is not the sum of two squares.

Figuring out whether a number is the difference of two squares is harder. Let’s use the same example: is 111 the difference of two squares? You need to start with some number larger than 111. Pick the least square larger than 111, namely 121. 111=121-10, and 10 is not a square, so we move on to 144: 111=144-33, and 33 is not a square. So we move on to 225: 111=225-114, and 114 is not a square.

And so on. This process can continue forever, each time with a larger candidate for squaredom on the right side of the minus sign. It might never terminate.

Is there some clever way I’m not thinking of to detect whether a number is the difference of two squares?

Richard A. Posner, How Judges Think

slaniel | How Judges Think | Wednesday, June 11th, 2008

Cover of _How Judges Think_: Posner's name in white text on a black background, and the book's title in black text on a white background.I started out wanting to hate this book, but as it turns out I think that most people with an engineering cast of mind will love it: like a good engineer, Posner wants to take apart problems, see what makes them tick, and find solutions. Barring that, he’s content to clear away intellectual dross; if he has to be rather short about it, too bad. He’ll tear your arguments apart, but at least he’s eloquent about it.

Not all arrogant men deserve to be; in fact most don’t. Fortunately for Posner, he’s a Seventh Circuit Court of Appeals judge, founder of a major legal school of thought (namely “law and economics”), reframer of much of American antitrust law, and remarkably prolific besides: by a quick count, Posner is the author of two score books over the past few decades. This is the man whom Yale law professor Jack Balkin advocated for the Supreme Court (while acknowledging that “It’ll never happen”) before Bush nominated John Roberts.

Posner does, however, have a habit of being rather unfair. I continually go back to his description of behavioral economics, a subject which by now I know rather well:

Behavioral economics is defined by its subject rather than by its method and its subject is merely the set of phenomena that rational-choice models (or at least the simplest of them) do not explain. It would not be surprising if many of these phenomena turned out to be unrelated to each other, just as the set of things that are not edible by man include stones, toadstools, thunderclaps, and the Pythagorean theorem.

The man is cold. Fortunately for the reader, it is this icy wit that makes reading Posner’s books such a joy. Watch how he rips into inconsistencies:

In discussing a case that invalidated the exclusion of homosexuals from the military, Beatty approvingly remarks that the court “noted the lack of ‘concrete’ and ‘actual or significant’ evidence that allowing gay men to enlist in the armed forces would prejudice its morale, fighting power, or operational effectiveness in any way.” He does not require that there be “concrete” and “actual or significant” evidence that homosexuals are harmed by the exclusion. Nor is he bothered by a lack of concreteness when he says that “laws that establish a broadcasting spectrum [must] guarantee that the full spectrum of opinion in the community will be heard.” What is “the full spectrum” of opinion, and who is to decide? Must every lunatic have access to a broadcast studio? Beatty contends that government has a constitutional duty to subsidize religious schools but “may make funding conditional on religious schools agreeing to teach the same curriculum that is used in state-run schools.” If the curriculum is identical, in what sense are they religious schools?

(internal footnotes omitted)

The point, here as elsewhere in How Judges Think, is to drive a spear into the side of judicial and scholarly hypocrisy. The particular target here, Beatty, is no more or less hypocritical than the rest of us: judges and legal scholars, as much as anyone, pretend that their opinions are more than just opinions. Judges — especially Supreme Court Justices — have a fancy term for this, which we as Americans have come to sanctify as The One True Way Of Judging. The fancy term is ‘textualism’ or ‘originalism’ or (as Posner calls it) ‘legalism.’ Legalism is meant to keep the judges out of judging: they’re supposed to read the facts of the case, read the relevant precedents, read the text of any relevant statutes, maybe read the legislative history, then decide the case syllogistically. A judge becomes an automaton lacking independent will. This is supposed to keep politics out of the court, and keep us closer to the ideal of “a nation of laws, not men.” The law, after all, shouldn’t depend on who’s enforcing it. This isn’t the way actual judges or actual courts work, says Posner; he spends the next 350 pages crisply and efficiently taking down any number of legalist conceptions of judging. He replaces them with his own description of how judging actually works.

Judges also don’t spend much time at all deliberating — at least not in groups. A judge may be internally conflicted over a case, and at times he may actually change his mind on the basis of what others say. But not normally. Normally — like poor Mr. Beatty, above — he’s either deliberately or subconsciously deploying judicial reasoning, or the appearance of judicial reasoning, in the service of what he already believes to be true. The ultimate source of judicial opinion is emotion: the race you were born into, the economic class you inhabit, whether you worked as a prosecutor or a defense attorney before you reached the Court.

If judges find sophisticated-sounding justifications for conclusions that they reached at the start, what’s to stop them from running totally off the rails? Why can’t a judge say whatever he wants? Here Posner walks through the range of ‘judges’ — from paid arbitrators through Federal appellate-court judges, all the way to the Supreme Court. An arbitrator has certain economic motivations: if he’s known as thorough and unbiased, he’ll get more business; if he tends to land on compromises that make both sides happy, he’ll get still more. District court judges are subject to review by the appellate courts. Federal appellate judges have life tenure, insulating them from public opinion — but they’re subject to review by the Supreme Court. Supreme Court Justices themselves have a cushy job with limited caseloads and no possibility of review. So where do Supreme Court justices get their constraints? The public: if the Court veers too far into cloud cuckoo land, it can expect that the people will revolt and clamor for overriding legislation. The Supreme Court still has constraints.

Judges are “constrained pragmatists,” in Posner’s terminology. They must choose among conflicting interpretations of the common-law and statute history; a pragmatist chooses by considering the consequences of each interpretation in the light of the law’s intent, if not its wording. A pragmatic judge doesn’t get overly bogged down in the words of the law, when those words are an imperfect guide to what the law was supposed to achieve. This sounds similar to objectives-based regulation: specify the outcome and the intent, and focus less on the implementation. The realization behind this is that society changes quickly, and laws that fixate on the present moment’s circumstances will quickly become obsolete.

This was the weakest part of Posner’s argument: legislation, says Posner, moves more slowly than the courts do, so it’s natural to place some of the burden of its interpretation on the courts. The process of amending the Constitution is tortuous, but Posner never makes it clear why this is a bad thing, or whether legislators actually desire to make the judicial branch a second branch of execution. We already have a president who overrules legislation via signing statements; do we really need another branch that overrules via loose construction?

Posner’s argument isn’t absurd. Even pragmatist judges operate under constraints, after all: if they strike down perfectly constitutional legislation, remedies up to impeachment are theoretically available. And the public has been trained to be on the lookout for ‘activist judges’. But to base a large part of the argument for pragmatism on a bare assertion that “it works out better that way for everyone” is odd.

His analyses of how a pragmatist would resolve any number of cases are fascinating. Take the Kelo case, for instance, which allowed the city of New London, Connecticut to seize land by eminent domain for private development. A pragmatist assesses a claim of eminent domain by looking at the original intent of the law, and the economic consequences of granting or withholding the seizure right. The original intent, says Posner, was to prevent individual people from holding a big public-works project hostage: if I’m building a several-thousand-mile-long road, everyone in its path knows that their cooperation is vital. They have, in other words, something like monopoly power, and they can demand exorbitant sale prices for their land. If there’s no danger of “holdouts,” as these are called, there’s no reason to grant the state eminent domain. Moreover, a pragmatist would examine the consequences of granting eminent domain in these cases, would realize that the market is better able to assign just compensation to land sales than the state itself is, and would in effect hand the case over to the market for resolution.

A pragmatist judge, it seems to me, is expected to exercise remarkable foresight. Not only must he know enough about the common and statute law to genuflect appropriately at the law’s majesty, but now he must also be able to guess the long-term consequences of a particular taking. This means he must be rather thoroughly educated in economics and statistics. Posner might reply here that it’s six of one, half-dozen of another: a non-pragmatist judge only has to convert his gut feelings into the language of precedent, but the outcome of this simpler process is decidedly worse than what a pragmatist — with his wider scope — comes up with. If I have Posner right, there’s little evidence for this claim in How Judges Think. Indeed, Posner repeatedly critiques judges for a lack of interest or skill in the exact sciences. So what’s to make us think that an unschooled pragmatist judge would come up with better decisions overall? Maybe “unschooled pragmatist” is a contradiction in terms?

This reliance on economics, statistics, and science makes it all the more jarring when Posner throws down bare assertions — as, for instance, when he asserts (p. 306) that the “total misery of the wrongly convicted was not lessened” when the Court increased the rights of criminal defendants in the ’60′s. Total misery decreases if the average wrongly convicted defendant spends less time in jail, or if fewer people are wrongly convicted to begin with. Posner asserts (with evidence) that defendants spent more time in jail after the ’60′s, in part because of a legislative backlash against the courts. (It could also be because violent crime increased. Posner himself doesn’t engage in much convincing heavy-duty statistical analysis, though he cites plenty.) For his claim to hold, he has to show that the probability of wrongful conviction didn’t fall enough to compensate for increased jail time. This he does not do. In general, the pretensions of “a sect of academics who want to use their facility with the differential calculus to impose … hegemonic domination over social science” invite skepticism during their falls from the empiricist wagon.

One final note from Posner that I found especially interesting: academics, he says, have grown increasingly distant from the actual practice of judging. One consequence is that law students learn the very artificial academic view of how judicial decisions are made. Law students, in a word, are trained to be legalists. They come to expect that judges are the automata they read about in class. Students learn that if they want to convince judges of anything, all they need to do is read a long litany of precedent; the judge will be forced, through logic alone, to accept their conclusions. They import this conceit into the courtroom and get nowhere with it. If legal academia were more in line with how judging actually worked, law students would learn to address judges pragmatically. As it is, even a decorated legal scholar like Larry Lessig — a man who clerked for Scalia and Posner, in fact — didn’t understand quite how to talk to Supremes:

“Here was a case [ Eldred v. Ashcroft ] that pitted all the money in the world against reasoning. And here was the last naïve law professor, scouring the pages, looking for reasoning.”

Languages that can express only truths

slaniel | Mathematics | Wednesday, June 11th, 2008

Suppose you wanted to create a language in which all sentences that could be spoken would be true. For the sake of concreteness, imagine this is a formal logical language using the logical operators AND, OR, NOT, XOR and so forth. Logical operators on their own don’t do anything; they only construct new sentences out of old ones. So to get this language started, you need a set of atomic sentences — call them A, B, C, etc. Each of the atomic sentences is, by definition, true. So maybe, for instance, “one object is drawn toward another object at a rate proportional to the product of their masses and inversely proportional to the square of the distance between them” is an atomic sentence. Or maybe it’s something from the theory of relativity. Obviously what we pick for atomic sentences is important. Among other things, where do they come from? Physics? Math? Let’s leave this question to one side; it opens a whole bag of worms, and isn’t really related to what I’m after.

So we have a set of atomic sentences. Now we need to pick which logical operators we’re allowed to use to assemble the atomic sentences into other sentences. We’re not allowed to use the NOT operator: if A is an atomic sentence, NOT-A is false, and false sentences are not allowed. Likewise, XOR is inadmissible: A XOR B is false for any true sentences A and B. So exclude any binary operator which could possibly take two true inputs and return false. Likewise for unary operators.

The set of sentences that can be spoken in this language is clearly much smaller than the set of sentences in ordinary logic (my schooling in logic is meagre; I don’t know whether “ordinary logic” means propositional logic, or the predicate calculus, or what; forgive me). My question is: how small? It’s clear that this restricted language is self-consistent: to prove that it’s consistent, you need to show that the sentences A and NOT-A cannot both be derived. Since NOT-A cannot, by construction, be derived at all, our system is trivially consistent.

Is it too weak, though, to do any interesting work? I mentioned this system to my friend Seth a while back, translated into the language of computers. Instead of ‘operator’, use ‘gate’. So you’re allowed AND gates and OR gates, but not XOR, NOT, or NOR. Can a computer constructed only with this restricted set of gates do anything interesting? Seth’s response, which I don’t have the engineering background to totally grok as yet, is that latches and flip-flops would be impossible to construct without some type of negation gate. Without those, you couldn’t (I also don’t get this part yet) build any kind of memory. So your computer would be restricted to stateless operation, I guess. I’m curious

  1. If I summarized that ‘stateless’ part correctly, and
  2. what the mathematical parallel to an absence of computer memory is.

Starting all VMWare instances at once

slaniel | VMWare | Tuesday, June 10th, 2008

This will be old news to at least one of you. If you run VMWare Server (i.e., not ESX), and you have a bunch of virtual machines, you can reboot all of them at once without having to open up the VMWare Console (the Console being somewhat irritating for me, because I have a randomly-generated password for my Console account that I always have to look up). You can use the vmware-cmd command:

vmware-cmd -l | xargs -i vmware-cmd '{}' start

The full vmware-cmd manpage is below, just because.

(more…)

Paper request: “Coronary artery disease in combat casualties in Vietnam”

slaniel | Health | Tuesday, June 10th, 2008

A coworker today told me about a fascinating-sounding paper:

“Coronary artery disease in combat casualties in Vietnam” JAMA, Vol. 216, Issue 7, 1185-1187, May 17, 1971

The idea seems to be that, as part of routine autopsies during the Vietnam War, doctors found high rates of arteriosclerosis even among young soldiers. The subjects of the study, having died from (presumably) conditions unrelated to heart disease, would form a valuable sample.

For me there’s the natural question: since the wealthy tend to have better diets than the poor, and since the military recruits predominantly among the poor, is that a bias in their heart-disease measurements? Seems unavoidable that there would be. My coworker tells me that other studies have gone on to correct for these measurements (if the original study did not).

So if anyone has access to a database containing JAMA, I would love to get a copy of that paper. Muchos gracias.

How to not micturate on a franchise

slaniel | Indiana Jones and the Kingdom of the Crystal Skull | Sunday, June 8th, 2008

See, George Lucas? That wasn’t hard, was it? You had a good thing going there with the Indiana Jones heretofore-trilogy. All you had to do with this fourth one was not change a damn thing. Just put our hero through some hair’s-breadth escapes, give Cate Blanchett a ridiculous — self-consciously so — Russian accent, make some pyramids move creakily, give us some secret doors, throw in some ancient languages that encode the mysteries of creation … there you go, done and done. Wasn’t that easy? Doesn’t it feel nice to leave your audience feeling good about the films they loved as kids? You may have actually enticed their children into your franchise.

Just think, George: there are millions of people out there just waiting to relive a fun part of their youth. You need to actively be a dick to mess that up. They’d ignore even a little screwup; if you want to alienate a whole audience, you have to work really hard at it. You didn’t do that with the latest Indy. Congrats!

I look forward to the fifth Indiana Jones movie. With any luck, it will be exactly the same as the first four.

(Though Harrison Ford is almost 66 years old, so maybe we’re nearing the end of the line. This may explain the presence of “Mutt” in the latest film.)

John Kenneth Galbraith, Money: Whence It Came, Where It Went

slaniel | Money: Whence It Came, Where It Went | Friday, June 6th, 2008

Cover of _Money_: 'John Kenneth Galbraith' in blue text on a white background, then 'MONEY' in white text on a blue background, 'Whence It Came, Where It Went' in red text on the same blue backgroundOn one side of the world is a broad swath of professional mystery-makers, who stand in awe at the world’s complexity, quite often view it as unanalyzable or irreducible, and let it stand pretty much as it was before. Then there are people in this world who want very much to take apart all the world’s complex systems and machines, show you what they’re made of, and say, “See? It’s not all that awe-inspiring after all.” I’ve decided that John Kenneth Galbraith, on the basis of Money: Whence It Came, Where It Went, is one of the latter.

Among those peddling mystery rather than clear thinking around money are some of Galbraith’s own economist colleagues, who enshround the topic in hefty terminology and bestow upon money men an authority that, as it turns out, they don’t deserve. Here’s Galbraith clarifying a couple often-heard terms from the world of finance:

A rapid expansion of commercial bank loans and resulting deposits and the spending of the latter would, as we have seen, cause prices to rise. The effect on England, exposed as it was to the full force of foreign competition, was to encourage purchases from abroad. And it made England a more costly market from which to buy. A signal of an unduly rapid expansion of bank lending, accordingly, was an outflow of gold for overseas purchases or for investment in supplying them. This the bank now anticipated and forestalled by raising the bank rate — the rate at which, in one manner or another, it loaned funds to other banks or at which it accepted credit instruments from those seeking funds to finance commercial transactions…. Such an increase in the bank rate now became a signal to the banks that they should restrict their lending. In case the signal was missed, the Bank of England could sell government securities in the open market and allow its other investments, including its commercial paper, to expire and be collected. So instead of an investment portfolio it now had cash. And this cash not being in the other banks, they had fewer reserves against their deposits and were thus forced to be more restrained in making new loans. They could replenish their cash by borrowing from the Bank of England. But here the bank rate entered. Having been increased, this discouraged such borrowing — and discouraged borrowing by ultimate customers when passed on to them. Thus did the Bank of England come to regulate the lending — and therewith the making of deposits and money — by the banking system as a whole.

Few phrases have ever been endowed with such mystery as open-market operations, the bank rate, the discount rate. This is because economists and bankers have been proud of their access to knowledge that even the most percipient of other citizens believe beyond their intelligence. Open-market operations are the sale of securities just mentioned by the central bank which removes the loanable cash or reserves from the commercial or ordinary banks. The bank rate and the discount rate are the same; they are what prevent the banks from too painlessly recouping their cash by borrowing from the central bank. This is it. Viewed in the context of their development in the last century [i.e., the 19th], it is hard to regard these mysteries as anything but a simple, even obvious, accommodation to circumstance.

That same tone, in a couple of particulars, is what makes Money such a tremendous book. First there’s the persistently arched eyebrow, aimed at other economists. Then there’s the urge to make the world clearer. The whole book is quite admirable in this way.

Money‘s pace is a little funny: perhaps 80 pages get us from the start of world history up to the Bank of England, then another 100 pages from the 19th century to World War I. The remaining 150 pages covering the practical collapse of the gold standard through the Depression and its aftermath. It’s like Zeno’s Monetary History.

Galbraith’s central observation about banking is that, beyond its most primitive forms, all banks suffer from one single, ineradicable problem: they have more money on the books than they actually have on hand. And every now and again, panic spreads from bank to bank, justly or unjustly: a nearby bank fails, so all my depositors rush to empty out their accounts. They are all shocked to discover that I don’t have a special bag of gold coins labeled “Doris’s savings account.” My bank fails, as do all the other banks. My bank wasn’t necessarily any worse just before the failure than it was a week earlier, but expectations combined to make it collapse. If I’m not mistaken, observations of this form are distinctly Keynesian.

Indeed, Galbraith is an old-school Keynesian, responsible in some fashion for price controls during World War II. Some of the most interesting parts of Money, to me, were Galbraith’s defenses of this centralization. It all worked quite well, says Galbraith, and people seemed generally satisfied with it. When the price controls were lifted, inflation did not go through the roof; there was no pent-up demand waiting to explode, but for the evil central planners. This, and much of the rest of the book, is a more or less direct response to Milton Friedman, maybe especially Friedman and Stigler’s “Roofs or Ceilings?”

Part of Money is in fact a direct attack on Friedman’s monetarism. The standard Keynesian attack seems to go like this: there comes a point in an economic crisis when the interest rate just cannot be productively lowered any more — we are at the “zero lower bound”. Banks are afraid to lend out any more money, so they hoard it. Lower interest rates near the ZLB just lead to more hoarding. The distinctive Keynesian response is to emphasize fiscal policy here over monetary policy: the government should actively spend money to put it in consumers’ pockets to get people spending, get them borrowing (clear out those hoards), etc. (Paul Krugman brought an early-twenty-first-century perspective to this dispute, including the Japanese experience of the late nineties, in his critical obituary for Friedman. It’s really a gem of an article. I’m no professional economist, but it looks to me like he got the better of the exchange with Anna Schwartz.) When read today, Keynes sounds somewhat naïve about the prospects for apolitical control of the economy by a technocratic élite; so does Galbraith.

Some of Galbraith’s naïveté comes from a belief that the world is moving to greater centralization: fewer corporations controlling production, and unions representing workers in bulk. It sounds like commerce really was more concentrated during World War II, and consequently that the central planner had a much easier task than he would now. Galbraith doesn’t seem to have updated this picture of the world since 1945, and Krugman gives him hell for it.

Still, Galbraith’s Money is a terrific read. A lot of what Galbraith says makes perfect sense, and I have a much better picture of how monetary policy works. He’s maybe less reliable on Keynesian demand management; just read the final 50 pages or so with the same skepticism that you brought to the rest of the book, and you’ll be fine.

Nonsense statistic of the day

slaniel | Internet and its history | Friday, June 6th, 2008

“The Ferris Research technology group estimates that the global cost of combating unwanted e-mails will reach $140 billion in 2008.”

Via Vanity Fair’s oral history of the Internet, which is kinda neat but unnecessary. You know how on the nightly news, they send people out into the field so that they have the appropriate object sitting behind them? E.g., a tornado, or the White House? Well, that Vanity Fair article is like that, except for the Internet. There’s nothing in there that you couldn’t have gotten from, say, Where Wizards Stay Up Late. The Vanity Fair piece itself would have been just fine as a book report. In fact, by now I bet Vint Cerf would prefer not to talk about being Present At The Creation for the zillionth time.

Anyway, $140 billion? So that means that each and every living human spends something like $20 a year combatting spam? If there are only, say, two billion people on the Net, that number goes up to $60 per year. Riiiight. $20 in lost opportunities doesn’t even make sense: I just deleted a couple thousand emails from my spam box today with a few seconds of labor. And if we’re going to run down that path, this country loses hundreds of billions of dollars every year from Tetris and Minesweeper.

Technical people always find something to grumble about in articles written by nontechnical people. In this case:

“He is also the progenitor of Metcalfe’s Law: as the number of users on a network grows, the value of that network increases exponentially.”

Metcalfe’s Law says that the value of the network grows with the square of the number of its users. Exponential growth is faster than growth with the square. In fact, exponential growth is really fast: take any polynomial — say, n100 + 3n7 — and you will eventually find a value of n where the exponential function exceeds that polynomial. As n grows larger, the ratio of the polynomial to the exponential gets closer and closer to zero, no matter how high the exponent is.

So to say that the value of a network grows exponentially with its user base is an overstatement. In fact Andrew M. Odlyzko has convinced me that Metcalfe’s Law itself is an overstatement, and that the value in a network grows more like n log n.

Trees and topological sorting in Python

slaniel | Python | Thursday, June 5th, 2008

I want to create a tree in Python, then topologically sort the tree. What I’m trying to do is simple; imagine that I have to install a Debian package called A, which depends on packages B and C, and that package B depends on some package D. Naturally one envisions a tree here, with B and C children of A and D a child of B. To install A, then, the order “D, B, C, A” will work, as will “D, C, B, A”. So in Python, I’d like to be able to do something like so:

tree = Tree()
a_node = tree.addNode( 'A' )
b_node = a_node.addNode( 'B' )
c_node = a_node.addNode( 'C' )
c_node.addNode( 'D' )
sorted_tree = tree.topo_sort()

Now sorted_tree = ('D', 'C', 'B', 'A') (I don’t care which of the total orders consistent with the partial order (D < C, B < A, C < A) it picks.)

I’d prefer not to write my own code for an abstract tree, my own code for a topo sort, etc. Yet it seems that there’s no standard solution here. The most promising appears to be Boost, yet the documentation there doesn’t give me a quick entrée into using it in Python. In fact it’s not clear to me that I can use Boost in Python without writing some C, which I’d prefer not to do. There are Boost bindings for Python, which might be what I want.

Does anyone know of a quick way to do what I want?

Is the Dow Jones Industrial Average important for GDP?

slaniel | Economics;False consciousness;Statistics | Sunday, June 1st, 2008

This country makes a big deal out of the Dow Jones Industrial Average. People watch its rise and fall as though it were a very important number. I rather wonder if it actually is. I doubt that most Americans make very much money at all from investment income, though a bit of googling couldn’t find me the authoritative statistics I was looking for. I also doubt that most Americans are directly employed by DJIA companies, nor even employed by DJIA companies or their subcontractors, though again I’d need more data than I have.

What I do have access to, though, are historical DJIA numbers, the historical Consumer Price Index, historical GDP, and historical population (whose source, for the life of me, I can’t find at the moment). I did a bit of rudimentary data analysis; what I found was that

  1. The R2 between the DJIA’s year-over-year percent return, and year-over-year percent change in per-capita real GDP, is 0.06.
  2. If you just look at 0/1 variables — 1 if the year-over-year number rose, 0 if it fell — then the R2 is somewhat better: 0.31. Still nothing special.
  3. Doing data analysis in OpenOffice sucks. I should relearn R.

I’ll admit my suspicion going in: people often falsely assume that their fates are tied to those of economic elites, because it’s in the economic elites’ interests to make people think so.

If others would like to take a crack at this data (or add any other public sources of data that I missed), I’d love to see what you come up with. Among other things, the following would help:

  1. Higher-frequency data (surely available for DJIA; not as surely available for CPI, GDP, or population).
  2. Looking at the S&P rather than the DJIA, because the S&P is a broader pool of companies that may be more representative of the economy as a whole.
  3. Using better statistical tools. I admit shyly that it has been eight years since I’ve done any respectable data analysis.
  4. Using something other than OpenOffice, which — I repeat — sucks.

P.S. (3 June 2008): Obviously I need to be using the χ2 statistic on the 0/1 variables: a two-by-two table, where each axis is “rose” or “fell” for each of the two financial measures that I’m comparing. If the rise and fall of the DJIA is statistically independent of the GDP’s rise or fall, then the χ2 statistic won’t be too large. I’m just not inclined to try to do this with OpenOffice.

I don’t totally get why inflation is important for real income

slaniel | Economics | Sunday, June 1st, 2008

While recovering from an extremely nasty infection with the aid of codeine and penicillin, I’m in the middle of reading John Kenneth Galbraith’s Money: Whence It Came, Where It Went (don’t you desperately want that “Where” to be a “Whither”?) on Cosma‘s recommendation. It’s a really terrific and — in a way that affirms Harvard’s perennial desire to be Oxford — hilarious. I’ll have a review up once I finish it.

In the meantime, I have to admit my confusion about how inflation works. Here’s my main question: don’t wages generally follow prices? So if prices go up, won’t wages follow them, and won’t the net effect be fairly trivial? An obvious caveat is that I signed an employment contract at a certain wage, so my wage is stuck there no matter how far prices rise. However, I get a cost-of-living adjustment every year. If my employer refuses to increase my wage along with inflation, I’ll look for an employer who will. This holds good especially if there’s a lot of inflation. I may pay less attention if inflation is at the 3% level or so. By this reasoning, then, isn’t inflation only an important “silent tax” when it’s low? High inflation isn’t silent.

But then inflation has some positive effects. One is that it helps debtors. If you have $10,000 in debt outstanding, and your wages follow inflation, and inflation is 50% per year, then your debt is now down to $5,000 (as measured in terms of your last year’s income). Obviously this is sensitive to the assumptions: if you have a variable-rate mortgage, then inflation doesn’t help you at all. But with fixed-rate debt, inflation actually helps.

Because of its effects on real interest rates, high inflation will probably cause banks to loan out less money — or make them choose alternate vehicles like variable-rate mortgages. I wonder if it will cause them to denominate their debt in other currencies: I’ll loan you $10,000 but not, say, £10,000, because I know that in a year those 10,000 dollars will still be worth approximately 10,000 dollars. This drives up the dollar-pound exchange rate, so now my $10,000 loan to you is worth more in pounds than it was when I lent it to you. If you’re still earning your salary in pounds, this makes life worse for you. If you could somehow orchestrate being paid in dollars rather than pounds, you’d be set. But the grocer down the street, the auto mechanic, and most everyone else will still expect to be paid in volatile pounds.

I can see an argument, along these lines, that a global currency — or at least a supranational currency — would lead to more price stability: weakness in one country wouldn’t harm the currency all that much. Of course this is sensitive to the number of nations under the über-currency: too few nations, and weakness in one country may pull down the other country even more strongly under a unified currency. And in fact, a unified currency may bind one nation’s fortunes to another; I’m not sure. In any case, padding one nation’s weak economy with another nation’s strong one seems to be the idea behind the euro. But a supranational currency gives a nation less control over its own macroeconomic policy. I wonder what sort of bargains and policy compromises went into the creation of the euro, and how it will behave in the event of a crisis.

I’m curious whether it’s ever happened that one side of a political border had a weak currency while the other side did not, and whether the weak side started paying its employees in the strong side’s currency. Then those people living right on the border could drive across, buy their groceries, and drive back. Nowadays I suspect that’s unlikely: the national government would likely clamp down on border crossings. This raises the question whether strongly enforced political boundaries are worse for economies in the aggregate. Suppose that, say, France’s economy is weak and Germany’s is strong. If the border were open and if German retailers could accept French currency, would economic health in the aggregate — i.e., the health of the French and German people considered as a whole — be greater? I can’t really justify it at the moment, but it seems like it would. Then again, it might lead to a deflationary spiral in France and an inflationary spiral in Germany: people would rush to buy goods in Germany, which would deflate the French currency more, which would lead to a still-greater rush into Germany. At this point in my education, I’m not clear where this process would stop. Perhaps it would stop at the limit of German productive capacity? That seems doubtful, if only because — especially in an open-borders régime — immigrants would flood into Germany in response to increased economic opportunity, thereby increasing Germany’s productive capacity. Seems like one obvious consequence of this process is that there would be every incentive for French politicians to shut down their borders. (If it’s the weaker nation, under this story, that wants to shut down its borders, then why does the reverse — say, the U.S. closing its border to Mexicans — seem to happen in real life?)

My macroeconomic education continues…