The algorithmic mind : a study of inference in action