Tuesday, January 15, 2008

Philip Dunn ansers the question I would have asked

On his blog, photoactive, pro photographer Philip Dunn answers a question about manual exposure from a former student that addresses exactly the issue I ranted about two posts ago:
When you are using an automatic exposure mode such as Aperture Priority, ... every time you make an adjustment to the your framing of your composition the chances are that the exposure will change as the metrering system reads from a different area of the subject.

This is precisely why I cannot be bothered with auto settings.

I want to take my reading from the area of the subject I choose and for that exposure not to change when I re-frame the picture.
To keep this in perspective, Dunn also wrote the following, in the tutorial on manual mode he posted this Sunday:
Never let setting the exposure get in the way of capturing the moment. ... If you think you are going to miss a picture – revert to Auto Exposure mode. It’s the picture that matters, not the way it’s exposed.

To summarize, I was more or less on target when I said that the right reason to use manual mode is that you think the lighting conditions affecting your subject are unlikely to change quickly between shots, and that auto mode is justifiable when this is not the case.

Philip Dunn, being a highly experienced pro, advocates practicing with M mode until you are fast enough with it to use it most of the time. ("You will be surprised how quickly you will be able to set your exposures manually.") I'd say that's a matter of taste, except that his "taste" is the result of years of success taking pictures, while mine is the result of not having had years of success taking pictures. You figure it out.

Photo: Infected Waxworm


Waxworm
Originally uploaded by C Joe V
Here's the story of this picture. Elissa has been studying Heterorhabditis bacteriophora for about two and a half years now, and by last November had decided she really would like some pictures illustrating its life cycle that she could use in presentations, papers and whatnot. Up to now, she had been using images borrowed from another lab.

When she asked if I could take some pictures for her, I said I didn't think either of the lenses I own would give enough magnification. A decent macro lens would cost almost $500, which was too much to justify for just a couple of little pictures of worms. But there was another option: close-up lenses that screw onto the filter threads of any lens. I indicated that if I were to receive a set of these for Christmas, I would probably be able to take some close-up pictures of her little animals.

I need to clarify something here. H. bacteriophora is a tiny worm -- you need a microscope to see them as anything other than little white specks. What we needed to take pictures of were the moth larvae (wax moths, Galleria mellonella to be specific) that served as hosts for the tiny parasitic worms. The moth larvae are maybe a couple of centimeters long.

Lo and behold, I did get a set of close-up filters for Christmas (guess from whom!), so one day in early January we took almost all the photography equipment I own into her lab to try them out.

First we took some shots of a long-since dead and rather disgusting carcass of a waxworm, in a puddle of clear liquid teeming with the aforementioned little white specks that had killed it. Those were long exposures, since nothing was moving. We killed the fluorescent lights so that the subject would be side-lit by the windows on the other side of the room. Those pictures were pretty gross, but Elissa was happy with them.

The photo above is one of a much healthier waxworm, which had only been infected with the parasites 24 hours before the photo session. Since this one was alive, and crawled around on the posing surface, I had to use flash. Here's the setup: camera, with 50mm f/1.8 lens and some combination of Hoya HMC close-up filters that gave an appropriate magnification, mounted on a tripod with inverted center column looking straight down at the subject; SB-600 flash on-camera, set to TTL with some negative compensation (because the background was black -- but that turned out to be a mistake, as the pictures were all underexposed). I used a fast shutter (1/200, if I remember...) and small aperture (f/8, maybe) so that we could safely turn the room lights back on. The camera was too close to the subject for the flash to light it evenly, so I set up a piece of flexible craft foam (as in A Better Bounce Card) around the non-flash side of the worm and bounced light onto it as best I could with a piece of white paper on the other side of the flash.

I shot in RAW+JPEG mode; the picture you see is the result of processing the RAW file with RAW Therapee and a bit of Photoshop. The JPEG was not usable because I had set the flash exposure too low.

Elissa and I were both fairly pleased with the results.

As a final note, the image you see here is one of the rejects, in case Elissa needs to use the good one in an article in a copyrighted journal. Normally, I follow the Computer Science community in civilly disobeying copyright restrictions on scientific literature when I am the author, but this is not CS and I'm not the author here.

Friday, January 11, 2008

Manual Exposure

Recently on photo.net I read yet another discussion forum thread on the question of manual versus auto exposure modes. Usually these threads are a newbie asking what mode to use, and the answers from seasoned pros vary from "who cares, use whatever you like" to "I always use manual because that's what I learned in the Stone Age" to "unless you use manual mode you are a mere snapshooter, not a photographer." (Those are paraphrases.)

The vast, vast majority of people in these discussions are missing the point, which is this: Modern cameras have meters. And except for people who really did learn photography in the Stone Age and are very comfortable with their skills, people use them. We rely on these electronic devices to measure light, because the perceptions of light levels we're fed by our eyes and brains are just not accurate enough to set a digital camera by. The only difference between manual exposure and non-manual exposure is the interface by which we choose to communicate our desires to the camera.

I agree somewhat with the sentiment that a "real photographer" is distinguished from a "mere shapshooter" partially by the fact that she or he pays attention to the technical aspects of what is going on rather than just aiming the camera and pressing the shutter button. I take issue, though, with the way people apply this notion. Stone Age photographers think understanding what's going on means knowing what aperture and shutter speed you want and telling the camera to use them. Digital Age photographers understand, or should understand, that it really means knowing as much as you can about how your camera works, and using that knowledge to make it do what you want in an efficient and reliable way.

