0% found this document useful (0 votes)
5 views9 pages

Module 2

The document outlines the development of a rule-based system for diagnosing telephone malfunctions using probabilities, detailing various rules for identifying issues such as faulty instruments, exchange problems, and broken cables. It also discusses non-monotonic reasoning, probabilistic reasoning, and Bayesian networks, emphasizing their applications in AI for decision-making under uncertainty. Key concepts include conditional probabilities, inference methods, and the use of Bayesian networks in fields like medical diagnosis and decision support systems.

Uploaded by

sannsanam13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

Module 2

The document outlines the development of a rule-based system for diagnosing telephone malfunctions using probabilities, detailing various rules for identifying issues such as faulty instruments, exchange problems, and broken cables. It also discusses non-monotonic reasoning, probabilistic reasoning, and Bayesian networks, emphasizing their applications in AI for decision-making under uncertainty. Key concepts include conditional probabilities, inference methods, and the use of Bayesian networks in fields like medical diagnosis and decision support systems.

Uploaded by

sannsanam13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Module-2

Rule-based systems
 Let us develop a simple rule-based system for the diagnosis of
malfunctioning of some equipment say a landline telephone, using the
concept of probabilities. As the first step, various situations unde which
the telephone does not work properly are identified with the help of
experts of this domain.
 For example, we can think of the following reasons for the malfunctioning
of telephones:
⚫ Faulty instrument
• Problem in Exchange
• Broken cable
 Let us estimate probabilities of these situations and write the
corresponding rules. We must no that the rules must be carefully
designed in consultation with domain expert. Here, we are giving
hypothetical estimation for the sake of explaining the design of such a
system.
 Rules Regarding Faulty Telephone Instrument
The following are some of the rules that may be designed regarding faulty
telephone instrument
 Rule 1 If the telephone instrument is old and has been repaired several
times in the past then is 40% sure that the fault lies with the instrument.
It is coded in Prolog in the following manner
telephone_not_working(0.4) - ask(tele_history).
Here, the ask predicate will ask questions to the user who wants diagnosis
regarding whether t instrument is old, has been repaired several times in the
past etc. and checks if the response is positive or negative.

 Rule 2 If the instrument has fallen on the ground and broken, then it is
80% sure that the fault lies with the instrument. The rule may be written
as
telephone_not_working(0.8) :- ask(telephone_broken).

 Rule 3 If there are children in the house who play with the keypad of the
telephone, with some robability, then it is 80% sure that the instrument is
faulty because of excessive and unusual R usage. The rule may be written
as
telephone_not_working(P): ask(children_present, P1), ask(children_keypad,
P2), and_combination([P1, P2, 0.8], P).

Rules for Diagnosis of Instrument Fault


The rule for diagnosis based on instrument fault which we assume to be 70%
sure might be written as
diagnosis('Instrument is faulty', P):- instrument_faulty(P1),
and_combination([P1, 0.7], P).

Rules Regarding Faults due to Other Reasons


Let us consider other kinds of telephone diagnosis such as problems with
telephone exchange or cable connection.
Rules for Faults due to Problem in Exchange
There are some rules related to problems in the telephone exchange. For
example,
exchange_probability (0.99) :- ask(exchange_problem).
exchange_probability (0.5) :- ask(connecting_switch_problem).
overall_exchage_probability (P) :- findall(X, exchange_probabilty(X), L), or
combination(L, P).

Rules for Faults due to Broken Cable There might be problems related to broken
cable due to some reasons as given below:
cable_broken_probabilty (0.98) :- ask(cable_old), ask(if_storm_recently).
cable_broken_probability (0.3) : ask(recent_furniture_rearranging).
overall_cable_probabilty(P): findall(X, cable_broken_probability (X), L),
or_combination (L, P).

Rules for Diagnosis of Cable and Exchange Faults


Assume that the rule for diagnosis of cable fault is 80% sure. We can write
diagnosis('Cable_problem', P) :- overall_cable_probabilty (P1),
and_combination([P1, 0.8], P).

