16

Note: Although adding zero has usually no effect, there is sometimes a situation where it is the essence of a calculation which drives the development into a surprisingly fruitful direction. Here is one example of what I mean.

The Goulden-Jackson Cluster Method counts words built from a finite alphabet which are not allowed to contain so-called bad words. This method nicely presented (and something to chuckling about) by J. Noonan and D. Zeilberger is very efficient and the reason for it's efficiency is due to a clever addition of zeros.

Let's denote the alphabet $V$, the language $\mathcal{L}$ and let $B$ be the set of bad words. Since we want to work with generating functions, we introduce weights on words $$weight(w):=s^{length(w)}$$

The generating function $f(s)$ is the weight enumerator of the set of valid words $\mathcal{L}(B)$ that avoids the members of $B$ as factors (i.e. substrings). We obtain \begin{align*} f(s)=\sum_{w\in\mathcal{L}(B)}weight(w) \end{align*}

It turns out according to the first section in the referred paper that counting these words is a cumbersome job. In fact we can do it much better and the trick is to add $0$ to both sides and

rewrite this expression as \begin{align*} f(s)=\sum_{w\in V^*}weight(w)0^{[\text{number of factors of }w\text{ that belong to }B]} \end{align*} and then use the following deep facts (wording from the paper :-) ) \begin{align*} 0&=1+(-1)\\ 0^r&= \begin{cases} 1,&\text{if }r=0\\ 0,&\text{if }r>0 \end{cases} \end{align*} and for any finite set $A$, \begin{align*} \prod_{a\in A}0=\prod_{a\in A}(1+(-1))=\sum_{S\subset A}(-1)^{|S|} \end{align*} where $|S|$ denotes the cardinality of $S$.

We now have \begin{align*} f(s)&=\sum_{w\in V^*}weight(w)0^{[\text{number of factors of }w\text{ that belong to }B]}\\ &=\sum_{w\in V^*}weight(w)(1+(-1))^{[\text{number of factors of }w\text{ that belong to }B]}\\ &=\sum_{w\in V^*}\sum_{S\subset\text{Bad}(w)}(-1)^{|S|}s^{\text{length}(w)} \end{align*} where Bad$(w)$ is the set of factors of $w$ that belong to $B$.

This clever usage of the Inclusion-exclusion principle is a much more superior approach to calculate the valid words not containing any bad factors and the essence was to add zero in order to introduce the IEP.

So, my question is: Do you know from other situations where cleverly adding $0$ or multiplying with $1$ opens up a door to solve a problem.

