Wednesday, December 12, 2007

Volume Measurements

One of the biggest problem I've seen with commercial recipe software is in scaling recipes. Say you have a recipe that yields four portions. This is normally perfect for your family, but you have extended family coming over this weekend and you need eight portions. Just double it, right? No problem.

What if you've managed to track down a recipe that normally feeds 50, and you need it to feed your small family of four. What do you do now? That's easy. Just plug it into your home recipe program and suddenly that cup of Worcestershire sauce becomes... 0.08 cups? How the heck are you supposed to measure that? Such a pain. How about if I told you that 0.08 cups was equal to 0.64 fluid ounces? Is that any easier to deal with? Not really. What if I told you that was roughly the same as one tablespoon plus one teaspoon? Okay, we can handle that.

What recipe software needs to do is give us answers in terms of fractions and measurements that may have different names that what we entered, if necessary. For instance, we entered cups, but what we needed back were teaspoons and tablespoons. Decimals are fine for scientists and maybe wholesale food operations, but not for home users, and not even for most professional kitchens.

First of all, we need a basic breakdown. How many of X are in Y? Note: These measurements are standard US (imperial) measurements. Metric is easier, but not as common in my country.

1 tablespoon = 3 teaspoons
1 fluid ounce = 1 tablespoon
1 cup = 8 fluid ounces
1 pint = 2 cups
1 quart = 2 pints
1 magnum = 2 quarts
1 gallon = 4 quarts
1 peck = 2 gallons
1 bushel = 4 pecks

Okay, so magnums are usually only used in winespeak. And pecks and bushels aren't all that common, even in commercial kitchens. The highest they usually go is gallons, though at that level of production, they usually measure by weight. But that's another topic altogether.

It should also be noted that we occassionally measure in fractions. Most home and professional kitchens have both measuring cups (usually 1 cup, 1/2 cup, 1/3 cup, 1/4 cup) and measuring spoons (usually 1 Tbsp [tablespoon], 1 tsp [teaspoon], 1/2 tsp, 1/4 tsp). Oddly, 1/2 Tbsp, 1/3 Tbsp and even 1/3 tsp are pretty uncommon. Then again, we already know that 1/2 Tbsp = 1 1/2 tsp and 1/3 Tbsp = 1 tsp. 1/3 tsp gets left in the cold. Also, many cooks refer to a dash and a pinch as roughly 1/8 tsp, where a dash is for liquid ingredients and a pinch is for dry.

So we need software that will give us measurements using the smallest and/or easiest version of the following measurements:
  • 1/8 teaspoon
  • 1/4 teaspoon
  • 1/2 teaspoon
  • teaspoon
  • tablespoon
  • fluid ounce
  • 1/4 cup
  • 1/3 cup
  • 1/2 cup
  • cup
  • pint
  • quart
  • gallon

Other measurements are nice, but these will be sufficient for most operations. But that still doesn't help us in terms of actually setting up software. We need a common measurement that is easy to work with, that everything else can be converted to and from. Fortunately, in this measurement system (for both weight and volume) we have ounces. Every whole measurement larger than an ounce can be calculated in terms of full ounces, and everything smaller than an ounce can be calculated in terms of fractions of an ounce. But that still doesn't solve the decimal problem.

When it comes to decimals, we're going to have to do some rounding. I would personally prefer my software to tell me both the decimal value, and the approximate fraction(s) that that relates to, and let me choose. I suspect most bakers would start off wanting just the fraction, and after a week of failed pastries demand to know what the decimal would have been, so that they can adjust accordingly. Most cooks (non-bakers) would likely be fine with the approximations.

Note: this table will attempt to be conservative, for instance, only covering the values up to half an ounce. That should be sufficient for our needs. Since you would not normally be hard-coding values, I'll also include the fraction of an ounce. If you can't figure out how to convert fractions into division in your code, it's time to pick up a new hobby/career.

1/8 teaspoon = 0.020833333 oz (1/48 oz)
1/4 teaspoon = 0.041666667 oz (1/24 oz)
1/2 teaspoon = 0.083333333 oz (1/12 oz)
1 teaspoon = 0.166666667 oz (1/6 oz)
1 tablespoon = 0.5 oz (1/2 oz)

This tells us exact values. Unfortunately, few of our recipes will scale to exactly these amounts. So we round.

1/8 teaspoon = 0.020833333 oz (1/48 oz)
  0.03125 oz (1/32 oz)
1/4 teaspoon = 0.041666667 oz (1/24 oz)
  0.0625 oz (1/16 oz)
1/2 teaspoon = 0.083333333 oz (1/12 oz)
  0.125 oz (1/8 oz)
1 teaspoon = 0.166666667 oz (1/6 oz)
  0.25 oz (1/4 oz)
1 tablespoon = 0.5 oz (1/2 oz)

Anything smaller than 0.03125 oz is considered 1/8 teaspoon (a pinch or a dash), anything between that and .0625 is considered 1/4 teaspoon, and so on.

This is a pretty basic operation. Many years ago I had a Perl subroutine that did this for me (with a good bit of help from Harley), and I've managed to lose it. One day I'll write it again, unless somebody else beats me to it. But it seems to me that any recipe software worth using would take the above information into account.

Many thanks to TuxGirl for helping me with the math, since I'm so horrible at it myself. Yet another reason why I need my software to do my thinking for me.

3 comments:

  1. Or, you know, just use ml (milliliters), dl (deciliters) and, very occasionally, liters. First thing I do with any recipe is convert to easy-to-use units.

    Just make sure you have equipment marked in these units in addition to whatever classical size they have - tablespoon measure with "15ml" marked on it; a "cup" marked as 2dl or 180ml depending on where you live, and so on. That makes it easy to segue between the units and make you comfortable with them.

    ReplyDelete
  2. For baking (which is what I do most) you use only weights, not volumes, so that's a non-problem - well, a one-off problem as you convert a recipe for weights and your specific flour and may have to adjust it once or twice.

    For most other foods, well, nobody seems to worry that there's recipes out there with 180cc "cups" and 200cc "cups" when they use them. Most cooking has a fair bit of margin of error. Converting recipes between nice, even imperial measurements and nice, even metric gets you close enough (metric recipes all over the world are not failing to a higher degree than metric after all).

    But as I said, an easy way out is to have measures marked in both.

    ReplyDelete
  3. Yes, many people use volumes for baking. And you may need to convert recipes even if you do use weights normally - though you only do that once, as I wrote.

    My other point stands - bread recipes in metric measures do not fail any more often than US measured ones. And yet, they manage to use nicely rounded units anyhow. In reality, if you accept the inherent problems with using volume measurements for baking (I read your essay long ago; you make the point well), then it completely swamps whatever small discrepancy you get from going between rounded units in one to another.

    ReplyDelete

Comments for posts over 14 days are moderated

Note: Only a member of this blog may post a comment.