Thursday, October 12, 2006

What I learned in school

Nerd alert!

Yesterday in my optimization class, we learned about the integer knapsack problem. The basic idea is that you have a fixed volume to fill and you want to maximize or minimize, depending on your problem, the total cost of the items that you choose to fill the volume.

Okay, seems logical enough, although maybe a bit abstract. To help us understand the problem better, the lecturer gave an example. Here's where it gets weird - instead of using any number of generic examples to explain the problem, he starts out like this: "Imagine you're a thief."

Hmm.

It actually makes a lot more sense that way though. Imagine you're a thief. You break into a store and you want to steal as much stuff as you can, but you only have your backpack to carry stuff out in, so everything you steal has to fit in there. Obviously you want to turn a profit, so you're going to grab expensive stuff. But you're not going to steal the big TV because then you won't have room in your backpack for anything else. Given a fixed number of items each with a fixed cost, there's actually an optimal method for filling your backpack.

The funny part was that there are numerous examples that the lecturer could have chosen that would not have involved explaining the optimal way to commit a felony. Filling a backpack with the most essential items for a hiking trip, grocery shopping on a budget with a fixed amount of cabinet space, filling up your iPod with songs... but no, he chose the thief.

No comments: