Inclusion exclusion/generating function help

mahjk17

New member
Joined
May 29, 2012
Messages
45
I am stuck on this problem "A book is selling for $2 while a magazine is for $3. How many diff erent ways
are there to buy books and magazines for $8?
My attempt: Let k1and k2, be the number of $2 and $3, respectively. So 2k1 + 3k2 = 8
Now we have a generating function for x^(2k1) * x^(3k2), we are looking for x^8. So the generating function is, 1/((1-x^2)(1-x^3)). But now I am stuck because now I cant find x^8 because i think the binomial theorem will not work here. Can anyone help me finish the problem or am I doing it wrong? Thank you !!!!
 
Are you SURE you want to use those infinite definitions? 8 is not a very big number.

I was leaning toward \(\displaystyle \frac{1-x^{10}}{1-x^{2}}\cdot\frac{1-x^{9}}{1-x^{3}}\)
 
But they are asking for "and", so doesn't that mean both books and magazines are included??? So there should be no 1's in the generating function, so instead of 1+x+x^2+... it should be x+x^2+x^3+... ???
 
Personally, I wouldn't do it that way at all (perhaps because when I see "generating function" I start looking for the exit!). I would treat it as a Diophantine equation and actually find the solutions. We are looking for numbers a and b such that 3a+ 2b= 8 where a is the number of magazines, b is the number of books. Obviously 3- 2= 1 so, multiplying by 8, 3(8)+ 2(-8)= 8. That is, a= 8, b= -8 is a solution. Of course, we can't have -8 books but it is clear that, for any integer k, a= 8- 2k, b= -8+ 3k is also a solution: 3(8- 2(k))+ 2(-8)+ 3k)= 24- 6k- 16+ 6k= 8. k must be at at 3 in order that -8+ 3k not be negative. When k= 3, a= 8- 6= 2 magazines and b= -8+ 9= 1 book. When k= 4, a= 8- 8= 0 magazines and b= -8+ 12= 4 books. If k is larger than 4, a, the number of magazines is negative so there are only two possible answers.
 
Truthfully, I'm with Halls on the methodology, but here's your "and".

First, I'm not entirely convinced that the simple existence of the word "and" implies that neither count should be zero. Perhaps you discussed this in class. That would be fine.

I'm struggling a bit with your example, as well, since you've nothing to suggest 1 + x + x^2 + ... Had you argued against 1 + x^2 + x^4 + ..., instead, I would feel better about it. Your argument would be for x^2 (x^2 + x^4 + x^6), which is a little different.
 
TPerhaps you discussed this in class. That would be fine.
I'm struggling a bit with your example, as well, since you've nothing to suggest 1 + x + x^2 + ... Had you argued against 1 + x^2 + x^4 + ..., instead, I would feel better about it. Your argument would be for x^2 (x^2 + x^4 + x^6), which is a little different.
Here is the way generating functions could be used.
Look at the coefficient of \(\displaystyle x^8\).
 
Thank you very much all of you!! I understand now because of your help : ) .. I will repost soon with the correct answer, whether "and" is explicit or not, just for future reference ... : )
 
Top