function r=bandit(varBetween,varWithin,n,T,epsilon,alpha)

global task

task = makeTask(n,varBetween,varWithin);
Qs = zeros(1,n)+10;
r = zeros(1,T);
for t=1:T
    a = choose(Qs,epsilon);
    r(t) = getReward(task,a);
    Qs(a) = learn(Qs(a),r(t),alpha);
end