Freeze a game of Pong while the ball is halfway down the court. Its position is visible, but its direction is not. The same picture could have come from a ball moving upward or a ball moving downward. If the paddle takes the same action in both cases, should we expect the same thing to happen next?
The previous frame resolves the ambiguity because it reveals the ball’s direction. That gives us a practical test for a state representation:
After the current representation and action are known, can any detail from the history still change our prediction of the next representation or reward?
A Markov decision process, or MDP, is the standard starting point for formalizing many reinforcement learning problems. It brings together states, actions, rewards, and transition dynamics. At time , the environment’s complete state is . After the agent chooses , the dynamics define a distribution over the next state and reward, .
The agent does not always receive that complete state. It may instead receive a chosen representation : perhaps a sensor reading, a collection of features, or a summary constructed from the interaction history. Let
denote everything the agent has observed before choosing . The representation is Markovian when adding that history cannot change the predicted distribution:
The equality is about history, not certainty. A transition may remain genuinely random and still be perfectly Markovian. The property fails only when two histories that produce the same and lead to different distributions over what happens next.
Does the previous frame change your prediction?
A ball travels up-right or down-right at a fixed speed, away from the walls. The paddle stays still.
Position alone
History changes the prediction.
Use only the current state
Either direction is possible.
Now, reveal the previous frame
The previous position reveals the direction.
Position + velocity
History adds no new information.
Use only the current state
Velocity already gives the direction.
Now, reveal the previous frame
The prediction stays the same.
The Markov property therefore belongs to the process induced by the chosen representation, not to the agent, policy, or learning algorithm. The underlying environment can stay fixed while one representation preserves the property and another aliases situations that require different predictions or decisions.
We will explore that effect in three environments. Each pair keeps the dynamics, rewards, algorithm, hyperparameters, and training budget fixed. Only the representation supplied to the agent changes. The examples will hide three different kinds of information: motion, a remembered event, and progress that gives a transition its reward.
Pong
Pong gives us the smallest useful version of the opening puzzle. The objective is intuitive, but the reward is sparse: hitting the ball earns a positive reward, missing it earns a negative reward, and every intermediate step earns zero. We will use a small quantized court so that both agents can learn with the same tabular Q-learning algorithm in the browser.
The MDP
Our first MDP is a simplified Pong environment where a ball crosses a rectangular arena. It bounces off the walls and must be hit by a paddle controlled by the agent at the bottom of the screen. The agent can move the paddle left, stay still, or move right.
We compare two representations. The first contains the ball and paddle positions, . A ball at one position could be moving up or down, so earlier positions still change the predicted next position. The second representation adds velocity, . Position and velocity now describe the relevant dynamics of this simplified court; earlier frames add no further predictive information.
Simplified Pong MDP
Move the paddle before the ball arrives
The first representation violates the Markov property because two histories can reach the same with different hidden velocities. Averaging over those velocities produces a distribution over several possible next positions. That spread is not itself the violation: a stochastic transition can be Markovian. The violation is that the distribution changes when the previous position reveals which velocity is present.
One snapshot · two state representations
Can this state tell us where the ball goes next?
With position and velocity together, the relevant histories agree about the next-transition distribution. The equality now holds for the simplified dynamics.
Learning
The two playgrounds use the same 11-by-9 court. A successful contact reflects the ball upward, while a miss ends the rally; each training episode allows up to three successful returns. The dynamics, reward, launch sequence, Q-learning algorithm, and hyperparameters are identical. Only the observation changes.
Predict before training
Can one action serve two hidden directions?
Hold the visible ball position, paddle position, and chosen action fixed. If one history contains an upward-moving ball and another contains a downward-moving ball, should one position-only Q-value be reliable in both? Predict which learning curve will level off first.
Start with the agent that cannot observe velocity. Press Train agent and watch its policy and hit rate change across varied launches. When training ends, press Run agent to watch the learned policy continue playing while hits and misses accumulate.
Experiment 1 · Broken state
Can a position-only agent learn to return the ball?
z = (x, y, paddle)Velocity hiddenTraining has not started.
Now repeat the experiment after adding velocity to the representation. The direction arrow marks the new information available to this agent.
Experiment 2 · Markov state
What changes when velocity is part of the state?
z = (x, y, vₓ, vᵧ, paddle)Velocity observedTraining has not started.
Each curve evaluates its greedy policy on every one of the 176 possible launch states at regular training checkpoints. It does not plot noisy rewards gathered while the agent is still exploring.
In this reproducible run, the velocity-aware policy reaches a 100% hit rate after 5,000 episodes. The position-only policy reaches 36% because one Q-value must average situations that call for opposing actions.
The gap is computed from the learned Q-values, not drawn in advance. Reloading the page reproduces the same curves because the seed, launch schedule, and evaluation set are fixed. This matched run demonstrates the effect in this environment; it is not a general benchmark for every algorithm or state representation.
Matched result
One missing variable changes what can be learned
Same game and training budget. Only the state representation differs.
This scenario exemplifies what we can call Missing dynamics, where the state fails to capture the instantaneous motion required to predict physical transitions.
The Door and the Key
The MDP
Our second environment is a small gridworld where the agent must retrieve a key before passing through a door to reach the goal. The key and the door are located on opposite sides of the map, forcing the agent to traverse a central region, collect the key, and then retrace its steps toward the door.
The complete state in this MDP is , where represents the agent’s position and indicates whether the key has been collected. The available actions are . The door acts as a solid wall when and allows passage when . Reaching the goal yields a positive reward and ends the episode.
The route
The agent must cross the same corridor twice
The useful direction reverses after the key is collected.
We evaluate two representations. In the first, , meaning the agent only knows its current position. In the second, , it knows its position and whether it holds the key.
This presents a different challenge from Pong. There is no missing information regarding instantaneous movement dynamics. If the agent is in an empty cell and moves left, we know exactly which cell it will land in. Instead, the missing information relates to an event that occurred in the past.
Consider the position immediately in front of the door. The same spatial position represents two distinct underlying states: before the key is collected, and after the key is collected.
Executing the same action in these two states produces completely different transitions. If , moving toward the door results in the agent being blocked. If , the agent steps through. Because the representation merges these two realities, the transition probability is forced to represent a mixture of both possible outcomes.
Knowing the history resolves this ambiguity. If the history shows that the agent previously visited the key’s location, we know with certainty that . Consequently, the transition probabilities differ:
This shows the position-only representation violates the Markov property. Adding to the state resolves the issue by compressing a potentially distant historical event into a single current variable. Once is known, the exact path the agent took to get there adds no further relevant information for predicting the next transition.
The hidden difference
Same position. Same action. Different next state.
Position alone merges these two states. The key bit keeps them separate.
We can refer to this as Missing memory. Unlike Pong, the hidden information does not describe physical momentum, but rather summarizes a critical milestone that occurred earlier in the episode.
Learning
We again keep the reward structure, transition dynamics, algorithm, hyperparameters, and training budget fixed.
Predict before training
Which way should the center point?
Before collecting the key, the agent must leave the center toward the key. After collecting it, the agent must cross the same center toward the door. If both moments share one position-only Q-value, can one greedy action complete both halves of the route?
Train the position-only agent, then press Run agent. Watch the route and the counts of completed goals and capped rollouts.
Experiment 1 · Broken state
Can position alone encode the return route?
z = pKey status hiddenTraining has not started.
During exploratory training, the agent may stumble to the goal. Its final greedy policy cannot reliably reproduce that route: at the shared corridor cells, one fixed action cannot point toward the key before collection and toward the door afterward.
Now run the matched experiment after including in the representation.
Experiment 2 · Markov state
What changes when the key is part of the state?
z = (p, has_key)Key rememberedTraining has not started.
The key-aware agent can distinguish the center before collecting the key from the center afterward. It can learn two policies over the same corridor: move left while , then move right while . Its current position, key status, and chosen action are sufficient to predict whether the door blocks the move.
Each curve checkpoint evaluates the current deterministic greedy policy once from the same central start. The displayed 0% or 100% therefore means that this single fixed route failed or succeeded; it is not an estimate across varied starts. The final comparison is computed from the learned Q-values using the same 3,000-episode budget.
To keep unsuccessful demonstrations bounded, training and playback stop a rollout after 24 actions. That cap belongs to the experiment harness, not to the MDP: reaching it adds no environment transition or reward, and the agent does not need a hidden clock in its state.
Matched result
One bit of memory makes the route learnable
Same corridor and training budget. Only the state representation differs.
In Pong, we added a variable to capture current momentum. Here, we added a variable to compress relevant past events.
Checkpoints
The MDP
The third environment is a gridworld featuring a central hub connected to three distinct checkpoints: A, B, and C. To successfully complete the episode, the agent must visit these checkpoints in the strict order of .
Importantly, no paths are physically blocked or altered during the episode. The geometry of the map and the physical mechanics of movement remain entirely unchanged from start to finish.
The complete state for this MDP is . The variable defines the spatial position, and tracks the next expected checkpoint in the sequence. Moving the agent updates its position on the grid. The task state advances only when the correct checkpoint is visited, generating a positive reward.
The route
Three open paths. One required order.
The map never changes. Only the next expected checkpoint does.
We evaluate the representations and .
This scenario presents a subtle counterintuitive challenge. The position alone is perfectly sufficient to predict the physical movement of the agent. For any given position and action, the spatial transition holds true regardless of the past:
Knowing the history does not improve our ability to predict where the agent will physically end up next.
However, an MDP defines both the next state and the reward. The current state must be sufficient to determine the reward distribution as well.
Consider entering checkpoint B. If , entering the cell generates a positive reward and advances the task. If the agent enters that exact same cell while or , the transition yields zero reward. The physical position and the executed action are identical, yet the resulting reward is different.
The variable is entirely dependent on the task history. Knowing which checkpoints have been visited allows us to deduce what reward a specific transition will produce.
While the spatial dynamics are fully Markovian, the reward distribution is not:
Consequently, the full transition distribution of the MDP violates the Markov property under the reduced representation:
Including makes the current state of the task explicit. Once we know the physical position and the expected checkpoint, the rest of the history is no longer needed to predict the full transition, including the reward.
The hidden difference
Same move into B. Different reward.
Position predicts the movement. Task progress predicts what that movement means.
We categorize this as Missing reward state. We are not obscuring physical dynamics, nor are we hiding a condition that enables new physical movements. We are hiding the variable that assigns meaning to a physical transition within the context of the task.
Learning
We train the algorithm once again while keeping the spatial dynamics, reward logic, algorithm, hyperparameters, and budget fixed.
Predict before training
Can one hub action encode three stages?
At the hub, the agent must head toward A, B, or C depending on the next expected checkpoint. If progress is hidden, which of those three actions can a deterministic position-only policy choose? Predict whether exploration during training can repair that limitation in the final greedy policy.
Train and run the position-only agent first. Watch whether its final policy can credit A, B, and C in order before the rollout cap.
Experiment 1 · Broken state
Can position alone learn the ordered route?
z = pTask progress hiddenTraining has not started.
Exploration can occasionally produce the right sequence during training, but it cannot repair the representation used by the final policy. At the hub, one greedy action must serve all three stages.
Now run the matched experiment after explicitly providing .
Experiment 2 · Markov state
What changes when task progress is part of the state?
z = (p, next)Next checkpoint observedTraining has not started.
The progress-aware policy can choose a different path from the hub for each value of , despite occupying the same physical position. Run the final policy and watch A, B, and C become credited in order.
As in the door experiment, each curve checkpoint evaluates one deterministic greedy rollout from the same hub. Its 0% or 100% value records whether that fixed route failed or completed. The final comparison is computed from the learned Q-values using the same 4,000-episode budget.
The 42-action rollout cap is also external to this MDP. It keeps unsuccessful training and playback finite but introduces no transition or reward of its own.
Matched result
Task progress makes the order learnable
Same map, rewards, and training budget. Only the state representation differs.
This highlights a third category of hidden information. The representation perfectly predicted the next physical state, but failed to capture the variables necessary to determine the reward process.
What was missing?
When we place all three experiments side by side, a clear pattern emerges. In every case, the underlying physical dynamics, the true reward function, the learning algorithm, and the hyperparameters remained completely constant between the two versions. We only altered what the agent considered to be its state.
In the first case, Missing dynamics, position failed to inform velocity. The history allowed us to infer the ball’s trajectory, thereby altering the predicted distribution of the next spatial state.
In the second case, Missing memory, position failed to indicate whether a crucial event had occurred. The history revealed if the key had been collected, dictating which physical transitions were possible moving forward.
In the third case, Missing reward state, position perfectly predicted the next movement but failed to determine the reward. The history revealed the agent’s progress within the task sequence.
These labels describe what the omitted information changes; they are not mutually exclusive formal categories. Both key status and checkpoint progress, for example, summarize earlier events. The useful question is whether the hidden fact changes physical dynamics, available transitions, rewards, or some combination of them.
Pong is missing dynamics, repaired by adding velocity to position. The door-and-key environment is missing memory, repaired by adding whether the agent has the key. The checkpoint environment is missing reward state, repaired by adding the next required checkpoint.
Pong
Missing dynamics
Key–Door
Missing memory
Checkpoints
Missing reward state
A useful state does not need to remember everything. It can keep a compact, sufficient summary of the past that still changes what happens next.
These three examples are manifestations of the same mathematical condition. If any detail from the history modifies the predicted distribution of the next representation or reward, even after we know the current representation and action, then the representation is not sufficient:
The entire history would always preserve its own information, but carrying it verbatim is rarely useful. State design aims for a compact sufficient summary: keep the facts from the past that can still change the future, and discard the rest.
In these fixed-seed demonstrations, repairing the aliases allowed the same tabular Q-learning algorithm to produce a more successful greedy policy. That does not mean adding variables always makes learning faster. Irrelevant variables enlarge a tabular state space and can make learning less efficient. The goal is sufficiency, not maximum detail.
Keep the diagnostic
Hold the current representation and action fixed. If two compatible
histories still predict different next representations or rewards, find
the hidden fact responsible and add a current summary of it.
Transfer the idea
What is missing from this delivery state?
A delivery drone observes its position, velocity, and battery level. It earns +1 for reaching a clinic before 6 p.m. and 0 for the same arrival after 6 p.m. Two flights can have the same observation and take the same action while arriving on opposite sides of the deadline. Is the proposed representation Markovian? What compact variable would repair it?
Check your reasoning
It is not Markovian for the stated reward process. The flight history can reveal whether the deadline has passed, which changes the reward even when position, velocity, battery, and action match. Add the current time or time remaining before the deadline; the full flight path is unnecessary.
Markovianness is a property of the representation used to describe a process. The environment can remain the same while one representation preserves every distinction that matters for the next state and reward and another hides exactly the information the agent needs.