I'm currently doing generating functions, and the purpose of those functions is to find how many ways there are to choose an x amount of objects.
I just don't understand how they get to the final conclusion. Take for example this exercise:
You have to go to the baker and you have to buy r amount of cakes. The baker has 3 cheese-cakes, 2 apricots-cakes, and 4 strawberry-cakes. How many different ways are there for you to choose?
This gives us the following generating function: $(1 + x + x^2 + x^3)(1 + x + x^2)(1 + x + x^2 + x^3 + x^4)$
After resolving this function, we get the polynomial: $1 + 3x + 6x^2 + 9x^3 + 11x^4 + 11x^5 + 9x^6 + 6x^7 + 3x^8 + x^9$
I understand how they get the generating function, and how to resolve it to get the polynomial, but now the solution of the exercise says:
So we can conclude that there are 6 different ways to choose 7 cakes.
I know the 6 and 7 relate to each other because one is the exponent of the other (see the term $6x^7$), but how do they get to the number 6, and 7?
There are 9 different cakes, so why 7?