Optimal control of a noisy sensor being used by an agent to play a game