How Your Brain (and a Computer) Learn the 'Rules of the Game'