Optimal programming problems with a bounded state space