Finding a generating function for a given sequence

57 Views Asked by At

Find an expression for the generating function $\sum_{n\geq0}h_nx^n$. Where $h_n$ is the number of multisets of size $n$ with elements in $\{a,b,c,d\}$ in which either
i) the number of a's is even and the number of b's is odd, or
ii) the number of c's is even and the number of d's is odd.

Remember that the $or$ is the inclusive or. I'm trying to do this using a principle of inclusion-exclusion argument to find the number of multisets, but I've got a little confused

1

There are 1 best solutions below

0
On

The generating function for the number of multisets satisfying (i) is $$ (1+x^2+x^4+\dots)(x+x^3+x^5+\dots)(1+x+x^2+\dots)^2=x(1-x^2)^{-2}(1-x)^{-2}. $$ Similarly, this is the generating function for the number of multisets satisfying (ii). The number satisfying both (i) and (ii) is generated by $$ (1+x^2+x^4+\dots)^2(x+x^3+x^5+\dots)^2=x^2(1-x^2)^{-4}. $$ Finally, to find the number of sequences satisfying (i) or (ii), we add the generating functions for (i) and (ii) alone, and correct for the doubly counted sequences by subtracting the generating function for both (i) and (ii). The result is $$ 2x(1-x^2)^{-2}(1-x)^{-2}-x^2(1-x^2)^{-4}. $$