15.1 Relational Probability Models
Relational models share uncertainty across entities and their links. A property of one person can depend on the properties of connected people, not just on a fixed list of variables.
AI · PROBABILISTIC REASONING
Represent uncertainty with ordinary program structure: random choices describe possible worlds, and evidence narrows which worlds remain plausible.
Relational models share uncertainty across entities and their links. A property of one person can depend on the properties of connected people, not just on a fixed list of variables.
In an open universe, the number and identity of objects are uncertain too. A model can generate a different set of people or events in each possible world.
A world contains many dependent random choices. Structured representations and inference algorithms make it practical to reason about only the parts relevant to a query.
A probabilistic program combines deterministic computation, random sampling, and observations. Running it samples worlds; conditioning on evidence focuses inference on worlds consistent with what is observed.
Pseudocode / trace
rainy ~ Bernoulli(0.35); n ~ Uniform{1,…,6}
repeat n times: ill[i] ~ Bernoulli(rainy ? 0.58 : 0.14)
Example: rainy → n=3 → outcomes (ill, well, ill) → 2 ill residentsThe numbers illustrate the assumed generator, not evidence that real weather causes illness at these rates.
Interactive model
Each run samples shared weather, an uncertain population size, then each resident's health conditional on that weather.
World summary
Not sampled
Residents: —
Ill: —
Ready. Sample a world to see its random choices.
Let n be the sampled resident count. Sampling uses O(1) time for weather and population count plus O(n) health draws, so total time is O(n) worst case; here n ≤ 6, making it bounded O(1) in this fixed demo. Algorithm auxiliary space is O(1) counters beyond the result; the displayed world needs O(n) DOM elements. Reset removes the displayed elements in O(n) time.