# Probability that a group of 7 randomly choosen pizzas includes 4 specific pizzas when there are 4 kinds of pizzas to choose from.

This Problem is from "Bayesian Reasoning and Machine Learning" Exercise 1.16

Seven friends decide to order pizzas by telephone from Pizza4U based on a ﬂyer pushed through their letterbox. Pizza4U has only 4 kinds of pizza, and each person chooses a pizza independently. Bob phones Pizza4U and places the combined pizza order, simply stating how many pizzas of each kind are required. Unfortunately, the precise order is lost, so the chef makes seven randomly chosen pizzas and then passes them to the delivery boy.

1. How many dofferent combined orders are possible?

2. What is the probability that the delivery boy has the right order?

If I'm not mistaken the number of different orders is $4^4 = 64$ but I don't know how to do 2. Any help would be greatly appreciated.

• How does the chef "randomly choose" pizzas? Are they selected independently one at a time, or uniformly from all possible combinations of 7 pizzas? – platty Aug 2 '17 at 16:16
• We can only give a meaningful answer to part 2 if we assume that the 7 friends randomly choose 1 of the 4 pizzas as well .... (not very realistic ...) – Bram28 Aug 2 '17 at 16:26

For question $1$, I assume you meant $4^7$ rather than $4^4$? (for there are $7$ people that can each order one of $4$ pizzas).

Anyway, that doesn't work as an answer to question $1$, because it would be $4^7$ only if the order of the people matters, but it doesn't. For example, if Bob, Alice, Carrie, and Dave, Edgar, Felice, and Greg order (in the order as listed) pizzas $A,B,C,B,C,C,D$ respectively, then that it is in effect the same pizza order as when they would have ordered $B,C,B,A,C,D,C$: it is still $1$ pizza $A$, $2$ pizza's $B$, $3$ pizza's $C$, and 1 pizza $D$.

For part $2$, you need to consider the chance of each of the possible orders being made and ordered. Note that we are assuming that the 7 friends chose their pizzas randomly as well (not very realistic, but hey ...). Anyway, as an example:

The pizza order $7$ pizza's $A$ has a chance of $1$ in $4^7$ of being ordered and has the same chance of being made. So, a match for that particular order is $1$ in $4^{14}$

But the pizza order I gave as an example earlier, $1$ pizza $A$, $2$ pizza's $B$, $3$ pizza's $C$, and 1 pizza $D$ has a much larger chance of being ordered and made: 7 different people could have ordered pizza $A$, and from the remaining $6$, there are ${6 \choose 2} = 15$ pairs of people that can order pizza $B$, etc. So the chance of this order being ordered and made is:

$1$ in $( {7 \choose 1}\cdot {6 \choose 2} \cdot {4 \choose 3} \cdot {1 \choose 1})^2$

So this is what you need to do for all possible orders. As @S.Ong said, it's tedious. (though mathematicians more clever than I am will probably know some better method that is far quicker than this ...)

• Very insightful, thank you! If we have no information about the order wouldn't it be right to assume that the probability of the order being correct is 1/(number of possible orders), so 1/120 like @arch said? – Felix Hofstätter Aug 3 '17 at 8:29
• @FelixHofstätter I admit it is a little ambiguous, but when it says that 'the chef makes seven randomly chosen pizzas', that does actually not sound like he randomly picks one of the 120 differents kinds of orders, but rather that each of the seven pizzas was picking randomly. And that means that the chef is far lass likely to make an order where all pizzas are of one kind than that the chef ends up making an order where there is a mix. So, I believe that what I do in my answer is the correct way to do this, and that it is not $\frac{1}{120}$ – Bram28 Aug 3 '17 at 12:28
• I think you are correct, choosing each of the pizzas randomly does better fit the phrasing and context of the question. – Felix Hofstätter Aug 4 '17 at 18:51
1. Note that the order of pizzas does not matter; as such, you overcount.

2. If the pizzas are independently sequentially chosen, the probability of success depends upon the order itself (consider the cases where all 7 are the same pizza, or when one is different from the other 6). This will likely require some messy case work. If the random selection is from the set of all distinct combinations of pizzas, then your probability space is uniform, so you can use your answer from part 1) here.

• Yes, I think you're right that this will be messy .... – Bram28 Aug 2 '17 at 16:23