At JOMO's Pizzeria, you can design your own pizza. You can choose from any of the 6 toppings: Pepperoni, Salami, Onions, Mushrooms, Pineapples, and Ham. You can also choose between a thick and thin crust. A plain pizza with no toppings costs $120 HKD. Each extra topping you add on costs an extra $20 HKD. If I only have $200 HKD, how many different types of pizza could I order?
Details and Assumptions
You are allowed to order a Pizza with repeating toppings, so you could order a pizza with 3 toppings of all pineapple.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
You can do this without casework. Ignore the different crusts to begin with. Also, denote the number of toppings of pepperoni as a 1 etc. up to ham as a 6 . So in fact we want to find the number of solutions to a 1 + a 2 + a 3 + a 4 + a 5 + a 6 ≤ 4 , where all terms are non-negative integers. This is also the same as the number of solutions to a 1 + a 2 + a 3 + a 4 + a 5 + a 6 + k = 4 where again all terms are non-negative integers. Therefore, using stars and bars, the number of possibilities is ( 4 7 + 4 − 1 ) = ( 4 1 0 ) . But each pizza can also either be thin crust or thick crust, meaning that the total number of possibilities is 2 ( 4 1 0 ) = 4 2 0
Log in to reply
Isn't this also called the pigeon-hole principle?
Log in to reply
No. It is called Stars and bars . Josh's approach of adding an additional term to deal with the inequality is extremely useful to simplify the calculations.
You can learn more about the Pigeonhole Principle .
I have just read about Stars and Bars and I thought it was explained well. But, I got confused with how from a 1 + a 2 + a 3 + a 4 + a 5 + a 6 + k = 4 , you got ( 4 7 + 4 − 1 ) . I am thinking that 7 refers to the number of terms ( a 1 to k ). Am I correct? And, where do the numbers ( 4 7 + 4 − 1 ) come from?
Log in to reply
So you know that a1, ... k can be 0 to whatever. But stars and bars only works when they're greater than or equal to 1. So you let a1=a'-1 etc. so then you have a1'+a2'+a3'+...k'=7+4=11. So now you want stars and bars on a1' etc. and then when you do that, subtract 1 from everything to get your original a's and k's. There are 11-1 choose 7-1 = 10 choose 6 == 10 choose 4 ways.
Log in to reply
@Faraz Masroor – Er... not really the explanation I expected.
I came up first with 3 1 1 0 because I assumed that a pizza with 2 0 HKD worth of, say, pineapple is different from another pizza with 4 0 HKD worth of pineapple (because it had more toppings). I really wish the problem was clear with that.
Oh, well. Back to Level 3.
Log in to reply
Me too :)
Me also.. The problem is vague about this. Personally, I still consider a pizza with 2 pineapple toppings as being of a different type than a pizza with 1 pineapple topping..
Same here
With 2 toppings should not we have 2 6^2=72 with 3 toppings 2 6^3=432 and so on
Log in to reply
Please refer to the Stars and Bars algorithm Calvin was above talking about, to clarify your doubt.
This was among the few questions, I couldn't get on JOMO.
Problem Loading...
Note Loading...
Set Loading...
This is Actually a question in JOMO 1, if you think this question wasn't too hard but isn't too easy, then you should take part in JOMO!
The Pizza I order can have a maximum of 4 toppings.
If there are no toppings, I can order 2 different pizzas, one with thick crust and one with thin crust.
With 1 topping, There are C 1 6 = 6 different toppings you can choose, and you can choose between thick and thin crust. So there are 12 different pizzas you can order with 1 topping.
With 2 toppings, you can have 2 different toppings or two identical toppings, which has C 2 6 = 1 5 and C 1 6 = 6 different combinations respectively. You can choose between thick and thin crust. So there are ( 1 5 + 6 ) × 2 = 4 2 different pizzas you can order with 2 toppings.
With 3 toppings, you can have 3 different toppings, two identical toppings and 1 different, and 3 identical toppings, which has C 3 6 = 2 0 , C 1 6 C 1 5 = 3 0 , and C 1 6 = 6 different combinations respectively. You can choose between thick and thin crust. So there are ( 2 0 + 3 0 + 6 ) × 2 = 1 1 2 different pizzas you can order with 3 toppings.
With 4 toppings, you can have 4 different toppings, 2 identical toppings and 2 different, 2 identical toppings and another 2 identical toppings, 3 identical toppings and 1 different, and 4 identical toppings, which has C 4 6 = 1 5 , C 1 6 2 ! C 1 5 C 1 4 = 6 0 , 2 ! C 1 6 C 1 5 = 1 5 , C 1 6 C 1 5 = 3 0 and C 1 6 = 6 different combinations respectively. You can choose between thick and thin crust. So there are ( 1 5 + 6 0 + 1 5 + 3 0 + 6 ) × 2 = 2 5 2 different pizzas you can order with 4 toppings.
In total there are 2 + 1 2 + 4 2 + 1 1 2 + 2 5 2 = 4 2 0 Different Pizzas I can order with $200 HKD