Assigning $m$ balls to $n$ buckets - recursive algorithm
An assignment of balls into $n$ bins falls into either one of the following two cases.


Every bin has as last one ball. So let us assign one ball to each bin first. What remains to do is to assign the remaining balls to the bins. 
Otherwise. That is, there is at least one bin that has no ball. This case is the same as assigning all balls into $n-1$ bins.


Exercise. Verify that we are counting without duplicates and without missing assignment.