this purpose, we use the following transitions on the right end-marker in which the value of the counter is not changed:

-   Both states $ p_1 $ and $ p_2 $ switch to $ p_1 $. Thus, the pair $  {\langle p_1,-k \rangle} -  {\langle p_2,-k \rangle} $ disappears.

-   If the value of the counter is non-zero, both states $ p_3 $ and $ p_4 $ switch to $ p_3 $. Thus, each pair of the form $ (-1)^{x[i]} {\left(  \frac{1}{2} {\langle p_1,\neq 0 \rangle} - \frac{1}{2} {\langle p_2,\neq 0 \rangle}  \right)} $ disappears ($ i \neq k $).

-   If the value of the counter is zero, both states $ p_3 $ and $ p_4 $ switch to themselves. Moreover, the state $ p_0 $ switches to $ p_3 $ and $ p_4 $ with values of $ \frac{1}{2} $. Then, the following interference appears: $$v_f =
        (-1)^{x[i]} {\left(  -\frac{1}{2} {\langle p_3,0 \rangle} + \frac{1}{2} {\langle p_4,0 \rangle}  \right)}
        +
        \frac{1}{2} {\langle p_3,0 \rangle} + \frac{1}{2} {\langle p_4,0 \rangle}.$$

If $ x[i] = 1 $, then $ v_f = {\langle p_3,0 \rangle} $. If $ x[i] = 0 $ or $ x[i] =2 $, then $ v_f = 