AI · Uncertain knowledge and reasoning

12 · Quantifying Uncertainty

Probability gives a coherent language for uncertain beliefs. Use Bayes’ rule to see how prior belief and test accuracy combine after evidence arrives.

Beliefs under uncertainty

12.1 Acting under Uncertainty

When an agent cannot know the state with certainty, it represents degrees of belief and chooses actions by reasoning over possible outcomes.

12.2 Basic Probability Notation

Probability measures uncertainty: 0 is impossible and 1 is certain. Conditional probability P(A|B) is the probability of A given evidence B.

12.3 Inference Using Full Joint Distributions

A joint distribution assigns probabilities to every complete assignment. Queries sum the relevant entries and normalize to obtain a conditional distribution.

12.4 Independence

A and B are independent when P(A,B)=P(A)P(B); conditional independence applies the same factorization given evidence.

12.5 Bayes’ Rule and Its Use

P(H|E)=P(E|H)P(H)/P(E). Evidence shifts prior belief according to how expected it is under competing hypotheses.

12.6 Naive Bayes Models

Naive Bayes predicts a class by multiplying a class prior by feature likelihoods, assuming features are conditionally independent given the class.

12.7 The Wumpus World Revisited

Probabilistic beliefs let an agent reason about hidden hazards from noisy or incomplete percepts instead of treating uncertain clues as certainties.

Interactive Bayes’ rule

A positive test is not certainty

Illustrative binary condition and test. Adjust prevalence, sensitivity P(+|D), and false-positive rate P(+|¬D).

After a positive result

Demo algorithm and complexity

For scalar inputs p = P(D), s = P(+|D), and f = P(+|¬D), compute evidence q = ps + (1−p)f, then posterior ps/q. The implementation uses a constant number of arithmetic operations; its bar and three labels are updated directly.

Time: O(1) per slider change. Auxiliary space: O(1); control values, labels, and the single probability bar are also O(1) UI space. This is a binary-condition, binary-test model, and the displayed slider limits ensure q > 0. Values are illustrative and assume the selected sensitivity and false-positive rate are calibrated and apply to the population represented by the prior.