On random minimization of functions