maths.free › Combinatorics & Graph Theory › Generating Functions › Another look at distributing apples or folders
Another look at distributing apples or folders
A recurring problem so far in this book has been to consider problems that ask about distributing indistinguishable objects (say apples) to distinct entities (say children).
Another look at distributing apples or folders
A recurring problem so far in this book has been to consider problems that ask about distributing indistinguishable objects (say apples) to distinct entities (say children). We started in by asking how many ways there were to distribute \(40\) apples to \(5\) children so that each child is guaranteed to get at least one apple and saw that the answer was \(C(39,4)\). We even saw how to restrict the situation so that one of the children was limited and could receive at most \(10\) apples. In , we learned how to extend the restrictions so that more than one child had restrictions on the number of apples allowed by taking advantage of the . Before moving on to see how generating functions can allow us to get even more creative with our restrictions, let's take a moment to see how generating functions would allow us to solve the most basic problem at hand.
We could revisit an example from to see that if we wanted to limit a child to receive at most \(4\) apples, we would use \((x+x^2+x^3+x^4)\) as its generating function instead of \(x/(1-x)\), but rather than belabor that here, let's try something a bit more exotic.
The compact form of the solution to suggests that perhaps there is a way to come up with this answer without the use of generating functions. Thinking about such an approach would be a good way to solidify your understanding of a variety of the enumerative topics we have already covered.
The invocation of partial fractions in is
powerful, but solving the necessary system of equations and then hoping that the resulting
formal power series have expansions we immediately recognize can be a challenge. If had not asked about the general case with \(n\) on
the right-hand side of the equation but instead asked specifically about \(n=30\), you might
be wondering if it would just be faster to write some Python code to generate all the solutions
or more interesting to huddle up and devise some clever strategy to count them. Fortunately,
technology can help us out when working with generating functions. In SageMath, we can use the
series() method to get the power series expansion of a given function. The two arguments to
series are the variable and the degree of the terms you want to truncate. In the cell below,
we ask SageMath to expand the generating function from
by giving us all the terms of degree at most 30 and then collapsing the rest of the series into
its form of big-Oh notation, which we discard by storing the output from series() in a
polynomial f(x).
Let's see that the answer agrees with what our formula in the solution to gives us for \(n=30\):
Condensed: the full section is in Keller & Trotter, Applied Combinatorics.
Now you Không máy tính nào có thể tính toán được nó, nhưng các mảnh của nó có thể tính toán được. Thử một trong những cách dưới đây, hoặc gõ theo ý bạn.
Luyện tập (2)
Đầu tiên thử mỗi câu trên giấy. Cho thấy câu trả lời để kiểm tra; những câu trả lời đã kiểm tra có thể mở trong trình giải cho mỗi bước.
-
Suppose you are making a generating function for the number of ways to distribute some type of objects, as in the examples of this section. When a recipient can get no objects, what is the constant term in the factor of the generating function that corresponds to that recipient? What is the constant term when a recipient must get at least one object? Briefly explain your reasoning.
-
Suppose in the country Combinatoria, they use coins with values \(1\), \(2\), \(5\), \(10\), \(20\), \(50\), and \(100\). If you would like to write a generating function in which the coefficient on \(x^n\) is the number of ways to form a collection of coins worth \(n\) subject to the restriction that the number of coins of value \(5\) is one, three, four, or five, what factor would you introduce into your generating function? Briefly explain your reasoning.
Ký hiệu được dùng ở đây
Nhấn vào bất kỳ ký hiệu nào để xem định nghĩa đầy đủ, một bức ảnh, và ý nghĩa của từng chữ cái trong nó.
Câu hỏi người ta hỏi
Permutation or combination?
Ask whether order matters. A lock code is a permutation (order matters); a hand of cards is a combination (it does not).
What is a graph in this sense?
Dots (vertices) joined by lines (edges), not a plot. Road maps, social networks and molecules are graphs; questions like "is there a route" and "how few colours" are graph theory.
Một số phần của trang này được chuyển từ Keller & Trotter, Applied Combinatorics (CC BY-SA 4.0). Được nén lại và giải thích lại ở đây; lỗi là của chúng tôi.
More in Combinatorics & Graph Theory
The counting principlesPigeonhole principle and inclusion, exclusionBinomial coefficients and Pascal's triangleRecurrences and generating functionsGraphs: vertices, edges, degreesPaths, cycles, trees, Euler and HamiltonColouring and planar graphs