A Q-table is a scorecard for choosing actions in reinforcement learning. Each row represents a state, each column an action, and each cell a Q-value: an estimate of how favorable that action is in that state. The table stores a score for each action, not a separate instruction naming the best one. section 10.6
Figure 10.11 An example Q-table and states that it represents
Compare the action scores across a row to see how the agent chooses for a particular state. section 10.6
Choosing a move
Imagine an agent navigating a parking-lot simulation. Its current state identifies a row of the table. The agent compares that row’s action values and usually chooses the highest-valued move. During training, it can instead try a random move, observe the reward and next state, and use that experience to improve its estimates. section 10.6 section 10.7
A simple implementation starts with an array of zeros sized by the number of states and actions. Training repeatedly runs the simulator, choosing between a table-guided and random action and learning from the result. To use the trained table, look up the current state and take its highest-valued action until the goal is reached. section 10.6 section 10.7
The table is limited to states it represents. For an unseen state, it has no learned action value and needs a fallback such as a random move. A table based only on nearby objects may work in another parking-lot layout, but its limited view can favor short-term rewards over a better route across the whole map. section 10.7

