Number of ways to transform binary sequences into another one using given operations

71 Views Asked by At

You're allowed to perform one of four operations each time on a binary sequence:

  1. Delete the rightmost 0 in the sequence (if it exists)

  2. Turn the rightmost 0 into 1 (if it exists)

  3. Insert 0 to a position such that it becomes the rightmost 0 of the new sequence

  4. Turn a 1 into 0 (if it exists) such that it becomes the rightmost 0 of the new sequence

Operation 3&4 are basically inversions of operation 1&2 respectively.

For example, you can turn 1 into 111 with the following process using 8 operations: $1\xrightarrow{3}01\xrightarrow{2}11\xrightarrow{3}101\xrightarrow{4}100\xrightarrow{1}10\xrightarrow{2}11\xrightarrow{3}110\xrightarrow{2}111$.

Now the problem is to find the number of ways to transform $\underbrace{11\cdots11}_{n\text{ ones}}$ into $\underbrace{11\cdots11}_{m\text{ ones}}$ ($n\le m$) using exactly $2k$ operations. Two ways are considered different if and only if there exists a time where two sequences differ.

The solution to this problem turns out to be

$$ (2k-1)!!\sum_{i=0}^{\min\{n,m\}}\binom k{m-i}\binom mi\binom{k+m-i}{n-i} $$

I've proved this for the case $k=m-n$, but currently I can't find a complete proof. Any help is appreciated!