IT228 Artificial Intelligence

Artificial IntelligenceUnit 65 min read

Probability, Bayes’ Theorem, Uncertainty in AI

Unit 6 of Artificial Intelligence covers probabilistic reasoning, Bayes’ theorem, decision trees, and handling uncertainty in AI systems—key for diagnosing diseases, spam filtering, and autonomous systems.

TAKEAWAYS:

  • Probability quantifies uncertainty in AI decisions (e.g., spam detection, medical diagnosis).
  • Bayes’ theorem updates beliefs with new evidence: .
  • Decision trees model choices under uncertainty (e.g., loan approvals, traffic routing).
  • Naive Bayes simplifies classification by assuming feature independence (e.g., email spam filters).
  • Expected utility balances risk/reward in AI decisions (e.g., investment advice, medical treatments).
  • Real-world AI uses these to handle noisy data (e.g., Ncell’s network predictions, eSewa’s fraud detection).

1. Probability and Uncertainty in AI

AI systems rarely have perfect information. Probability helps quantify uncertainty.

Key Concepts

  • Probability: Measures likelihood of events (0 to 1).
    • : Probability of event .
    • : Conditional probability (probability of given ).
  • Bayes’ Theorem: Updates probabilities with new evidence.
    • : Hypothesis (e.g., "patient has disease").
    • : Evidence (e.g., "test result positive").

Worked Example: Medical Diagnosis

Suppose:

  • Disease prevalence: (1% of population).
  • Test accuracy: (95% true positive), (5% false positive).

Question: If a patient tests positive, what’s ? Solution:

  1. .
  2. Apply Bayes’: P(H|E) = \frac{0.95 \times 0.01}{0.059} \approx 0.161 \text{ (16.1%)} Insight: Even with a positive test, the probability is low due to rare disease prevalence.

2. Decision Trees for Uncertainty

Decision trees model choices under uncertainty (e.g., loan approvals, traffic routing).

How They Work

  1. Nodes: Decisions (square) or chance events (circle).
  2. Branches: Possible outcomes with probabilities.
  3. Leaf Nodes: Final payoffs or utilities.

Example: Loan Approval

graph TD
    A["Approve Loan?"] --> B["Credit Score > 700"]
    B -->|"Yes"| C["Income > 50k"]
    B -->|"No"| D["Reject"]
    C -->|"Yes"| E["Approve"]
    C -->|"No"| F["Reject"]

Worked Example:

  • , .
  • Approval rate: (42%).

3. Naive Bayes Classifier

Assumes features are independent (simplifies computation).

Formula

  • Used in spam detection (e.g., Gmail filters).

Example: Spam Filter

Feature Spam Not Spam
"Free" 0.8 0.01
"Offer" 0.7 0.05

Question: Classify an email with "Free" and "Offer". Solution:

  1. Assume , .
  2. Compute and :
  3. Result: → Spam.

4. Expected Utility Theory

Balances risk/reward in AI decisions (e.g., investment advice).

Formula

  • : Outcome, : Utility (e.g., profit, cost).

Example: Investment Choice

Option Probability Profit (k) Utility (k)
Stock A 0.7 10 10
Stock B 0.3 -5 -5

Expected Utility:


5. Real-World Applications

In the Real World

  1. eSewa Fraud Detection: Uses Bayes’ theorem to flag suspicious transactions (e.g., unusual payment patterns).
  2. Ncell Network Predictions: Models call drop probabilities to optimize tower placements.
  3. Khalti Loan Approvals: Decision trees evaluate credit scores and income for loan decisions.

Worked Example: Ncell Call Drop Prediction

  • Data: 80% calls drop in area X, 20% in area Y.
  • Action: AI predicts drop risk to reroute calls.
  • Bayes’ Update: If a call drops, increases significantly.

6. Advantages and Limitations

Method Pros Cons
Bayes’ Theorem Handles uncertainty well Needs accurate prior probabilities
Decision Trees Easy to interpret Sensitive to data noise
Naive Bayes Fast, works with high dimensions Assumes feature independence

Exam Tip

  • Focus on Bayes’ theorem: Always show step-by-step calculations.
  • Decision trees: Draw them clearly; label probabilities and utilities.
  • Naive Bayes: Know when to use it (text classification, spam filters).
  • Real-world tie-ins: Relate to eSewa, Ncell, or Khalti in exam answers.

decision tree diagramExample of a loan approval decision tree (Image: CollaborativeGeneticist, CC BY-SA 4.0, via Wikimedia Commons)

bayes theorem formulaProbability update visualization (Image: Erzbischof, CC BY-SA 3.0, via Wikimedia Commons)

Based on the TU BIM syllabus for Artificial Intelligence (IT228), unit 6.

Discussion

Loading…