How many ways can two pizzas be chosen from 4 sizes and 8 toppings

combinatorics

You are ordering two pizzas. A pizza can be small, medium, large, or extra large, with
any combination of 8 possible toppings (getting no toppings is allowed, as is getting all
8). How many possibilities are there for your two pizzas?

The no of ways of ordering the pizza is (since the order does not matter but replacements are allowed):
$$P_p= \binom{4+2-1}{2} = \binom{5}{2}=10$$

And the 8 toppings (including the no toppings options could be chosen in): $$P_t= \sum_{k=0}^8 \binom{8}{k}$$

And the solution is $P_p*P_t$.

Is my reasoning correct?

Best Answer

Number of ways to select sizes for two pizzas $ = {5 \choose 2} \,$ (as the order does not matter but replacements are allowed).

Number of ways to select toppings on a pizza $ = 2^8 = 256$ as you can choose each topping independently (either it is selected or not selected).

So far your workings is correct. Now split the cases as follows -

i) where two pizzas are of different sizes - as both pizzas are of different sizes, they are distinct and hence total number of possible toppings choices $ = 256 \times 256$.

Example - say you have chosen $(S, M)$ pizza sizes and say you have choice of only one topping - pineapple (P or N - none). Then one pizza has $2$ combinations of toppings and so two of them have $2^2 = 4$ different combinations. $(S - P, M - P), (S - P, M - N), (S - N, M - P), (S - N, M - N)$.

ii) Both pizzas are of the same size - now there is no distinction between them and hence it is a case where the order does not matter but replacements are allowed. So total number of choices of toppings on a pizza should be extended to two pizzas in this fashion.

Total number of cases where both pizzas are of same size $= 4 \, (S, M, L, XL)$.

Total number of cases where both pizzas are of different sizes $ = 10 - 4 = 6$.

i) Number of combinations $ = 6 \times 256^2$

ii) Number of combinations $ = 4 \times {257 \choose 2}$

So total number of combinations $ = i) + ii) = 524800$.

EDIT: or you can simply look at it as $1024$ possibilities for a pizza and when you extend it to two pizzas where order does not matter but replacements are possible.

So total number of combinations = $ {{1024 + 2 - 1} \choose 2} = 524800$