The Art of Being Good Enough
Time has a funny way of turning good decisions into bad ones.
The Art of Being Good Enough

Time has a funny way of turning good decisions into bad ones.
Wait too long to brake, and a near miss becomes a collision. Delay medical intervention by a few minutes, and a treatable condition becomes life-threatening. Hold a traffic signal for just a moment too long, and congestion begins to ripple outward through an entire city.
A lot of the time, correctness is not only determined by what decision is made, but also by when it is made. A perfect answer delivered too late could end up being worse than a wrong one.

Decision quality and timeliness are often competing goals. Real-time systems prioritise faster response times over optimality.
Real-time systems exist in this unforgiving space. They operate in the real world, where information is incomplete, the future is uncertain, and the world continues to change even while decisions are being made. They don’t have the luxury of pausing, gathering every possible detail, and computing an ideal response.
Time refuses to wait.
And yet, these systems are expected to function anyway.
The Clock Has Always Been Ticking…
The first thing time steals is the present.
By the time a system observes its environment, the world has already moved on.
At an intersection, the controller does not observe ‘traffic’. It receives fragments: a sensor triggering above a lane, a pedestrian pressing a button, a camera frame obscured by rain or headlights. Everything outside those inputs simply doesn’t exist to the system.
It’s like looking down a kaleidoscope and trying to see a mirror: a system sees reality through a noisy, blurry filter.
The problem is that these fragments rarely tell the whole story. Different traffic conditions can produce identical observations. A sensor may report that a vehicle is present without revealing whether congestion is beginning to ease or rapidly building beyond the intersection.

A system can only deal with what it observes, not with what actually exists. Partial observability emerges from the gap between those two realities.
This creates a fundamental problem. If the system cannot accurately determine the actual current state, it cannot act as if it knows exactly what is happening. Instead, it maintains a belief state, an estimate of what the state could be, given everything it has observed so far.
By the time a decision must be made, the system is already working with an incomplete picture. It no longer reacts to reality, but to its own version of reality.
The battle against time begins not with predicting the future, but with trying to understand a present that refuses to stay still.

A Partially Observable Markov Decision Process (PODMP) is a mathematical framework for decision-making under uncertainty. This image depicts a finite part of a POMDP, where S is a set of states, A a set of actions and O a set of observations.
… And It Always Will Be
Understanding the present, albeit imperfectly, is only half the battle. Time keeps the future just out of reach, too.
At an intersection, traffic conditions can change in seconds. A queue may be clearing normally, only for another burst of vehicles to arrive from a signal upstream. A pedestrian crossing, an emergency vehicle, or congestion elsewhere in the network can suddenly alter the flow entirely.
At any given moment, the system may be in some state S, but that state does not determine the next input it receives. The future unfolds one event at a time, and there simply is no way to know what will happen next.

Contrary to popular belief, clairvoyance is not included in most system design budgets.
In an ideal world, you’d want to look at the entire sequence of future inputs, evaluate all possible decisions, and choose the one that minimises some global cost. This is the assumption behind offline computation, where the entire input sequence is known beforehand.
Real-time systems don’t have that luxury. They operate online, where inputs arrive one step at a time, and each decision must be made without knowing what the future looks like. Once a decision is made, it usually cannot be undone.
Once a signal phase is extended, the consequences ripple outward. Extend it for too long, and congestion may build elsewhere. End it too early, and queues may begin to grow unnecessarily.

The difference between offline and online computation is the difference between planning a journey with the entire map in hand and navigating while the road is still being built beneath your feet.
The challenge is no longer to find the perfect sequence of actions. It is to make the best possible decision with the information available, while time slowly reveals the future one moment at a time.
A Thousand Futures
Just for a second, let’s say our system tries to fight back.
If the present is uncertain, maybe it could reason over every possible state. If the future is unknown, maybe it could anticipate every possible outcome. Given enough computation, surely the right answer could still be found.
Time still rules unchallenged.
Every situation is far more complex than it seems. But time doesn’t sit around waiting for us to figure out the present.
The system must also consider how the world might evolve over the next few seconds, and the next few after that. Every passing moment branches into countless new possibilities, producing an ever-growing tree of futures.
This is known as state space explosion.

A state transition graph showing how combinations of variables rapidly increase the number of reachable states. Exhaustively reasoning over every possibility quickly becomes infeasible, especially as the number of variables increases.
The cruel irony here is that the harder a system tries to account for uncertainty, the more possibilities it creates for itself. Exhaustive reasoning quickly becomes impossible as time ensures that the search outruns the system itself.
Expecting the Unexpected
Sometimes, time leaves behind patterns.
Rush hour arrives daily with relative consistency. School dismissals create predictable surges. Traffic ebbs and flows in rhythms that a system can learn to expect.
But time is under no obligation to remain predictable.

