This week, we have a guest post written by Alexander B. on generating functions, which are useful tools for solving advanced counting problems.
How would you use generating functions to solve the following?
>
How many non-negative integer solutions are there to for any positive integer ?
Share a question which can be approached using Generating Functions.
If you are interested in contributing a post, please contact me at Calvin@Brilliant.org.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
After you finish number 1, try this:
How many non-negative integer solutions are there to a+b+2c=n for any positive integer n for distinct a,b,c?
Log in to reply
If dn is the number of solutions with a=b, then dn={21n+10n evenn odd If en is the number of solutions with a=c or b=c then en=1+⌊31n⌋ If fn is the number of solutions with a=b=c then fn={104∣n4∣n and the number of solutions with a,b,c distinct is cn−dn−2en+2fn where cn=⌊41(n+2)2⌋ is as in my other post.
The number of solutions, cn, is the coefficient of xn in the expansion of (1−x)2(1−x2)1=(1−x)3(1+x)1=(j=0∑∞(2j+2)xj)(k=0∑∞(−1)kxk) and so cn====∑m=0n(−1)n−m(2m+2)=21(−1)n∑m=0n(−1)m(m+1)(m+2)41(−1)n∑m=0n(−1)m[(m+1)2+(m+2)2−1]41(−1)n[∑m=0n(−1)m(m+1)2−∑m=1n+1(−1)m(m+1)2−∑m=0n(−1)m]41(−1)n[1+(−1)n(n+2)2−∑m=0n(−1)m]=41[(n+2)2−εn] where εn={01n evenn odd and hence cn=⌊41(n+2)2⌋
Awesome..Till now, I was completely unknown to this concept,(I had seen it in problems but never understood )but now I am very interested in it...I am very happy now..thnx Alexander and Calvin.
Can you use generating functions when you are picking 2 or more distinct elements from one set?
Log in to reply
Consider f(x)2−f(x2).
What would it look like for picking 3 distinct objects?
Log in to reply
Ah, brilliant. Though as you start picking 3, 4, 5, etc. elements this doesn't become very practical anymore.
To your edit-- It would be f(x)3−f(x3)− some other things to get rid of the products in which only a pair are the same. I'll think about it.
Log in to reply
I don't think your example works.
Hint: Just because you learnt an advanced technique, doesn't mean that you should forget your basics.
Log in to reply
x4×x4×x7). However, while a term being multiplied three times occurs only once, the situation where two terms plus another distinct term occurs thrice. This makes me come to the formula of f(x)3−3f(x)f(x2)+2f(x3). It's multiplying by three, then taking out three times the pairwise non-distinct as well as the triple non-distinct, and then adding two of the triple non-distincts back in since that only occurs once in the original expansion of f(x)3. Though I'm a bit doubtful that this one works either..
I know mine doesn't work, my sentence comes out weird in latex but what I meant was "this minus some other things." Your first one works because you take the product and then subtract the case when two of the same element is being multiplied by each other, but when you scale up to three you have to worry about all three of them being the same as well as them being not pairwise distinct (e.g.Log in to reply
Principle of Inclusion and Exclusion.
To elaborate on my hint, use theThis tells you why the formula looks the way it does (and also why it gets ugly quickly). Interestingly, it only involves terms of the form f(xn), so if you have a simple description of f(x), then you might be able to get a simple description for the generating function of distinct elements.
If f(x)=x4+x5+x6+x7 then it would be (f(x))3−x4f(x2)−x5f(x2)−x6f(x2)−x7f(x2)?
Log in to reply
Your formula looks like f(x)3−f(x)f(x2).
If it works, why does it work?
If it doesn't work, why doesn't it work?