Markus Scheuer
  • 108,315
  • 2
    This looks like an instance of what I call the “18th camel technique” (named for an old puzzle about dividing up a herd of 17 camels) in which to simplify a problem you add another object or element to it that will drop back out at the end. Another example that comes to mind is certain sorting algorithms in which you add a dummy element that allows you to remove special cases from the algorithm and thus simplify it. – amd Mar 05 '16 at 20:13
  • 1
    The product rule from calculus is my go-to example of this phenomenon. (I think you can prove it without ever invoking this trick, but it's very roundabout indeed). – Eric Stucky Mar 11 '16 at 01:31

5 Answers5

5

Filter polynomial coefficients by cleverly adding zeros

We consider the polynomial \begin{align*} (1+x+x^2)^n=\sum_{j=0}^{2n}a_jx^j \end{align*} and want to find \begin{align*} \sum_{{j=0}\atop{j \equiv 0(3)}}^{2n}a_j=a_0+a_3+a_6+\cdots\tag{1} \end{align*}

Of course we can evaluate $(1+x+x^2)^n$ at $x=1$ to get \begin{align*} 3^n=\sum_{j=0}^{2n}a_j\tag{2} \end{align*} But how can we filter the coefficients to obtain (1)? Cleverly adding zeros will help.

We consider the $3^\text{rd}$ roots of unity \begin{align*} \omega_1=\exp\left(\frac{2\pi i}{3}\right)\qquad\qquad \omega_2=\exp\left(\frac{4\pi i}{3}\right)=\omega_1^2\tag{3} \end{align*} and use the nice property that the sum of all $m$-th roots of unity sum to $0$ iff $m> 1$: \begin{align*} 1+\omega_1+\omega_2=0 \end{align*}

It follows when evaluating $1+x+x^2$ at $\omega_1$ and $\omega_2$: \begin{align*} 1+\omega_1+\omega_1^2=1+\omega_1+\omega_2\color{blue}{=0}\\ 1+\omega_2+\omega_2^2=1+\omega_2+\omega_1\color{blue}{=0} \end{align*}

Adding these zeros to (2) does the job. We evaluate $(1+x+x^2)^n$ at $1,\omega_1$ and $\omega_2$. We obtain using (3)

\begin{align*} 3^n\color{blue}{+0+0}&=(1+1+1)^n +(1+\omega_1+\omega_1^2)^n+(1+\omega_2+\omega_2^2)^n\\ &=\sum_{j=0}^{2n}a_j+\sum_{j=0}^{2n}a_j\omega_1^j+\sum_{j=0}^{2n}a_j\omega_2^j\\ &=\sum_{j=0}^{2n}a_j+\left(\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j+\sum_{{j=0}\atop{j\equiv 1(3)}}^{2n}a_j\omega_1+\sum_{{j=0}\atop{j\equiv 2(3)}}^{2n}a_j\omega_1^2\right)\\ &\qquad\qquad+\left(\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j+\sum_{{j=0}\atop{j\equiv 1(3)}}^{2n}a_j\omega_2+\sum_{{j=0}\atop{j\equiv 2(3)}}^{2n}a_j\omega_2^2\right)\\ &=3\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j +\sum_{{j=0}\atop{j\equiv 1(3)}}^{2n}a_j\left(1+\omega_1+\omega_2\right) +\sum_{{j=0}\atop{j\equiv 2(3)}}^{2n}a_j\left(1+\omega_1^2+\omega_2^2\right)\\ &=3\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j +\sum_{{j=0}\atop{j\equiv 1(3)}}^{2n}a_j\left(\color{blue}{1+\omega_1+\omega_2}\right) +\sum_{{j=0}\atop{j\equiv 2(3)}}^{2n}a_j\left(\color{blue}{1+\omega_2+\omega_1}\right)\\ &=3\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j \end{align*}

and we finally conclude

\begin{align*} \color{blue}{\sum_{{j=0}\atop{j\equiv 0(3)}}^{2n}a_j=3^{n-1}\qquad\qquad n\geq 1} \end{align*}

Note: This is a rewrite of this answer based upon a comment there from @labbhattacharjee.

Markus Scheuer
  • 108,315
3

There are many different ways to prove the binomial identity \begin{align*} \sum_{j=0}^{n}(-1)^j\binom{m}{j}=(-1)^n\binom{m-1}{n}\tag{1} \end{align*} where $n$ is a non-negative integer and $m\in\mathbb{C}$.

A nice little gem does the job by cleverly multiplying the left hand-side of (1) with $(\pm)1$. We obtain \begin{align*} \sum_{j=0}^{n}(-1)^j\binom{m}{j} &=\sum_{j=0}^{n}(-1)^j\binom{m}{j}\color{blue}{\cdot 1}\\ &=\sum_{j=0}^{n}(-1)^j\binom{m}{j}\color{blue}{\binom{n-j}{n-j}}\\ &=\color{blue}{(-1)^n}\sum_{j=0}^{n}\binom{m}{j}\color{blue}{\binom{-1}{n-j}}\tag{2}\\ &=(-1)^n\binom{m-1}{n}\tag{3} \end{align*}

Comment:

  • In (2) we use the binomial identity $\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$.

  • In (3) we apply the Chu-Vandermonde Identity.

Note: This contribution is thanks to this MSE post by @robjohn.

Markus Scheuer
  • 108,315
2

Here is an example for your list. It is problem 1 in W. Sierpinski's "250 Problems in Elementary Number Theory".

The question is to find all $n$ such that $n + 1 | n^2 + 1$. The answer is that $n = 1$ is the only solution.

Although Sierpinski does not include these intermediate steps in his solution, here is how one might include those steps in order to meet your requirements:

$$n^2 + 1 = n^2 + 1 + 0 = n^2 + 1 + (n - n) = (n^2 + n) - n + 1 = n(n + 1) - (n - 1)$$

One can see that if $n + 1$ divides $n^2 + 1$, then it must also divide $n - 1$.

Frank Hubeny
  • 1,527
  • Here is a solution using modular arithmetic. If $(n+1) \mid (n^2+1)$, set $m = n+1 \geq 2$ and look at $n^2+1 \bmod m$. First, $n^2+1 \equiv 0 \bmod m$ since $m$ is a factor of $n^2+1$. Second, since $n \equiv -1 \bmod m$ we have $n^2 \equiv 1 \bmod m$, so $n^2 + 1 \equiv 2 \bmod m$. Thus $2 \equiv 0 \bmod m$, so $m \mid 2$. Since $m \geq 2$, $m = 2$ and thus $n = 1$. – KCd Jul 10 '22 at 17:30
2

When trying to prove that $$ \sum^{j}_{k = i} (-1)^{j + k} \binom{j}{k} \binom{k}{i} = \delta_{i j} $$ (which is related to this porblem ) one can start with $x$ and expand the expression by adding 0, with the goal of getting two binomial coefficents. \begin{align*} x^{j} &= (x + 0)^j = (x +1 -1)^j =((x +1 ) -1 )^{j} \\ &= \sum^{j}_{k = 0} \binom{j}{k} (x + 1)^{k} \underbrace{ (-1)^{j - k} }_{= (-1)^{j - k + 2 k}} = \sum^{j}_{k = 0} (-1)^{j + k} \binom{j}{k} (x + 1)^{k} \\ &= \sum^{j}_{k = 0} (-1)^{j + k} \binom{j}{k} \sum^{k}_{i = 0} \binom{k}{i} x^{i} = \sum^{j}_{k = 0} \sum^{k}_{i = 0} (-1)^{j + k} \binom{j}{k} \binom{k}{i} x^{i} \\ &= \sum^{j}_{i = 0} \sum^{j}_{k = i} (-1)^{j + k} \binom{j}{k} \binom{k}{i} x^{i} \\ \end{align*} Comparing the polynomials on each side then gives the desired result.

Léreau
  • 3,015
1

The answer below originally given here by @MarkoRiedel is a great example how creative multiplication with $1$ paves the way for an instructive and elegant solution to show a binomial identity containing Stirling Numbers of the Second kind ${n\brace m}$.

The following is valid for non-negative integers $n\geq m$: \begin{align*} \sum_{j=m}^n {j\brace m} (m+1)^{n-j}= {n+1\brace m+1}\tag{1} \end{align*}

We obtain \begin{align*} \sum_{j=m}^n{j\brace m} (m+1)^{n-j} &=\sum_{j\ge m} {j\brace m} (m+1)^{n-j} \color{blue}{[z^n] \frac{z^j}{1-z}}\tag{1}\\ &=(m+1)^n[z^n] \frac{1}{1-z} \sum_{j\ge m} {j\brace m} \frac{z^j}{(m+1)^j}\tag{2}\\ &=(m+1)^n [z^n] \frac{1}{1-z}\prod_{r=1}^m \frac{z/(m+1)}{1-rz/(m+1)}\tag{3}\\ &=[z^n] \color{blue}{\frac{1}{1-(m+1)z}}\prod_{r=1}^m \frac{z}{1-rz}\tag{5}\\ &= [z^{n+1}] \prod_{r=1}^{m+1} \frac{z}{1-rz}\tag{6}\\ &= {n+1\brace m+1}\tag{7}\\ \end{align*} and the claim follows.

Comment:

  • In (1) we extend the index region of the sum to $\infty$ to enable series manipulations. But in doing so we have to assure that the exponent of $(m+1)^{n-j}$ is non-negative. One way to do this is by using Iverson brackets \begin{align*} [[ j\leq n|j\geq 0]] \end{align*} which is $1$ if $j\leq n$ , provided $j\geq 0$ and $0$ otherwise. An interesting aspect is that we can achieve this also with the help of formal power series (marked in blue). \begin{align*} [z^n]\frac{z^j}{1-z}&=[z^n]z^j\left(1+z+z^2+\cdots\right)\\ &=[z^n]\left(z^{j}+z^{j+1}+z^{j+2}+\cdots\right)\\ &=[[j\leq n|0\leq j]] \end{align*} This approach is more powerful than using Iverson brackets, since we can manipulate this series and we will see, that this factor $1$ is a key to solve the problem.

  • In (2) we use the linearity of the coefficient of operator and apply the rule $[z^{p-q}]A(z)=[z^p]z^qA(z)$.

  • In (3) we use the product representation of the ordinary generating function of the Stirling numbers of second kind

\begin{align*} \sum_{j\ge m} {j\brace m} x^j = \prod_{r=1}^m \frac{x}{1-rx}\tag{4} \end{align*}

  • In (5) we do a simplification.

  • In (6) we make a further simplification and we obtain the product representation (4).

Note that the blue marked factor $\frac{1}{1-(m+1)x}$ which is the clou to obtain ${n+1\brace m+1}$ in the last line (7) comes from the factor $\frac{1}{1-z}$ which is part of the blue marked factor in (1).

Markus Scheuer
  • 108,315