In how many ways $5$ different balls be distributed to $3$ different boxes, when each box can hold any number of balls?
According to me: every ball can go to any of the $3$ boxes So ways of going in the first box $= 3$ In the second box $= 2$ In the third box $=1$ Same for every ball. So answer should be $3!$ ways. Similarly for every ball. So ways must be $3!^5$
According to solution Every ball can go to any of the 3 boxes. So no. of ways will be=$3^5$ way
Imagine this as a tree where each node has 3 children and the height of the tree is the number of balls you have.
The choices for the first ball are the children of the first node(the root of the tree). There are 3 options to go from the start (root), so the first node will have 3 children (directions in which it can go). Now imagine each of those 3 children (nodes) as the different situations you could have potentially gotten yourself into. For each of those three cases we will have 3 more cases for the second ball, i.e. $3\times3=9$. Now, having 9 cases for each of those cases you can go on three different paths for the third ball, so the overall number of times becomes $9\times3=27$.
Continuing like that till the $5^{th}$ ball you get $3\times3\times3\times3\times3=3^5$ different scenarios for the positions of the balls.
This is a classic example of permutations with repetitions where the formula is $\tilde V_n^k=k^n$ for $n$ elements (balls) with $k$ choices (boxes).