Deterministic systems evolve predictably, while stochastic systems are shaped by chance. Real-time systems must be prepared for both predictable rhythms and unexpected disruptions.
An ambulance requires priority passage. A sensor may fail in heavy rain. Congestion can spill over unexpectedly from a neighbouring intersection. The familiar rhythm breaks down, and the system is forced to adapt to a reality that no longer resembles its expectations.
Real-time systems, therefore, cannot rely solely on what usually happens. They must also remain functional when the world behaves unexpectedly, as it so often does.
The Luxury of Waiting
If only we could convince time to stop. So many of these issues would practically evaporate if time could spare the system just a moment to catch up.
A traffic controller could gather more information, refine its estimates, simulate additional outcomes, and eventually arrive at a better decision. It could wait until uncertainty had been resolved before committing to an action.
But time keeps moving.

The universe isn’t always this accommodating.
Vehicles continue to arrive at intersections. Pedestrians continue to wait (or just jaywalk). Queues continue to grow. While the system is still reasoning, the problem itself is changing in front of its eyes.
The Best There Never Was
Not all systems experience the consequences of delay equally. In soft real-time systems, missed deadlines degrade performance. In hard real-time systems, they define failure.
Either way, time becomes part of correctness itself.
At this point, time has established itself as a system’s worst enemy. It obscures the present. It withholds the future. It multiplies possibilities faster than they can be explored, and refuses to slow down while decisions are being made.
Global optimisation assumes the opposite of all these conditions.
But by the time a traffic controller must decide whether to extend a green phase, the information available to it is still incomplete. The future conditions that determine whether the decision was truly optimal have not yet unfolded. Even if both of those problems disappeared, the sheer number of possible outcomes would make exhaustive reasoning infeasible.

Decision-making is considerably more stressful when the problem itself refuses to sit still.
The challenge, then, is no longer to discover the perfect decision. It is to make the best decision that can be justified before time leaves it behind.
Fighting Back
But ultimately, what would we be if we simply bowed down to time’s demands? Humans are nothing if not stubborn, and a ticking clock only pushes us harder to try and slow down the hands.
Engineers have mastered the art of bending time’s rules to make space for a solution. Real-time systems cannot eliminate uncertainty, but they can learn to live with it.
When time hides the present, they estimate. Traffic controllers infer queue lengths from incomplete sensor readings. The picture is imperfect, but usually enough to make an educated guess.
When time makes the future unpredictable, they adapt. As queues form and dissolve, pedestrians arrive at crossings, and signals elsewhere shift their own rhythms, the system continuously updates its decisions in response to a world that refuses to sit still.
When time gives them more possibilities than they know what to do with, they simplify. Systems use heuristics, bounded planning horizons, and rules of thumb rather than exhaustive optimisation. Rather than searching for the perfect decision, they search for one that is sufficient before the problem changes again.
And when time, as it always does, refuses to wait, they prioritise. Some tasks matter more than others. An ambulance trying to pass through a traffic-choked lane must take precedence, even if it increases delays elsewhere. A VIP convoy can cause unprecedented stoppages, and the system must find a way to keep the roads moving regardless.
Time still sets the rules. Real-time systems have simply become** **good at bending them.
The Final Countdown
Theories are easy to understand from the comfort of four walls and hindsight. It’s much harder when the clock is ticking. So let’s trade our abstractions for something a little more familiar.
Welcome to Bengaluru, a city where the streets defy every known mathematical model. Recently, a system called VAC (Vehicle Actuated Control) has been the one calling the shots on the street. Let’s take a peek at how it makes its decisions, shall we?
Vehicle Actuated Control (VAC) replaces rigid signal schedules with responsive decision-making. Using sensors embedded in or positioned near the roadway, the system detects approaching vehicles and dynamically extends or terminates green phases based on demand.
Imagine you’re managing an intersection at 5:00 pm, peak hours. You have ten seconds to decide whether to extend the current green signal or terminate it.
10 seconds.
The eastbound approach has been green for 24 seconds. A healthy number of vehicles are still moving through the intersection.
Two pedestrians are waiting to cross.
8 seconds.
A sensor detects vehicles accumulating in the northbound lane. How many? No idea. The sensor only tells you that something is building up.
6 seconds.
An ambulance requests priority passage from the southbound approach.
Ending the current phase too early could leave vehicles stranded at the junction. Extending it for too long could delay emergency response.
4 seconds.
Traffic conditions in the south have changed. A burst of vehicles arrives unexpectedly from a neighbouring intersection.
The decision you make now cannot be undone.
2 seconds.
You still have no clarity on what is accumulating in the north. The eastbound lanes are still going strong. The ambulance demands priority.
0 seconds.
You have to decide. What do you do?
There is no perfect answer. There never was.* *Time makes sure of that.
No system can eliminate uncertainty. They estimate. They adapt. They simplify. They prioritise. They negotiate with a clock that refuses to stop ticking. Every green phase is a compromise struck between competing demands.
The remarkable thing is not that these systems are imperfect. It is that they work at all.
메타데이터
- post_id
- 2f6fcbf7a6b0
- slug
- the-art-of-being-good-enough-2f6fcbf7a6b0
- url
- https://medium.com/gdg-vit/the-art-of-being-good-enough-2f6fcbf7a6b0
- canonical_url
- https://medium.com/gdg-vit/the-art-of-being-good-enough-2f6fcbf7a6b0
- author_url
- https://medium.com/@asridharan30
- status
- ok
- fetched_at
- 2026-06-22 07:15:07