Solution (source code)

= Solution

The moving sums $(K_n)$ are not necessarily Markov. For a counterexample, let the $X_n$ be independent Bernoulli variables with parameter $1/2$. On the event
$$
K_n=1,
\qquad K_{n-1}=0,
$$
we must have $X_{n-1}=0$ and $X_n=1$, so
$$
\mathbb P(K_{n+1}=2\mid K_n=1,K_{n-1}=0)=\frac12.
$$
On the other hand, $K_n=1$ and $K_{n-1}=2$ force $X_{n-1}=1$ and $X_n=0$, whence
$$
\mathbb P(K_{n+1}=2\mid K_n=1,K_{n-1}=2)=0.
$$
Both conditioning events have positive probability. Knowledge of $K_n$ alone therefore does not determine the next-step law. The <overlapping moving sum need not be Markov>.