[Math] The number of ways of posting the letters when no letter box remains empty is

combinatorics

$6$ letters are to be posted in three letter boxes.The number of ways
of posting the letters when no letter box remains empty is?

I solved the sum like dividing into possibilities $(4,1,1),(3,2,1)$ and $(2,2,2)$ and calculated the three cases separately getting $90,360$ and $90$ respectively.

What I wanted to know is there any shortcut method to solve this problem faster?Can stars and bars be used?How?

Or can the method of coefficients be used like say finding coefficient of $t^6$ in $(t+t^2+t^3+t^4)^3$.Will that method work here?

Best Answer

Inclusion-Exclusion.

$3^6$ ways total.
$2^6$ ways if you only mail to $1\&2,2\&3$ or $1\&3$, subtract them off (3 alike cases).
$1^6$ way if you only mail to $1$, or to $2$, or to $3$, add them back in because they were subtracted twice (agai, 3 cases all alike).

$3^6 - 3 \cdot 2^6 + 3 \cdot 1^6$