Inference and Reasoning Under UncertaintyIntroduction and ContextArtificial intelligence systems rarely operate with complete, perfectly reliable information. A medical decision-support system may receive symptoms that are compatible with several diseases. A robot may have noisy sensors and only partial knowledge of its surroundings. A fraud-detection system may observe unusual transactions without knowing whether they are legitimate. In each case, the system must infer plausible conclusions from available evidence and represent the degree of confidence attached to those conclusions. Inference is the process of deriving conclusions from facts, observations, and rules. Reasoning under uncertainty extends inference to situations in which information is incomplete, ambiguous, imprecise, noisy, or probabilistic. These conditions must be distinguished carefully: - Incomplete knowledge occurs when relevant facts are unknown or unavailable. For example, a system may not know whether a server is currently overloaded.
- Uncertainty concerns lack of confidence about which state or event is true. A weather forecast may assign a 70% probability to rain.
- Ambiguity occurs when an observation or statement has multiple interpretations. The word “bank” may refer to a financial institution or a river edge.
- Imprecision occurs when a concept has vague boundaries, such as “high temperature” or “nearby.”
- Inconsistency occurs when available information conflicts, such as two sensors reporting different temperatures.
Classical logic is powerful when facts are precise and rules are certain. Probability is appropriate for uncertainty about events. Fuzzy logic is useful when concepts have gradual membership or linguistic meanings. Bayesian networks represent dependencies among variables, while Markov models represent how states evolve over time. An effective AI practitioner must select a representation that matches the source and nature of uncertainty rather than treating all uncertainty as the same phenomenon. Learning ObjectivesAfter completing this chapter, students should be able to: 1. Explain logical inference and distinguish deductive, inductive, and abductive reasoning. 2. Apply forward chaining, backward chaining, and resolution to simple knowledge bases. 3. Explain probability, conditional probability, Bayes’ theorem, and diagnostic reasoning. 4. Construct and interpret simple Bayesian networks. 5. Describe Markov models and calculate state-transition probabilities. 6. Explain fuzzy sets, membership functions, and fuzzy inference. 7. Select an appropriate reasoning framework for a practical AI problem. 8. Evaluate limitations, risks, and governance issues in uncertain AI systems. 1. Logical Inference as a Foundation of AI1.1 Propositions, predicates, and knowledge basesA proposition is a statement that is either true or false under a specified interpretation. For example, “The server is available” can be represented as Available(Server1). Propositional logic represents whole statements using symbols such as P and Q. Predicate logic represents objects, properties, and relationships, as in: Human(Socrates) ∀x Human(x) → Mortal(x) The first statement says that Socrates is human. The second says that every human is mortal. From these premises, a system can infer Mortal(Socrates). A knowledge base contains facts and rules. A fact may be Bird(Tweety). A rule may be Bird(x) → HasWings(x). The system applies an inference procedure to derive consequences. The distinction between a knowledge base and an inference engine is important: the knowledge base stores represented knowledge, while the inference engine determines what follows from it. 1.2 Deduction, induction, and abductionDeductive reasoning derives a conclusion that must be true if the premises are true and the inference is valid. Modus ponens is a basic deductive pattern: P → Q, P ⊢ Q For example, if “if a device overheats, it shuts down” and “the device overheats” are true, then “the device shuts down” follows. Inductive reasoning generalizes from observations. If many observed swans are white, an inductive reasoner may hypothesize that swans are generally white. Induction can be useful but does not guarantee truth. Abductive reasoning infers the most plausible explanation for an observation. If a device is not responding, overheating may be one possible explanation, but a disconnected cable or software failure may also explain the observation. Abduction is central to diagnosis and fault detection. 1.3 Open-world and closed-world assumptionsUnder the closed-world assumption, a statement not known to be true is treated as false. This is common in database queries. Under the open-world assumption, absence of evidence is not evidence of falsity. Semantic web systems and many knowledge representation systems use the open-world view. Confusing these assumptions can produce serious errors: “the system has no record of vaccination” does not necessarily mean “the patient was not vaccinated.” 2. Rule-Based Inference2.1 Forward chainingForward chaining is data-driven. It begins with known facts and repeatedly applies rules whose premises are satisfied until no new facts can be derived or a target conclusion is reached. Consider the knowledge base: - Rainy(Today)
- Rainy(x) → Wet(Ground)
- Wet(Ground) → Slippery(Ground)
Starting with Rainy(Today), the first rule derives Wet(Ground). The second derives Slippery(Ground). Forward chaining is useful when many possible consequences of incoming data must be generated, as in monitoring, expert systems, and production-rule systems. A simple forward-chaining procedure is: 1. Place all known facts in a working memory. 2. Find a rule whose premises are satisfied. 3. Add its conclusion if it is not already known. 4. Continue until no rule fires or a stopping condition is met. If rules are finite, monotonic, and conclusions only add facts, the process terminates when a fixed point is reached. Practical systems require conflict-resolution strategies when several rules can fire, such as rule priority, recency of facts, or specificity. 2.2 Backward chainingBackward chaining is goal-driven. It begins with a query and works backward to identify rules that could establish it. To prove Slippery(Ground), the system searches for a rule with that conclusion, namely Wet(Ground) → Slippery(Ground). It then tries to prove Wet(Ground), which requires Rainy(Today) under the first rule. Since Rainy(Today) is a known fact, the query succeeds. Backward chaining is efficient when the system has a small number of specific goals. It is widely associated with logic programming languages such as Prolog. Its weaknesses include repeated subgoals, infinite loops in poorly designed rule sets, and difficulty when many alternative explanations must be explored. 2.3 Forward and backward chaining comparedForward chaining is appropriate when the system receives a stream of facts and must determine all relevant consequences. Backward chaining is appropriate when it receives a particular query and needs only the supporting reasoning path. Hybrid systems often combine both approaches. For example, a diagnostic application may use backward reasoning to identify possible causes, then forward simulation to predict consequences of each cause. 3. Resolution and Logical RefutationResolution is an inference rule used in automated theorem proving. In propositional logic, the rule is: (P ∨ Q) ∧ (¬Q ∨ R) ⊢ (P ∨ R) The complementary literals Q and ¬Q are eliminated. Resolution systems generally convert statements into conjunctive normal form (CNF), a conjunction of clauses, where each clause is a disjunction of literals. To prove a statement by refutation, the system adds the negation of the desired conclusion to the knowledge base. If repeated resolution produces the empty clause, written □, a contradiction has been found and the original conclusion follows. Worked example: propositional resolutionSuppose the knowledge base contains: 1. P → Q 2. Q → R 3. P To prove R, rewrite implications: - ¬P ∨ Q
- ¬Q ∨ R
- P
- ¬R (negation of the goal)
Resolve P with ¬P ∨ Q to obtain Q. Resolve Q with ¬Q ∨ R to obtain R. Resolve R with ¬R to obtain the empty clause. Therefore R follows from the knowledge base. Resolution is complete for propositional logic: if a set of clauses is unsatisfiable, resolution can eventually derive the empty clause, assuming a fair search strategy. In first-order logic, resolution is also a central method, but variables require unification. Resolution can be computationally expensive, so practical theorem provers use indexing, clause selection heuristics, and restrictions on search. 4. Probability and Conditional ReasoningProbability provides a numerical language for uncertain events. For an event A, P(A) lies between 0 and 1. P(A)=0 indicates impossibility under the model, while P(A)=1 indicates certainty under the model. For complementary events: P(¬A) = 1 − P(A) For mutually exclusive events A and B: P(A ∪ B) = P(A) + P(B) More generally: P(A ∪ B) = P(A) + P(B) − P(A ∩ B) The subtraction prevents the intersection from being counted twice. Conditional probabilityThe conditional probability of A given B is: P(A|B) = P(A ∩ B) / P(B), provided P(B) > 0. It measures the probability of A within the subset of cases in which B occurs. The product rule follows directly: P(A ∩ B) = P(A|B)P(B) Two events are independent when P(A|B)=P(A), equivalently P(A ∩ B)=P(A)P(B). Independence is an assumption, not a default fact. Incorrect independence assumptions can produce highly misleading AI predictions. Bayes’ theoremBayes’ theorem follows from applying the product rule in two ways: P(A|B) = P(B|A)P(A) / P(B) Here, P(A) is the prior probability, P(B|A) is the likelihood, P(B) is the evidence probability, and P(A|B) is the posterior probability. Bayes’ theorem is especially important when evidence is more readily measured than the condition being diagnosed. Worked example: medical screeningAssume a disease affects 1% of a population. A test has sensitivity 90%, so P(Positive|Disease)=0.90. It has a false-positive rate of 5%, so P(Positive|No Disease)=0.05. Let D represent disease and + represent a positive test. P(D)=0.01, P(¬D)=0.99. Using the law of total probability: P(+) = P(+|D)P(D) + P(+|¬D)P(¬D) P(+) = (0.90)(0.01) + (0.05)(0.99) = 0.009 + 0.0495 = 0.0585. Therefore: P(D|+) = (0.90)(0.01) / 0.0585 ≈ 0.1538. The probability of disease after a positive result is approximately 15.38%, not 90%. The difference arises because the disease is rare and false positives occur among the much larger non-diseased population. This is the base-rate effect and demonstrates why diagnostic systems must communicate posterior probabilities rather than only test sensitivity. 5. Bayesian NetworksA Bayesian network is a directed acyclic graph in which nodes represent random variables and each node has a conditional probability distribution given its parents. The graph encodes conditional independence assumptions. For variables X1,...,Xn, a Bayesian network represents the joint distribution as: P(X1,...,Xn) = ∏ᵢ P(Xᵢ | Parents(Xᵢ)) This factorization can greatly reduce the number of probabilities that must be specified. For example, a simple network may contain Cloudy, Rain, and WetRoad, with edges Cloudy → Rain and Rain → WetRoad. The joint distribution is: P(Cloudy)P(Rain|Cloudy)P(WetRoad|Rain) The graph does not merely show correlation; it represents a model of dependency and conditional independence. If WetRoad is conditionally independent of Cloudy given Rain, then learning Rain screens off the direct relevance of Cloudy for WetRoad in that model. Inference in Bayesian networksCommon queries include: - Predictive inference: estimating effects, such as P(WetRoad|Rain).
- Diagnostic inference: reasoning from effects to causes, such as P(Rain|WetRoad).
- Intercausal reasoning: explaining away, where observing one cause can reduce the probability of another cause when both explain the same effect.
Exact inference can be performed by enumeration or variable elimination in small networks. Larger networks may require approximate methods such as sampling or variational techniques. Model quality depends on graph structure, probability estimates, data quality, and whether the assumed dependencies are defensible. 6. Markov Models and Sequential ReasoningMany AI tasks involve states that change over time. A Markov model assumes that the next state depends on the current state, possibly with no additional dependence on the full history. This is the first-order Markov property: P(Sₜ₊₁ | Sₜ, Sₜ₋₁,...,S₁) = P(Sₜ₊₁ | Sₜ) A discrete-time Markov chain has a transition matrix T, where Tᵢⱼ=P(Sₜ₊₁=j|Sₜ=i). Every entry is between 0 and 1, and each row sums to 1. Worked example: weather chainSuppose states are Sunny and Rainy, with transition matrix: T = [[0.8, 0.2], [0.4, 0.6]] The first row means that a sunny day is followed by a sunny day with probability 0.8 and a rainy day with probability 0.2. If today is Sunny, the probability of Rainy tomorrow is 0.2. The probability of Sunny two days from now is: P(Sunny at t+2) = (0.8)(0.8) + (0.2)(0.4) = 0.64 + 0.08 = 0.72. Markov chains are useful for queueing, text generation, user modeling, reliability analysis, and robotics. A Hidden Markov Model (HMM) adds hidden states and observable emissions. It supports three classic tasks: evaluating an observation sequence, decoding the most likely hidden-state sequence, and learning model parameters. The forward algorithm, Viterbi algorithm, and Baum–Welch algorithm address these tasks respectively. The Markov assumption is an approximation. If the relevant history extends beyond the current state, the model may be inaccurate unless the state representation is expanded. 7. Fuzzy ReasoningProbability and fuzziness address different ideas. Probability represents uncertainty about whether an event occurs. Fuzzy logic represents the degree to which an object belongs to a concept. A temperature can be 0.8 “high” even though the temperature itself is known precisely. A fuzzy set A over universe X is described by a membership function μA(x) with values in [0,1]. The value μA(x)=0.8 means that x has a high degree of membership in A; it does not mean there is an 80% probability that x belongs to A. A fuzzy rule might be: IF temperature is high AND humidity is high THEN fan speed is fast. A typical fuzzy controller performs: 1. Fuzzification: convert crisp sensor values into membership degrees. 2. Rule evaluation: calculate the strength of each rule, often using minimum for AND. 3. Aggregation: combine outputs from multiple rules. 4. Defuzzification: convert the aggregated fuzzy output into a crisp action, commonly using the centroid method. Fuzzy reasoning is useful for control systems, appliances, and decision-support tasks involving linguistic concepts. Its disadvantages include dependence on expert-designed membership functions and rules, difficulty scaling to many variables, and limited probabilistic interpretation. 8. Choosing a Reasoning FrameworkThe framework should follow the problem structure: - Use classical logic when facts and rules are discrete, explicit, and sufficiently reliable.
- Use forward chaining for data-driven consequence generation.
- Use backward chaining for query-driven diagnosis or proof.
- Use resolution for automated logical refutation and theorem proving.
- Use probability when uncertainty concerns competing events or hypotheses.
- Use Bayesian networks when variables have interpretable dependency relationships.
- Use Markov models when state evolves sequentially and the current state summarizes relevant history.
- Use fuzzy logic when categories are gradual, linguistic, or inherently vague.
- Combine methods when a system contains multiple types of uncertainty. A robot, for example, may use logical rules for safety constraints, Bayesian filtering for localization, and fuzzy control for smooth movement.
A crucial design principle is to distinguish epistemic uncertainty, caused by limited knowledge, from aleatory uncertainty, associated with variability or randomness in the world. More data may reduce epistemic uncertainty, but it may not eliminate genuine variability. 9. Applied Case: Illustrative Hospital Monitoring SystemBackgroundConsider an illustrative hospital system that monitors patients for possible deterioration. It receives heart rate, oxygen saturation, temperature, blood pressure, nursing observations, and laboratory results. ProblemThe system must decide whether to alert a clinician. Excessive alerts create alarm fatigue, while missed alerts may delay treatment. Sensor readings can be noisy, some observations may be missing, and symptoms may have several causes. AnalysisA rule such as “IF oxygen saturation is low AND respiratory rate is high THEN respiratory alert” provides transparency and can encode clinical policy. However, a deterministic rule may be too rigid near threshold values. Fuzzy membership functions can represent “low oxygen saturation” gradually, reducing abrupt changes around a cutoff. A Bayesian network can combine evidence about infection, respiratory failure, medication effects, and measurement reliability. It can estimate a posterior risk rather than merely issuing a binary conclusion. Prior disease prevalence and patient-specific information are important because the same measurement may have different significance in different populations. A temporal model, such as an HMM or a more general state-space model, can distinguish a persistent deterioration trend from a single anomalous reading. The model may include hidden states such as stable, worsening, and critical, with observations generated by each state. Approach and solutionA responsible architecture could use sensor validation first, probabilistic temporal estimation second, and a transparent rule layer for alert escalation. The system should display the principal evidence, uncertainty, timestamp, and recommended human action. Missing data should be represented as missing rather than silently replaced with normal values. OutcomeIn an evaluation, success should not be measured only by accuracy. Sensitivity, specificity, positive predictive value, calibration, alert rate, time to intervention, and subgroup performance should be examined. Clinicians should be able to override alerts and report errors. The system should be monitored after deployment because patient populations, equipment, and clinical practices change. Learning pointsThis case demonstrates that no single formalism solves every problem. Logic supports policy and explanation; probability supports diagnostic uncertainty; temporal models support change over time; and fuzzy reasoning can handle gradual linguistic categories. Combining these methods requires explicit assumptions and careful governance. 10. Limitations, Ethics, and GovernanceUncertain reasoning systems can fail because of poor data, biased sampling, incorrect independence assumptions, misspecified rules, calibration drift, or hidden correlations. A probability estimate is meaningful only relative to its reference population and model assumptions. A highly confident prediction may still be wrong if the system encounters an out-of-distribution case. Ethically, decision-makers should distinguish assistance from replacement of professional judgment in high-impact domains. Systems used in health, credit, employment, policing, or education may affect rights and opportunities. Important safeguards include: - documentation of data sources and assumptions;
- validation on representative and independent data;
- calibration and subgroup fairness analysis;
- audit logs and traceable explanations;
- privacy protection and access controls;
- human oversight with genuine authority to intervene;
- mechanisms for contesting and correcting decisions;
- monitoring for distribution shift and performance degradation.
Regulatory obligations differ across jurisdictions, but risk management, transparency, data protection, and accountability are recurring requirements. Explainability should be appropriate to the audience: a clinician may need evidence and calibration information, while an engineer may need model structure and diagnostic logs. 11. Contemporary Developments and Best PracticesModern AI increasingly combines symbolic reasoning with statistical learning. Neuro-symbolic systems use learned representations together with rules or constraints. Probabilistic programming makes model assumptions explicit and supports inference over complex generative models. Large language models can perform useful reasoning-like tasks, but their outputs may be uncertain, unsupported, or inconsistent; fluent language is not proof of valid inference. Best practices include: 1. Define the uncertainty source before selecting a method. 2. State assumptions, including independence, stationarity, and closed- or open-world interpretation. 3. Separate training, validation, and deployment monitoring. 4. Report calibrated probabilities when decisions depend on risk. 5. Use sensitivity analysis to identify influential assumptions. 6. Preserve provenance for facts, rules, and observations. 7. Test edge cases, missing data, contradictions, and distribution shifts. 8. Prefer interpretable models when stakes are high and explanations are necessary. 9. Combine automated inference with appropriate human review. 10. Treat uncertainty as information to communicate, not merely as a defect to hide. Chapter SummaryInference derives conclusions from facts, observations, and rules. Classical logic supports sound deduction when propositions and rules are precise. Forward chaining is data-driven, backward chaining is goal-driven, and resolution proves conclusions through refutation. Probability represents uncertainty about events, while conditional probability and Bayes’ theorem support evidence-based updating. Bayesian networks factorize joint distributions using graph-encoded dependencies. Markov models represent state transitions over time under a memory assumption, and Hidden Markov Models distinguish unobserved states from observations. Fuzzy logic represents gradual membership in vague concepts rather than probability of occurrence. Uncertainty, ambiguity, incompleteness, imprecision, and inconsistency are different problems and should not be addressed indiscriminately. Practical AI systems often combine symbolic, probabilistic, temporal, and fuzzy methods. Reliable deployment requires validated assumptions, calibration, transparency, privacy, fairness assessment, human oversight, and continuous monitoring. Key TermsInference: The process of deriving conclusions from information. Knowledge base: A collection of represented facts and rules. Deduction: Reasoning in which a valid conclusion follows necessarily from premises. Induction: Generalization from particular observations. Abduction: Inference to a plausible explanation. Forward chaining: Data-driven application of rules from facts to conclusions. Backward chaining: Goal-driven reasoning from a query toward supporting facts. Resolution: An inference rule that eliminates complementary literals. Conditional probability: Probability of an event given another event. Bayes’ theorem: A rule for updating prior probability using evidence. Prior: Belief assigned before considering current evidence. Likelihood: Probability of evidence under a hypothesis. Posterior: Updated probability after considering evidence. Bayesian network: A directed acyclic graph with conditional probability distributions. Markov property: Assumption that the next state depends on the current state rather than the full history. Hidden Markov Model: A temporal model with hidden states and observable emissions. Fuzzy set: A set whose membership values range continuously from 0 to 1. Membership function: Function assigning a degree of membership to an element. Calibration: Agreement between predicted probabilities and observed frequencies. Base-rate effect: Influence of prevalence on posterior probability. Review QuestionsShort Answer Questions1. Distinguish uncertainty, ambiguity, and incomplete knowledge. 2. What is the difference between forward chaining and backward chaining? 3. Define prior, likelihood, and posterior probability. 4. State the first-order Markov property. 5. Why is fuzzy membership not the same as probability? Long Answer Questions1. Explain how resolution proves a conclusion by refutation, using a simple example. 2. Derive Bayes’ theorem from the product rule and explain each term. 3. Describe the structure and uses of Bayesian networks. 4. Compare Markov chains and Hidden Markov Models. 5. Discuss ethical and governance requirements for uncertain AI systems in healthcare. Analytical / Application Questions1. A screening test has sensitivity 95%, a false-positive rate of 4%, and a disease prevalence of 2%. Calculate the probability of disease given a positive result. 2. Design a reasoning architecture for a delivery robot operating with noisy sensors, explaining where logic, probability, temporal modeling, and fuzzy control would be used. 3. A rule-based alert system generates too many warnings because measurements fluctuate around a threshold. Analyze whether probabilistic smoothing, fuzzy membership, temporal modeling, or a combination would be most appropriate, and justify your choice. Multiple Choice Questions with AnswersQuestion 1Which reasoning strategy begins with known facts and repeatedly derives consequences? A. Forward chaining B. Backward chaining C. Abductive reasoning D. Defuzzification Correct Answer: A. Forward chaining Question 2In Bayes’ theorem, P(A) is generally called the: A. Likelihood B. Prior probability C. Posterior probability D. Evidence probability Correct Answer: B. Prior probability Question 3A Bayesian network must be represented by a: A. Cyclic undirected graph B. Directed acyclic graph C. Fuzzy rule table only D. Markov transition matrix only Correct Answer: B. Directed acyclic graph Question 4If P(A)=0.3 and P(B|A)=0.4, what is P(A and B)? A. 0.12 B. 0.30 C. 0.40 D. 0.70 Correct Answer: A. 0.12 Question 5What does the first-order Markov property assume? A. All states are equally likely B. The next state depends only on the current state C. Observations are always error-free D. The system has no hidden variables Correct Answer: B. The next state depends only on the current state Question 6A fuzzy membership value of 0.8 means that an element: A. Has an 80% probability of existing B. Belongs to a concept to degree 0.8 C. Must be in exactly 80% of observations D. Is uncertain with probability 0.8 Correct Answer: B. Belongs to a concept to degree 0.8 Question 7What is the purpose of adding the negation of a goal in resolution-based proof? A. To create a contradiction if the goal follows B. To increase the prior probability C. To fuzzify the goal D. To remove all variables Correct Answer: A. To create a contradiction if the goal follows Question 8In the medical screening example, why was the posterior probability lower than the test sensitivity? A. Sensitivity is always lower than prevalence B. The test had no likelihood value C. The low disease base rate and false positives affected the posterior D. Bayes’ theorem ignores negative cases Correct Answer: C. The low disease base rate and false positives affected the posterior Question 9Which method is primarily goal-driven? A. Forward chaining B. Backward chaining C. Fuzzification D. State transition sampling Correct Answer: B. Backward chaining Question 10Which statement best distinguishes probability from fuzziness? A. Probability models event uncertainty; fuzziness models gradual concept membership B. Probability applies only to logic; fuzziness applies only to time series C. They are mathematically identical in all applications D. Fuzziness always requires random samples Correct Answer: A. Probability models event uncertainty; fuzziness models gradual concept membership
|