Artificial Intelligence
Comprehensive exam revision notes for BCA-301N Unit 4 (Reasoning Techniques & Structured Knowledge Representation). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.
Artificial Intelligence
Reasoning Techniques & Structured Knowledge Representation
Core Definitions & Key Concepts
What is Monotonic Reasoning and why is it insufficient for real-world AI
In Monotonic Logic, the set of derived propositions can only grow as new axioms are added; newly acquired knowledge can never invalidate previously established truths. It fails in real-world AI because common sense relies on incomplete information, defaults, and changing facts.
Non-Monotonic Reasoning and give an example
Non-Monotonic Reasoning is an inference framework where conclusions can be retracted or invalidated when new, contradictory evidence is introduced. Example: Believing 'Tweety flies' because Tweety is a bird, but retracting it upon learning 'Tweety is a penguin'.
What is Default Logic formulated by Raymond Reiter
Default Logic formalizes reasoning with default assumptions using default rules of the form: $\frac{\alpha : \beta}{\gamma} meaning: 'If \alpha is known (prerequisite), and it is consistent to assume \beta (justification), then infer \gamma$ (consequent).'
The Closed World Assumption (CWA)
CWA assumes that any proposition not explicitly stated as true in the knowledge base is false by default. Used universally in relational databases and Prolog.
What is a Bayesian Belief Network (BBN)
A BBN is a Directed Acyclic Graph (DAG) where nodes represent random variables and directed edges represent direct conditional probabilistic dependencies, parameterized by Conditional Probability Tables (CPTs).
Bayes' Theorem and its components
$P(H | E) = \frac{P(E | H) \cdot P(H)}{P(E)} Where P(H|E) is posterior probability, P(E|H) is likelihood, P(H) is prior probability of hypothesis, and P(E)$ is marginal evidence probability.
What is Fuzzy Logic and how does it differ from Boolean Logic
Boolean logic restricts truth values strictly to \{0, 1\}. Fuzzy Logic allows continuous truth membership values in the real interval [0.0, 1.0], modeling linguistic vagueness (e.g., 'tall', 'hot').
The Fuzzy Intersection (AND) and Union (OR) operators
For two fuzzy sets A and B with membership functions µ_A(x) and µ_B(x):
- Intersection ($A \cap B$): µ_{A \cap B}(x) = \min(µ_A(x), µ_B(x))
- Union ($A \cup B$): µ_{A \cup B}(x) = \max(µ_A(x), µ_B(x))
What is Defuzzification? Mention one common method
Defuzzification is the mathematical conversion of a fuzzy output distribution into a single crisp numerical control signal. The most widely used technique is the Centroid (Center of Gravity) Method.
What is a Certainty Factor (CF) in the MYCIN expert system
A numerical metric in the range [-1.0, +1.0] representing expert confidence in a hypothesis, computed as CF = MB - MD, where MB is Measure of Increased Belief and MD is Measure of Increased Disbelief.
Conceptual & Architectural Analysis
Compare Monotonic vs Non-Monotonic Reasoning Paradigms
| Dimension | Monotonic Reasoning | Non-Monotonic Reasoning |
|---|---|---|
| Truth Persistence | Theorems once proved remain permanently true | Conclusions can be retracted when new evidence arises |
| Information Completeness | Requires complete, fully consistent knowledge | Operates effectively over incomplete, tentative information |
| Real-World Suitability | Pure mathematics, formal theorem proving | Common sense reasoning, medical diagnostics, robotics |
| Formalisms | Propositional logic, First-Order Predicate Calculus | Default Logic, Circumscription, Truth Maintenance Systems (TMS) |
Bayesian Networks with a Conditional Probability Table (CPT) Example
Consider the classic Burglary-Earthquake-Alarm network:
1[ Burglary ] (B) [ Earthquake ] (E)2 \ /3 v v4 [ Alarm ] (A)5 / \6 v v7 [ JohnCalls ] [ MaryCalls ]- Joint Probability Decomposition:
$P(B, E, A, J, M) = P(B) \cdot P(E) \cdot P(A | B, E) \cdot P(J | A) \cdot P(M | A)$
- Instead of requiring 2^5 - 1 = 31 parameters for full joint distribution, network independence requires only 1 + 1 + 4 + 2 + 2 = 10 parameters, dramatically reducing computational complexity.
Fuzzy Membership Functions (Triangular, Trapezoidal, Gaussian) with Mathematical Formulations
Fuzzy Membership Function Formulations
- Triangular Function $\text{trimf}(x; a, b, c)$:
$µ(x) = \max≤ft(0, \min≤ft(\frac{x - a}{b - a}, \frac{c - x}{c - b}\right)\right)$
- Trapezoidal Function $\text{trapmf}(x; a, b, c, d)$:
$µ(x) = \max≤ft(0, \min≤ft(\frac{x - a}{b - a}, 1, \frac{d - x}{d - c}\right)\right)$
- Gaussian Function $\text{gaussmf}(x; c, \sigma)$:
$µ(x) = \exp≤ft( -\frac{(x - c)^2}{2\sigma^2} \right)$ Where parameters define geometric boundaries and centers.
The Architecture and Operation of a Truth Maintenance System (TMS)
A TMS (or Reason Maintenance System) manages dependency networks between beliefs:
- Nodes: Represent propositions.
- Justifications: Track reasons supporting nodes (
IN= believed true,OUT= not believed). - JTMS (Justification-based TMS): Re-evaluates status when nodes are asserted or retracted.
- ATMS (Assumption-based TMS): Maintains multiple hypothetical worlds/contexts simultaneously, preventing costly backtracking during planning.
Detail the Fuzzy Inference System (Mamdani Model) Architecture
4-Stage Mamdani Architecture:
- Fuzzification: Crisp numerical sensor inputs are mapped to fuzzy linguistic values via membership functions.
- Rule Base Evaluation:
IF-THENrules are evaluated; firing strength is computed via \min (AND) or \max (OR). - Aggregation: Clipped or scaled output fuzzy sets from all rules are combined using \max.
- Defuzzification: Crisp output is calculated using the Center of Gravity (Centroid) formula: z^* = \frac{\int z \cdot µ_C(z) dz}{\int µ_C(z) dz}.
In-Depth Analysis & Implementation
Solve a Complete Bayesian Diagnostic Problem Using Bayes' Rule with Sensitivity, Specificity, and Prior Prevalence
Medical Diagnostic Case Study
Problem Statement:
- Disease Prevalence (Prior Probability): P(D) = 0.01 (1% of population has the rare disease).
- Test Sensitivity: P(Positive | D) = 0.95 (95% chance of positive test if diseased).
- Test Specificity: P(Negative | \neg D) = 0.90 (90% chance of negative test if healthy).
- Hence False Positive Rate: P(Positive | \neg D) = 1 - 0.90 = 0.10.
- Question: If a randomly selected patient tests Positive, what is the true posterior probability that they actually have the disease (P(D | Positive))?
Mathematical Derivation via Bayes' Theorem:
$P(D | Positive) = \frac{P(Positive | D) \cdot P(D)}{P(Positive)}$
Step 1: Compute Total Marginal Probability P(Positive) via Law of Total Probability:
$P(Positive) = P(Positive | D) \cdot P(D) + P(Positive | \neg D) \cdot P(\neg D) Given P(\neg D) = 1 - 0.01 = 0.99: P(Positive) = (0.95 × 0.01) + (0.10 × 0.99) P(Positive) = 0.0095 + 0.0990 = 0.1085$
Step 2: Calculate Posterior Probability:
$P(D | Positive) = \frac{0.0095}{0.1085} ≈ 0.08755 \implies \mathbf{8.76\%}$
Examiner Insight & Analysis:
Even though the test is 95% accurate, a positive test result only gives an 8.76% chance of having the disease! This counter-intuitive result (known as the Base Rate Fallacy) occurs because the disease is extremely rare relative to the false-positive rate. In examinations, students must state both the numerical derivation and the base rate interpretation.
Design an End-to-End Fuzzy Logic Controller for an Automated Air Conditioning System
Complete Industrial Design: Smart AC Temperature Controller
1. Input/Output Linguistic Variables & Universes of Discourse:
- Input 1: Room Temperature Error ($e$) \in [-10, +10]^\circC:
Cold(Negative),Comfortable(Zero),Hot(Positive)- Input 2: Rate of Change of Temperature ($\Delta e$) \in [-5, +5]^\circC/min:
Cooling(Negative),Stable(Zero),Warming(Positive)- Output: AC Compressor Motor Speed ($S$) \in [0, 100]\%:
Off(0%),Low(25%),Medium(50%),High(75%),Maximum(100%)
2. Fuzzy Rule Matrix (9 Mamdani Rules):
| Error (e) \ \Delta e | Cooling (N) | Stable (Z) | Warming (P) |
|---|---|---|---|
| Cold (N) | Off | Off | Low |
| Comfortable (Z) | Low | Medium | High |
| Hot (P) | Medium | High | Maximum |
3. Python Implementation of Fuzzy Controller:
1import numpy as np2
3def triangular_mf(x, a, b, c):4 return max(0.0, min((x - a)/(b - a) if b > a else 1.0, (c - x)/(c - b) if c > b else 1.0))5
6def evaluate_ac_controller(error_val):7 # Fuzzify Error8 cold = triangular_mf(error_val, -10, -10, 0)9 comfortable = triangular_mf(error_val, -5, 0, 5)10 hot = triangular_mf(error_val, 0, 10, 10)11
12 # Rule Firings (assuming stable delta_e):13 # R1: IF Cold THEN Low (Speed = 20%)14 # R2: IF Comfortable THEN Medium (Speed = 50%)15 # R3: IF Hot THEN Maximum (Speed = 90%)16 w1 = cold17 w2 = comfortable18 w3 = hot19
20 # Centroid Defuzzification21 speeds = [20, 50, 90]22 weights = [w1, w2, w3]23
24 if sum(weights) == 0:25 return 50.0 # Default fallback26 crisp_speed = sum(s * w for s, w in zip(speeds, weights)) / sum(weights)27 return crisp_speed28
29print(f"For Error +6.0C (Hot room): Compressor Speed = {evaluate_ac_controller(6.0):0.2f}%")Dempster-Shafer Theory of Evidence, Belief, Plausibility, and Rule of Combination
Dempster-Shafer (D-S) Mathematical Framework
1. Frame of Discernment (\Theta):
The set of mutually exclusive and exhaustive elementary hypotheses: \Theta = \{\theta_1, \theta_2, \dots, \theta_n\}. The power set 2^\Theta represents all possible subsets.
2. Basic Probability Assignment (Mass Function m):
A mapping m: 2^\Theta \to [0, 1] such that: $m(\emptyset) = 0 \quad and \quad \sum_{A \subseteq \Theta} m(A) = 1$
3. Belief and Plausibility Functions:
- Belief ($Bel(A)$): Measures total confidence committed strictly to A and all its subsets (lower bound of probability):
$Bel(A) = \sum_{B \subseteq A} m(B)$
- Plausibility ($Pl(A)$): Measures the degree to which A is not contradicted by competing evidence (upper bound of probability):
$Pl(A) = \sum_{B \cap A \neq \emptyset} m(B) = 1 - Bel(\neg A)$
- Uncertainty Interval: [Bel(A), Pl(A)] models genuine epistemic ignorance without forcing arbitrary prior probabilities.
4. Dempster's Rule of Combination:
Combines independent mass functions m_1 and m_2: $m_{1,2}(A) = \frac{\sum_{B \cap C = A} m_1(B) m_2(C)}{1 - K} \quad (for A \neq \emptyset) Where conflict factor K = \sum{B \cap C = \emptyset} m1(B) m_2(C)$ measures mutual contradiction.
Important Exam Points & Quick Revision
Examiners heavily weight: Bayes Rule calculations (guaranteed 5-10 marks), Fuzzy Logic Controller architecture with rule base, and Monotonic vs Non-Monotonic distinctions.
100% left on this page — finishing it closes the gap for Reasoning Techniques & Structured Knowledge Representation.
Reasoning Techniques & Structured Knowledge Representation still counts as a weak topic until you finish this note and answer its questions.
Practise this unitTest Your Understanding
Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.