# What's the probability that one goldfish eats more than 2 pellets?

I scatter 10 pellets among the 7 goldfish in my tank. Assuming each goldfish has equal probability of obtaining any pellet, what is the probability that at least one goldfish eats over 2 pellets?

I tried to solve this problem by asking the reverse question: What is the probability that no goldfish eats over 2 pellets? And then complementing the solution. However, I couldn't find how this latter question is easier to solve. I am thinking about manually drawing out the possibilities, but figured that'd take long (7 is a lot of fish).

-

Think of the goldfish as distinct, and of the pellets as distinct, and assume that all pellets get eaten. Drop the pellets in one at a time. Any of the fish is just as likely to get the pellet as any other. So there are $7^{10}$ possible eating patterns (or, in mathspeak, functions from the set of pellets to the set of fish), all equally likely.

We count the number of these ways in which no goldfish eats more than $2$ pellets. Like you were suggesting, we go for the probability of the complement.

There are three different ways that we can imagine no goldfish eating more than $2$ pellets: (i) every fish gets at least one pellet. Then $4$ of the fish eat $1$ pellet each, and the remaining $3$ fish eat $2$ pellets each; (ii) exactly $1$ fish eats $0$ pellets. Then $2$ fish eat $1$ pellet each, and $4$ fish eat $2$; (iii) exactly $2$ fish eat $0$ pellets. Then every fish that gets to eat must eat $2$ pellets.

We do counts of (i), (ii), and (iii). For (i) the fish that get to eat $1$ each can be chosen in $\binom{7}{4}$ ways. For each such choice, the set of pellets they get to eat can be chosen in $\binom{10}{4}$ ways. And once this is done, the pellets can be distributed in $4!$ ways. For each of these ways, line up the lucky fish who get $2$ each, say in the order of their Social Insurance number (SIN). The fish with the smallest SIN can be assigned pellets in $\binom{6}{2}$ ways. For each of these ways, the fish with the second smallest SIN can be assigned pellets in $\binom{4}{2}$ ways. And now it's over. So the count for (i) is $$\binom{7}{4}\binom{10}{4}(4!)\binom{6}{2}\binom{4}{2}.$$

For (ii), the unlucky fish can be chosen in $\binom{7}{1}$ ways. The rest of the calculation follows similar lines as the calculation for (i). We get $$\binom{7}{1}\binom{6}{2}\binom{10}{2}(2!)\binom{8}{2}\binom{6}{2}\binom{4}{2}.$$

For (iii), the counting is simpler. The unlucky fish who get nothing can be chosen in $\binom{7}{2}$ ways. Now line up the lucky fish in order of SIN. The one with the smallest SIN can be given her pellets in $\binom{10}{2}$ ways. For each of these ways, the fish with the second smallest SIN can get her pellets in $\binom{8}{2}$ ways, and so on. So the number of patterns of type (iii) is $$\binom{7}{2}\binom{10}{2}\binom{8}{2}\binom{6}{2}\binom{4}{2}.$$

-
But are the pellets distinguished? My interpretation is that they shouldn't be treated as such, in which case there aren't $7^{10}$ possibilities. Seems to me that the outcomes "fish_1 eats pellets 1-9, fish_2 eats pellet 10" and "fish_1 eats pellets 2-9, fish_2 eats pellet 1" should be considered identical. Only the total number of pellets eaten appears to be relevant in the question. –  user12477 Sep 10 '12 at 22:32
@user12477: It seems to me that the model I am using is reasonable. There is no issue about distinguishability versus non-distinguishability. What is useful if we are going to do it by counting is to have a set of equally likely outcomes, and to count correctly total number of outcomes, and total number of favourable outcomes. –  André Nicolas Sep 10 '12 at 22:39
But the question of distinguishability directly affects the counting of the total number of outcomes. Please see the aside that I added to my answer. –  user12477 Sep 10 '12 at 23:03
...I take it back: $7^{10}$ is the number of equally likely outcomes, which is the crucial number. The 8008 outcomes that I counted in my answer are not equally likely. –  user12477 Sep 11 '12 at 7:41

Let $X_i$ be the (random) number of pellets the $i$-th fish ate. Then $(X_1,X_2,\ldots, X_7)$ is a random vector that follows that multinomial distribution. Then: $$\mathbb{P}\left( X_1=k_1, X_2=k_2, \ldots, X_7=k_7 \right) = \frac{1}{7^{10}} \binom{10}{k_1,k_2,\ldots,k_7} [ k_1+k_2+\cdots+k_7 = 10 ]$$ The complementary probability that no fish ate more than 2 pellets is: $$\begin{eqnarray} \mathbb{P}\left(X_1 \leqslant 2, \ldots, X_7 \leqslant 2\right) &=& \sum_{k_1=0}^2 \cdots \sum_{k_7=0}^2 \mathbb{P}\left( X_1=k_1, X_2=k_2, \ldots, X_7=k_7 \right)\\ &=& \binom{7}{5} \cdot \mathbb{P}\left(X_1=X_2=X_3=X_4=X_5=2,X_6=X_7=0\right) \\ && + \binom{7}{4,2,1} \cdot \mathbb{P}\left(X_1=X_2=X_3=X_4=2,X_5=X_6=1,X_7=0\right) \\ && + \binom{7}{3} \cdot \mathbb{P}\left(X_1=X_2=X_3=2,X_4=X_5=X_6=X_7=1\right) \\ &=& \binom{7}{5} \cdot \frac{1}{7^{10}} \frac{10!}{2!^5} + \binom{7}{4,2,1} \cdot \frac{1}{7^{10}} \frac{10!}{2!^4} + \binom{7}{3} \cdot \frac{1}{7^{10}} \frac{10!}{2!^3}\\ &=& \frac{858600}{7^8} \approx 0.148938 \end{eqnarray}$$ Thus the probability that at least one fish ate more than 2 pellets: $$p = \frac{4906201}{5764801} \approx 0.851062$$

