### A Summer Hamburger Challenege

Its lunchtime. Are you hungry? Might you want to enjoy

“a place where [you] can escape today’s complicated world and experience the food, fun and friendliness reminiscent of feel-good Americana”?

If so, you will so be in luck. Johnny Rockets is about to open on Connecticut Avenue, just above Dupont Circle, in the old Burrito Brothers space (what ever happened to BB anyway?).

How might Johnny Rockets be different from any other burger joint and earn its title of “the Original Hamburger.” How about this claim off its website:

Johnny Rockets’ hamburgers can be made more than 1 million different ways. Favorite toppings include Tillamook Cheddar cheese, crisp onion rings, grilled onions and all-meat chili.

Hmm.. More than 1 million ways? I think I taste a great lawsuit from a *very* bored and hungry summer intern.

What are you talking about? If there are 18 things you can put on a burger (which doesn’t sound like a lot to me when you figure condiments, different cheeses, etc.) and four ways of cooking it, that’s over a million different ways right there.

Al, some basic math.

18 toppings x 4 ways to cook = 72 possible combos, slightly less than the 1,000,001 target

Wayan, some basic combinations.

18 toppings, each either on or off x 4 ways to cook = (2^18)*4 = 1,048,576 possible combos.

Um, that would be 18 x 2 x 4 = 144 not 2 to the 18th power.

You’re both wrong. Wayan, your numbers ignore that if you have toppings A, B and C you actually have more than 3 combinations – 6, in fact.

Al, you’re failing to recognize that the combinations are not order-dependent – this is a set. A burger with A & B is the same as a burger with B & A.

The number of topping combinations is actually 18!, 18 factorial, times 4. NOT 2 raised to the power of 18 times 4. Google calculates that as 6.40237371 × 10^15

And actually, you need to add 1 to that: no toppings.

And 18 is less than 1,000,001, the number (over 1 million) that we need to reach in order for the Johnny Rockets claim to be true.

Again, where is that bored and hungry lawyer?

Um, no. I don’t know where you’re coming up with your method of calculation, but it’s just plain wrong. Might be a little counterintuitive, but the 2^18th is quite right.

Can’t wrap your mind around it in the abstract? Try this illustration. Suppose the only things you could put on a burger were ketchup, mustard, and/or cheese (K, M, and C) and you could only cook the burger rare or well-done (R or W). That’s 3 toppings, 2 ways to cook. By your formula, that’s 3×2 = 6 combos. By mine, it’s (2^3)*2 = 16. Which sounds right?

Still don’t believe me? Count ’em: plain-R, plain-W, K-R, K-W, M-R, M-W, C-R, C-W, KM-R, KM-W, KC-R, KC-W, MC-R, MC-W, KMC-R, KMC-W.

Got it now?

math geek fight! i thought this was an english major turned lawyer town.

Don, not quite. 18! would be the number of 18-member

permutationsyou could make from a set of 18 total members.You’re quite right that we want combinations, not permutations, and the general formula for that is n!/((n-k)!*k!), where k is the number of elements in the combination, and n is the total number of elements from which to choose.

Wrinkle is that, while our n=18 (or whatever), we don’t have a fixed k: it can range from 0 to n, since we can have none of the toppings, some of them, or all of them. We could sum up this equation for each value of k, or we could just do it the way I did it in the first place, which is equivalent.

Crap-o, Al’s right – I did a quick check in my head before I posted that and didn’t even notice that I failed to count combos with all items and no items.

My theory of algorithms prof would be ashamed of me.

And NC – I’d say how completely I forgot my permutation/combination formulas proves I’m a comp sci turned writer type, not a math geek.

The only thing more riveting than this “Mathletes” smackdown was the Great Spelling Bee Conspiracy of 2006.

I’m going to McDonalds.

There’s still a Burrito Brothers in the Union Station basement food court. I stop by there at least once a week for a super spinach.

Wow, ime gettin’ edjamacated.

good lord. forget the possible hambuger combinations and hand me a chocolate malt shake…its one of the best