[Math] In how many way we can arrange 4 books on 7 different shelves – with no specific demandings

balls-in-binscombinationscombinatorics

I was given an unconventional combinatorics question I was struggling with.
Suppose we have 4 books and 7 different bookshelves.
In how many ways the books can be arranged without loss of generality?

I can either put all 4 of them on 1 shelf, or either split each one in a different shelf. In a case such as that, how do I consider the shelves that can't be picked? how to sum the number of options I have left when I do pick $k < 4$ books on 1 shelf (which are arranged in $k!$ options) and left with 6 different shelves and $4-k$ books?

Best regards for the helpers.

Best Answer

(Assume all books and shelves identical)

So you can have $(4,0,...,0)$ - 7 ways to choose which shelf this is

$(3,1,0,...,0)$ - 42 ways to choose the two shelves i.e. 6*7

$(2,2,0,...,0)$ - 7C2 ways to choose the two shelves (i.e. 6*7/2)

$(2,1,1,0,...,0)$ - 7*(6C2)

$(1,1,1,1,0,...,0)$ - 7C4

Now add all of these solutions together to get the final answer.