# 2006 AMC 12A Problems/Problem 24

## Problem

The expression

$(x+y+z)^{2006}+(x-y-z)^{2006}$

is simplified by expanding it and combining like terms. How many terms are in the simplified expression?

$\mathrm{(A) \ } 6018\qquad \mathrm{(B) \ } 671,676\qquad \mathrm{(C) \ } 1,007,514\qquad \mathrm{(D) \ } 1,008,016\qquad\mathrm{(E) \ } 2,015,028$

## Solution 1

By the Multinomial Theorem, the summands can be written as

$$\sum_{a+b+c=2006}{\frac{2006!}{a!b!c!}x^ay^bz^c}$$

and

$$\sum_{a+b+c=2006}{\frac{2006!}{a!b!c!}x^a(-y)^b(-z)^c},$$

respectively. Since the coefficients of like terms are the same in each expression, each like term either cancel one another out or the coefficient doubles. In each expansion there are:

$${2006+2\choose 2} = 2015028$$

terms without cancellation. For any term in the second expansion to be negative, the parity of the exponents of $y$ and $z$ must be opposite. Now we find a pattern:

if the exponent of $y$ is 1, the exponent of $z$ can be all even integers up to 2004, so 1003 terms.

if the exponent of $y$ is 3, the exponent of $z$ can go up to 2002, so 1002 terms.

$\vdots$

if the exponent of $y$ is 2005, then $z$ can only be 0. So 1 term.

add them up we get $\frac{1003\cdot1004}{2}$ terms. However, we can switch the exponents of $y$ and $z$ and these terms will still have a negative sign. So there are a total of $1003\cdot1004$ negative terms.

Subtract this number from 2015028 we obtain $D. 1008016$ as our answer.

Alternatively, we can use a generating function to solve this problem. The goal is to find the generating function for the number of unique terms in the simplified expression (in terms of $k$). In other words, we want to find $f(x)$ where the coefficient of $x^k$ equals the number of unique terms in $(x+y+z)^k + (x-y-z)^k$.

First, we note that all unique terms in the expression have the form, $Cx^ay^bz^c$, where $a+b+c=k$ and $C$ is some constant. Therefore, the generating function for the MAXIMUM number of unique terms possible in the simplified expression of $(x+y+z)^k + (x-y-z)^k$ is $$(1+x+x^2+x^3\cdots)^3 = \frac{1}{(1-x)^3}$$

Secondly, we note that a certain number of terms of the form, $Cx^ay^bz^c$, do not appear in the simplified version of our expression because those terms cancel. Specifically, we observe that terms cancel when $1 \equiv b+c\text{ (mod }2\text{)}$ because every unique term is of the form: $$\binom{k}{a,b,c}x^ay^bz^c+(-1)^{b+c}\binom{k}{a,b,c}x^ay^bz^c$$ for all possible $a,b,c$.

Since the generating function for the maximum number of unique terms is already known, it is logical that we want to find the generating function for the number of terms that cancel, also in terms of $k$. With some thought, we see that this desired generating function is the following: $$2(x+x^3+x^5\cdots)(1+x^2+x^4\cdots)(1+x+x^2+x^3\cdots) = \frac{2x}{(1-x)^3(1+x)^2}$$

Now, we want to subtract the latter from the former in order to get the generating function for the number of unique terms in $(x+y+z)^k + (x-y-z)^k$, our initial goal: $$\frac{1}{(1-x)^3}-\frac{2x}{(1-x)^3(1+x)^2} = \frac{x^2+1}{(1-x)^3(1+x)^2}$$ which equals $$(x^2+1)(1+x+x^2\cdots)^3(1-x+x^2-x^3\cdots)^2$$

The coefficient of $x^{2006}$ of the above expression equals $$\sum_{a=0}^{2006}\binom{2+a}{2}\binom{1+2006-a}{1}(-1)^a + \sum_{a=0}^{2004}\binom{2+a}{2}\binom{1+2004-a}{1}(-1)^a$$

Evaluating the expression, we get $1008016$, as expected.

## Solution 2

Define $P$ such that $P=y+z$. Then the expression in the problem becomes: $(x+P)^{2006}+(x-P)^{2006}$.

Expanding this using binomial theorem gives $x^n+P*x^{n-1}+...+P^{n-1}*x+P^n+x^n-P*x^{n-1}+...-P^{n-1}*x+P^n$ (we may omit the coefficients, as we are seeking for the number of terms, not the terms themselves).

Simplifying gives: $2(x^n+x^{n-2}*P^2+...+x^2*P^{n-2}+x^n)$. We can also take out all the 2 and all the x terms, as they will not affect the answer.

Thus, we must find the number of terms in this expression:

$1+P^2+P^4+...+P^{2004}+P^{2006}$.

Because $P=y+z$, $P^n$ will have n+1 terms, by the binomial theorem. Thus, the expression will have $1+3+5+...+2005+2007$ terms.

We can easily find this sum by noting that this is equal to the sum of the first 1004 consecutive odd integers, or $1004^2$, which gives us $1,008,016$, or D.