Optimal payoff from sampling from a collection of Bernoulli random variables?
This is called the explore/exploit trade-off in machine learning.  This scenario is precisely captured by the multi-armed bandit problem with i.i.d. payoffs.  Algorithms such as UCB and Exp3 will get you an expected payoff within $\tilde{O}(\sqrt{Kn})$ of the optimal, and you asymptotically cannot do better.