Let $x^2=y^2=1$ and $xy\neq yx$. There are $\binom{2n}{n}$ expressions of length $2n$ in $x$ and $y$ that are equal to $1$.

We can note that a necessary condition for an expression to evaluate to $1$ is that the number of $x$ (or $y$) occurrences in odd position be equal to the number of $x$ (or $y$, respectively) occurrences in even position, because every $x$ or $y$ must have its "companion", and the inner variables between each couple can be simplified only if their number is even.

We need to show that that condition is also sufficient. For every expression with the condition above there are always two adjacent $x$ or two adjacent $y$. Suppose that is false: suppose one variable ($x$ or $y$) is at position $1$, then the other variable must be at position $2$, then the same variable at position $1$ must be at position $3$ and so on, thus one variable is on all odd positions and one variable on all even positions, which contradicts the original assumption about the above condition. Once we have eliminated the two adjacent equal variables, we can repeat again and again the process till we simplify the expression to $1$.

Finally we need to count all expressions that satisfy the condition. We have $n$ odd positions and $n$ even positions; the number of expressions with $2k$ $x$ in it is:

$${n \choose k}{n \choose k}$$

because we first choose $k$ $x$ in odd position and then $k$ $x$ in even position.

So the whole number of wanted expressions is:

$$\sum_{k=0}^n {n \choose k}^2 = {2n \choose n}$$

which is well known and follows from Vandermonde's identity, which in turn has a combinatorial proof.


I make a much stronger claim.

For each simplified expression $z$ that comprises of $n-2k$ terms, the number of ways to express it as $n$ terms is $ { n \choose k }$.
In particular, with $n = 2N, k = N$, the number of ways to write $1$ with $2N$ terms is $ 2N \choose N$.

Proof: Induct on $n$.
For a simplified expression with $n+1-2k$ terms, WLOG it starts with $x$. It can be built from $(x+y)(x+y)^n$ via
1. $x$ times a simplified expression with $n-2k$ terms or
2. $y$ times a simplified expression with $n - 2k+2$ terms.
This gives us the number of ways as ${n \choose k} + { n \choose k-1 } = { n+1 \choose k}$.


It's late, so I might have some errors. In particular, we should check:

  • Boundary conditions, but that should work out. )

  • To prove that one has $n-2k$ terms and one has $n-2k+2$ terms, it suffices to show that there is no expression equal to $$x \times \text{Term $z_1$ that is simplified to $n$ terms} = y \times \text{Term $z_2$ that is simplified to $n$ terms}\,.$$