In my efforts at learning digital photography, I have discovered two things: first, all exposure modes are equivalent; and second, all exposure modes are not the same. After elaborating on the former at some length, I will explain the latter.

In the digital era, cameras have three canonical exposure parameters: aperture, shutter speed, and ISO. And pretty much every camera that has a Manual mode (in which the photographer dials in all three of these) also has a Shutter priority mode (labeled S or Tv on the mode dial), an Aperture priority mode (A or Av) and a Program mode (P). The choices you get besides these will differ between cameras, so never mind them. There are two big things that many people seem to miss: First, in every single one of these modes, including Manual, you are probably relying on the camera's meter to almost exactly the same extent. Second, on many if not most digital SLRs, in every single one of these modes you have independent control over all three of the canonical exposure parameters.

I'll elaborate that second one first. In all four modes (M,S,A, and P) you get to set the ISO. And in each of the four modes (with the possible exception of P on some cameras) you have two other inputs that control the exposure. So you have three parameters that need setting, and you have three degrees of freedom in your control of the camera. This means that within certain limits, you can always get the ISO, shutter speed and aperture you want.

In M mode, you set aperture and shutter speed.

In S mode, you set shutter speed and exposure compensation.

In A mode, you set aperture and exposure compensation.

In P mode (on many or most camera bodies), you set exposure compensation and program shift.

So suppose you somehow know that you want to take your next shot at ISO 400, 1/250s at f/5.6. Set your camera to ISO 400, and then you have four choices. Go into M mode and set the shutter speed to 1/250 and the aperture to f/5.6; or go into S mode and set the shutter speed to 1/250 and adjust the exposure compensation until the camera chooses f/5.6 for the aperture; or go into A mode, set the aperture to f/5.6 and adjust the exposure compensation until the camera chooses 1/250 for the shutter speed. In P mode it's a bit harder to describe how to get what you want, but trust me, if you move the exposure compensation and program shift controls around enough you'll eventually be able to get the camera to choose both 1/250 and f/5.6 as long as this is not too radically different from what the camera would have chosen in Auto.

Therefore, if you happen to know what aperture and shutter speed you want, you can get them in any of the four modes. Of course, human beings almost never know what aperture and shutter speed they really want, because we're bad at measuring light levels by eye. So under most normal circumstances you're going to let the camera's light meter measure the amount of light in the scene for you.

Assuming you trust the meter, what do you do? If you're in P mode, with the exposure compensation set to zero, the camera will measure the amount of light coming through the lens and choose an aperture and a shutter speed for you. If you're a casual snapshooter or are in a hurry, you can just press the button. On the other hand, if you take the time to look at the parameters the camera has chosen and don't approve of them, you can use program shift to override them. But notice: if you keep the ISO the same, then for any given aperture there will be at most one shutter speed that gives the correct exposure, and vice versa. If you want a particular f-stop, you watch the aperture as you turn the program shift dial; when the f-stop you want is displayed, you take the picture and the camera uses the right shutter speed. Similarly, if you want a particular shutter speed, you watch the shutter speed display as you turn the dial, and when you see the number you want, you take the picture. What if you choose the shutter speed you want and then notice the camera has chosen an aperture you don't like? Well, tough luck -- that's the aperture you need to use in order to let in the right amount of light for the brightness of the scene as measured by the meter (which, for now, we assume you trust), unless you change the ISO. So you may end up looking for a compromise, using a slower shutter speed than you thought you wanted in order to get enough depth of field, or a larger aperture than you thought you wanted in order to freeze motion, or whatever.

What happens in A or S mode? The exact same thing! If you're in A mode, you adjust the aperture directly, and as you do so, the camera follows you by changing the shutter speed in the opposite direction to keep the overall exposure in line with the brightness of the scene. So if there's a particular f-stop you want, you adjust the aperture until you see it, and if the corresponding shutter speed is okay with you, you take the picture. Conversely, if there's a particular shutter speed you want, you can just watch the shutter speed display while you adjust the aperture, and when you see the speed you want, if the aperture you had to set in order to get it is okay with you, you take the picture. If you set one parameter and the camera chooses a value for the other that you don't like, you look for a compromise. In other words, the aperture dial in A mode does the exact same thing as the program shift dial in P mode. The same is true of the shutter speed dial in S mode.

Now for M mode. M mode is "manual" in the sense that after you've set one parameter (aperture or shutter speed) it's also your responsibility to set the other one. Naturally, you use the meter to do this. Maybe you think you know what f-stop you want, so you dial it in using the aperture control; now you must set the shutter speed to get the right exposure. Looking at the "meter" in the viewfinder, you turn the shutter speed dial until the needle is centered, pointing to zero. When that happens, you know you've set a combination of parameters that will provide the amount of light the camera's metering circuits think is appropriate. Since we're still assuming you believe the meter's analysis of the scene, all you have to do is make sure the shutter speed you've selected is acceptable, then shoot. Similarly, if you start out thinking you know what shutter speed you want, you dial that in first, adjust the aperture until the meter reads zero, check that the aperture you've arrived at is okay with you, and shoot. If, after setting one parameter, you find that the value of the other one that centers the needle is too high or too low, you still have to look for a compromise just as in the other modes, except now you are responsible for changing both settings to find a pair that works for you and centers the needle.

