r/askmath•
northzilla

How many unique sandwiches can I make with 3 meats and 4 cheeses?

Use at least one meat and one cheese per sandwich and up to any number of both. Me and my friend can't figure out how to solve this problem!

Posted Jan 10, 2016, 1:23 AM UTC

01
Deckard666•

I can think of two ways to do this:

You can just add up all the combinations using 1 meat and 1 cheese, 1 meat and 2 cheeses, etc. This can be summed up in the expression

sum(sum((3 choose i)*(4 choose j),j=1..4),i=1..3)

You can then input this in wolframalpha to get the result: 105 possible ways to make a sandwich.

Alternatively, you could see every meat and every cheese as a binary choice: you either put it in the sandwich or you dont. Thus, the number of possible ways to put meat in the sandwich is 2^(3)-1 (you have 3 meats, and you have to discount the scenario in which you use no meat at all). Similarly, the number of ways to put cheese in the sandwich is 2^(4)-1.

You can then multiply these 2 values to get the same result: (2^(3)-1)*(2^(4)-1)=7*15=105

2