# How many ways to put indistinguishable balls into distinguishable boxes with restrictions?

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!

• I assume you meant to say each box can contain one ball. Hint: Select which boxes will receive a ball. Commented May 12, 2021 at 1:58
• Yes, I meant that a box can be either empty or occupied by 1 ball. Commented May 12, 2021 at 2:07
• The answer is $\binom{y}{x}$ (Im assuming $y$ is at least equal to $x$ as otherwise there is no way to do it.) Commented May 12, 2021 at 2:12
• Thank you for your answer! This results makes sense in the context of my problem. Commented May 12, 2021 at 3:02
• 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. Commented May 12, 2021 at 11:33

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.