Three friends have a total of 6 identical pencils, and each one has at least one pencil. In how many ways can this happen?
I want to count the number of possible distributions of 6 pencils among 3 friends, where each friend gets at least one pencil. One way to approach this problem is to use the stars and bars method, which is a technique for dividing n identical objects into k groups. The idea is to represent the n objects as stars (*) and the k groups as bars (|). For example, if I have 6 stars and 2 bars, I can arrange them in a row like this: * * * | * * * |. This means that the first group gets 3 objects, the second group gets 3 objects, and the third group gets 0 objects. In general, there are (n + k - 1) choose (k - 1) ways to arrange n stars and k bars in a row, where (a choose b) means the number of ways to choose b items out of a items without regard to order. However, this includes cases where some friends get 0 pencils, which I want to exclude. To avoid this, I can give each friend one pencil first, and then distribute the remaining 3 pencils among them. This means that I have n = 3 objects (remaining pencils) and k = 3 groups (friends), so there are (3 + 3 - 1) choose (3 - 1) ways to arrange 3 stars and 3 bars in a row. This is the same as (5 choose 2), which is equal to 10. Therefore, there are 10 ways to distribute 6 pencils among 3 friends, where each friend gets at least one pencil. 