Also assume that the rule for diagnosis of exchange problem is 90% sure. We
can write
diagnosis('Exchange_problem', P) - overall_exchange_probabilty (P1),
and_combination([P1, 0.9], P).
To run such a system, call a goal as given below.

?diagnosis(D,P)

NON-MONOTONIC REASONING

Non-monotonic reasoning in AI refers to a type of reasoning where the conclusions derived from
a set of facts or rules can change when new information is introduced. This contrasts with
monotonic reasoning, where once something is concluded, it remains true even if new
information is added.

In monotonic reasoning, the process is rigid, meaning that the addition of new facts never
invalidates the conclusions that have already been drawn. For example, if you conclude that "all
birds can fly" based on a set of observations, adding new birds to your knowledge (e.g.,
penguins) doesn’t change that conclusion unless you specifically update the rule.

In non-monotonic reasoning, conclusions can be revised or retracted when new evidence is


introduced that contradicts or modifies previous knowledge. This mirrors how humans often
reason and update beliefs in real-world situations. For example, you might initially believe that
"all birds can fly" based on what you know, but when you learn about penguins (which are birds
but cannot fly), you revise your belief.

Key Features of Non-Monotonic Reasoning:

1. Revisability: Conclusions can be changed or withdrawn when new information conflicts


with earlier conclusions.
2. Handling Uncertainty: It allows systems to make reasoned decisions even in the face of
incomplete or uncertain information.
3. Default Assumptions: Systems can make reasonable assumptions in the absence of
complete knowledge, but these assumptions can be retracted if new facts contradict them.

Examples of Non-Monotonic Reasoning:

 Default Logic: A system might assume that "birds fly" as a default rule, but it can revise
this if it learns about specific birds that do not fly.
 Common-Sense Reasoning: In everyday reasoning, people often make assumptions that
are later corrected when more information comes in. For example, assuming that a friend
is at home if you haven’t heard otherwise, but you revise this assumption when you learn
they’re out.
 Robotics: A robot might plan a route based on available information, but if a new
obstacle is detected during its journey, the robot revises its plan.

Probabilistic reasoning

Probabilistic reasoning in AI refers to the use of probability theory to model and reason about
uncertainty in intelligent systems. Since real-world environments are often uncertain and
incomplete, AI systems need to make decisions based on information that is imprecise, noisy, or
incomplete. Probabilistic reasoning helps systems make predictions, infer missing information,
and make decisions in situations where the outcome is not certain.

Key Concepts in Probabilistic Reasoning:

1. Probability Theory: The foundation of probabilistic reasoning is based on probability


theory, which quantifies uncertainty. A probability value ranges from 0 (impossible) to 1
(certain), and it represents the likelihood of an event occurring.
2. Random Variables: In probabilistic reasoning, a random variable represents an uncertain
quantity that can take different values, each with an associated probability.
3. Bayes' Theorem: Bayes' theorem is a key principle in probabilistic reasoning. It provides
a way to update the probability of an event occurring based on new evidence. The
theorem expresses how the probability of a hypothesis (H) is updated when new evidence
(E) is observed:
P(H∣E)=P(E∣H)⋅P(H)P(E)P(H|E) = \frac{P(E|H) \cdot P(H)}
{P(E)}P(H∣E)=P(E)P(E∣H)⋅P(H)

This allows the system to revise its beliefs as new information is obtained.

4. Conditional Probability: The probability of an event given that another event has
occurred. It is a fundamental concept used in probabilistic reasoning to express how the
probability of one event depends on the outcome of another.
5. Markov Decision Processes (MDPs): In decision-making, MDPs are used to model
environments where an agent must make a sequence of decisions over time, each with
probabilistic outcomes. MDPs are often used in reinforcement learning.

Types of Probabilistic Reasoning:

1. Bayesian Inference: This is a method of updating the probability estimate for a


hypothesis as new evidence is acquired. It’s a central technique for probabilistic
reasoning in AI, allowing systems to continuously refine their beliefs.

Example: A medical diagnosis system might initially assume that a patient has a certain
disease with a certain probability based on prior information (e.g., 30%). As new test
results are received, the system updates the probability of the disease based on Bayes'
theorem.

