A Minimum Relative Entropy Principle for Learning and Acting