A Learning Algorithm That Attains the Human Optimum in a Repeated Human-Machine Interaction Game