2. Probabilistic Graphical Models:


o Bayesian Networks: These are graphical models that represent the probabilistic
relationships between different variables in a domain. They are used to model
joint probability distributions of a set of variables and to perform inference on
them.
o Markov Networks: These are undirected graphical models used for representing
complex dependencies and relationships among variables.

These models allow for efficient computation and inference in systems with many
variables and uncertainty.

3. Hidden Markov Models (HMMs): HMMs are used for modeling time-series data or
sequences of observations where the system being modeled is assumed to be a Markov
process with hidden states. For example, in speech recognition, HMMs can be used to
model the probability of different phonemes (hidden states) based on observed acoustic
signals.
4. Monte Carlo Methods: These are computational algorithms that rely on repeated
random sampling to obtain numerical results, often used to estimate probabilities in
complex systems where exact calculations are infeasible. One well-known technique is
Markov Chain Monte Carlo (MCMC).

Applications of Probabilistic Reasoning in AI:


1. Medical Diagnosis: Probabilistic models can assist in diagnosing diseases by considering
the likelihood of various diseases based on symptoms, medical history, and test results.
2. Autonomous Vehicles: Self-driving cars use probabilistic reasoning to make decisions
under uncertainty, such as predicting the behavior of pedestrians, other vehicles, and
dynamic road conditions.
3. Robotics: Robots use probabilistic models to estimate the state of the world (e.g.,
position, orientation) and to plan actions under uncertainty (e.g., using Simultaneous
Localization and Mapping or SLAM).
4. Natural Language Processing (NLP): Probabilistic models like Hidden Markov
Models (HMMs) and conditional random fields (CRFs) are used for tasks like part-of-
speech tagging, named entity recognition, and machine translation.
5. Recommender Systems: Systems like Netflix or Amazon use probabilistic reasoning to
predict user preferences based on past behavior and item characteristics.
6. Spam Filtering: Probabilistic models, such as Naive Bayes classifiers, are commonly
used to classify emails as spam or not based on various features (e.g., word frequencies).

Bayesian networks.
Bayesian Networks (BNs) are a powerful probabilistic graphical model used in AI to represent
the relationships among variables and model uncertainty. They are widely used for reasoning,
decision-making, and prediction in situations where uncertainty is present and there are
probabilistic dependencies among variables.

Key Concepts of Bayesian Networks:

1. Graphical Structure: A Bayesian network is a directed acyclic graph (DAG) where:


o Nodes represent random variables (which can be observed or hidden).
o Edges represent probabilistic dependencies between the variables (i.e., one variable
influences another).

2. Conditional Independence: In a Bayesian network, each node is conditionally


independent of its non-descendants, given its parents. This property allows for efficient
representation and computation of joint probabilities, as it reduces the complexity of
modeling all the possible dependencies between variables.
3. Probabilities: Each node in the network has an associated conditional probability
distribution (CPD) that quantifies the effect of its parents on the node. If a node has no
parents, it is assigned a prior probability distribution.
o Conditional Probability: This is the probability of a node taking a particular value given
the values of its parents. For example, the probability of a variable AAA given its parent
BBB, denoted as P(A∣B)P(A|B)P(A∣B).
o Prior Probability: This is the probability of a node in the absence of any parents (e.g., for
a root node).
4. Joint Probability Distribution: The joint probability of all variables in a Bayesian
network can be factored into the product of conditional probabilities according to the
structure of the network:

P(X1,X2,...,Xn)=P(X1)⋅P(X2∣X1)⋅P(X3∣X1,X2)⋯P(Xn∣X1,X2,...,Xn−1)P(X_1, X_2, ..., X_n) = P(X_1) \


cdot P(X_2 | X_1) \cdot P(X_3 | X_1, X_2) \cdots P(X_n | X_1, X_2, ..., X_{n-1})P(X1,X2,...,Xn
)=P(X1)⋅P(X2∣X1)⋅P(X3∣X1,X2)⋯P(Xn∣X1,X2,...,Xn−1)

