Dynamic programming for stochastic control of discrete systems | Synapse