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.
AI · Uncertain knowledge and reasoning
Probability gives a coherent language for uncertain beliefs. Use Bayes’ rule to see how prior belief and test accuracy combine after evidence arrives.
When an agent cannot know the state with certainty, it represents degrees of belief and chooses actions by reasoning over possible outcomes.
Probability measures uncertainty: 0 is impossible and 1 is certain. Conditional probability P(A|B) is the probability of A given evidence B.
A joint distribution assigns probabilities to every complete assignment. Queries sum the relevant entries and normalize to obtain a conditional distribution.
A and B are independent when P(A,B)=P(A)P(B); conditional independence applies the same factorization given evidence.
P(H|E)=P(E|H)P(H)/P(E). Evidence shifts prior belief according to how expected it is under competing hypotheses.
Naive Bayes predicts a class by multiplying a class prior by feature likelihoods, assuming features are conditionally independent given the class.
Probabilistic beliefs let an agent reason about hidden hazards from noisy or incomplete percepts instead of treating uncertain clues as certainties.
Interactive Bayes’ rule
Illustrative binary condition and test. Adjust prevalence, sensitivity P(+|D), and false-positive rate P(+|¬D).
After a positive result
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.