Friday, August 28, 2009

There are only 10 types of people in the world

...those who understand binary numeral system, and those who don't. (Sorry about the old joke; couldn't help myself.)

Matthias Wandell is most definitely one of those who do. He designed and constructed a calculator capable of adding 6-bit positive binary integers (that is, integers between 0 and 63). There wouldn't be anything extraordinary about it if not for the fact that the machine is made of wood and marbles. Below the fold is a video with some demonstrations; it's strangely mesmerizing.



Thursday, August 27, 2009

Elaborate waste of human intelligence

Raymond Chandler once wrote of a particular chess problem that it was "as elaborate a waste of human intelligence as you could find anywhere outside of an advertising agency." Chandler may have been right in his day, but his observation holds no longer. Today, the most elaborate waste of human ingenuity is not designing chess problems that go nowhere or managing political campaigns. It's not even coming up with new financial securities based on bundles of mortgages. It's pathological programming.

What's pathological programming? Normally, computer programming languages are designed so that it's as easy as possible to get the machine to do what you want it to do (given the complexity and range of tasks the language is meant to be dealing with). Pathological languages are designed with the sole purpose of exemplifying structures that are as pointlessly bizarre and/or complicated as possible. It's not an easy task. It actually takes great intelligence to design a computer language to be as stupid as possible.

Perhaps the simplest program you can imagine is a "hello world" program: a bit of code that just prints the words "Hello, world!" on the computer screen. So in BASIC, a "hello world" program is simply

PRINT "Hello, world!"

whereas in R it would be

cat("Hello, world!\n")

And so on. How do pathological languages deal with this task? Well, one of them (called "Chef") has a syntax that requires programs written in it to look like cooking recipes; a "hello world" program written in Chef looks like this:

Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes


Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put red salmon into the mixing bowl.
Put oil into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put oil into the mixing bowl.
Put lard into the mixing bowl.
Put lard into the mixing bowl.
Put eggs into the mixing bowl.
Put haricot beans into the mixing bowl.
Liquify contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.


Nice, huh? Then try it in Homespring, a language with syntax that forces programs to look like absurd poetry:

Universe of bear hatchery says Hello. World!.
It powers the marshy things
the power of the snowmelt overrides.


