If I am understanding correctly. You are placing 5 identical balls into 4 different boxes?.
There are C(5+4-1,5)=C(8,5) ways to do that.
If the balls are distinct, then 4^5 ways.
Will this always be true, like (n + m -1, n) and I have another problem that reads like this so I think it is 18 choose 15 but not quite sure, FInd the number of ways of assigning 15 distinct paintings to 18 different dormitories so that no dormitory receives more than one painting.
No, there is no such generalization as ‘always true’!
is the number of ways to put m identical object into n different cells.
The number of ways of assigning 15 distinct paintings to 18 different dormitories so that no dormitory receives more than one painting is the count of the number of one-to-one functions from a set of 15 to a set of 18: .