Optimistic planning for sparsely stochastic systems