transformation of a difference equation How can I translate the difference equation
$$x_{k+3}+4x_{k+2}+3x_{k+1}+x_k=2u_{k+2}$$
into a state-space representation of the following form (A and B are matrices)
$$x_{k+1}=Ax_k+Bu_k$$
 A: As always in such cases. Let 
$$ X_k := \begin{pmatrix} x_k \\ x_{k+1}\\ x_{k+2} \end{pmatrix} $$
and 
$$ U_k := \begin{pmatrix} u_k \\ u_{k+1} \\ u_{k+2}\end{pmatrix} $$
Then the above can be written as 
\begin{align*}
  X_{k+1} &= \begin{pmatrix} x_{k+1} \\ x_{k+2}\\ x_{k+3} \end{pmatrix} \\
   &= \begin{pmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ -1 & -3 & -4\end{pmatrix}
   \begin{pmatrix} x_k \\ x_{k+1}\\ x_{k+2} \end{pmatrix}
  + \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0\\ 0 & 0 & 2\end{pmatrix}
    \begin{pmatrix} u_k \\ u_{k+1}\\ u_{k+2} \end{pmatrix}\\
  &=: AX_k + BU_k
\end{align*}
A: One way is
$$
\begin{bmatrix}
x_{k+3}\\x_{k+2}\\x_{k+1}
\end{bmatrix}
=
\begin{bmatrix}
4&3&1\\
1&0&0\\
0&1&0
\end{bmatrix}
\begin{bmatrix}
x_{k+2}\\x_{k+1}\\x_k
\end{bmatrix}
+
\begin{bmatrix}
2&0&0\\
0&0&0\\
0&0&0
\end{bmatrix}
\begin{bmatrix}
u_{k+2}\\u_{k+1}\\u_k
\end{bmatrix}
$$
A: We can shift back to time by two samples i.e.
$$x_{k+1}+4x_{k}+3x_{k-1}+x_{k-2}=2u_{k}$$
We only need one input and three states. Define 
$$X_k:=[x_{k-2}, x_{k-1}, x_{k}]^T$$
then
$$X_{k+1}=\left[\matrix{ 0 & 1 & 0\\0 & 0 & 1\\ -1 & -3 & -4}\right]X_k+\left[\matrix{0\\0\\2}\right]u_k$$ 
