The Rational Use of Cognitive Resources