This decomposition significantly simplifies the calculation of complex joint probabilities.

5. Inference: One of the main uses of a Bayesian network is to perform inference — that is,
to compute the probability of certain variables given observed evidence for other
variables. Inference can be used to update beliefs about certain variables based on new
data.
6. Learning: Bayesian networks can be constructed manually by domain experts or learned
from data using algorithms like expectation-maximization (EM) or Bayesian
parameter estimation. The structure of the network can also be learned using algorithms
like structure learning (e.g., score-based methods or search-and-score algorithms).

Components of a Bayesian Network:

 Nodes (Variables): Represent random variables, which can be discrete or continuous.


 Edges (Dependencies): Directed edges between nodes represent conditional dependencies
between variables.
 Conditional Probability Tables (CPTs): Each node has a conditional probability table (CPT) that
defines the probability of the node given its parents. If there are no parents, the node has a
prior distribution.

Example of a Simple Bayesian Network:

Consider a simple network that models a medical diagnosis scenario:

 Let AAA be a node representing whether a person has a disease.


 Let BBB represent the symptom of coughing, which depends on whether the person has the
disease.
 Let CCC represent the symptom of fever, which also depends on whether the person has the
disease.

The relationships would be represented as:

 A→BA \rightarrow BA→B (having the disease influences whether the person coughs).
 A→CA \rightarrow CA→C (having the disease influences whether the person has a fever).

Conditional Probability Tables (CPTs):

 P(A)P(A)P(A) would represent the prior probability of having the disease.


 P(B∣A)P(B|A)P(B∣A) would represent the probability of coughing given whether the person has
the disease.
 P(C∣A)P(C|A)P(C∣A) would represent the probability of having a fever given whether the person
has the disease.

Inference in Bayesian Networks:

Inference is the process of calculating the probability of a set of variables, given evidence about
other variables in the network. There are several techniques for inference in Bayesian networks,
including:

1. Exact Inference: This involves calculating the exact posterior probabilities of variables
using methods like variable elimination or junction tree algorithms.
2. Approximate Inference: In cases where exact inference is computationally expensive
(e.g., large networks), approximate methods like Monte Carlo simulations (e.g.,
Markov Chain Monte Carlo (MCMC)) can be used.

Applications of Bayesian Networks in AI:

1. Medical Diagnosis: Bayesian networks are used to model and diagnose diseases based
on symptoms and test results. They can calculate the probability of different diseases
based on observed symptoms and other patient data.
o Example: In a healthcare setting, a Bayesian network can help diagnose whether a
patient has a disease based on symptoms like fever and cough.

2. Decision Support Systems: Bayesian networks are used in decision-making problems


where uncertainty is involved. They help decision-makers assess risks and make optimal
decisions under uncertainty.
o Example: In finance, Bayesian networks can model the uncertainty around stock prices
or financial risks and help guide investment decisions.

3. Natural Language Processing (NLP): Bayesian networks can be used in NLP tasks like
speech recognition, part-of-speech tagging, and machine translation. For instance, in
speech recognition, the network can model the probability of a sequence of words or
phonemes given a set of observed acoustic features.
4. Robotics and Autonomous Systems: Bayesian networks help robots reason about
uncertain situations, make decisions in dynamic environments, and handle partial
information about the world.
5. Fault Diagnosis: In engineering, Bayesian networks can model complex systems and
predict component failures based on observed behavior or sensor data.
6. Planning and Scheduling: They can be used in planning algorithms, where an agent
must choose actions that maximize the probability of achieving its goals, considering
uncertain outcomes.

Advantages of Bayesian Networks:


 Clear Representation of Uncertainty: BNs provide an intuitive way to represent and reason
about uncertainty using probabilities.
 Efficient Inference: Bayesian networks enable efficient inference and decision-making by
decomposing complex joint distributions into simpler conditional probabilities.
 Modularity: The structure of a Bayesian network allows for easy extension by adding new
variables or relationships.
 Interpretable: The structure of a Bayesian network is often easy for humans to interpret, making
them useful for decision support and expert systems.

You might also like