-

The total number of ways to assign $10$ pellets to $7$ goldfish is just $7^{10}$; that's the easy part.

Now, let $N_{k,m_0,m_1}$ be the number of ways to assign $k$ pellets such that $m_0$ goldfish have eaten no pellets, $m_1$ goldfish have eaten $1$ pellet each, and the remainder have eaten $2$ pellets each. When a new pellet is thrown in, there will be $m_0$ ways to choose a goldfish to move from $0$ to $1$ pellets, and $m_1$ ways to choose a goldfish to move from $1$ to $2$ pellets, and so the recursion is $$N_{k,m_0,m_1} = (m_0+1)N_{k-1,m_0+1,m_1-1} + (m_1+1)N_{k-1,m_0,m_1+1},$$ with initial condition $N_{0,7,0}=1$ (and $N_{0,m_0,m_1}=0$ otherwise). Using the Python code,

def N(k, m0, m1):
if k==0:
if m0==7 and m1==0: return 1
else: return 0
else: return (m0+1) * N(k-1, m0+1, m1-1) + (m1+1) * N(k-1, m0, m1+1)

for m0 in xrange(0, 8):
for m1 in xrange(0, 8):
if N(10, m0, m1)>0: print m0, m1, N(10, m0, m1)


results in the output:

0 4 15876000
1 2 23814000
2 0 2381400


So there are $15876000+23814000+2381400=42071400$ ways to assign the pellets so that no goldfish gets more than $2$, and the corresponding probability is $$\frac{42071400}{7^{10}}=\frac{858600}{5764801}=0.148938...$$ Moreover, given that no goldfish ate more than $2$, the probability that all goldfish are fed is exactly $20/53$; the probability that exactly one is unfed is $30/53$; and the probability that exactly two are unfed is $3/53$.

-

First, count the total number of ways that the fish can eat the pellets (assume they all get eaten). For this, we construct all multisets of cardinality 10, chosen from a finite set of cardinality 7. (We keeping choosing fish 10 times, with no restriction on how many times ($\leq10$) that we can choose each fish.) The number of such distinct multisets is $C(7+10-1,10)=8008$.

Now follow your idea of counting the number of ways that no fish eats more than 2 pellets. If we write $p_i$ for the number of pellets eaten by fish$_i$, then $$p_1+p_2+\cdots+p_7=10,$$ with the restriction that $0\leq p_i\leq 2$ for each $i$. We can count these as follows: the key is to consider how many fish get 2 pellets.

Case 1: Five fish eat 2 pellets, two fish eat 0 pellets. This can happen $C(7,2)=21$ ways.

Case 2: Four fish eat 2 pellets, two fish eat 1 pellet, one fish eats 0 pellets. This can happen $7\times C(6,2)=105$ ways.

Case 3: Three fish eat 2 pellets, four fish eat 1 pellet. This can happen $C(7,3)=35$ ways.

These are the only possibilities, so there is a total of 161 ways that no fish gets more than 2 pellets. So the probability that at least one fish gets more that 2 is $\frac{8008-161}{8008}\simeq 0.98$.

Aside: The total number of ways that the fish can eat the pellets is not $7^{10}$. This result could be arrived at as follows: How many ways can the first pellet be eaten? Ans: 7. ... How many ways can the 10th pellet be eaten? Ans: 7. How many ways in total? Ans: $7\times\cdots\times7=7^{10}$.

But this fails to distinguish between these two outcomes: (i) Fish$_1$ eats pellets 1-9, fish$_2$ eats pellet 10; (ii) Fish$_1$ eats pellets 2-10, fish$_2$ eats pellet 1.

But these outcomes are identical in terms of the question, as they both correspond to "fish$_1$ eats nine pellets, fish$_2$ eats one pellet". Thus $7^{10}$ includes lots of multiple counting of the same outcome.

Further aside: This is wrong! 8008 is indeed the number of different possible ways that the pellets can be eaten (assuming distinct fish), but these outcomes are not equally likely. $7^{10}$ is the number of equally likely outcomes.

-

As I explained in How to calculate the number of favorable cases, I like to use multinomial coefficients to keep such calculations straight. The numbers below for the three cases have already been found by others who have answered this question. Yet I like the formulas below, as they don't involve much thinking; they are quite automatic.

$${7\choose 0,4,3}\times {10\choose 2,2,2,1,1,1,1}=15876000.$$ $${7\choose 1,2,4}\times {10\choose 2,2,2,2,1,1,0}=23814000.$$ $${7\choose 2,0,5}\times {10\choose 2,2,2,2,2,0,0}=2381400.$$

-