Equivalent stochastic and deterministic optimal control problems