Module 3 — Uncertainty, probability and inference
Lesson 1 of 13
Why uncertainty matters
We do not know the future.
We do not observe the present perfectly.
And our knowledge of the past is incomplete.
That means uncertainty is not an unusual problem that appears when something goes wrong.
It is a fundamental property of making decisions in the real world.
A weather forecast cannot tell us with certainty whether it will rain at exactly 15:00 tomorrow.
A doctor cannot know with certainty whether a treatment will work for a particular patient.
An electricity system operator cannot know exactly how much electricity every household will consume this evening.
A robot cannot know the exact position and intention of every object around it.
An AI system cannot know with certainty which word should come next.
Instead, intelligent systems operate with incomplete information about:
what has happened
what is happening
and:
what might happen next.
The challenge is not to eliminate uncertainty.
It is to represent it, reason about it, and make good decisions despite it.
Intelligence is not the ability to know everything. It is the ability to act sensibly when we do not.
We have already encountered uncertainty
In the previous module, we discovered several reasons why data cannot provide a perfect description of reality.
Data may be:
- missing,
- noisy,
- selectively sampled,
- measured imperfectly,
- spatially incomplete,
- temporally incomplete.
Even a very large dataset is still only a representation of the world.
So our course framework is not really:
REALITY → DATA → PERFECT KNOWLEDGE
It is closer to:
REALITY
↓
PARTIAL OBSERVATIONS
↓
INFERENCE
↓
BELIEF ABOUT REALITY
There is uncertainty at every stage.
The present is uncertain too
It is tempting to think uncertainty applies only to the future.
But we are often uncertain about what is happening right now.
Imagine a robot driving through a city.
Its camera sees part of a pedestrian behind a parked van.
Its radar detects something moving.
Its map says there is a pedestrian crossing nearby.
The robot does not know the complete state of the world.
It has observations from which it must infer that state.
Perhaps it concludes:
There is an 80% probability that a pedestrian is about to enter the road.
That is uncertainty about the present.
The past can be uncertain
Even events that have already happened may not be perfectly known.
Suppose we ask:
How many people attended a protest yesterday?
Different sources may provide different estimates.
Or:
What was the temperature at this exact location 200 years ago?
No thermometer measurement exists.
We may infer it from other evidence.
Historical knowledge is often reconstructed from incomplete observations.
So:
past ≠ perfectly known
present ≠ perfectly observed
future ≠ predetermined
Uncertainty runs through the entire timeline.
Uncertainty is not the same as randomness
Suppose we roll a fair die.
We do not know which number will appear.
That uncertainty arises from a process we can describe probabilistically.
Now suppose we ask:
How many undiscovered species live in a particular rainforest?
We may be uncertain because we simply do not have enough information.
These are different kinds of uncertainty.
Sometimes the world contains genuine variability.
Sometimes our uncertainty comes from limited knowledge.
Often both are present.
Known unknowns
Sometimes we know what we are uncertain about.
A weather forecast might say:
There is a 30% probability of rain tomorrow.
The uncertainty is explicit.
We know the possible event.
We have some basis for assigning a probability.
This is a known unknown.
We do not know whether it will rain.
But we understand something about the uncertainty.
Unknown unknowns
Other uncertainty is harder.
Suppose a company forecasts demand for a product next year.
Its model considers:
- price,
- income,
- season,
- historical demand.
Then an entirely new technology appears and changes consumer behaviour.
The model may never have considered that possibility.
This is closer to an unknown unknown.
The difficulty is not merely that we were uncertain about the value of a variable.
The possibility itself was outside our model.
Models contain uncertainty
Recall:
Models are representations, not reality.
Every model excludes something.
A weather model cannot represent every molecule in the atmosphere.
An economic model cannot represent every human decision.
A traffic model cannot perfectly represent every driver.
A language model cannot contain every possible fact and context.
We simplify reality so that reasoning becomes possible.
Those simplifications introduce uncertainty.
Measurement uncertainty
Suppose a sensor reports:
20°C ± 0.5°C
We do not know the exact temperature.
The observation gives us a range of plausible values.
This uncertainty comes from the measurement process.
We explored this in the previous module.
But now we can make the uncertainty itself part of our reasoning.
Instead of pretending:
temperature = 20°C
we can think:
temperature is probably somewhere around 20°C.
That is a richer representation of knowledge.
State uncertainty
Suppose a robot wants to know where it is.
GPS suggests one position.
Its camera suggests another.
Wheel sensors provide another estimate.
The robot combines these observations to estimate its current state.
Instead of:
position = x
we might represent:
estimated position = x
together with:
uncertainty about x.
This distinction becomes fundamental when we later study state vectors, robotics and autonomous systems.
Prediction uncertainty
Now suppose we know the present state reasonably well.
We still do not know exactly what happens next.
A demand forecast might predict:
10,000 MW
But perhaps plausible outcomes range from:
9,000 MW to 11,500 MW.
A useful forecast should ideally tell us more than:
My best guess is 10,000 MW.
It should help us understand:
How uncertain is that guess?
A point forecast hides information
Consider two forecasting models.
Model A
Tomorrow's demand will be 10 GW.
Model B
Expected demand is 10 GW, with most plausible outcomes between 9.8 and 10.2 GW.
Now compare:
Model C
Expected demand is 10 GW, with plausible outcomes between 6 and 14 GW.
All three may have the same central prediction:
10 GW.
But they imply completely different levels of uncertainty.
A single predicted value hides that difference.
Forecasts are better understood as distributions
Rather than imagining the future as one predicted point:
FUTURE = 10
we can imagine a range of possible futures:
8
9
10
11
12
with different probabilities attached to each.
Some outcomes are more likely.
Some are less likely.
This is a probability distribution.
Instead of saying:
This is what will happen.
we say:
These are the outcomes we currently consider plausible, and this is how likely we think they are.
That is a much more honest description of prediction.
Probability gives us a language for uncertainty
Suppose tomorrow could be:
- sunny,
- cloudy,
- rainy.
A forecast might assign:
sunny: 20%
cloudy: 50%
rainy: 30%
The model has not failed because it cannot tell us exactly which future will occur.
It has represented its uncertainty.
Probability gives us a mathematical language for doing this.
That is what much of this module will develop.
Uncertainty matters because decisions depend on consequences
Suppose there is a:
10% chance of rain.
Should you carry an umbrella?
Perhaps not.
Now suppose there is a:
10% chance of a catastrophic flood.
Should a flood barrier operator ignore it because 90% is larger than 10%?
Probably not.
The probability alone does not determine the decision.
We also care about:
what happens if the event occurs.
So decision-making combines:
probability
with:
consequence.
Low probability can still matter
Suppose an autonomous vehicle estimates:
99.9% probability that the road ahead is clear
and:
0.1% probability that the object ahead is a pedestrian.
Should it simply choose the most likely interpretation?
Not necessarily.
The consequence of being wrong may be severe.
This is why intelligent decision-making cannot simply mean:
Choose whatever the model thinks is most likely.
We need to consider uncertainty together with the cost of error.
The most likely outcome is not always the best basis for action
Suppose electricity demand tomorrow is most likely:
40 GW.
But there is a smaller probability of:
50 GW.
If the system prepares only for 40 GW, the most likely forecast may be correct most of the time.
But on the occasions when demand reaches 50 GW, the system may fail.
Critical systems therefore often need to consider:
- tails,
- reserves,
- contingencies,
- safety margins.
We care about the distribution, not merely its centre.
Expected values
Suppose an action has two possible outcomes:
- 90% chance of gaining €10,
- 10% chance of losing €50.
We can combine probabilities and outcomes to calculate an expected value.
Conceptually:
EXPECTED VALUE = PROBABILITY × OUTCOME, summed across possible outcomes
This gives us one way to compare uncertain choices.
We will explore expected values later in this module.
But expected value is not the whole story either.
Two choices can have the same expected value
Imagine two games.
Game A
You receive:
€50 with certainty.
Game B
You receive:
- €100 with probability 50%,
- €0 with probability 50%.
Both have an expected value of:
€50.
But they do not feel like the same choice.
One is certain.
One is risky.
The distribution of possible outcomes matters.
Variance matters
Suppose two electricity forecasts both predict average demand of:
40 GW.
Forecast A usually lies between:
39 and 41 GW.
Forecast B usually lies between:
30 and 50 GW.
Their expected values are identical.
Their uncertainty is not.
We need ways of describing how spread out possible outcomes are.
This leads to concepts such as:
- variance,
- standard deviation,
- confidence intervals,
- prediction intervals.
Risk and uncertainty are related but different
People often use the words interchangeably.
A useful distinction is:
risk
often refers to situations where we can assign meaningful probabilities to outcomes.
uncertainty
is broader and can include situations where the probabilities themselves are poorly known.
For example:
There is a 5% probability this machine fails tomorrow.
is a quantified risk.
But:
We have never operated this machine under these conditions and do not know how reliable our failure model is.
describes deeper uncertainty.
Confidence in the probability matters too
Suppose two models both say:
20% probability of failure.
Model A has been trained and validated using millions of relevant observations.
Model B has seen 20 examples from a somewhat different environment.
The numerical prediction is identical.
Our confidence in that prediction should not be.
There can therefore be uncertainty about the probability estimate itself.
Uncertainty about uncertainty
This may sound strange, but it is important.
A model might estimate:
P(event) = 0.2
But how certain are we that:
0.2
is a good estimate?
Perhaps the true probability could plausibly be:
0.18–0.22.
Or perhaps:
0.05–0.60.
A probability written to three decimal places does not automatically imply confidence.
Data reduces some uncertainty
Suppose we know almost nothing about a system.
Then we collect observations.
Our beliefs can become more precise.
Conceptually:
PRIOR UNCERTAINTY
↓
NEW DATA
↓
UPDATED BELIEF
↓
REDUCED UNCERTAINTY
This is one of the central ideas behind statistical inference and Bayesian reasoning.
Data allows us to update what we believe.
But more data does not eliminate all uncertainty
Suppose we collect enormous amounts of historical data.
We may learn historical patterns extremely well.
But the future can still contain:
- random variation,
- structural change,
- new technology,
- new behaviour,
- unexpected events.
More data can reduce uncertainty.
It cannot abolish uncertainty.
The future may differ from the past
This is particularly important for AI.
Machine learning largely learns from:
historical examples.
But predictions are usually used in:
future situations.
So the system implicitly assumes that something about the relationship learned from the past will continue.
Sometimes that assumption is excellent.
Sometimes the world changes.
This is distribution shift.
Uncertainty should increase when we leave familiar territory
Suppose a model has been trained on temperatures between:
0°C and 30°C.
Now we ask it to predict behaviour at:
50°C.
The model may still output a number.
But we should be less confident.
The system is operating outside the region where it has strong evidence.
A good intelligent system should ideally recognise:
I have not seen enough situations like this before.
Knowing when you do not know
This is one of the most important properties we might want from AI.
Compare:
System A
The answer is definitely X.
with:
System B
X appears most likely, but the evidence is weak and several alternatives remain plausible.
System B may sound less impressive.
But in many situations it is far more useful.
Confidence should reflect evidence, not the fluency with which an answer is expressed.
This becomes particularly important when we later discuss AI hallucinations.
AI can sound certain without being certain
A large language model can produce a sentence in a confident tone.
But linguistic confidence is not the same thing as statistical confidence.
A model may generate:
The answer is X.
because X was a plausible continuation of the context.
That does not automatically mean:
P(X is factually correct) ≈ 100%.
This is an important distinction when interacting with generative AI.
Prediction confidence should be calibrated
Suppose a model makes 100 predictions and assigns each:
80% confidence.
If the model is well calibrated, roughly:
80 of those predictions
should be correct over repeated comparable cases.
If only:
50
are correct, the model is overconfident.
If:
98
are correct, it may be underconfident.
This idea is called calibration.
We will return to it later.
Uncertainty is not a weakness
People sometimes interpret uncertainty as:
the model does not know what it is doing.
But expressing uncertainty can be a sign of a better model.
Compare:
It will rain tomorrow.
with:
There is a 60% probability of rain tomorrow.
The second statement contains more information.
It acknowledges that multiple futures remain possible.
Experts often communicate uncertainty
Science frequently produces statements such as:
- confidence intervals,
- probability ranges,
- error bars,
- uncertainty bands.
These are not admissions that the analysis has failed.
They are attempts to communicate the limits of what the evidence supports.
A claim without uncertainty can sometimes be less informative than a probabilistic one.
Decisions can respond to uncertainty
Suppose an electricity system expects demand of:
40 GW.
If forecast uncertainty is low, perhaps it schedules:
41 GW of available capacity.
If uncertainty is high, perhaps it schedules:
45 GW.
The expected demand has not changed.
The decision changes because uncertainty changed.
This is why uncertainty matters operationally.
Safety margins are responses to uncertainty
Engineers rarely design critical systems assuming every estimate will be exactly correct.
Instead they use:
- safety factors,
- redundancy,
- reserves,
- contingency planning.
Why?
Because reality contains uncertainty.
A bridge is not designed to support exactly the predicted average load.
An electricity system does not ideally maintain exactly enough capacity for expected demand.
A robot should not pass an obstacle with zero margin for localisation error.
Robust design acknowledges uncertainty.
Uncertainty has economic value
Suppose a company can purchase a highly accurate weather forecast.
Why might it pay for that information?
Because reducing uncertainty can improve decisions.
An airline might schedule more effectively.
A renewable generator might forecast output more accurately.
A retailer might manage inventory better.
Information has value when it changes decisions.
But information has a cost
More measurement is not always worthwhile.
Suppose reducing uncertainty from:
±10%
to:
±9.9%
requires installing millions of euros of new sensors.
Perhaps that improvement has almost no effect on decisions.
The goal is not:
eliminate uncertainty at any cost.
The question is:
How much uncertainty matters for the decision we need to make?
Sometimes uncertainty does not matter
Suppose a room is approximately:
20°C ± 0.5°C.
If the decision is:
Is the room suitable for ordinary office work?
that uncertainty may be irrelevant.
If the decision is:
Is this laboratory process within a tolerance of ±0.1°C?
the same uncertainty becomes critical.
Uncertainty is always relative to the decision.
Different decisions require different certainty
Consider three predictions:
Weather
Will it rain during my walk?
A wrong prediction may be mildly inconvenient.
Medicine
Does this patient have a serious disease?
A wrong prediction may be life-changing.
Autonomous driving
Is that object a pedestrian?
A wrong prediction may cause immediate physical harm.
The acceptable level of uncertainty depends on the consequence of error.
Uncertainty and fairness
Suppose an AI system is:
95% accurate overall.
But perhaps uncertainty differs between groups.
For Group A, predictions may be:
high confidence and well calibrated.
For Group B, the model may have:
less training data and much greater uncertainty.
A single global accuracy number can hide this.
Fairness therefore requires asking not only:
Is the model equally accurate?
but potentially:
Does the model know some populations much better than others?
Scarce data creates unequal knowledge
Suppose medical data is abundant for one population but scarce for another.
The model may make:
precise predictions
for the first group and:
highly uncertain predictions
for the second.
That uncertainty may then affect:
- treatment,
- insurance,
- resource allocation.
Unequal data can become unequal certainty.
And unequal certainty can become unequal service.
Decision systems should respond to uncertainty
Suppose a model is uncertain about a medical diagnosis.
One possible response is:
Choose the most likely diagnosis anyway.
Another is:
Request another test.
Likewise, an autonomous vehicle may:
slow down.
A financial system may:
request human review.
A robot may:
gather another observation.
An intelligent system can change its behaviour when uncertainty is high.
"I don't know" can be an action
This is an important idea.
An intelligent system does not always need to produce an immediate answer.
Sometimes the best response is:
collect more information.
Conceptually:
UNCERTAIN STATE
↓
IS UNCERTAINTY ACCEPTABLE?
If yes:
ACT
If no:
OBSERVE MORE
↓
UPDATE BELIEF
↓
ACT
Uncertainty can therefore influence the decision process itself.
Exploration reduces uncertainty
Suppose a robot is uncertain about what lies around a corner.
It can move slightly forward and look.
Suppose a recommendation system knows little about a user's taste in documentaries.
It can recommend one and observe the response.
Suppose a scientist is uncertain between two hypotheses.
They can design an experiment.
These are all forms of exploration.
The system acts partly to gain information.
Actions can create information
This gives us a deeper feedback loop:
BELIEF
↓
UNCERTAINTY
↓
CHOOSE OBSERVATION OR ACTION
↓
NEW DATA
↓
UPDATED BELIEF
An intelligent system does not merely passively receive data.
It can sometimes decide which information would be useful to collect next.
This idea will reappear in:
- active learning,
- reinforcement learning,
- robotics,
- experimental design.
Uncertainty grows into the future
Suppose we know a car's current position and speed.
Predicting where it will be:
one second from now
may be relatively easy.
Predicting where it will be:
one hour from now
is much harder.
More possible events can occur as the prediction horizon increases.
So uncertainty often expands through time.
Conceptually:
NOW
↓
narrow range of near futures
↓
wider range of later futures
↓
many possible distant futures
This is why long-term forecasts often need broader uncertainty ranges.
Prediction horizons matter
A weather forecast for:
one hour ahead
is generally a different problem from:
ten days ahead.
An electricity forecast for:
five minutes ahead
is different from:
five years ahead.
A robot planning its next movement faces different uncertainty from a government planning infrastructure for 2050.
Whenever we discuss prediction, we should ask:
Prediction over what horizon?
Space introduces uncertainty too
Suppose we know the temperature at one weather station.
How certain are we about the temperature:
100 metres away?
Probably fairly certain.
What about:
100 kilometres away?
Much less so.
Predictions often become more uncertain as we move away from observed locations.
So uncertainty exists across:
time
and:
space.
The world is only partially observable
We can now strengthen the framework introduced earlier.
We do not observe:
the complete state of reality.
Instead:
WORLD
↓
PARTIAL + NOISY OBSERVATIONS
↓
INFERRED STATE
↓
UNCERTAINTY ABOUT STATE
↓
POSSIBLE FUTURES
↓
UNCERTAINTY ABOUT FUTURES
↓
DECISION
This is much closer to how real intelligent systems operate.
Prediction should not erase uncertainty
A dangerous transformation is:
UNCERTAIN WORLD
↓
MODEL
↓
SINGLE NUMBER
The model can create an illusion that uncertainty disappeared.
A better representation is:
UNCERTAIN WORLD
↓
MODEL
↓
PREDICTION + UNCERTAINTY
The prediction should ideally preserve what we know about the limits of our knowledge.
The decision may need the whole distribution
Suppose two power plants are planning for tomorrow.
Both receive a demand forecast of:
40 GW.
But Plant A sees:
90% range: 39–41 GW
while Plant B sees:
90% range: 30–50 GW.
The central prediction is identical.
The appropriate operational response may be completely different.
This is why probabilistic forecasts can be much more useful than point forecasts.
The central idea
Uncertainty is not an inconvenience that disappears once we have enough data or a powerful enough AI model.
It exists because:
- observations are incomplete,
- measurements are imperfect,
- models simplify reality,
- future events have not happened,
- environments change,
- some possibilities are unknown.
The goal of intelligence is therefore not:
DATA → CERTAINTY
It is:
DATA
↓
INFERENCE
↓
BELIEF + UNCERTAINTY
↓
POSSIBLE FUTURES
↓
DECISION
A good model should not merely tell us:
What do I think will happen?
It should also help us understand:
How certain am I?
And a good decision system should go further:
Given that uncertainty, what should we do?
To reason about these questions systematically, we need a language for describing uncertainty.
That language is probability.
In the next lesson, we will introduce probability not merely as a mathematical exercise involving coins and dice, but as a way of representing what we know, what we do not know, and how strongly we should believe different possible futures.