In order to explain some physics related experimental results, I would have to find a general formula for the following problem:

"How many different ways are there to put $x$ indistinguishable balls into $y$ distinguishable boxes, given that every ball has to be put inside a box and each box is either left empty or receives exactly one ball."

Can anybody provide some help with this. Thanks!

  • 1
    $\begingroup$ I assume you meant to say each box can contain one ball. Hint: Select which boxes will receive a ball. $\endgroup$ Commented May 12, 2021 at 1:58
  • $\begingroup$ Yes, I meant that a box can be either empty or occupied by 1 ball. $\endgroup$
    – Light
    Commented May 12, 2021 at 2:07
  • 1
    $\begingroup$ The answer is $\binom{y}{x}$ (Im assuming $y$ is at least equal to $x$ as otherwise there is no way to do it.) $\endgroup$
    – Asinomás
    Commented May 12, 2021 at 2:12
  • $\begingroup$ Thank you for your answer! This results makes sense in the context of my problem. $\endgroup$
    – Light
    Commented May 12, 2021 at 3:02
  • $\begingroup$ By convention, $\binom{y}{x} = 0$ if $y < x$. Thus, the answer is $\binom{y}{x}$ regardless of whether it is physically possible to distribute the balls to the boxes with the stated restriction that no more than one ball can be placed in each box. $\endgroup$ Commented May 12, 2021 at 11:33

1 Answer 1


Each box here can contain either 0 or 1 ball, and there are $y$ boxes. This fact can be represented using binomial coefficients. We can rephrase the question as: $(1+t)(1+t)....(1+t)$ where $(1+t)$ has been multiplied $y$ times. What is the coefficient of $t^x$? Clearly the answer is $\binom {y}{x}$. Here, $(1+t)$ has been used for each box, because the power of $t$ represents the number of balls in that box. Thus, multiplying them together gives all possible combinations.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .