Math Problem: pizza topping combinations

One of my favorite commercials is an old ad for Little Caesar’s pizza.

They were offering a deal for ordering 2 pizzas, with up to 5 toppings on each.

The commercial emphasized how customers could order pizzas in many different possibilities.

The question is: exactly how many distinct ways are there to order toppings on a pair of pizzas? You’ll need to know there are 11 possible topping choices.

Below is a link to the commercial which also contains the answer Little Caesar’s came up with.

One thing to keep in mind: the answer in the commercial is wrong!

Video: Little Caesar’s pizza math

Transcript of commercial:

Guy: So what’s this new deal?

Employee: Two pizzas.

Guy: Two pizzas! Write that down.

Employee: And on the two pizzas choose any topping up to five.

Kid: Do you…

Employee: …have to pick the same topping on each pizza. No!

Math Kid: Then the possibilities are endless.

Guy: What do you mean? Five plus five are ten.

Math Kid: Actually, there are 1,048,576 possibilities.

Guy: Ten was just a ballpark figure.

Old Guy: You got that right.

Narrator: Little Caesar’s favorite five – not one, but two pizzas – choice of five toppings – $7.98 – pizza, pizza.

Beware: the math in the commercial is wrong!

I sensed you could get a lot of possibilities when picking 5 toppings out of 11 choices. So how did they get the number of over a millions ways?

The calculation is based on the following logic. The person added up the number of ways you could order a single pizza with up to 5 toppings out of 11. You need to add up the number of ways to order the pizza with 0 toppings, 1 toppings, 2 toppings, 3 toppings, 4 toppings, and 5 toppings.

The way to calculate this is to add up the number of combinations as follows:

This means one pizza can be ordered in 1,024 ways. Similarly, the other pizza could be ordered in that many ways too.

The calculation in the commercial is based on multiplying 1,024 by 1,024 to get 1,048,576.

This seems like proper logic until you think about it more carefully. The problem is the above calculation treats each pizza individually instead of considering them as a pair.

That is, imagine one person ordered a cheese pizza and a pepperoni pizza, and another person ordered a pepperoni pizza and a cheese pizza. These are clearly identical orders as each person gets one cheese and one pepperoni pizza. But the formula above would double count this as two orders–it would count (cheese, pepperoni) and (pepperoni, cheese) as distinct ways of ordering the pair of pizzas.

The formula must be corrected to get the right number. This leads to the first question.

Question 1: How many distinct ways are there to order a pair of pizzas, with up to 5 toppings out of 11?

Until this point I have excluded another issue in ordering pizza. In deals like this, it is usually not allowed to order double toppings.

But for the sake of argument, let us assume that you can order double toppings so you can load up on your favorite flavors. How does this change the number of ways to order?

Question 2: How many ways are there, if double toppings are allowed?

A note to clarify: A double topping counts as two. So if you order double pepperoni, you can only get up to three more toppings.

As I have been doing lately, I will post my answer in a few days so you can have some time to figure out the answer.

If you do get the solution early, feel free to post your numerical answers (but not the solution method) and how long it took you.

Update 5-3-11: my solution posted below



Share this post:

| More

Previous post:

