In how many ways $7$ pencils can be distributed to $5$ children such that each child can get any number of pencils? 
Q - In how many ways $7$ pencils can be distributed to $5$ children such that each child can get any number of pencils?

I am little confused whether the answer is $5^7$ or $7^5$ ? 
I think every student can have any no of pencils hence $(7 \times 7\times 7\times 7\times 7 = 7^5)$ but ans is $5^7$.
Moreover if we consider that this question is like $a+b+c+d+e=7$ then answer would be ${11 \choose 7}$
which answer is correct out of those 3? why is it so ?
Please help me with this.
 A: The answer is either $5^7$ or $_{11}C_7$ depending on one very crucial question: Are the pencils distinct? In other words, is there a "pencil number one", and does it matter who gets that exact pencil (and so on, for pencil number $2$, number $3$,...)? Or is it just the number of pencils each person gets that matters? (If who's who among the boys doesn't matter either, only "how many pencils did the person with the most pencils get" and so on, then the answer is even lower.) This is impossible to tell from the question as it stands, so if it appeared on a test, you would need to ask about clarification, and if it appeared as a question in a book, you would need to see the context of that specific section of the book.
As for why $7^5$ is wrong, that's basically because of the setup. It is not that each boy gets assigned to a pencil, and a pencil might have multiple boys or no boys assigned to it; it's the other way around. That means that pencil number $1$ has a choice between $5$ boys on where to go. That's $5$. Pencil number $2$ has again a choice between $5$ boys, which brings the total to $5^2 = 25$. And so on, up to $5^7$.
A: It depends on whether the pencils are identical or not.

Suppose the pencils are all different. Let's label them as $P_1,P_2,\cdots,P_7$.
Now, for each pencil, there is a choice of $5$ children. This gives the number of ways to be $5^7$.

Suppose the pencils are all identical. Then, in a a particular instance of the previous case, let the first child have one pencil. Then, it does not matter whether he has $P_1,P_2,\cdots$ or any particular pencil. All pencils are equivalent.
Then, it can be viewed as the number of non negative integer solutions of $x_1+x_2+x_3+x_4+x_5=7$. In this case, how much a child gets matters, not which ones he gets.

Finally, $7\times7\times\cdots7=7^5$ does not make much sense. A pencil cannot be assigned to more than one boy, which is allowed in this case.
A: "Any number of pencils" in this case would be a minimum of $0$ and a maximum of $7$--altogether eight possible numbers of pencils the first child may have, not seven. But if the first child gets seven pencils there are none left to give to any other child, so it's really not true that "any student can have any number of pencils" in the sense that you tried to use that fact: any child can receive (in fact, must receive) only the pencils that are not given to any other child.
How could the answer be $7^5$? The most obvious way is that there are indeed exactly seven choices of what to give to each child, and our choices of what to give to one child are not limited in any way by what we have already given to other children. Suppose we have a large stock of pencils of several types--e.g. "number 1" pencils (very soft leads), "number 2" pencils (a little harder), "number 3" (harder yet), and so forth, and we have at least five of each type. Then suppose we give one pencil to each child, and we want to know how many ways to distribute the pencils, where a number 1 pencil is distinguishable from a number 2 but not distinguishable from another number 1. Then we have five times to make independent choices from seven possible options each time: $7$ for the first child, $7^2$ for the first two children combined, $7^5$ for all children.
But that is very clearly not the problem that was set.
