It’s All in Your Head

Sunday, July 16, 2006

Question: How much does a head of lettuce weigh?

(Stay with me, I’m going somewhere with this.)

Astute reader that you are, I’m sure you immediately answered, “It depends.” Well, you’re right. In my quick Google search I did not find a definitive answer to how many varieties of lettuce there are, but some advertiser would eagerly sell me over 40 different lettuce seeds, so let’s assume there are at least that many. I’ll narrow it down a bit, then: How much does an adult head of iceburg lettuce, like you would buy in any grocery store, weigh?

Unfortunately, the answer is still, “it depends.” Circumference and leaf density are going to be your main variables at this point. Still, we should be able to define a range of weights that 99% or more of the iceburg lettuce heads you see in a grocery store will fall into. According to the University of California Vegetable Research and Information Center’s report on Iceberg Lettuce Production in California, heads of iceburg lettuce are typically shipped in 50 pound cartons containing 24 to 30 heads. These numbers give us a range of 1.67 - 2.08 pounds per head. We should probably extend our range to something like 1.5 - 2.25 to reduce the number of outliers.

Still, we’re only guessing. What we really need is sample data. What if we could weigh millions of heads of lettuce? Then, do you suppose it would be possible to define a range that would encompass 99% or more of iceburg lettuce heads?

Apparently not.

I say that because, despite Wal-Mart having access to that volume of statistical data — over a long period of time — they still do not know, even approximately, how much a head of lettuce weighs.

We eat a lot of salads and, consequently, buy a lot of lettuce. Lettuce is sold by the head, not by the pound, so it makes sense that when I buy lettuce, I buy the biggest head I can. And when I shop at Wal-Mart, I always use the self-checkout. Nearly every time, the self-checkout gives me a “weight error” on the lettuce, because the machine thinks the weight is outside of the boundary of what a head of lettuce should be. I then have to stop and wait for the error to be cleared by a checker who doesn’t know what the error actually means. And since they don’t know, they don’t report it, and the problem never gets fixed.

If this was a rare occurance, I wouldn’t think anything of it. But it happens almost every time, which means a statistically significant percentage of their lettuce falls outside the acceptable range they have programmed for the weight of a head of lettuce.

From a developer’s point-of-view, I see two possible solutions: one easy but buggy, the other complicated but accurate. They could simply extend whatever range they are using. Probably a half pound on either side of the range would do it. You will still have outliers, but a lot fewer. The other option would be to constantly recalculate the range. Every time someone buys a head of lettuce, re-average based on the new data. I imagine it wouldn’t be long before they had enough data that outliers would almost never happen.

I suppose there’s a third option. If all you lettuce farmers out there (which I choose to believe is a statistically significant portion of my audience) would start weighing each head of iceburg lettuce you grow and sending the data to Wal-Mart, they could re-calculate based on that data. Here’s the address:

Wal-Mart Stores, Inc., Home Office
702 S.W. 8th Street
Bentonville, AR 72716

Of course, from a user’s point-of-view, I’ve already solved this problem for myself: I won’t ever buy lettuce at Wal-Mart again.