Regret Analysis of Stochastic and Nonstochastic Multi-armed Bandit Problems