It would seem, then, that a major difference between manual and non-manual modes is that in non-manual modes the camera won't let you choose a combination of aperture and shutter speed that disagrees with the meter, but in manual mode you can do anything. That's not quite true, though.

Suppose you look at the scene and say to yourself, "I know from experience that my camera's meter will think this scene is brighter than I think it is." Maybe you're taking a picture of somebody who's backlit by the sun, and you think the camera will pay more attention to the bright sky than to the face that's in shadow. Or maybe you're taking a picture of a polar bear on a glacier, and you think the camera will mistake the white subject and white background under an overcast sky for a gray subject and gray background under full sun. In either case, you are going to want to let more light into the camera than the meter will tell you to. It's not hard to see how to do this in M mode: everything is the same as before, except that rather than finding a combination of settings that centers the needle at zero, you will look for a combination that puts the needle somewhere above zero. If you're taking a picture of a black bear in a cave, you'll be placing the needle below zero. Naturally, it is up to you to decide how far above or below the camera's recommendation you want to place the exposure.

This may sound like the kind of elite hackery that can only be done in manual mode, but of course it is not. Making this kind of adjustment in A, S and P modes is the entire point of exposure compensation. All you need to do is guess how far off you think the meter's recommendation will be. For instance, if you're in A mode and you think the meter will tend to underexpose by, say, one stop, you set the exposure compensation to +1, then adjust the aperture as before, watching the shutter speed, until you find an acceptable combination. S and P are analogous.

Thus we've returned to a point I claimed earlier: no matter what mode you're in, you need to know whether you think the meter is misunderstanding the scene, in what direction, and by how much. You can do this by guessing, or (in the Digital Age) you can do it by taking a test shot and reading the histogram. Regardless, using the auto modes does not excuse you from thinking about metering, nor does manual mode force you to think about it significantly more. They are the same.

Well, almost. The exposure compensation on most cameras is only settable from -2 to +2, or from -3 to +3, depending on configuration. So non-manual modes do confine you to working within 2 or 3 stops of the meter's preferred exposure level, while manual mode does not. But honestly, would the camera maker only give you a meter that reads from -3 to +3 if they thought you would be working outside that range very often?

So much for why all exposure modes are equivalent. How are they different, and what should you use?

My implicit assumption when arguing that all modes are equivalent was that you are only taking one photograph at a time: you set the exposure parameters once, click the shutter once, and start over from the beginning. Real life is not like this: you adjust some settings, shoot a few frames, adjust some more, shoot some more, and all the while you must pay attention to what is going on around you. The more you need to concentrate on composition, lighting, timing and focus, the less attention you will be able to give to exposure. This is where taking advantage of your modern, highly automated camera can help you.

The difference between M, A, S and P modes is how control over the image is divided between you, the camera, and The World. The only real reason this is important is that things you control will remain fixed from one shot to the next until you take the time to change them.

In all modes, The World controls the amount of light available for making a picture. In non-manual modes, the camera has enough control over the exposure that it can react to changes caused by The World, keeping the image consistent without your having to do anything. In manual mode, the camera stays out of it and if The World suddenly gets brighter or dimmer, so will the image you record.

If you believe that The World is unlikely to change from one shot to the next, then any difference in levels as measured by the meter is probably misleading. Thus, you should choose M mode so the camera does not mess up the images by compensating for "changes" that aren't really there.

If you believe that The World is likely to change very fast -- if there are clouds moving past the sun, or you're moving from sun to shade, or you're walking around a room with big windows at one end and dark corners at the other -- then you may want the camera to react to these changes so you don't have to. Thus, you should choose some mode other than M.

Which auto mode to use when using an auto mode? That depends on which exposure parameters you want to hold fixed until you change them. If you're shooting a waterfall on a partly cloudy day, you might use S mode so that when the sun goes behind a cloud, the camera will react by changing the aperture rather than messing up your carefully chosen shutter speed. If you're shooting a landscape, or an extreme close-up, you might want to use A mode so the camera's automatic adjustments won't affect your depth of field. If you're running around after your 2-year-old, you may want to use P mode, giving the camera permission to speed up the shutter when you're in the sun but also to open the aperture when you're in the shade.

None of this makes you any less of a photographer. Anyone who says it does is stuck in the Stone Age. What makes you a photographer is that you know what you want, and you get it.

Wednesday, January 09, 2008

Every four damn years...

...I find something to hate about the way the news media handle presidential elections. And usually I find something to hate about the way the candidates and their parties handle them.

This year it's the fact that the media seem to have the nominating conventions confused with the Electoral College. They're nothing alike. In the national election for President, electoral votes are (for the most part) racked up one whole state at a time. So a victory in (say) Florida for the Republican candidate shifts the electoral vote in the Republican's favor by 27 votes, which is 5 percentage points, no matter how tiny the margin was in Florida.

