I was at a restaurant that allows you to build your own custom burger. I got bored and started to work out how many possible combinations of burger there could be. After figuring that out and sharing the number with a friend he wondered how much it would cost you if you were to order every possible combination. This is where I got stuck.
Ignoring all the options that don't affect the price here's the basic menu:
- Choose either one (\$7.99) or two (\$9.48) patties.
- Choose from 7 cheeses \$0.89 each
- Choose from 10 hot toppings \$0.99 each
- Choose from 3 premium toppings \$1.49 each
- Choose from 4 cold toppings \$0.39 each
I've been mulling it over in my head for a few days and I can't really figure out a good way to go about it. The best thing I've come up with so far is to pick a category and find out the total to try all combinations in that category using $\sum _{i=1}^m \binom{m}{i} c i$ where $c$ is the cost per item and $m$ is the total number of items to choose from. Then taking that and multiplying it by all the other possibilities created by the other categories.
Please forgive me if I'm missing something obvious or screwed something up, my formal schooling doesn't extend much beyond algebra and that was a decade ago.