Optimal control of discrete linear processes with quadratic cost