Thursday, January 3, 2008

Optimizing your nutrition

I used to be completely oblivious to what I ate. I would just eat whatever I wanted, whenever I wanted and never really worry about it. I have good reasons though, I'm 5'10 and 130lbs, I don't really have anything to worry about.


But this all changed last March when I went to the Computer Science Games for the second straight year. The CS Games, as it's called, is a week-end long competition where teams composed of undergrads from various universities fight in computer science related contests. One of the competition involved generating the best diet possible for an athlete, given a list of food, with their associated nutrition information, and a set of guidelines. I unfortunately don't have the exact problem anymore but the rules were of the type:

  • You need 2000 calories, you will lose one point for every calorie under or over that.
  • You lose 100 points for every gram of trans fat.
  • You lose 100 points if you don't have at least one green vegetable.
  • You need exactly 60g of sugar and will lose 5 points for every g under or over.
  • You need 100% of the daily intake of Vitamin A
  • etc.
It's a typical example of what is called combinatorial optimization. This is when I realized that every thing you put in your mouth can be categorized and transformed into a set of numbers. Ever since then I've been semi-obsessively looking at every nutrition label before eating something. Not because I'm worried about my health or my weight, but simply because now that I know they're there it's difficult to ignore them.

Since there are people out there with degrees in nutrition, I won't try to pretend actually knowing a lot. But here are the tips I picked up in the last nine months or so.

  1. Make sure to look at the serving portion. Since every number is per portion, if a company decides that their juice box has two portions in it, they can effectively halve everything, and some do.
  2. Saturated fat, bad. Trans fat, BAD!
  3. People eat way too much sodium, especially if most of what you eat come from a box or a can.
  4. You need a lot of physical exercise to burn calories so don't think you can eat as much as you want and you'll just work it off. It'll take almost an hour of jogging to burn a cheeseburger. Or if you go running for 30 minutes, come back and drink a can of soda to cool off, you've just "wasted" half your exercise.
  5. There is an awful lot of sugar in soda, about 10 teaspoon of it. Compare that to how much sugar you put in your coffee. I used to drink a lot of Pepsi, not anymore.
  6. Same thing with beer, lots of calories in them. If you drink 24 beers on top of your regular diet, you will gain a pound.

Health Canada has a guide to help you in understanding the labels.

P.S. For the record, we solved the problem by writing an algorithm to find a very good solution, but got a bad score because we stupidly thought a "green pepper" was a "green vegetable". Turns out the color isn't the only thing that makes a vegetable green...

No comments: