2

I found a solution for this that uses multinomial however I tried to solve it in a different way and I don't know where I am going wrong.

So I thought how about we fill each box with one ball first, and then put the remaining 3 in all possible boxes.

This was my reasoning:

First let's choose 4 balls from the 7 and order them, that's 7C4*4!
Now the number of ways to place the remaining 3 balls is: 4^3
The cardinality of our sample space is 4^7
So the probability should be: (7C4*4!*4^3)/4^7
However this yields a number greater than 1.

Could you point where I am going wrong?

  • You are double counting: When the first box contains $B_1, B_2$, this can happen in more than one way in your counting: Choosing $B_1$ first and putting it in first box or choosing $B_2$ first. –  Sep 27 '16 at 10:10

3 Answers3

2

Use inclusion/exclusion principle.


First, count the number of ways to distribute $7$ balls into $4$ boxes so that no box is empty:

  • Include the number of ways to distribute $7$ balls into at most $\color\red4$ boxes, which is $\binom{4}{\color\red4}\cdot\color\red4^7$
  • Exclude the number of ways to distribute $7$ balls into at most $\color\red3$ boxes, which is $\binom{4}{\color\red3}\cdot\color\red3^7$
  • Include the number of ways to distribute $7$ balls into at most $\color\red2$ boxes, which is $\binom{4}{\color\red2}\cdot\color\red2^7$
  • Exclude the number of ways to distribute $7$ balls into at most $\color\red1$ boxes, which is $\binom{4}{\color\red1}\cdot\color\red1^7$

Then, divide this result by the total number of ways to distribute $7$ balls into $4$ boxes:

$$\frac{\binom{4}{4}\cdot4^7-\binom{4}{3}\cdot3^7+\binom{4}{2}\cdot2^7-\binom{4}{1}\cdot1^7}{4^7}$$


Please note that you get the same probability even if the balls and/or the boxes are indistinguishable from each other.

barak manos
  • 43,109
  • The description of what you are computing is a bit confusing. If we can compute "the number of ways to distribute $7$ balls into at most $3$ boxes", that would seem to be the complement of filling all the boxes. – robjohn Sep 27 '16 at 11:11
  • @robjohn: Our solutions seem to be identical, but I agree with you that my description is rather confusing (for the exact reason which you have mentioned). Let me think how to rephrase this... Thanks. – barak manos Sep 27 '16 at 11:17
  • I can remove mine once you've updated yours. – robjohn Sep 27 '16 at 11:22
  • @robjohn: Thanks. I suggest that you leave yours, with the pointing out of the problems in my description (or at least leave it here in that comment above). Essentially, in each bullet I am fixing a double-count of the previous bullet, until the exact count is achieved. But I'm not really sure how to rephrase the description... Be my guess to fix it if you can think of a more accurate manner :) If the answer gets too many down-votes, then I'll assume that it's not good enough to remain here... Thanks again. – barak manos Sep 27 '16 at 11:30
  • Your answer seems to be using the Generalized Inclusion-Exclusion Principle as described in this answer. In this context $S(i)$ is the number of arrangements with box $i$ empty. Then, the cadinality of the all intersections of $j$ of the $S(i)$, $N(j)=\binom{4}{j}(4-j)^7$. Your formula counts the number of arrangements in none of the $S(i)$. – robjohn Sep 27 '16 at 12:02
0

This answer uses Inclusion-Exclusion just like barak manos' answer, but as the description in that answer seems a bit confusing, I am posting this answer.


The number of ways for one particular box to be empty (other boxes may be empty) $$ \overbrace{\ \ \ \binom{4}{1}\ \ \ }^{\substack{\text{number of ways to choose}\\\text{the particular box}}}\,\,\overbrace{\ \ \ \ \ \vphantom{\binom{4}{3}}3^7\ \ \ \ \ }^{\substack{\text{number of ways to put the $7$ balls}\\\text{into the remaining boxes}}} $$ The number of ways for two particular boxes to be empty (other boxes may be empty) $$ \binom{4}{2}2^7 $$ The number of ways for three particular boxes to be empty $$ \binom{4}{3}1^7 $$ Inclusion-Exclusion says that the number of ways to have at least one box empty is $$ \binom{4}{1}3^7-\binom{4}{2}2^7+\binom{4}{3}1^7 $$ Since there are $4^7$ ways to put the balls in the boxes, there are $$ 4^7-\binom{4}{1}3^7+\binom{4}{2}2^7-\binom{4}{3}1^7 $$ ways to have no boxes empty. The probability of this is $$ \frac{4^7-\binom{4}{1}3^7+\binom{4}{2}2^7-\binom{4}{3}1^7}{4^7}\doteq51.27\% $$

robjohn
  • 345,667
0

Different approach, different solution:

Count arrangements (for 'no box empty' I don't understand why 'distinguishable' matters)

A) All arrangements: place 3 bars between 7 balls: $10 \choose 3$.

B) Non-empty arrangements: Then remove 4 balls, one for each box, and place 3 bars between 3 items: $5 \choose 3$

Probability: B) / A) = $\frac{1}{12}$

Then, when I look at the reputation of the other authors, I wonder where I went wrong.

(Or are not all arrangements equiprobable?)

Pieter21
  • 3,475
  • The arrangement $2/2/2/1$ has probability $$\frac1{4^7}\frac{7!}{2!2!2!1!}=\frac{630}{16384}=3.8452%$$ The arrangement $7/0/0/0$ has probability $$\frac1{4^7}\frac{7!}{7!0!0!0!}=\frac1{16384}=0.0061%$$ This approach counts these as both the same. – robjohn Sep 28 '16 at 11:01
  • I was afraid of that, thanks! – Pieter21 Sep 28 '16 at 14:17