Stochastic approximation on a discrete set and the multi— armed | Synapse