Next post:



  • Scott

    Question 1: I’d say the true answer is half the given one. For every distinct combination there is a mirror ot that combination. So every combination is doubled. Dividing by half should get rid of that.

  • http://vpsgraphics.com Paul Smith

    15,692,035,590
    Assuming double topping, and ignoring “zero toppings” as an option. Took 10 minutes on my phone, and haven’t double checked my thinking.

  • Ari

    Why do you say that the calculation is wrong ?

    You say “That is, imagine one person ordered a cheese pizza and a pepperoni pizza, and another person ordered a pepperoni pizza and a cheese pizza. These are clearly identical orders”

    they don’t have to be if you clearly number the pizzas.

  • Justin

    @Ari: Numbering the pizzas doesn’t stop the fact that the pizzas both have the toppings: cheese and pepperoni. They are identical pizzas, regardless of which comes first or second. And as such, you’d be double-counting them to give you a higher number than the true possibilities.

  • E

    Scott, two problems:

    First, when you say “dividing by half” you probably meant “dividing by two” or “multiplying by half” or just “halving”. The former isn’t the same as the others.

    Second problem, there is no mirror of two identical pizzas, so you must take care not to remove those from the count. Kind of like how rolling 5 and 4 on two dice is twice as likely as 5 and 5.

  • Frank

    Yeah, I got half the original answer, 524288, using some method involving MATLAB instead of common sense. (“Elapsed time is 0.013884 seconds.”)

  • Frank

    @E: Or he meant “dividing in half.” Also, the mirror of two identical pizzas is two identical pizzas. Such combos are double counted when taking 1024^2.

  • Scott

    @E:

    Yes, thank you, I meant “divide by two.” Blergh.

    Good catch about the identical Pizzas. This is easy enough to account for as there are only 1024 such pizzas.

    I believe this would make the answer:

    {[(1024^2) - 1024] / 2} + 1024

  • http://vpsgraphics.com Paul Smith

    @E:
    Rolling a 4 & 5 is not twice as likely as rolling double 5s.

  • http://vpsgraphics.com Paul Smith

    4,510,506
    Now that I’m home and have rethought the matter, I think this is better. I didn’t account for duplications on each individual pizza…the duplications between pizzas.
    (10 minutes)

  • Frank

    When doubles are allowed, I get 3,732,944, which seems way too high.

  • http://vpsgraphics.com Paul Smith

    9,537,528

    First post: Overlooked individual duplication (but allowed for fewer than 5 toppings)

    Second post: Corrected duplication, but then forgot about few toppings.

    Third, and I hope final post: Nailed both simultaneously.

    Third times a charm. That’d be nice on a solution that relies heeeavily on triangle numbers.

  • Eyal

    @Paul: There are 36 ways that a roll of two dice can turn out. Only one of them is 5,5 but 4,5 and 5,4 both exists, so it’s double. Draw a 6×6 matrix of all the possibilities and see for yourself.

    @Frank: Imagine that there were only 2 toppings avaiable (lets say olives and mushrooms) and you only got to choose up to 1 topping per pizza. The number of possible pizzas would be 3 (olives alone, mushrooms alone, and plain). So with two pizza, that would be 3*3=9. By your logic, removing the doubles would leave 4.5 possibilities.

  • Frank

    @Eyal: Oh, I see that you are right. Thanks

  • Aditya Kelkar

    Q1) I think there are 1047552 ways to order the pair of pizzas, with no double toppings.

  • Aditya Kelkar

    My previous comment is based on the assumption that the two pizzas cannot be the same……

  • Aditya Kelkar

    If double topppings are allowed, and the two pizzas cannot be the same, then 2510640 possibilities arise…….:)

  • Aditya Kelkar

    Correction: Hopefully this is right now…..

    Question 1) 523776 ways without double toppings
    Question 2) 1223830 ways with double toppings…

  • Aditya Kelkar

    @Eyal in your example of 2 toppings, there would be 3*2 = 6 total possibilities, i.e. 3 without duplicating the combinations.

  • Aditya kelkar

    Q2-1,628,110 possibilIties…?

  • Dan

    I found 3510 unique ways to make one pizza with up to 5 toppings with the option of double toppings.
    My final answer is 3510^2/2 =

    6160050

  • http://vpsgraphics.com Paul Smith

    Eyal: thanks for pointing it out. Funny thing is, that fact wasn’t lost on me as I worked out the answer. I just flubbed was making that response. :-/ oh well, thanks though.
    Is there one formal question that is the one we are all answering. It seems that there are many different starting assumptions that is contributing to the varying solutions…that in addition to just plain and simple mistakes.

  • patrick

    1) 523776 if you don’t allow the pizzas to be the same, and 524800 if you do.
    About a minute for the answer disallowing pizza duplication and another two thinking about it to realize my method removed duplicates when they probably shouldn’t be.

  • http://www.mindyourdecisions.com/blog/ Presh Talwalkar

    Thanks for all the responses! Here is my writeup of the solution.

    Question 1:
    A single pizza can be ordered in 1,024 ways as calculated above. If we order both pizzas with the same topping combination–like having both pizzas as pepperoni and mushroom–it is easy to see there are 1,024 ways to do this. To this number we need to add the number of ways the two pizzas have different topping orders. This is C(1024, 2)–that is, we pick two from the total possible set.

    That means we have C(1024,2) + 1024 = 524,800 ways to order a pair of pizzas.

    Question 2:
    This is a little bit trickier to calculate. My approach is to count the number of ways to order a double topping pizza and then add it to the previous answer.

    Note: I believe this is the right answer, but no one has checked my work. If you find an error please do let us know.

    Step 1: How many ways are there to order a pizza with two double toppings?

    If there are four toppings on the pizza then it must be the case we ordered exactly two double toppings. The number of ways to do this are C(11,2). Another case is the pizza could have five toppings. We again pick two toppings as doubles, and then the single topping is one of the nine possible remaining toppings. Thus there are C(11,2) * 9 ways to do this.

    That means we have: C(11,2) (1 + 9) = 550 ways to order a pizza with two double toppings.

    Step 2: How many ways are there to order a pizza with a single double topping?

    We need to break this up into cases depending on how many toppings are ordered. If exactly two toppings are ordered, then the number of ways is 11 as any topping can be chosen as the double.

    If exactly three toppings are ordered, then one topping must be added to the double topping. The number of ways this can be ordered is 11*10.

    If exactly four toppings are ordered, then two toppings must be added to the double topping. There are 11 ways to pick the double topping, and then there are C(10,2) ways to pick the single toppings, so we have 11*C(10,2).

    For five toppings the logic is similar. There are 11 ways to pick the double topping, and then C(10,3) ways to pick the three single toppings along with it.

    We thus find out the number of ways to order a pizza with a single double topping is:

    11 + 11*10 + 11*C(10,2) + 11*C(10,3) = 1,936

    Step 3: Calculate the number of ways to order a pair of pizzas

    We now add up the ways to order a single pizza:

    There are 1024 ways without any double toppings
    There are 1936 ways without one double toppings
    There are 550 ways without two double toppings

    This adds up to 3,510 ways to order a single pizza.

    Now we use the method from Question 1 to deduce there must be:

    C(3510, 2) + 3510 = 6,161,805 ways to order a pair of pizzas.

    Extra credit: how many ways can you order the pizza if you allow for triple, quadruple, and quintuple toppings?

    You get roughly six times more ways to order pizza.

    The answer is given on this page as 36,709,596.

  • Aditya Kelkar

    Presh, heres my reasoning, I will have to depend on you to point out where I may be wrong!

    Q1) I thought the pizzas have to be different. So in that case, the first has 1024 ways of selecting it, the second has 1023. So the combinations would be (1024*1023)/2 = 523776.

    Q2) For one pizza, if I want to select 5 toppings, but doubling 2 of them, it becomes a 11C3 problem (2+2+1), counting # of unique toppings, instead of total toppings. I could also do 2+1+1+1 (11C4)

    Similarly, if I want to select 4 toppings, I could do 2+2 (11C2) or 2+1+1 (11C3).

    If I want to select 3 toppings, I can only do 2+1 (11C2).

    If I want to select 2 toppings, I can do just 2 (11C1).

    So the total number of pizzas I can have is
    1024 + 11C4 + 2*11C3 + 2*11C2 + 11C1 = 1805 possibilities for one pizza.
    Using the same assumption as in Q1, #2 = (1805*1804)/2 = 1628110.

  • http://vpsgraphics.com Paul Smith

    I was already treating the puzzle with thinking that quintuple toppings were allowed. So my answer of 9,537,528 was with that understanding.

    I don’t see how the 36,709,596 was arrived at.

    If we were to reduce the puzzle to:
    1 Pizza
    4 Choices
    up to 3 Toppings, (triple cheese, being allowed)

    What would you arrive at? (I get 34)

    Then change it to 2 Pizzas. (I get 595)

  • David

    This isn’t a complicated puzzle, but fun to discuss – and funny to see that the company got it wrong. I still like the, “Let’s Make a Deal,” puzzle with the three doors. For me, it’s one of those puzzles that I can understand, but I still don’t feel like I do. Hah.

  • Pingback: Denny’s math commercial - Mind Your Decisions

Previous post:

Next post: