On the Optimality of Perturbations in Stochastic and Adversarial Multi-armed Bandit Problems