Artificial IntelligenceUnit 89 min read
Reasoning & Uncertainty: Probability, Bayes, Dempster-Shafer, Fuzzy Logic
Unit 8 of Artificial Intelligence explores how AI handles uncertainty using probabilistic reasoning, Bayesian networks, Dempster-Shafer theory, and fuzzy logic—essential for real-world decision-making in medical diagnosis, fraud detection, and autonomous systems.
TAKEAWAYS:
- Probabilistic reasoning replaces deterministic logic when data is uncertain (e.g., "Is this email spam?").
- Bayesian networks model dependencies between events (e.g., "Does rain cause traffic jams?").
- Dempster-Shafer theory handles incomplete evidence better than probability (e.g., "Is this patient’s symptom A or B?").
- Fuzzy logic deals with vague categories (e.g., "Is this traffic speed ‘slow’ or ‘fast’?").
- Expected utility balances risk vs. reward (e.g., "Should a bank approve this loan?").
- Real-world AI (e.g., eSewa fraud detection, Ncell network routing) uses these to make decisions under uncertainty.
1. Why Uncertainty Matters in AI
AI systems rarely face 100% certainty. Real-world data is noisy, incomplete, or ambiguous. For example:
- eSewa must decide if a transaction is fraudulent (probability: 95% vs. 5%).
- Pathao estimates delivery times despite traffic unpredictability (fuzzy logic: "slow," "medium," "fast").
- Ncell’s 5G network routes calls probabilistically to avoid congestion.
Key Idea:
- Inference = deriving conclusions from known facts (e.g., "If it rains, roads are slippery").
- Reasoning = handling uncertainty (e.g., "There’s a 70% chance it will rain; should we cancel the trip?").
Visual: Inference vs. Reasoning
2. Probabilistic Reasoning
2.1 Basics: Probability Theory
Probability quantifies uncertainty using:
- Joint probability: = chance of both A and B happening.
- Conditional probability: = chance of A given B (e.g., "Probability of disease given symptoms").
- Bayes’ Theorem:
- : Probability of hypothesis given evidence .
- Used in spam filters, medical diagnosis, and fraud detection.
Worked Example: eSewa Fraud Detection
- Hypothesis (H): "This transaction is fraudulent."
- Evidence (E): "User logged in from a new country."
- Given:
- (1% of transactions are fraudulent).
- (90% of frauds come from new countries).
- (5% of all transactions come from new countries).
- Calculate : P(H|E) = \frac{0.9 \times 0.01}{0.05} = 0.18 \quad \text{(18% chance of fraud)} Decision: Flag for review (threshold: >15%).
2.2 Bayesian Networks
A Bayesian network is a directed acyclic graph (DAG) where:
- Nodes = random variables (e.g., "Rain," "Traffic Jam").
- Edges = conditional dependencies.
- Each node has a Conditional Probability Table (CPT).
Example: Traffic Prediction for Kathmandu
- CPT for "Traffic Jam":
Rain Traffic Jam Probability No 0.1 Yes 0.8
Worked Example: NTC Network Routing
- Variables:
- : "Server Overloaded" ().
- : "User Requests High" (, ).
- : "Route 1 Selected" (, ).
- Question: What’s ?
- Use law of total probability:
- .
- .
- (57.3% chance Route 1 is selected).
- Use law of total probability:
3. Handling Incomplete Evidence: Dempster-Shafer Theory
Probability assumes all possibilities are known. Dempster-Shafer (DS) theory handles unknown or conflicting evidence by assigning:
- Belief (Bel): Minimum probability.
- Plausibility (Pl): Maximum probability.
- Uncertainty (U): .
Example: Medical Diagnosis (Is the patient’s symptom A or B?)
- Evidence 1: "Doctor sees rash" → Believes 60% it’s A, 30% it’s B, 10% unknown.
- Evidence 2: "Patient reports fever" → Believes 50% it’s A, 40% it’s B, 10% unknown.
- Combined belief:
- .
- .
- Decision: More likely A (75% > 54%).
Visual: Belief vs. Probability
4. Fuzzy Logic: Dealing with Vague Data
Fuzzy logic handles gradual transitions (e.g., "temperature is hot" vs. binary "hot/cold").
- Membership functions assign degrees of truth (0 to 1).
- Example: Traffic speed classification.
Worked Example: Pathao Delivery Speed
- Input: Speed = 30 km/h.
- Membership functions:
- Slow: .
- Medium: .
- Fast: .
- Calculations:
- .
- .
- .
- Output: "Speed is 50% slow, 75% medium" → Decision: "Medium speed; adjust ETA."
Visual: Fuzzy Membership Functions
5. Expected Utility Theory
AI agents should maximize expected utility, not just probability.
- Utility: Value of an outcome (e.g., profit, safety).
- Formula: where = possible outcomes.
Worked Example: Bank Loan Approval (Nepal Bank)
- Scenario: Approve or reject a loan.
- Outcomes:
- Approve:
- Repayment: , (profit).
- Default: , (loss).
- Reject: .
- Approve:
- Expected Utility:
- Approve: .
- Reject: .
- Decision: Approve (higher EU).
6. Real-World Applications
In the Real World
| Company/App | AI Technique | How It’s Used |
|---|---|---|
| eSewa | Bayesian Networks | Detects fraud by analyzing transaction patterns (e.g., "Unusual login location"). |
| Pathao | Fuzzy Logic | Adjusts delivery ETAs based on vague traffic conditions ("slow," "medium," "fast"). |
| Ncell | Probabilistic Routing | Chooses network paths with highest success probability to avoid drops. |
| Nepal Rastra Bank | Expected Utility | Approves loans balancing risk vs. profit. |
| Google Maps | Dempster-Shafer Theory | Handles incomplete traffic data (e.g., "Possible jam here, but not confirmed"). |
IMAGE: Real Outputs
7. Exam Tip
- Differentiate clearly:
- Probability = known outcomes; Dempster-Shafer = unknown outcomes.
- Fuzzy logic = gradual truth; binary logic = 0/1.
- Bayes’ Theorem is key:
- Always show the formula and label , , .
- Real-world mapping:
- Link eSewa fraud to Bayesian networks.
- Link Pathao speeds to fuzzy logic.
- Expected Utility:
- Compare of two options (e.g., "Approve vs. reject loan").
- Common Pitfalls:
- Don’t confuse with .
- In DS theory, belief ≠ probability.
Final Note: Uncertainty is everywhere in AI. Master these tools to build systems that make decisions despite imperfect data—just like eSewa, Pathao, and banks do every day.
Based on the TU BCA syllabus for Artificial Intelligence (CACS410), unit 8.
Discussion
Loading…