An action-value function, written Q(s,a), estimates the expected cumulative future reward after taking action a in state s and then following policy π. It measures the long-term goodness of a specific action in a specific state. section 12.1.2
Use Q-values to distinguish action choices within reinforcement learning:
- Contrast Q(s,a) with the state-value function V(s), which evaluates a state under a policy rather than a particular action. section 12.1.2
- Interpret future rewards through the discount factor γ: values near zero emphasize immediate rewards, while values near one consider more distant rewards. section 12.1.2
- Place action-value estimates alongside value iteration, policy iteration, and policy gradients as methods for learning policies that maximize expected cumulative discounted reward. section 12.1.2
A trajectory after moving right
A hand-worked trajectory combines possible rewards and transition probabilities to obtain an expected return of 5.728: 0.4 × 10 + 0.6 × 4 + 0.4 × 0.2 × (−10) + 0.4 × 0.8 × 4 × 0.1 = 5.728, with additional zero-reward terms shown in the full calculation. section 12.1.2
Figure 12.4 Reach the Treasure game
Use the Reach the Treasure game to visualize how an agent’s action choices connect to expected returns. section 12.1.2




