Problem 102: Run-length Encoding |
The binary representation (expansion) of a positive integer $x$ is denoted by $r(x)\in\{\sa{0},\sa{1}\}^*$. The run-length encoding of a word $w\in\sa{1}\{\sa{0},\sa{1}\}^*$ is of the form $\sa{1}^{p_0}\sa{0}^{p_1}\cdots \sa{1}^{p_{s-2}}\sa{0}^{p_{s-1}}$, where $s-2\geq0$, $p_i$s are positive integers for $i=0,\dots,s-2$ and $p_{s-1}\geq0$. Value $s$ is called the run length of $w$.
In the problem we examine the run length of the binary representation of the sum, the difference and the product of two integers.