In deterministic dynamic programming, given a state and a decision, both the immediate payoff and next state are known. If we know either of these only as a probability function, then we have a stochastic dynamic program. The basic ideas of determining stages, states, decisions, and recursive formulae still hold: they simply take on a slightly different form.