Primaries are different. The pledged delegates from each state are divided between candidates according to the candidates' shares of the state's primary or caucuses. That means that if the top two candidates in (say) the Democratic primary in New Hampshire get very different numbers of votes, they get very different numbers of pledged delegates, but if the race is close and they end up with nearly equal numbers of votes, they get nearly equal (or even exactly equal) numbers of pledged delegates. Sure enough, according to CNN's Election Center 2008, Barack Obama's "huge" eight-percentage-point win in the Iowa caucuses gave him 16 pledged delegates, with 15 going to Hillary Clinton and 14 to John Edwards. (And clearly there's even more to it than I know about, because that is not even the same relative order as the popular vote.) Hillary Clinton's two-percentage-point win in the New Hampshire primary gave her and Obama 9 each and Edwards 4.

That's right. In terms of pledged delegate count, Obama came out of Iowa with literally the smallest possible lead over Clinton, and New Hampshire was a tie. That leaves Obama one pledged delegate ahead of Clinton, and Edwards the only one of those three who's in any kind of trouble. Meanwhile, Mitt Romney, with his "two silvers and one gold", actually leads the Republican field, because Iowa winner Mike Huckabee did poorly in New Hampshire and New Hampshire winner John McCain did poorly in Iowa.

Aside: Note how I keep saying "pledged delegate" rather than just "delegate". If you count Democratic superdelegates, who are individual people that get to vote at the convention as if their opinions were as valuable as those of thousands of ordinary citizens, Hillary is evidently ahead, with 183 predicted convention votes to Obama's 78 (as of today). I guess this reflects her status as the "establishment" candidate. So all non-Hillaries have a deficit to make up, but unlike the margins you see while watching returns on election night, this one can not increase proportionally as more and more precincts' votes are counted.

With the nomination process barely out of the starting gate, Obama and Clinton are neck and neck, Edwards is still in it, and Romney leads the pack of Republicans. So say the numbers, so say I. But noooo. In the perverted calculus of political news reporting, every caucus and every primary must have one candidate declared "the winner", with all others "losing" (and obliged to "concede" on national television) and the ranking of nonwinning candidates considered more important than their share of the vote. This is reasonable in the winner-take-all general election, but it is bogus and misleading in the primaries. There is tons more that I hate about politics, including the fact that my favorite candidates almost never win, but this is a case where most of the reporting and commentary is just plain stupid.

Wednesday, December 19, 2007

Paul to keep donation from white supremacist

Seen on the CNN Political Ticker blog. The AP reports that Ron Paul's campaign received a donation from the owner of a white supremacist web site, "and the Texas congressman doesn't plan to return it."
"Dr. Paul stands for freedom, peace, prosperity and inalienable rights. If someone with small ideologies happens to contribute money to Ron, thinking he can influence Ron in any way, he's wasted his money," Paul spokesman Jesse Benton said. "Ron is going to take the money and try to spread the message of freedom."

"And that's $500 less that this guy has to do whatever it is that he does," Benton added.

Assuming Ron Paul is in fact not a racist, this is awesome.

It's awesome because Ron Paul knows what he stands for and doesn't think the ideas of one small-time campaign donor should define what his candidacy is about. He's right, of course.

It's awesome because Ron Paul is not afraid to say it's ridiculous to think a politician is obliged to take on the causes of the people who fund his campaign, rather than act in the interests of the people who vote for him.

It's awesome because Ron Paul knows that his base consists of people who claim not to care what you do with your money, even if it used to be their money.

Why can't more politicians behave like this? How awesome would it be if, during a debate, when one candidate drew attention to the fact that another's candidacy was endorsed by the automobile industry, the answer was, "Yes, that's a matter of public record, but I represent the American people, not the American auto industry, and I believe we should fight global warming and be less dependent on foreign oil. That's why, in my first year as President, I'm going to push for higher mandatory fuel economy standards and give tax credits to people who ride bicycles to work!"

They can't do it, because they're all elitist power-broker Republicans and softie humanitarian Democrats. Only a no-holds-barred Libertarian would expect the public to believe he construes his obligations to his campaign supporters so narrowly.

"You gave money to Ron Paul for President, you got Ron Paul running for President. You expected something else?"

It's just so Ron Paul, which is awesome.


Note: I do not support Ron Paul. In fact, I do not expect to vote for him under any circumstances.

Tuesday, December 11, 2007

Turning Homosexuality On and Off

From John Tierney's
New York Times Blog, discussion of recent research showing that the sexual preference in fruit flies can to some extent be controlled with drugs.

A reader named catuskoti posted, in part:
Silly science and silly research. Why is sexual diversity believed to be a problem needing scientific investigation?

Short answer: because scientists investigate everything. Don't be confused by the use of the word problem -- A "problem" in science is really nothing more than a question. Why should sexual diversity be off-limits to the inquiries of people who want to understand what happens in our world?

Longer answer: Here are two sentences from the scientific article's abstract (follow the link above).
Mate choice is an evolutionarily critical decision that requires the detection of multiple sex-specific signals followed by central integration of these signals to direct appropriate behavior. The mechanisms controlling mate choice remain poorly understood.

Makes sense to me. Whether you think "mechanisms controlling mate choice" is a good way to describe human sexuality is another question. Fortunately, it's irrelevant here, as the article under discussion does not seem to mention any animals higher than rats (caveat: I only skimmed it). We will have to wait for analogous results in mammals, probably even in primates, before it can really be said to have anything to do with such a complex aspect of human society.

Monday, December 03, 2007

Interpreting Iran Intelligence

From the New York Times:
A new assessment by American intelligence agencies concludes that Iran halted its nuclear weapons program in 2003 and that the program remains frozen, contradicting judgment two years ago that Tehran was working relentlessly toward building a nuclear bomb.
That's a relief. But what's this...

"'It confirms that we were right to be worried about Iran seeking to develop nuclear weapons,' [national security advisor Stephen J.] Hadley said."

Now pay close attention here. Just as Bill Clinton said "there is no improper relationship" between himself and Monica Lewinsky (their relationship had supposedly ended by the time he said that), the U.S. government "were right" about nuclear weapons development in Iran (emphases added). Because at one time, their worries were true. But, according to NYT's and CNN's headlines, not anymore. Just because they were right to worry does not mean they will be right if they worry in the near future. So now we can call bullshit on any continued alarmism from the White House or the Republican presidential campaigners, right?

[Hadley continued,] "...But the intelligence also tells us that the risk of Iran acquiring a nuclear weapon remains a very serious problem."

Crap. I was planning to submit this apparently contradictory statement to Jon Stewart-style ridicule, but I guess it's actually true, because the intelligence showed that the Iranian uranium enrichment program that is supposedly for civilian purposes but could produce weapons-grade material is still going on, and (I assume, not having read otherwise) all the public rhetoric from Tehran continues to imply that the Iranian government wants nuclear weapons.

So now what I wish I could remember is what the administration's official words were on what conditions Iran would have to meet in order for us to engage them in diplomacy.

Thursday, November 29, 2007

Confluence and Church-Rosser

Okay, I'm back to post about confluence and the Church-Rosser property, as I threatened yesterday. This is a complaint about something I found very annoying when I was in graduate school; it's related to yesterday's complaint about type-1 and type-2 errors in statistics, but slightly different in that it's not about names for two things that don't help you know which names which, but rather about two names that one is supposed to keep straight even though they both name the same thing.

In lambda-calculi, and other rewriting systems with which I am less familiar, one defines a reduction relation on terms that is supposed to capture the idea of a single step of computation or simplification, like replacing "2+3" with "5". (These are expressions of arithmetic, not lambda-calculus, but never mind. I'll use arithmetic expressions again below.) Reduction relations are almost never reflexive (that would be zero steps of computation), transitive (more than one step) or symmetric (counting a backward step as a forward step), but it does make sense to look at the notion of "equivalence" that comes from thinking of things as equivalent if one can be reduced to the other. The equivalence relation induced by reduction, called conversion or convertibility, is the reflexive, symmetric, transitive closure of reduction -- which is to say that two terms are convertible if one can be transformed into the other by a sequence of zero or more steps each of which is a reduction either forwards or backwards. So, if "2+3" reduces to "5" and "9-4" also reduces to "5", the expressions "2+3" and "9-4" are convertible and we can think of them as having the same meaning.

In general, if A reduces in zero or more steps to B, and C also reduces in zero or more steps to B, then we can say that B is a "common reduct" of A and C. Clearly, any two terms with a common reduct are by definition convertible. The question is, do any two convertible terms have a common reduct?

[Why is this question important? Among other reasons, because if so, and you have two terms that you can show do not have a common reduct, you will know they are not convertible. Otherwise, it would be hard to be sure.]

In the lambda-calculus, the answer is yes. This fact was proven by Church and Rosser in 1936 and is called the Church-Rosser Theorem. For rewrite systems other than the untyped lambda-calculus, the answer obviously depends on what the reduction relation actually is. A reduction relation for which any two convertible terms have a common reduct can be said to have the Church-Rosser property.

OK. It turns out that the key to proving the Church-Rosser property, at least for the lambda calculus, is to prove the following: If there is more than one way to reduce a term A, say to B1 or to B2, in zero or more steps, then there exists some term C such that both B1 and B2 can be reduced in zero or more steps to C. More generally, we can say: any two terms with a common "source" also have a common reduct. So if two different people are trying to reduce A and their paths ever diverge, taking one to B1 and the other to B2, then it doesn't really matter because they will eventually "flow back together" at C. This property is called confluence.

So here's where I have a problem. It turns out that the property I refer to as CR above (convertible terms have a common reduct) and the property I just called confluence (terms with a common source have a common reduct) are equivalent. (The CR->confluence direction is obvious, as any terms with a common source are convertible; the proof of other direction left as an exercise. Hint: induction on the number of steps in the conversion.) Because they're equivalent, it's always hard to know whether I have the names the right way around. I was pretty sure this is the way I learned them in grad school, and it's consistent with MathWorld's definitions of confluence and Church-Rosser, but Wikipedia has it differently, as does at least one legitimate book I looked in while writing this.

What's my point? The point is that I resent having had to devote precious brain cells to remembering which is which of two different ways to say the same goddamn thing. It seems like a pretty small thing and not worth bothering to resent, but there it is.

Wednesday, November 28, 2007

I like what I'm hearing...



Now if only we could just edit out all this "Biden" stuff. :-)

Arbitrary Names

Language Log is a treasure trove. Every time I dive into its archives I find something old, but new to me, that is interesting.

In 2004, Geoffrey Pullum discussed his refusal to learn which business model for massage is called incall and which is called outcall, on the grounds that the names are utterly unhelpful and "if I can't see how it follows by some sort of linguistic principles, I will just forget it again." Later that same day, Christopher Potts pointed out that similar problems exist with ordering food "in" or "out", pushing an appointment "up" or "back", and (my favorite) identifying the root of a tree structure as maximal or minimal in the dominance relation. (Potts also says that "linguists draw their trees upside down, with the root at the top of the page" which of course is right-side up to computer scientists like me, as long as we're talking about trees as an abstract graph structure rather than about trees, the plants.)

I love reading this kind of LL post, because some of these are the kind of things about language, especially technical language, that drive me crazy.

Example: Statistics textbooks classify the ways a statistical test can go wrong as "type 1 errors" and "type 2 errors". (Or maybe they use Roman numerals. The point, namely that these names are stupid, is the same.) I have an old book (actually, a new copy of a Dover edition of an old text) that calls them "errors of the first kind" and "errors of the second kind". Now, one of these kinds of errors is when your test tells you two things are different when they're really the same, and the other is when the test tells you they are the same when they're really different. Like Pullum, I absolutely refuse to even try to remember which is which. And also like Pullum, I anticipate that many people reading this statement would respond to it by trying to tell me anyway: the fact that I don't know is not the point; the point is that the meanings of these technical terms are arbitrary, reflecting nothing about the events they describe but depending instead on what order some founding father of statistics happened to think of them in.

So what do I suggest? Well, in many contexts, like testing people for diseases or testing drugs for treatment effects or identifying spam or whatever, the terms "false positive" and "false negative" are transparent and work perfectly well. In other cases, where the designation of outcomes as "positive" and "negative" is not obvious, the statistics literature provides the terms "rejection error" and "acceptance error", referring to rejection or acceptance of the null hypothesis; which hypothesis is null is an unambiguous technical fact about the statistical method being used.

Interestingly, there are tons of these arbitrary namings in mathematics, and I don't object to all of them. I don't really care, for example, about the fact that one kind of function is called a homomorphism and another very different kind of function is called a homeomorphism, even though (as far as I can tell) there's no way to look at those words and determine from their structures which means what. But in this case, and many others, there's a good reason not to mind: a homomorphism is a function you study in algebra, and a homeomorphism is one you study in topology. So while if you're reading this paragraph as a nonmathematician and seeing these terms for the first time I could forgive you for being confused, the average mathematician probably learned the definitions of those two words in separate classes, probably separate semesters of undergraduate math. They're probably conceptually separate enough that no one who cares about either thing can possibly be confused.

Similarly, before I studied Euclidean geometry in ninth grade, I could never remember which kind of pair of angles was called complementary and which was called supplementary. (To be truthful, it's now been long enough that I will have to go look them up before I can finish this paragraph.) (Okay, looked it up. And guess what? I had it right.) There's an episode of the Cosby Show where Cockroach, complaining to Dr. Huxtable about having to study for a math test, says "I couldn't care less about complementary and supplementary angles." If he meant he didn't want to learn which word meant which thing, and Mrs. Westlake had organized her syllabus such that the two definitions were on the same pop quiz, then I can't say I blame him. But when I took geometry, the notion of a straight angle was introduced a whole week or two before that of a right angle. I'm not sure why that was, but it had the pleasant effect of letting us talk about supplementary angles for quite a while before we had to know about complementary angles. By the time we had to learn the second word, we were comfortable enough with the first word that they didn't interfere. (At least not for me. My classmates might not have agreed.) The difference between the classroom experience and the, well, call it the "dictionary experience" was impressive to me even then.

And don't get me started on confluence and the Church-Rosser property. Because I've spent so much time on these two examples that I'll have to save that one for later.

Monday, November 26, 2007

Paul Davies: Taking Science on Faith

Op-ed in the New York Times.

Over the years I have often asked my physicist colleagues why the laws of physics are what they are. The answers vary from “that’s not a scientific question” to “nobody knows.” The favorite reply is, “There is no reason they are what they are — they just are.” The idea that the laws exist reasonlessly is deeply anti-rational. After all, the very essence of a scientific explanation of some phenomenon is that the world is ordered logically and that there are reasons things are as they are. If one traces these reasons all the way down to the bedrock of reality — the laws of physics — only to find that reason then deserts us, it makes a mockery of science.

A very nice essay on the importance of faith to science. I have had many of the thoughts expressed here myself, but this is a much more eloquent presentation than I could have created. Read it.

The what percent?

From the Straight Dope Classic that ran today:
According to David Orme-Johnson, a researcher at Maharishi International University, "Thirty-one sociological studies conducted throughout the world document that the quality of life in society significantly improves when as little as the square root of one percent of a population practices TM-Sidhi Yogic Flying together in one place."

The square root of one percent? Is that ten percent, as in 0.10*0.10=0.01? Or, just as implausibly, does it mean (size of population affected) = 100 * (number of meditators)^2?

Wednesday, November 21, 2007

Impunity

Hey, I learned something today!

From Al Jazeera English (emphasis added):

Farida Deif, researcher in the women's rights division of Human Rights Watch, said: "A courageous young woman faces lashing and prison for speaking out about her efforts to find justice.

"This verdict not only sends victims of sexual violence the message that they should not press charges, but in effect offers protection and impunity to the perpetrators."



This is the first time I can remember seeing the word impunity not preceded by with. It looked so strange that I thought it might be a typo for immunity, like the kind prosecutors sometimes give to witnesses who would otherwise be subject to prosecution themselves. Most of the time, when I hear or read that someone acts "with impunity", I take it to refer to the attitude of the person acting, the confidence that their crimes will go unpunished. This isn't something it makes sense to "offer" someone, even unintentionally and even only "in effect" -- you can offer someone the opportunity to act with impunity, but you can't offer the impunity itself.

But never mind all that, because I looked it up, and sure enough, impunity means precisely "exemption or freedom from punishment, harm, or loss". So not only does it refer to the fact of non-punishment rather than just to the expectation of non-punishment, but it can refer to "exemption" rather than mere "freedom" from punishment. So when a prosecutor grants a witness immunity, I suppose she is also granting him impunity. Then again, the dictionary's usage example was "laws were flouted with impunity", which lets me go on believing it's weird to use impunity without with.

In any case, it may be that Al Jazeera's command of the English language is better than mine.

I suppose I have to compare and contrast Al Jazeera's (English-language) coverage of this story with the U.S. media's. The second sentence of the Al Jazeera story is:
But the decision to give a woman who was gang raped a six months jail term and 200 lashes received only mild criticism from the US on Monday.

The headline on CNN.com (as of now) is "Clinton: Saudi rape verdict 'an outrage'", and the article says in part:
Labeling it "an outrage", Sen. Clinton urged the U.S. government to protest the decision.

"The Bush administration has refused to condemn the sentence and said it will not protest an internal Saudi decision," the Democratic presidential frontrunner said in a statement.

That's not so different, but I have to admit that I read the CNN piece first and sort of missed the fact that the Bush administration has not condemned something so obviously condemnable. The Al Jazeera version puts it much more bluntly. I guess Democrats, particularly those running for President, criticize the Bush administration so often that I no longer assume it means they've actually done something wrong.

Tuesday, November 13, 2007

Abbas And Peres Call For Peace

Al Jazeera English quotes Israeli President Shimon Peres, referring to an upcoming Israeli-Palestinian peace conference to be hosted by the U.S.:
"Annapolis will not just be a performance, it is a stage on an agreed path that could lead to a peace agreement in the right direction."

Is that setting the bar low enough? At least Peres seems to think the meeting will involve some kind of progress -- later in the article, he is contradicted by "one Israeli official" who is quoted as saying:

"It's not a conference, as Israel has explained many times, but a meeting where representatives will read declarations without entering into negotiations."

Sigh.

Clearly I've been reading too much Language Log, because here's what I notice. When I saw the word "stage" following the word "performance", I initially assigned it the wrong meaning. The fact that "Annapolis" refers primarily to a place (kind of like "all the world"), rather than an event, is also a factor. (Obviously I'm not claiming it's not legit to use a place name to refer to an event that occurred or is scheduled to occur there. Witness "Pearl Harbor", "Kitty Hawk", or "Abu Ghraib".) Believing I am too smart to be tripped up by nothing, I submit that this is a clumsy translation. (Though I don't know what language the original statement was made in -- for all I know it was English!) And has Israel explained many times that the Annapolis meeting is not a conference, or claimed many times that it is one? I don't remember the name of the semantic phenomenon that causes me to favor the former interpretation, but it's the thing where saying someone "explained that X" (as opposed to "said that X" or "asserted that X") entails agreeing that X is true (though I suppose not as strongly as "proved that X"). The official clearly believes that the truth is "It's not a conference," so that's what Israel must have explained. Thus I am led to a picture of the Israeli government attempting many times to reassure its own citizens that their leaders are not getting ready to give anything away. Is that just me?

I found this after being persuaded to try reading some Al Jazeera news coverage.

Tuesday, October 16, 2007

Love Soul Mate

Love Soul Mate - "Find out the name of your Love Soulmate"

This was the target of a banner ad I saw today. The banner said it would "Calculate the exact name of your perfect lover!" And even though I wouldn't want anyone to think I'm looking for a more perfect mate than I have, I clicked. To save you the trouble of trying this yourself, here's what happened:

Select your gender. I click on the guy.

Select your sign. I click on Aries.

Enter your name (this will be used in the calculation). I type "Joe".

Enter your cell number.

I click "Back".

This is such a blatant spamtrap that I didn't even bother reading the fine print. Enter my cell number. Ha! I probably shouldn't even encourage these people by linking to their site. But somehow I can't resist.

Wednesday, October 03, 2007

Shortening Ph.D. programs

Caution: bitter rant from a recent Ph.D. recipient approaching!

Here's an article in the NYT on how universities are trying to
shorten the process of writing Ph.D. dissertations.
For those who attempt it, the doctoral dissertation can loom on the horizon like Everest, gleaming invitingly as a challenge but often turning into a masochistic exercise once the ascent is begun.
Very cute.
Nevertheless, education researchers like Barbara E. Lovitts, who has written a new book urging professors to clarify what they expect in dissertations; for example, to point out that professors “view the dissertation as a training exercise” and that students should stop trying for “a degree of perfection that’s unnecessary and unobtainable.”
First of all, is that a sentence? The only way I can parse that as a sentence is if "like" is a verb, giving something similar to "Education researchers approve of Barbara E. Lovitts." I don't think that's what was meant.

I remember being told that I should stop worrying about whether my dissertation was going to be perfect and just write the damn thing. "The only good thesis is a finished thesis," I think someone said, although "The only bad thesis is an unfinished thesis" would have been more helpful. I remember at least one of my graduate student colleagues reworking and reworking one chapter of his dissertation for weeks while his advisors told him in very direct terms that it didn't matter and he should leave it the way it was. So when the time finally comes for a CS graduate student to write a dissertation, yes, professors are pretty clear that it doesn't have to be a masterpiece.

But I would be very surprised to learn that professors at my graduate institution really thought of the entire process as a mere "training exercise." If they do, then they need to read Barbara E. Lovitts' book about how to make that clear to their students.

Here's how it looks from a student's point of view. Everyone knows that a Ph.D. thesis involves original research. What's a little less known to outsiders is that Ph.D. thesis projects comprise a sizable portion of the total original research that gets done in a university setting -- particularly in computer science, where there are fewer postdocs than in, say, chemistry. (The article refers to A.B.D. graduate students as a "pitied species" -- postdoc, the next stage in the academic life cycle, is actually one of the Worst Jobs in Science!) So the papers graduate students publish about their thesis work in peer-reviewed conferences and journals account for a significant percentage of the published articles those students' advisors' names are on. So professors are counting on their graduate students -- and in particular, on the Ph.D. thesis projects of their students, though admittedly not the dissertations themselves -- for exposure, reputation, tenure and funding.

It is easy to imagine that some professors -- ones I'd call "bad advisors" right to their faces if I had a chance -- make no attempt whatsoever to insulate their students from the pressure inherent in this situation. Let me just state for the record right now that I have never worked with any such people in real life. My own Ph.D. advisor certainly isn't one. Bad advisors are undoubtedly more prevalent in some fields of study than others -- in some disciplines, the pace of innovation and the pressure on faculty may even make bad advising the norm! Such professors think of graduate students as their own employees -- though they usually aren't -- and what ought to be five years of "training exercises" turn instead into five years of thankless labor. Viewing things this way, de-emphasis of the dissertation (touted as progress in this article) might actually be harmful to students' morale: naturally, the research a student does is much more important to a bad advisor than the dissertation about that research he or she produces at the end; since the dissertation itself is not published, any time spent writing it is time the student is getting paid for "nothing", and the ruthlessly efficient bad advisor tries hard to deny the student the very useful (and cathartic) exercise of writing a coherent report of his or her accomplishments. (Sure, whatever, just staple your published articles together and we can all get back to the lab where we belong.) The Ph.D. diploma is no longer a certificate of significant accomplishment you frame and hang on the wall (as I have done with mine), but more like a terse letter of reference you get when your first entry-level job lays you off. (As an aside, when I was hired at Caltech the lady who verified my credentials never saw my diploma, just a letter from my graduate department administrator stating that I had qualified for one. I imagine it's like that for a lot of folks.)

There. I feel better. Now I have to back off and clarify that I have no proof that advisors this bad actually exist. Most professors I know are Good Advisors who take their roles as mentors seriously. They encourage students to do the best work they can, helping them along and not confronting them with cold analysis of their contributions to the lab's bottom line. They see the beneficial symbiosis of the student-advisor relationship: the student is there to learn, and does so by doing brilliant work that reflects the advisor's brilliant leadership. Everybody wins. That's the way it should be.

Thursday, September 13, 2007

Who Needs Hackers? - New York Times

Who Needs Hackers?

The New York Times on the observation that complex systems can fail with spectacular results even in the absence of malicious attackers.

Wednesday, September 12, 2007

Eleven lessons learned from 9/11 - Travel News - MSNBC.com

Seen on MSNBC.com:
For the airline industry, 9/11 will always be a watershed moment, the horror between "before 9/11" and after "9/11."
Is this just lousy editing, or am I missing a fiendishly clever syntactic joke?

Monday, September 10, 2007

The Effects of Petraeus' Testimony

Iraq 'surge' working, Petraeus tells Congress - CNN.com: "A CNN/Opinion Research Corp. poll taken last month found about two-thirds of Americans -- 64 percent -- oppose the Iraq war, and 72 percent say even if Petraeus reports progress, that won't change their opinion."


Um, what? Does that say that more Americans say they won't change their opinion if Petraeus reports progress than say they oppose the war in the first place? I guess we're supposed to think that means that 72% of the 64% who oppose the war will still oppose it even if Petraeus reports progress, that is, that 46% of Americans both oppose the war and will continue to do so even if Petraeus reports progress, but that's really not what it says.

What it does say implies that 28% of Americans might change their opinion if Petraeus reports progress. Now, I suppose there might be people who don't oppose the war but would start opposing it if Petraeus reports progress, but that's a strange position; common sense says that most of the Americans who might change their opinions if Petraeus reports progress are among those for whom a change of opinion would entail ceasing to oppose the war. So somewhere between zero and 28% of Americans (but almost certainly closer to the latter) oppose the war now but might change their opinion if Petraeus reports progress. In other words, it's possible that up to 44% of those Americans who oppose the war now might change their opinion if Petraeus reports progress. That's pretty different from the 34% implied by the analysis in my first paragraph.

I decline to state which of these groups I am in. But I think the more interesting question is whether those who do not support the war and would not change their opinions even if Petraeus reports progress -- however many of them there actually are -- hold that view because they think any recent progress is irrelevant or because they think Petraeus is an unreliable source of information on the matter.

By the way, as the linked article title indicates, Petraeus has reported progress. What percentage of Americans are surprised?

Monday, August 13, 2007

Quote of the Day

Just saw this while researching a contribution to Wikipedia's type theory article:
Moreover we shall adopt the customary, self-explanatory, usage, according to which symbols belonging to the formal language serve in the syntax language (English) as names for themselves, and juxtaposition serves to denote juxtaposition.
Whoah.

Reference:

Alonzo Church. A formulation of the simple theory of types. The Journal of Symbolic Logic 5(2):56-68, Jun. 1940.