There are ‘n’ candies and ‘t’ boxes. Find the number of ways to place the candies in the boxes for each of the conditions (given in the problem).

combinatoricsdiscrete mathematicsinclusion-exclusionprobability

There are 'n' candies and 't' boxes. Find the number of ways to place the candies in the boxes for each of the conditions (all the candies must be spread out) :

(a) candies and boxes are different;

(b) candies of the same diiferent boxes should not be empty cartons:

(c) candies equally new, boxes are different;

Edit :(d) candies are different, the boxes are the same, there should be no empty boxes;

(e) candies of different boxes alike.(Edit : candies are different, boxes are equal)

Specify the display type that matches the placement, if possible.

My Answers :

(a) Each layout is encoded with a word of $n$ letters from the alphabet of 't' letters $\implies$ possible $n^t$ variants.

(b) Write, $n$ candies in the form of balls ina line, we need to put $(t-1)$ partition in $(n-1)$ place, but we can't put two partitions on one place, so we get : $^{t-1}C_{n-1}$.

(c) First we need to choose a candy in a box (in the first box $n$ ways, in the second box $(n-1)$, $\cdots$ in the $t-th$ : $(n-t+1)$ ways $\implies$ total $n!/(n-t)!$ methods,

and then we distribute the remaining $(n-t)$ candies into $t$ boxes, this is encoded with owrds from the alphabets (for each candy $t$ variants) $\implies$ $t^{n-t}$.

The Answer is : $\frac {n!}{(n-t)!}*t^(n-t)$

Are my answers (a), (b) & (c) are correct?

For (d) & (e) I don't know how to proceed? Please help me.

Best Answer

I'm re-writing your conditions slightly to be clear about each case.

(a) $n$ different candies into $t$ different boxes:

Since each candy can be placed into one of $t$ different boxes, the number of ways will be

$$t \cdot t \cdot t\cdot t \cdots t = t^n$$

(b) $n$ identical candies into $t$ different boxes, no box to remain empty:

Your solution is correct.

(c) $n$ identical candies into $t$ different boxes, some boxes may remain empty:

[I'm taking "candies equally new" to mean they're identical; if that's not the case please specify what "equally new" means.]

Since the candies are identical, there's no need to choose a candy for each box as you're doing in the early part of your solution. The simplest way to do this is similar to your solution for (b), except now some boxes may remain empty; thus we need the number of arrangements of $(t-1)$ partitions and $n$ candies, i.e.

$$\frac{(n+t-1)!}{n!(t-1)!} = \binom{n+t-1}{n} \quad \text{or} \quad \binom{n+t-1}{t-1} $$

(d) & (e) $n$ different candies into $t$ identical boxes

The solution(s) here are known as Stirling Numbers of the Second Kind which have no closed formula but do satisfy a recurrence relationship.

For (d) if all the boxes are to be unempty, then the number of ways is $$S(n,t)$$ For (e) if some boxes may remain empty, then the number of ways is $$S(n,1) + S(n,2) + S(n,3) + \cdot + S(n,t) = \sum_{k=1}^t S(n,k)$$.