And here we come to the one pathological language that, to me, takes the cake. The true winner of the "most elaborate waste of human intelligence" prize: Malbolge. This language has a structure that is (purposefully) so unintuitive, so devoid of transparency and logic that its own designer was unable to write a successful "hello world" program in it. In fact, as noted by Mark Chu-Carroll (author of the blog I'm linking to in this post), the only way that anyone was capable of writing a "hello world" program in Malbolge was through designing a genetic algorithm that succeeded in creating one.

Before seeing Malbolge, I wasn't aware that such elaborate pointlessness was even possible.

Wednesday, August 26, 2009

Time for blood

Healthcare Economist notes that the recession decreased the number of blood donations, and wonders why that is. Recession means more unemployed; when you're unemployed, the opportunity cost of your time is lower, so if you're someone with any inclination to donating blood at all you should be more willing to do it now.

I think it makes perfect sense that blood donations decreased because donating blood is something you're much more likely to do when there's other people watching you (and remembering if you did or did not participate in the recent blood drive). Donating blood is less of an individual imperative and more of a social norm; and it's much harder to break a social norm when the society is actually watching. In that respect, it's a bit like voting. I'm too lazy to look for actual statistics right now, but I bet that employed voters turn out better than the unemployed.

Unfortunately, the current drop in blood donations can't be taken as evidence for my "social pressure" argument because I don't think it's true that the opportunity cost of the act is lower for the unemployed. Lots of employers (especially government agencies) provide ample comp-time for donating blood and, at least to me, a three-hour break is much more valuable when it's a break in a work day rather than a break in a game of FIFA 2009 or something.

Someone should do an experiment.

Wednesday, August 19, 2009

Pet peeve: making up numbers

A few days ago while channel-surfing I accidentally landed on C-SPAN and watched one of the famous "Town Hall Meetings" about healthcare reform; that particular one was in Towson, Maryland. (I don't remember the name of the participating Senator.) At any rate, here's what stuck to my memory: a member of the audience asked a question about the costs of public insurance fraud; he said that the current costs of Medicare/Medicaid fraud are estimated at $20 billion, and so what are we going to do when, after enacting the public option, those costs go up to $1 trillion?

Seriously: why is it that some people think that if their statement contains a number it somehow becomes more credible, even if that number is quite obviously entirely made up? Who in their right mind would believe that after enacting the public option, the costs of insurance fraud would somehow jump by three orders of magnitude? And since we're making this sh*t up as we go along anyway, why stop at trillion? Why not quintillion, or googolplex, or $24.56?

The answer to the last question is probably that, if you're engaging in pretentious number-dropping, you'll want your number to sound "scary but not too scary" to someone stupid enough to think it has any justification to begin with.

Basketball possessions are like cars

Here's a fascinating paper making an analogy between basketball possessions and a well-known networking problem. The well-known problem being: suppose there are two cities A and B with two roads connecting them, one of them being a highway and the other being an alley shortcut. On the highway, a trip from A to B always takes ten minutes, no matter how many cars are on it at any given moment. The length of the same trip on the alley depends on how many cars are traveling with you: if you're by yourself, it'll take you one minute; if there's two cars, each will travel for two minutes; if there's three, the trip will take each three minutes, and so on. Suppose also that there are ten cars, and all drivers sequentially decide which road to take, but without knowing how many drivers are ahead of them in line. Then, the pure strategy Nash equilibrium is that all drivers pick the alley, and all of them travel for ten minutes. However, if there were a "central authority" that could force five drivers to pick the highway, and five to pick the alley, the total driving time would be reduced.

Now the analogy in the paper is: basketball possessions are like cars (the goal of each of them is to get from some starting point A to B, B being the basket), and different possible plays are like different roads. Some roads have higher initial efficiency; for example, Kobe Bryant shoots better than Derek Fisher. However, like with the shortcut alley, that efficiency is decreasing with use; the more possessions end with Kobe shooting, the more Kobe is defended against, so it is sometimes optimal for a team to make their best shooters shoot less than they actually do.

So far so good. However, like all game-theoretic arguments about sports that I've ever seen, this one also turns on one crucial assumption, which is that all sports teams care about is maximizing the probability of winning. I think this assumption is not true. Sure Lakers fans want Lakers to win; but they also want to see Kobe shoot a lot, and if Kobe shooting a lot decreases the probability of a Lakers win somewhat, well that's just the price that fans are willing to pay for a good show. So Kobe shooting a lot is not necessarily an inefficiency. The coaches probably know what they're doing: they're giving the audience what it wants.

Tuesday, August 18, 2009

Enough with the selfishness already

Here's a fairly interesting NYT article about an NYU game theorist. Too bad it still can't help but repeat one of the annoying little misconceptions about game theory (and perhaps economics in general):
Generally, game theory assumes that people are rational and selfish; they're always angling to get what's best for them, which means their behavior can often be predicted.
Repeat after me: game theory never assumes that people are selfish. It does assume they're rational; but rationality and selfishness are two different things. The selfish/selfless criterion applies to ends, whereas the rational/irrational criterion applies to means. For example, suppose your most important goal is to sacrifice your own life in order to save somebody else's. You find out you can be a donor for someone who needs a liver transplant but can't find a match and will die unless you donate. So you give them your liver and die saving their life. That's definitely not selfish behavior; but game theory would say it's rational. If, however, instead of doing that you'd participate as a victim in a human sacrifice ceremony meant to convince Jupiter to take your life instead of that other person's, that would be selfless and irrational.

The above-quoted sentence actually contains another error: it implies that it's the assumption of selfishness that's making it possible for human behavior to be (more or less) predictable. Not true. It's rationality that enables predictability; selfishness is completely superfluous.

To sum up: game theory does not assume people won't do selfless things. It assumes they won't do stupid things.

Monday, August 17, 2009

Healthcare isn't health

Right now, the U.S. spends about 18% of its GDP on healthcare (both private and public). It's by far the highest rate in the world, and on top of that, it keeps growing faster than inflation. Why is it so expensive? Well, standard stories are moral hazard and adverse selection; but there's another possible reason: we're buying the wrong thing. We're paying for healthcare as opposed to health, meaning that the "healthcare system" has an incentive to advise its customers to buy more and more health services, and not to evaluate which of those services provide the most bang for the buck in terms of health outcomes.

This article makes the point very thoroughly. And if indeed paying for the wrong thing is the biggest problem, then GMU economist Robin Hanson has a solution. Since currently neither the insurance providers nor doctors have an incentive to sell services that maximize health, and since it's impossible for individuals to find out on their own which services are best for health, health insurance should be sold in one package with life insurance, and from the same insurer. Then the insurer will have an incentive to try and find out which health services are best in terms of maximizing life expectancy; after all, they'll want you around as long as possible so they can keep collecting your premiums.

The devil's in the details, of course, and Hanson works these out too. They're just as interesting as the general idea.

Tuesday, August 11, 2009

The past is hard to predict

ThinkMarkets features a post arguing with Krugman's NYT column about the fiscal stimulus package. There's a great line in that post, which neatly summarizes an interesting point: "The future is hard to predict. But the past and present are hard to predict too."

The point here is: lots of times you'll notice people thinking that because a certain statement is about the past or present, it must therefore describe hard, indisputable facts (as opposed to statements about the future which are mere "speculation"). This is not true, because many statements about the past implicitly involve evaluating counterfactuals. For example, when someone says "The stimulus has been working," they must mean something like "Thanks to the stimulus, the unemployment rate is now 9.4% whereas without stimulus it would have been 10%." But the unemployment rate that would have been if there were no stimulus is definitely not a "hard fact;" it's a counterfactual. And the answer to the question "What would the unemployment rate be in June 2009 if we didn't have the stimulus package?" can only be obtained in the same way as to the question "What will the unemployment rate be in June 2010?" You have to take a model of the economy, set its parameters to match your question, and then calculate the answer.

For all practical purposes, counterfactuals and predictions are the same thing. So saying "The stimulus has been working" is a prediction too.

Sunday, August 9, 2009

Might as well be Chinese. Or Greek. Or Heavenly Script.


The above graph, found on the Strange Maps blog, shows inter-language relations of "mutual incomprehension." For example, in English, when you encounter something that's completely indecipherable, you might say that it's "Greek to you." Then what would you say in the same situation if you were Greek? The answer is: Chinese. Chinese seems to be unique on two counts. First, it's by far the most common designate of ultimate incomprehensibility. Second, it's the only language on the list which points to a language that doesn't actually exist. Which makes sense, if you think about it. If the Chinese are aware that their language is the standard of unintelligibility for most of the world, it's only natural that they'd have to venture into the realms out of this world to find something that's incomprehensible to them.

Arguing about taboo topics

Uwe Reihnardt has a great post at Economix about the absurdity of various requirements that the health care reform is expected (by probably the most of public debate participants) to meet. Before going on to write about healthcare itself, I'd want to use one of Reinhardt's observations to illustrate a more general point. He writes:
Cost-effectiveness analysis should never be the basis of any coverage decision by public or private third-party payers in healthcare, for to do so would put a price on human life - which, in America, unlike everywhere else, is priceless.
When you look at what people do as opposed to what they say, it seems though that no one actually thinks their life is priceless. For example, pretty much all of us have at some point made a choice tantamount to accepting a small (but non-zero) risk of dying in exchange for some benefit in terms of the quality of life. Like, for example, flying or driving. If we truly thought the monetary value of preserving our life is infinite, we should never choose to drive or ride a car, unless the car is an ambulance and we're in the middle of a massive heart attack. The fact that we do not think the value of our life is infinite can also be inferred from the amounts we're willing to pay to avoid certain risks. This research shows, for example, that most of us will pay $5 to avoid a one in a million chance of dying, but will not pay $20 for the same opportunity.

So our actions reveal that we do not really think that life, even our own, is priceless. What we acknowledge in our words, however, is a totally different matter. "Life is priceless" is a rhetorical taboo and, contrary to Reinhardt, not just in America. If you ever try to argue that the value of human life is finite, sooner or later you will hear as a counter-argument that you must therefore believe the value of human life is zero. This is a curious argument, and as commenters in this thread point out, it's more general than just this particular case. There are more rhetorical taboos that follow the same pattern. Say you have a continuum of policy choices in some interval with policies A and B at the opposing ends of it. You then try to argue in favor of some policy mix (1-x)A+xB where x is neither zero nor one. If A and/or B are taboo policies, then pretty soon you'll have B-supporters telling you that if you think x can be anything less then one it must mean you think it's zero, and so you really don't care about B at all, and/or A-supporters accusing you of thinking that x should be equal to one and so you don't care about A either. If there actually is a continuum, those accusations are patently absurd; but, apparently, hard-core supporters of the extremes view the choice space as a dichotomy, not a continuum. To them, the choice is between all A and all B; nothing in between is possible.

Game theory has a lot to say about the rationality of taboo. However, what it does say is mostly about taboo actions; but what could be the worth of taboo rhetoric, especially in cases where speakers' actions belie their own words? I think the purpose of such professed beliefs is to signal two things at once: group membership and loyalty. By saying "Anything less than all A is in fact all B" you identify yourself as an A-supporter, but also as someone who, once she establishes a relationship with her allies, is unwilling to reconsider that relationship upon hearing arguments against her preferred policy choice. In other words, someone loyal. The signaling is done via showing your fellow A-team members that you consider anyone who argues that maybe there's too much A and not enough B in the world to belong to the camp that wants to rid the world of all traces of A altogether. That is because anyone who tries to argue to an A-supporter in favor of something "in between A and B" is most likely to be one of two kinds of people. Either he's a B-supporter trying to hide his true colors, or he's someone who actually tries to figure out what mix of A and B is best for whom. The latter kind of people can be dangerous too, because they tend to be "overly rational" and therefore disloyal. They might convince you to become their ally and join forces in doing something together; but they always doubt whether the alliance they're currently in is really the one that's best for their interests. And if they decide otherwise, they will break the relationship they talked you into with no qualms and move on to look for a better one.

Now from a logical point of view, of course, things like that shouldn't be considered at all. Logically, the only thing that matters for evaluating an argument is its substance; it doesn't matter at all who's talking, only what they're saying. But if the true point of a debate is not to try and find out the truth behind various possible policy choices, but rather to signal things like team membership and strength of loyalties, we shouldn't expect substance to be very important. Yes, arguing ad hominem is logically incorrect; but if the criteria for winning the debate are something other than logical correctness, it could still be an effective rhetorical strategy. Conversely, the fact that arguments ad hominem actually are very effective in political debates is, I think, strong evidence telling us that the purpose of those debates is not to find the highest quality arguments with which to persuade those who disagree with you, but something else altogether.

Friday, August 7, 2009

Party till equilibrium

Unless you have a perfect translation engine, translating a phrase back and forth between two languages will be an iterative process. This is what the Translation Party does with English and Japanese: you type in a phrase in English, and then it uses some translation engine to convert that phrase into Japanese, then from Japanese back to English and so on, until it reaches an equilibrium, realizes it will never reach equilibrium, or just crashes. The equilibrium phrase usually has nothing to do with the initial phrase, and sometimes it doesn't even have much to do with English as we know it. It's also possible for the process to start oscillating forever between two or more pairs of phrases. At any rate, it's a lot of fun.

Saturday, August 1, 2009

Poetry and math: pretty even if you don't quite get it

Poetry and math seem to me to share an interesting feature: it's possible to perceive a poem or a piece of mathematical reasoning as "beautiful" without fully understanding it.

When it comes to poetry, this quality is perhaps experienced most sharply when you read it in a foreign language that you know very well on a basic level, but not quite proficiently. You might read a poem in that language, and realize that you don't quite understand it. Of course, it's perfectly possible for you to not understand a poem written in your native language as well; but in the latter case, it's most likely a different kind of not understanding. With a poem written in your native language, you might not understand its semantics, even though the syntax of its building blocks will be clear to you. After all, it is your native language. When you're learning a foreign language, however, you notice that it's possible to somehow grasp the semantics even though you're not quite sure about the syntax. And so lines we don't quite get can nevertheless seem beautiful.

A similar thing can happen when you're trying to follow a difficult proof which uses techniques that you know "sort of," but not really. You might understand, and appreciate, what is meant to be done without fully grasping all the details of how it's being done.

So, for example, it's possible to know what Dylan Thomas meant when he wrote,
The lips of time leach to the fountainhead;
Love drips and gathers, but the fallen blood
Shall calm her sores.
And I am dumb to tell a weather's wind
How time has ticked a heaven round the stars.
even if you have no idea what it means to tick something round something else, and it's possible to perceive this verse as beautiful, despite the lack of such knowledge. Similarly, it's possible to appreciate the beauty of Gödel's proof of his incompleteness theorems even if you don't understand all the details of how Gödel numbering procedure works.

(Of course, you have to know at least the basics of the syntax of whatever poetical or mathematical language you happen to be reading. For example, my lack of understanding of this or this is so fundamental that no level of appreciation is possible.)

A concept is either coherent or it's not. If we can define it, then we know for sure that it is; however, it's possible for a concept to be coherent even if we can't provide a definition. I think this is why we can appreciate a poem or a proof without understanding it fully: it's because, even though we can't define the thought that's being described, we can somehow feel that it makes sense, that it's a coherent thought. In this interview, logician Rohit Parikh talks about his reaction after reading one of Wittgenstein's works: "I did not really follow what he was saying, but I realized that he was a genius and that someday I must understand him." Exactly.