 Previously, we defined exponential generating functions, then we found that the product of exponential generating functions for multisets with just a single type of object will give us an exponential generating function for the multiset consisting of different types of objects. Let's see how that works. So let's find the generating functions for the number of n permutations of a and b where a must be used an even number of times, but b can be used any number of times. Since a must be used an even number of times, then hi is equal to 1 for all even i and 0 for all odd i, so its generating function will be, which we can get by starting with the power series for e to the x, the power series for e to the minus x, and if we add these two series together, all of the odd degree terms will cancel, and if we divide everything by 2, we'll get our exponential generating function. Since b can be used any number of times, hi equals 1 for all i, and so our exponential generating function for b will be, which is just e to the x, and so if we multiply our two generating functions together, we get our generating function for the multiset. Now remember, a generating function is only useful if there's an easy way to compute the coefficients that doesn't involve the counting arguments we need to make otherwise. Fortunately, we can rely on the calculus of power series. So let's find the coefficients of the power series for this product. Now to find the power series, we differentiate g of x repeatedly, if we wanted a lot of practice differentiating complicated expressions. Rather more efficiently, we might note that we can expand the product, and we know the power series expansion for e to the 2x. Now we want to add 1 to e to the 2x, and so what we can do is we can split off the constant term of our power series, and add 1, and then we want to multiply everything by 1 half, and so that gives us, we can move the factor of 1 half inside the summation, and simplify. So if we want to use our generating functions to find the number of permutations, remember that once we have the generating functions, the actual sequence is the numerator when the denominators are the factorials. So our series actually begins at i equals 1, so we note that this first term 1, that's really 1 divided by 0 factorial, and so that tells us the number of 0 permutations is 1. Meanwhile, for every other term, the number of n permutations is going to be 2 to the power n minus 1, which is the numerator of our coefficients where the denominator is n factorial. And it never hurts to check your answer, so let's consider the 0 permutations. The 0 permutations are nothing at all, and this is actually an allowable permutation. We had to use a an even number of times, and in fact we used a 0 times, and 0 is an even number. And we used b 0 times, and we could have used b any number of times. What about the n permutations? Well, let's pick a value for n. So suppose n is equal to 10. The number of 10 permutations is quite a bit, let's try n equals 4. We can find the 4 permutations directly. So a must be used an even number of times, but b can be used any number of times, so we'll find our 4 permutations. So either a is used 0 times. And so b has to be used 4 times, or a is used 2 or 4 times. And if we do that, we get the permutations. And so there are 8 4 permutations. Meanwhile, our formula tells us there should be 8 4 permutations, which matches.