NEURAL NETWORKS &
ARTIFICIAL INTELLIGENCE
BAI-205 UNIT III
Prof. Ravi Prakash Shahi
8979048096
ravishahi71@gmail.com
Propositional Logic in AI
 Propositional Logic is a fundamental concept in Artificial Intelligence
(AI), used to represent and reason about facts and relationships in a
formal, logical way.
 It deals with propositions (statements that are either true or false) and the
logical connections between them.
 In AI, propositional logic is useful for knowledge representation,
automated reasoning, and building intelligent systems.
Propositional Logic
Advantages of Propositional Logic in AI
Disadvantages of Propositional Logic in AI
Rules of Inference
Rules of Inference in Propositional Logic
Convert the following sentence into predicate logic:
"All humans are mortal, and some humans are philosophers."
Prove the following argument using predicate logic:
"If everyone who reads is smart, and John reads, then John is smart."
Show that the following argument is valid in predicate logic:
"If there is a student who loves every book, then every book is loved by some
student."
Prove using predicate logic:
"If all cats are mammals and some animals are cats, then some animals are
mammals."
Using predicate logic, show that the following statement is valid:
"If no student likes failure, and Tom is a student, then Tom does not like failure."
Rule-based systems in AI
• A rule-based system in AI is a system that applies predefined rules to a set
of inputs to make decisions, draw inferences, or take actions.
• These systems are typically used in domains where knowledge can be
codified as "if-then" statements, allowing the system to make deductions or
recommendations based on specific conditions.
• Rule-based systems form the base of many AI applications, like expert
systems and decision support systems, using deterministic rules that can
effectively guide decision-making.
• Example : MYCIN expert system, developed in the 1970s at Stanford
University. MYCIN was designed to diagnose bacterial infections and
recommend antibiotic treatments based on symptoms and laboratory test
results. It used a set of rules to emulate the decision-making process of
infectious disease experts.
Components of Rule-based systems
1. Knowledge Base (KB)
– contains a set of rules or facts that represent domain-specific knowledge. Rules are often
structured as if-then statements.
– Example: In a medical expert system, a rule might be: IF a patient has a high fever and a
sore throat, THEN diagnose a throat infection
2. Inference Engine (IE)
– The IE applies logical reasoning to the KB to deduce new information. It processes the
rules in the KB by evaluating current data or facts and then applying applicable rules.
– Common reasoning methods include: Forward Chaining and Backward Chaining.
– Forward Chaining: Starts with known facts and applies rules to derive new conclusions.
– Backward Chaining: Starts with a goal or hypothesis and works backward to find
supporting evidence.
3. Working Memory (Buffer)
– a temporary storage area where the system holds facts that are actively being evaluated or
modified.
4. User Interface (UI)
– The UI allows human operators to input data, review the reasoning process, and receive
results or recommendations from the system.
Algorithm(Working) of Rule-based systems
 The process in a rule-based system typically follows these steps:
1. Input Facts: Facts or data are inputted into the system, either from
sensors, databases, or user inputs.
2. Evaluate Rules: The inference engine scans through the rules to
identify which rules can be applied based on the input data.
3. Apply Rules: The system applies relevant rules to generate
conclusions, decisions, or new facts.
4. Repeat Process: This process may repeat, as the newly generated
conclusions can be used to trigger other rules until no more rules can
be applied or a final conclusion is reached.
5. Output: The system presents the final conclusions or
recommendations as output.
Example – Medical Diagnosis System
 Consider a rule-based system for assisting doctors in diagnosing flu.
1. Knowledge Base
 Rule 1: IF the patient has a fever AND sore throat, THEN the patient might have a viral
infection.
 Rule 2: IF the patient has a cough AND body aches, THEN the patient might have the flu.
 Rule 3: IF the patient has a fever AND has recently travelled to an area with high flu cases,
THEN suggest a flu test.
2. Inference Engine:
 When a patient’s symptoms (facts) are inputted, the inference engine checks which rules
apply to these symptoms.
 If a patient presents with a fever, sore throat, and recent travel to a high-flu area, Rules 1
and 3 are triggered.
3. Output:
 Based on the rule evaluation, the system might output a recommendation: “Suggest flu test
due to recent travel and flu symptoms.
Types of Reasoning in Rule-Based Systems
1. Forward Chaining
– Begins with known facts and applies rules sequentially to derive new
facts.
– Example: A smart home system that turns on lights based on a motion
sensor detecting movement.
2. Backward Chaining
– Starts with a goal or hypothesis and works backward to check if
supporting facts are available to confirm the goal.
– Example: In a diagnostic system, if the goal is to confirm “flu diagnosis,”
the system checks if symptoms like fever and cough are present
 Clear and Understandable: Rules are straightforward, making
it easy to understand and follow the system’s decision-making.
 Ease of Modification: New rules can be added, or old rules
modified, without major changes to the system structure.
 Domain Expertise: Rule-based systems can capture and
utilize domain-specific knowledge, allowing them to perform
tasks like an expert in a field (e.g., medical diagnosis, financial
advising).
Advantages of Rule-Based Systems
 Limited Flexibility: Rule-based systems can only make
decisions based on predefined rules, so they lack
adaptability to novel situations.
 Scalability Issues: As the number of rules grows,
managing and maintaining the system becomes complex,
potentially slowing down performance.
 Lack of Learning: Rule-based systems don’t learn from
new data. They must be manually updated with new rules
as knowledge evolves.
Disadvantages of Rule-Based Systems
Knowledge Representation in AI
• Knowledge Representation in AI refers to the way in which AI systems store,
organize, and utilize knowledge to solve complex problems. It is a crucial aspect of
AI, enabling machines to mimic human understanding and reasoning.
• Knowledge representation involves the creation of data structures and models that
can efficiently capture information about the world, making it accessible and usable
by AI algorithms for decision-making, inference, and learning.
Relationship between Knowledge and Intelligence
• Knowledge as a Foundation: Knowledge provides the necessary information, facts,
and skills that intelligence uses to solve problems and make decisions.
• Intelligence as Application: Intelligence is the ability to learn, reason, and adapt,
using knowledge to perform tasks and solve complex problems.
• Interdependence: Knowledge without intelligence is static, while intelligence without
knowledge lacks the raw material to function effectively.
• Synergy: Effective AI systems require a balance of both knowledge (the "what") and
intelligence (the "how") to operate successfully.
Types of Knowledge in AI
1. Declarative Knowledge
• Declarative knowledge refers to facts and information that describe the world, answering the
"what" type of questions.
• Example: Knowing that Paris is the capital of France.
• This knowledge is often stored in databases or knowledge bases and expressed in logical
statements, forming the foundation for more complex reasoning and problem-solving in AI
systems.
2. Procedural Knowledge
• Procedural knowledge is the knowledge of how to perform tasks or processes, answering the
"how" type of questions.
• Example: Steps to solve a mathematical problem or the procedure to start a car.
• This knowledge is embedded in algorithms or control structures, enabling AI systems to
execute tasks, perform actions, and solve problems step-by-step.
3. Meta-Knowledge
• Meta-knowledge is knowledge about knowledge, understanding which types of knowledge to
apply in different situations.
• Example: Knowing when to use a specific algorithm based on the problem at hand.
• Crucial for systems that need to adapt or optimize their performance, meta-knowledge helps
in selecting the most appropriate strategy or knowledge base for a given problem.
Types of Knowledge in AI
4. Heuristic Knowledge
•Heuristic knowledge includes rules of thumb, educated guesses, and intuitive
judgments derived from experience.
•Example: Using an educated guess to approximate a solution when time is limited.
•Often used in problem-solving and decision-making processes where exact
solutions are not feasible, helping AI systems to arrive at good-enough
solutions quickly.
5. Structural Knowledge
•Structural knowledge refers to the understanding of how different pieces of
knowledge are organized and related to each other.
•Example: Understanding the hierarchy of concepts in a taxonomy or the
relationships between different entities in a semantic network.
•This knowledge is essential for organizing information within AI systems,
allowing for efficient retrieval, reasoning, and inferencing based on the
relationships and structures defined.
FORWARD AND BACKWARD CHAINING
• Forward Chaining and Backward Chaining are the two most important strategies
in the field of Artificial Intelligence and lie in the Expert System Domain of AI.
• The inference engine is the component of the intelligent system in AI, which
applies logical rules to the knowledge base to infer new information from known
facts.
• Inference engine commonly proceeds in two modes, which are:
a. Forward Chaining
b. Backward Chaining
• Forward chaining is also known as a forward deduction or forward reasoning
method when using an inference engine. Forward chaining is a form of reasoning
which start with atomic sentences in the knowledge base and applies inference
rules (Modus Ponens) in the forward direction to extract more data until a goal is
reached.
• Backward-chaining is also known as a backward deduction or backward
reasoning method when using an inference engine. A backward chaining
algorithm is a form of reasoning, which starts with the goal and works backward,
chaining through rules to find known facts that support the goal.
FORWARD CHAINING
BACKWARD CHAINING
Properties of Forward Chaining
1. It is a down-up(bottom-up) approach, as it moves from bottom to top.
2. It is a process of making a conclusion based on known facts or data, by starting
from the initial state and reaches the goal state.
3. Forward-chaining approach is also called as data-driven as we reach to the goal
using available data.
4. Forward -chaining approach is commonly used in the expert system, such as
CLIPS, business, and production rule systems.
• Example:
• "As per the law, it is a crime for an American to sell weapons to hostile
nations. Country A, an enemy of America, has some missiles, and all the
missiles were sold to it by Robert, who is an American citizen."
• Prove that "Robert is criminal."
• To solve the above problem, first, we will convert all the above facts into first-
order definite clauses, and then we will use a forward-chaining algorithm to
reach the goal.
Facts Conversion into FOL:
Properties of Backward Chaining
 Backward-chaining is also known as a backward deduction or
backward reasoning method when using an inference engine. A
backward chaining algorithm is a form of reasoning, which starts with
the goal and works backward, chaining through rules to find known
facts that support the goal.
1. It is known as a top-down approach.
2. Backward-chaining is based on modus ponens inference rule.
3. In backward chaining, the goal is broken into sub-goal or sub-goals to prove the
facts true.
4. It is called a goal-driven approach, as a list of goals decides which rules are
selected and used.
5. Backward -chaining algorithm is used in game theory, automated theorem
proving tools, inference engines, proof assistants, and various AI applications.
6. The backward-chaining method mostly used a depth-first search strategy for
proof.
Forward vs. Backward Chaining
1. Forward chaining, start from the known facts and move forward by applying inference rules
to extract more data, and it continues until it reaches to the goal, whereas backward chaining
starts from the goal, move backward by using inference rules to determine the facts that
satisfy the goal.
2. Forward chaining is called a data-driven inference technique, whereas backward chaining is
called a goal-driven inference technique..
3. Forward chaining is known as the down-up approach, whereas backward chaining is known
as a top-down approach.
4. Forward chaining uses breadth-first search strategy, whereas backward chaining
uses depth-first search strategy.
5. Forward and backward chaining both applies Modus ponens inference rule.
6. Forward chaining can be used for tasks such as planning, design process monitoring,
diagnosis, and classification, whereas backward chaining can be used for classification
and diagnosis tasks.
7. Forward chaining can be like an exhaustive search, whereas backward chaining tries to
avoid the unnecessary path of reasoning.
8. In forward-chaining there can be various ASK questions from the knowledge base, whereas
in backward chaining there can be fewer ASK questions.
9. Forward chaining is slow as it checks for all the rules, whereas backward chaining is fast as
it checks few required rules only.
S.N Forward Chaining Backward chaining
1 Starts from known facts and applies inference rule
to extract more data unit it reaches to the goal.
Starts from the goal and works backward
through inference rules to find the required
facts that support the goal.
2 It is a bottom-up approach It is a top-down approach
3 known as data-driven inference technique as we
reach to the goal using the available data.
known as goal-driven technique as we start
from the goal and divide into sub-goal to
extract the facts.
4 applies a breadth-first search strategy applies a depth-first search strategy
5 Forward chaining tests for all the available rules Backward chaining only tests for few
required rules.
6 is suitable for the planning, monitoring, control,
and interpretation application.
is suitable for the planning, monitoring,
control, and interpretation application.
7 Forward chaining can generate an infinite number
of possible conclusions.
generates a finite number of possible
conclusions.
8 Forward chaining is aimed for any conclusion. Backward chaining is only aimed for the
required data.
9 May become slow with large rule sets Can be complex to manage with large rule
sets
10 Can be memory intensive due to storing
intermediate facts
Typically requires less memory
11 Suitable for dynamic environments with
continuously arriving data
Suitable for diagnostic systems and
interactive applications
12 Simple to implement More complex to implement due to recursive
nature
DEDUCTIVE REASONING
• Deductive reasoning is deducing new information from logically related known
information. It is the form of valid reasoning, which means the argument's conclusion
must be true when the premises are true.
• Uses available facts, information or knowledge to deduce a valid conclusion, whereas
inductive reasoning involves making a generalization from specific facts, and
observations.
• Deductive Reasoning is the strategic approach that uses available facts, information or
knowledge to draw valid conclusions. It basically beliefs in the facts and ideas before
drawing any result.
• Deductive reasoning uses a top-down approach. In deductive reasoning, the
arguments can be valid or invalid based on the value of the premises. If the value of
the premises is true, then the conclusion is also true.
• Deductive reasoning helps in scanning the generalized statement into a valid
conclusion. Some of the examples are
• Deductive arguments can be valid or invalid, which means if premises are true, the
conclusion must be true, whereas inductive argument can be strong or weak, which
means conclusion may be false even if premises are true.
Inductive Reasoning
• Inductive reasoning is a form of reasoning to arrive at a conclusion using limited
sets of facts by the process of generalization. It starts with the series of specific
facts or data and reaches to a general statement or conclusion.
• Inductive reasoning is a type of propositional logic, which is also known as cause-
effect reasoning or bottom-up reasoning.
• In inductive reasoning, we use historical data or various premises to generate a
generic rule, for which premises support the conclusion.
• In inductive reasoning, premises provide probable supports to the conclusion, so the
truth of premises does not guarantee the truth of the conclusion.
• Example:
• Premise: All of the pigeons we have seen in the zoo are white.
• Conclusion: Therefore, we can expect all the pigeons to be white.
COMPARISON
• The main difference between inductive and deductive reasoning is that inductive reasoning aims
at developing a theory while deductive reasoning aims at testing an existing theory.
• In other words, inductive reasoning moves from specific observations to broad generalizations.
Deductive reasoning works the other way around.
• When there is little to no existing literature on a topic, it is common to perform inductive research,
because there is no theory to test. The inductive approach consists of three stages: 1.
Observation 2. Seeking patterns 3. Developing a theory or general CONCLUSION.
• Inductive reasoning is a type of propositional logic, which is also known as cause-effect
reasoning or bottom-up reasoning.
• LIMITATION OF IR - A conclusion drawn on the basis of an inductive method can never be fully
proven. However, it can be invalidated.
• When conducting deductive research, you always start with a theory. This is usually the result of
inductive research. Reasoning deductively means testing these theories. Remember that if there
is no theory yet, you cannot conduct deductive research.
• LIMITATION OF DR - The conclusions of deductive reasoning can only be true if all the premises
set in the inductive study are true and the terms are clear.
Abductive Reasoning
• Abductive reasoning is a form of logical reasoning which starts with
single or multiple observations then seeks to find the most likely
explanation or conclusion for the observation.
• Abductive reasoning is an extension of deductive reasoning, but in
abductive reasoning, the premises do not guarantee the conclusion.
• Implication: Cricket ground is wet if it is raining
• Axiom: Cricket ground is wet.
• Conclusion It is raining.
Common Sense Reasoning
• Common sense reasoning is an informal form of reasoning, which
can be gained through experiences.
• Common Sense reasoning simulates the human ability to make
presumptions about events which occurs on every day.
• It relies on good judgment rather than exact logic and operates
on heuristic knowledge and heuristic rules.
• Example:
1. One person can be at one place at a time.
2. If I put my hand in a fire, then it will burn.
• The above two statements are the examples of common sense
reasoning which a human mind can easily understand and assume.
Monotonic Reasoning
• In monotonic reasoning, once the conclusion is taken, then it will remain the
same even if we add some other information to existing information in our
knowledge base. In monotonic reasoning, adding knowledge does not decrease
the set of prepositions that can be derived.
• To solve monotonic problems, we can derive the valid conclusion from the
available facts only, and it will not be affected by new facts.
• Monotonic reasoning is not useful for the real-time systems, as in real time, facts
get changed, so we cannot use monotonic reasoning.
• Monotonic reasoning is used in conventional reasoning systems, and a logic-
based system is monotonic.
• Any theorem proving is an example of monotonic reasoning.
• Example:
• Earth revolves around the Sun.
• It is a true fact, and it cannot be changed even if we add another sentence in
knowledge base like, "The moon revolves around the earth" Or "Earth is not
round," etc
Non-Monotonic Reasoning
 In Non-monotonic reasoning, some conclusions may be invalidated if we
add some more information to our knowledge base.
 Logic will be said as non-monotonic if some conclusions can be
invalidated by adding more knowledge into our knowledge base.
 Non-monotonic reasoning deals with incomplete and uncertain models.
 "Human perceptions for various things in daily life, "is a general example
of non-monotonic reasoning.
Example: Let suppose the knowledge base contains the following knowledge:
S1 : Birds can fly
S2 : Penguins cannot fly
S3 : Pitty is a bird
However, if we add one another sentence into knowledge base “S4 : Pitty is a penguin", which
concludes "Pitty cannot fly", so it invalidates the above conclusion.
ADV1 : For real-world systems such as Robot navigation,
we can use non-monotonic reasoning.
ADV2 : In Non-monotonic reasoning, we can choose
probabilistic facts or can make assumptions.
DISADVANTAGE : In non-monotonic reasoning, the
old facts may be invalidated by adding new
sentences.
REGRESSION
• Regression is a supervised machine learning technique which is used to predict continuous values.
• The ultimate goal of the regression algorithm is to plot a best-fit line or a curve between the data.
• The three main metrics that are used for evaluating the trained regression model are variance, bias and
error. If the variance is high, it leads to overfitting and when the bias is high, it leads to underfitting.
• Based on the number of input features and output labels, regression is classified as linear (one input and
one output), multiple (many inputs and one output) and multivariate (many outputs).
• Linear regression allows us to plot a linear equation, i.e., a straight line. We need to tune the coefficient
and bias of the linear equation over the training data for accurate predictions.
• The tuning of coefficient and bias is achieved through gradient descent or a cost function — least squares
method.
• Polynomial regression is used when the data is non-linear. In this, the model is more flexible as it plots a
curve between the data. The degree of the polynomial needs to vary such that overfitting doesn’t occur.
Regression (2)
• Regression analysis is a statistical method to model the
relationship between a dependent (target) and independent
(predictor) variables with one or more independent variables.
More specifically, Regression analysis helps us to understand how
the value of the dependent variable is changing corresponding to
an independent variable when other independent variables are
held fixed. It predicts continuous/real values such as temperature,
age, salary, price, etc.
We can understand the concept of regression
analysis using the below example:
Example: Suppose there is a marketing company
A, who does various advertisement every year
and get sales on that. The below list shows the
advertisement made by the company in the last
5 years and the corresponding sales
Now, the company wants to do the
advertisement of $200 in the year 2019 and
wants to know the prediction about the sales
for this year. So to solve such type of prediction
problems in machine learning, we need
regression analysis.
Regression (3)
• Regression is a supervised learning technique which helps in finding the
correlation between variables and enables us to predict the continuous output
variable based on the one or more predictor variables. It is mainly used
for prediction, forecasting, time series modeling, and determining the causal-
effect relationship between variables.
• In Regression, we plot a graph between the variables which best fits the given
datapoints, using this plot, the machine learning model can make predictions
about the data. In simple words, "Regression shows a line or curve that passes
through all the datapoints on target-predictor graph in such a way that the
vertical distance between the datapoints and the regression line is
minimum." The distance between datapoints and line tells whether a model has
captured a strong relationship or not.
• Some examples of regression can be as:
• Prediction of rain using temperature and other factors
• Determining Market trends
• Prediction of road accidents due to rash driving.
Classification
• Classification is a supervised machine learning method where the model tries to predict the correct label of a given input data. In classification, the
model is fully trained using the training data, and then it is evaluated on test data before being used to perform prediction on new unseen data.
• In Classification, a program learns from the given dataset
or observations and then classifies new observation into a
number of classes or groups. Such as, Yes or No, 0 or 1,
Spam or Not Spam, cat or dog, etc. Classes can be called as
targets/labels or categories.
• Unlike regression, the output variable of Classification is a category, not a value, such as "Green or Blue", "fruit or animal", etc. Since the
Classification algorithm is a Supervised learning technique, hence it takes labeled input data, which means it contains input with the corresponding
output.
• The best example of an ML classification algorithm is Email Spam Detector.
• The main goal of the Classification algorithm is to identify the category of a given dataset, and these algorithms are mainly used to predict the
output for the categorical data.
• Classification algorithms can be better understood using the below diagram. In the below diagram, there are two classes, class A and Class B. These
classes have features that are similar to each other and dissimilar to other classes.
Classification (2)
• There are two types of learners in machine learning classification: lazy and eager learners.
• Eager learners are machine learning algorithms that first build a model from the training dataset before making any
prediction on future datasets. They spend more time during the training process because of their eagerness to have a
better generalization during the training from learning the weights, but they require less time to make predictions.
• Most machine learning algorithms are eager learners, and below are some examples:
• Logistic Regression.
• Support Vector Machine.
• Decision Trees.
• Artificial Neural Networks.
• Lazy learners or instance-based learners, on the other hand, do not create any model immediately from the training
data, and this is where the lazy aspect comes from. They just memorize the training data, and each time there is a need
to make a prediction, they search for the nearest neighbor from the whole training data, which makes them very slow
during prediction. Some examples of this kind are:
• K-Nearest Neighbor.
• Case-based reasoning.
1. Expert Systems: Rule-based systems are widely used in expert
systems for tasks like medical diagnosis, legal advice, and
troubleshooting technical issues.
2. Decision Support Systems: They are applied in decision support
systems in industries like finance and insurance to provide
recommendations based on historical data.
3. Control Systems: Used in automated industrial processes, such as
quality control and environmental monitoring, where specific actions
are taken based on sensor readings.
4. Personal Assistants: Basic AI chatbots use rule-based systems to
respond to user queries with pre-defined answers.
Applications of Rule-Based Systems
 In AI, reasoning is the process of deriving conclusions or making decisions
based on available knowledge. There are various types of reasoning used
in AI, each with its specific approach and applications.
 Types of reasoning in AI:
1. Deductive Reasoning
2. Inductive Reasoning
3. Abductive Reasoning
4. Analogical Reasoning
5. Common-Sense Reasoning
6. Non-Monotonic Reasoning
7. Probabilistic Reasoning
8. Fuzzy Logic Reasoning
9. Forward Reasoning
10.Backward Reasoning
REASONING in AI
 It is a technique that begins with known facts or data and applies
inference rules to derive new conclusions or outcomes. It is a data-
driven approach, meaning that reasoning starts with available
information (facts) and then moves forward through inference rules to
reach a conclusion.
 This reasoning technique is often used in rule-based systems or expert
systems, where a system applies rules to input data to draw
conclusions, typically in a step-by-step manner.
Forward Reasoning (Chaining) in AI
 Data-driven: Starts with the available data or facts.
 Sequential: Inferences are made step-by-step by applying rules to data.
 Goal discovery: Forward reasoning may eventually lead to discovering
a goal or conclusion but does not start with the goal.
 Suitable for dynamic environments: Useful when facts are frequently
changing, and you need to infer conclusions based on new inputs.
Characteristics of Forward Chaining
1. Start with Facts: The system begins with a set of facts or known
information.
2. Apply Rules: The system checks which rules can be applied to the
given facts.
3. Generate New Facts: Once a rule is applied, it generates new
information (inferred facts).
4. Repeat: This process repeats by applying additional rules to the new
facts until no more rules can be applied or the desired conclusion is
reached.
Steps in Forward Reasoning(Chaining)
 A medical diagnosis system uses forward reasoning. The system starts with symptoms as
facts, applies rules based on those symptoms, and eventually diagnoses a disease.
 Facts:
 The patient has a cough.
 The patient has a fever.
 The patient is experiencing difficulty breathing.
 Rules:
1. Rule 1: IF a patient has a cough AND fever, THEN the patient might have a respiratory
infection.
2. Rule 2: IF a patient has a respiratory infection AND difficulty breathing, THEN the patient
might have pneumonia.
3. Rule 3: IF a patient has pneumonia, THEN suggest a chest X-ray.
 Process:
1. The system starts with the facts: cough, fever, and difficulty breathing.
2. It applies Rule 1: Since the patient has a cough and fever, the system infers that the patient
might have a respiratory infection.
3. The system applies Rule 2: Since the patient has a respiratory infection and difficulty
breathing, the system infers that the patient might have pneumonia.
4. The system applies Rule 3: Since the patient might have pneumonia, it suggests getting a
chest X-ray.
 Conclusion:
 Based on the given facts and the applied rules, the system concludes that the patient
should get a chest X-ray to confirm pneumonia.
Example of Forward Reasoning
 In AI, reasoning is the process of deriving conclusions or making
decisions based on available knowledge. There are various types of
reasoning used in AI, each with its specific approach and applications.
 Types of reasoning in AI:
 Deductive
 Inductive
 Abductive
 Analogical
 Common-Sense
 Non-Monotonic Reasoning
 Probabilistic
 Fuzzy Logic
 Forward and Backward Reasoning
REASONING in AI
69
70
71

Neural network Artificial intelligence ppt

  • 1.
    NEURAL NETWORKS & ARTIFICIALINTELLIGENCE BAI-205 UNIT III Prof. Ravi Prakash Shahi 8979048096 ravishahi71@gmail.com
  • 2.
  • 3.
     Propositional Logicis a fundamental concept in Artificial Intelligence (AI), used to represent and reason about facts and relationships in a formal, logical way.  It deals with propositions (statements that are either true or false) and the logical connections between them.  In AI, propositional logic is useful for knowledge representation, automated reasoning, and building intelligent systems. Propositional Logic
  • 4.
  • 6.
  • 9.
  • 10.
    Rules of Inferencein Propositional Logic
  • 15.
    Convert the followingsentence into predicate logic: "All humans are mortal, and some humans are philosophers."
  • 16.
    Prove the followingargument using predicate logic: "If everyone who reads is smart, and John reads, then John is smart."
  • 18.
    Show that thefollowing argument is valid in predicate logic: "If there is a student who loves every book, then every book is loved by some student."
  • 20.
    Prove using predicatelogic: "If all cats are mammals and some animals are cats, then some animals are mammals."
  • 22.
    Using predicate logic,show that the following statement is valid: "If no student likes failure, and Tom is a student, then Tom does not like failure."
  • 24.
    Rule-based systems inAI • A rule-based system in AI is a system that applies predefined rules to a set of inputs to make decisions, draw inferences, or take actions. • These systems are typically used in domains where knowledge can be codified as "if-then" statements, allowing the system to make deductions or recommendations based on specific conditions. • Rule-based systems form the base of many AI applications, like expert systems and decision support systems, using deterministic rules that can effectively guide decision-making. • Example : MYCIN expert system, developed in the 1970s at Stanford University. MYCIN was designed to diagnose bacterial infections and recommend antibiotic treatments based on symptoms and laboratory test results. It used a set of rules to emulate the decision-making process of infectious disease experts.
  • 25.
    Components of Rule-basedsystems 1. Knowledge Base (KB) – contains a set of rules or facts that represent domain-specific knowledge. Rules are often structured as if-then statements. – Example: In a medical expert system, a rule might be: IF a patient has a high fever and a sore throat, THEN diagnose a throat infection 2. Inference Engine (IE) – The IE applies logical reasoning to the KB to deduce new information. It processes the rules in the KB by evaluating current data or facts and then applying applicable rules. – Common reasoning methods include: Forward Chaining and Backward Chaining. – Forward Chaining: Starts with known facts and applies rules to derive new conclusions. – Backward Chaining: Starts with a goal or hypothesis and works backward to find supporting evidence. 3. Working Memory (Buffer) – a temporary storage area where the system holds facts that are actively being evaluated or modified. 4. User Interface (UI) – The UI allows human operators to input data, review the reasoning process, and receive results or recommendations from the system.
  • 26.
    Algorithm(Working) of Rule-basedsystems  The process in a rule-based system typically follows these steps: 1. Input Facts: Facts or data are inputted into the system, either from sensors, databases, or user inputs. 2. Evaluate Rules: The inference engine scans through the rules to identify which rules can be applied based on the input data. 3. Apply Rules: The system applies relevant rules to generate conclusions, decisions, or new facts. 4. Repeat Process: This process may repeat, as the newly generated conclusions can be used to trigger other rules until no more rules can be applied or a final conclusion is reached. 5. Output: The system presents the final conclusions or recommendations as output.
  • 27.
    Example – MedicalDiagnosis System  Consider a rule-based system for assisting doctors in diagnosing flu. 1. Knowledge Base  Rule 1: IF the patient has a fever AND sore throat, THEN the patient might have a viral infection.  Rule 2: IF the patient has a cough AND body aches, THEN the patient might have the flu.  Rule 3: IF the patient has a fever AND has recently travelled to an area with high flu cases, THEN suggest a flu test. 2. Inference Engine:  When a patient’s symptoms (facts) are inputted, the inference engine checks which rules apply to these symptoms.  If a patient presents with a fever, sore throat, and recent travel to a high-flu area, Rules 1 and 3 are triggered. 3. Output:  Based on the rule evaluation, the system might output a recommendation: “Suggest flu test due to recent travel and flu symptoms.
  • 28.
    Types of Reasoningin Rule-Based Systems 1. Forward Chaining – Begins with known facts and applies rules sequentially to derive new facts. – Example: A smart home system that turns on lights based on a motion sensor detecting movement. 2. Backward Chaining – Starts with a goal or hypothesis and works backward to check if supporting facts are available to confirm the goal. – Example: In a diagnostic system, if the goal is to confirm “flu diagnosis,” the system checks if symptoms like fever and cough are present
  • 29.
     Clear andUnderstandable: Rules are straightforward, making it easy to understand and follow the system’s decision-making.  Ease of Modification: New rules can be added, or old rules modified, without major changes to the system structure.  Domain Expertise: Rule-based systems can capture and utilize domain-specific knowledge, allowing them to perform tasks like an expert in a field (e.g., medical diagnosis, financial advising). Advantages of Rule-Based Systems
  • 30.
     Limited Flexibility:Rule-based systems can only make decisions based on predefined rules, so they lack adaptability to novel situations.  Scalability Issues: As the number of rules grows, managing and maintaining the system becomes complex, potentially slowing down performance.  Lack of Learning: Rule-based systems don’t learn from new data. They must be manually updated with new rules as knowledge evolves. Disadvantages of Rule-Based Systems
  • 31.
    Knowledge Representation inAI • Knowledge Representation in AI refers to the way in which AI systems store, organize, and utilize knowledge to solve complex problems. It is a crucial aspect of AI, enabling machines to mimic human understanding and reasoning. • Knowledge representation involves the creation of data structures and models that can efficiently capture information about the world, making it accessible and usable by AI algorithms for decision-making, inference, and learning. Relationship between Knowledge and Intelligence • Knowledge as a Foundation: Knowledge provides the necessary information, facts, and skills that intelligence uses to solve problems and make decisions. • Intelligence as Application: Intelligence is the ability to learn, reason, and adapt, using knowledge to perform tasks and solve complex problems. • Interdependence: Knowledge without intelligence is static, while intelligence without knowledge lacks the raw material to function effectively. • Synergy: Effective AI systems require a balance of both knowledge (the "what") and intelligence (the "how") to operate successfully.
  • 32.
    Types of Knowledgein AI 1. Declarative Knowledge • Declarative knowledge refers to facts and information that describe the world, answering the "what" type of questions. • Example: Knowing that Paris is the capital of France. • This knowledge is often stored in databases or knowledge bases and expressed in logical statements, forming the foundation for more complex reasoning and problem-solving in AI systems. 2. Procedural Knowledge • Procedural knowledge is the knowledge of how to perform tasks or processes, answering the "how" type of questions. • Example: Steps to solve a mathematical problem or the procedure to start a car. • This knowledge is embedded in algorithms or control structures, enabling AI systems to execute tasks, perform actions, and solve problems step-by-step. 3. Meta-Knowledge • Meta-knowledge is knowledge about knowledge, understanding which types of knowledge to apply in different situations. • Example: Knowing when to use a specific algorithm based on the problem at hand. • Crucial for systems that need to adapt or optimize their performance, meta-knowledge helps in selecting the most appropriate strategy or knowledge base for a given problem.
  • 33.
    Types of Knowledgein AI 4. Heuristic Knowledge •Heuristic knowledge includes rules of thumb, educated guesses, and intuitive judgments derived from experience. •Example: Using an educated guess to approximate a solution when time is limited. •Often used in problem-solving and decision-making processes where exact solutions are not feasible, helping AI systems to arrive at good-enough solutions quickly. 5. Structural Knowledge •Structural knowledge refers to the understanding of how different pieces of knowledge are organized and related to each other. •Example: Understanding the hierarchy of concepts in a taxonomy or the relationships between different entities in a semantic network. •This knowledge is essential for organizing information within AI systems, allowing for efficient retrieval, reasoning, and inferencing based on the relationships and structures defined.
  • 34.
    FORWARD AND BACKWARDCHAINING • Forward Chaining and Backward Chaining are the two most important strategies in the field of Artificial Intelligence and lie in the Expert System Domain of AI. • The inference engine is the component of the intelligent system in AI, which applies logical rules to the knowledge base to infer new information from known facts. • Inference engine commonly proceeds in two modes, which are: a. Forward Chaining b. Backward Chaining • Forward chaining is also known as a forward deduction or forward reasoning method when using an inference engine. Forward chaining is a form of reasoning which start with atomic sentences in the knowledge base and applies inference rules (Modus Ponens) in the forward direction to extract more data until a goal is reached. • Backward-chaining is also known as a backward deduction or backward reasoning method when using an inference engine. A backward chaining algorithm is a form of reasoning, which starts with the goal and works backward, chaining through rules to find known facts that support the goal.
  • 35.
  • 36.
  • 37.
    Properties of ForwardChaining 1. It is a down-up(bottom-up) approach, as it moves from bottom to top. 2. It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state. 3. Forward-chaining approach is also called as data-driven as we reach to the goal using available data. 4. Forward -chaining approach is commonly used in the expert system, such as CLIPS, business, and production rule systems. • Example: • "As per the law, it is a crime for an American to sell weapons to hostile nations. Country A, an enemy of America, has some missiles, and all the missiles were sold to it by Robert, who is an American citizen." • Prove that "Robert is criminal." • To solve the above problem, first, we will convert all the above facts into first- order definite clauses, and then we will use a forward-chaining algorithm to reach the goal.
  • 38.
  • 39.
    Properties of BackwardChaining  Backward-chaining is also known as a backward deduction or backward reasoning method when using an inference engine. A backward chaining algorithm is a form of reasoning, which starts with the goal and works backward, chaining through rules to find known facts that support the goal. 1. It is known as a top-down approach. 2. Backward-chaining is based on modus ponens inference rule. 3. In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true. 4. It is called a goal-driven approach, as a list of goals decides which rules are selected and used. 5. Backward -chaining algorithm is used in game theory, automated theorem proving tools, inference engines, proof assistants, and various AI applications. 6. The backward-chaining method mostly used a depth-first search strategy for proof.
  • 40.
    Forward vs. BackwardChaining 1. Forward chaining, start from the known facts and move forward by applying inference rules to extract more data, and it continues until it reaches to the goal, whereas backward chaining starts from the goal, move backward by using inference rules to determine the facts that satisfy the goal. 2. Forward chaining is called a data-driven inference technique, whereas backward chaining is called a goal-driven inference technique.. 3. Forward chaining is known as the down-up approach, whereas backward chaining is known as a top-down approach. 4. Forward chaining uses breadth-first search strategy, whereas backward chaining uses depth-first search strategy. 5. Forward and backward chaining both applies Modus ponens inference rule. 6. Forward chaining can be used for tasks such as planning, design process monitoring, diagnosis, and classification, whereas backward chaining can be used for classification and diagnosis tasks. 7. Forward chaining can be like an exhaustive search, whereas backward chaining tries to avoid the unnecessary path of reasoning. 8. In forward-chaining there can be various ASK questions from the knowledge base, whereas in backward chaining there can be fewer ASK questions. 9. Forward chaining is slow as it checks for all the rules, whereas backward chaining is fast as it checks few required rules only.
  • 41.
    S.N Forward ChainingBackward chaining 1 Starts from known facts and applies inference rule to extract more data unit it reaches to the goal. Starts from the goal and works backward through inference rules to find the required facts that support the goal. 2 It is a bottom-up approach It is a top-down approach 3 known as data-driven inference technique as we reach to the goal using the available data. known as goal-driven technique as we start from the goal and divide into sub-goal to extract the facts. 4 applies a breadth-first search strategy applies a depth-first search strategy 5 Forward chaining tests for all the available rules Backward chaining only tests for few required rules. 6 is suitable for the planning, monitoring, control, and interpretation application. is suitable for the planning, monitoring, control, and interpretation application. 7 Forward chaining can generate an infinite number of possible conclusions. generates a finite number of possible conclusions. 8 Forward chaining is aimed for any conclusion. Backward chaining is only aimed for the required data. 9 May become slow with large rule sets Can be complex to manage with large rule sets 10 Can be memory intensive due to storing intermediate facts Typically requires less memory 11 Suitable for dynamic environments with continuously arriving data Suitable for diagnostic systems and interactive applications 12 Simple to implement More complex to implement due to recursive nature
  • 42.
    DEDUCTIVE REASONING • Deductivereasoning is deducing new information from logically related known information. It is the form of valid reasoning, which means the argument's conclusion must be true when the premises are true. • Uses available facts, information or knowledge to deduce a valid conclusion, whereas inductive reasoning involves making a generalization from specific facts, and observations. • Deductive Reasoning is the strategic approach that uses available facts, information or knowledge to draw valid conclusions. It basically beliefs in the facts and ideas before drawing any result. • Deductive reasoning uses a top-down approach. In deductive reasoning, the arguments can be valid or invalid based on the value of the premises. If the value of the premises is true, then the conclusion is also true. • Deductive reasoning helps in scanning the generalized statement into a valid conclusion. Some of the examples are • Deductive arguments can be valid or invalid, which means if premises are true, the conclusion must be true, whereas inductive argument can be strong or weak, which means conclusion may be false even if premises are true.
  • 43.
    Inductive Reasoning • Inductivereasoning is a form of reasoning to arrive at a conclusion using limited sets of facts by the process of generalization. It starts with the series of specific facts or data and reaches to a general statement or conclusion. • Inductive reasoning is a type of propositional logic, which is also known as cause- effect reasoning or bottom-up reasoning. • In inductive reasoning, we use historical data or various premises to generate a generic rule, for which premises support the conclusion. • In inductive reasoning, premises provide probable supports to the conclusion, so the truth of premises does not guarantee the truth of the conclusion. • Example: • Premise: All of the pigeons we have seen in the zoo are white. • Conclusion: Therefore, we can expect all the pigeons to be white.
  • 44.
    COMPARISON • The maindifference between inductive and deductive reasoning is that inductive reasoning aims at developing a theory while deductive reasoning aims at testing an existing theory. • In other words, inductive reasoning moves from specific observations to broad generalizations. Deductive reasoning works the other way around. • When there is little to no existing literature on a topic, it is common to perform inductive research, because there is no theory to test. The inductive approach consists of three stages: 1. Observation 2. Seeking patterns 3. Developing a theory or general CONCLUSION. • Inductive reasoning is a type of propositional logic, which is also known as cause-effect reasoning or bottom-up reasoning. • LIMITATION OF IR - A conclusion drawn on the basis of an inductive method can never be fully proven. However, it can be invalidated. • When conducting deductive research, you always start with a theory. This is usually the result of inductive research. Reasoning deductively means testing these theories. Remember that if there is no theory yet, you cannot conduct deductive research. • LIMITATION OF DR - The conclusions of deductive reasoning can only be true if all the premises set in the inductive study are true and the terms are clear.
  • 45.
    Abductive Reasoning • Abductivereasoning is a form of logical reasoning which starts with single or multiple observations then seeks to find the most likely explanation or conclusion for the observation. • Abductive reasoning is an extension of deductive reasoning, but in abductive reasoning, the premises do not guarantee the conclusion. • Implication: Cricket ground is wet if it is raining • Axiom: Cricket ground is wet. • Conclusion It is raining.
  • 46.
    Common Sense Reasoning •Common sense reasoning is an informal form of reasoning, which can be gained through experiences. • Common Sense reasoning simulates the human ability to make presumptions about events which occurs on every day. • It relies on good judgment rather than exact logic and operates on heuristic knowledge and heuristic rules. • Example: 1. One person can be at one place at a time. 2. If I put my hand in a fire, then it will burn. • The above two statements are the examples of common sense reasoning which a human mind can easily understand and assume.
  • 47.
    Monotonic Reasoning • Inmonotonic reasoning, once the conclusion is taken, then it will remain the same even if we add some other information to existing information in our knowledge base. In monotonic reasoning, adding knowledge does not decrease the set of prepositions that can be derived. • To solve monotonic problems, we can derive the valid conclusion from the available facts only, and it will not be affected by new facts. • Monotonic reasoning is not useful for the real-time systems, as in real time, facts get changed, so we cannot use monotonic reasoning. • Monotonic reasoning is used in conventional reasoning systems, and a logic- based system is monotonic. • Any theorem proving is an example of monotonic reasoning. • Example: • Earth revolves around the Sun. • It is a true fact, and it cannot be changed even if we add another sentence in knowledge base like, "The moon revolves around the earth" Or "Earth is not round," etc
  • 48.
    Non-Monotonic Reasoning  InNon-monotonic reasoning, some conclusions may be invalidated if we add some more information to our knowledge base.  Logic will be said as non-monotonic if some conclusions can be invalidated by adding more knowledge into our knowledge base.  Non-monotonic reasoning deals with incomplete and uncertain models.  "Human perceptions for various things in daily life, "is a general example of non-monotonic reasoning. Example: Let suppose the knowledge base contains the following knowledge: S1 : Birds can fly S2 : Penguins cannot fly S3 : Pitty is a bird However, if we add one another sentence into knowledge base “S4 : Pitty is a penguin", which concludes "Pitty cannot fly", so it invalidates the above conclusion.
  • 49.
    ADV1 : Forreal-world systems such as Robot navigation, we can use non-monotonic reasoning. ADV2 : In Non-monotonic reasoning, we can choose probabilistic facts or can make assumptions. DISADVANTAGE : In non-monotonic reasoning, the old facts may be invalidated by adding new sentences.
  • 51.
    REGRESSION • Regression isa supervised machine learning technique which is used to predict continuous values. • The ultimate goal of the regression algorithm is to plot a best-fit line or a curve between the data. • The three main metrics that are used for evaluating the trained regression model are variance, bias and error. If the variance is high, it leads to overfitting and when the bias is high, it leads to underfitting. • Based on the number of input features and output labels, regression is classified as linear (one input and one output), multiple (many inputs and one output) and multivariate (many outputs). • Linear regression allows us to plot a linear equation, i.e., a straight line. We need to tune the coefficient and bias of the linear equation over the training data for accurate predictions. • The tuning of coefficient and bias is achieved through gradient descent or a cost function — least squares method. • Polynomial regression is used when the data is non-linear. In this, the model is more flexible as it plots a curve between the data. The degree of the polynomial needs to vary such that overfitting doesn’t occur.
  • 52.
    Regression (2) • Regressionanalysis is a statistical method to model the relationship between a dependent (target) and independent (predictor) variables with one or more independent variables. More specifically, Regression analysis helps us to understand how the value of the dependent variable is changing corresponding to an independent variable when other independent variables are held fixed. It predicts continuous/real values such as temperature, age, salary, price, etc.
  • 53.
    We can understandthe concept of regression analysis using the below example: Example: Suppose there is a marketing company A, who does various advertisement every year and get sales on that. The below list shows the advertisement made by the company in the last 5 years and the corresponding sales Now, the company wants to do the advertisement of $200 in the year 2019 and wants to know the prediction about the sales for this year. So to solve such type of prediction problems in machine learning, we need regression analysis.
  • 54.
    Regression (3) • Regressionis a supervised learning technique which helps in finding the correlation between variables and enables us to predict the continuous output variable based on the one or more predictor variables. It is mainly used for prediction, forecasting, time series modeling, and determining the causal- effect relationship between variables. • In Regression, we plot a graph between the variables which best fits the given datapoints, using this plot, the machine learning model can make predictions about the data. In simple words, "Regression shows a line or curve that passes through all the datapoints on target-predictor graph in such a way that the vertical distance between the datapoints and the regression line is minimum." The distance between datapoints and line tells whether a model has captured a strong relationship or not. • Some examples of regression can be as: • Prediction of rain using temperature and other factors • Determining Market trends • Prediction of road accidents due to rash driving.
  • 55.
    Classification • Classification isa supervised machine learning method where the model tries to predict the correct label of a given input data. In classification, the model is fully trained using the training data, and then it is evaluated on test data before being used to perform prediction on new unseen data. • In Classification, a program learns from the given dataset or observations and then classifies new observation into a number of classes or groups. Such as, Yes or No, 0 or 1, Spam or Not Spam, cat or dog, etc. Classes can be called as targets/labels or categories. • Unlike regression, the output variable of Classification is a category, not a value, such as "Green or Blue", "fruit or animal", etc. Since the Classification algorithm is a Supervised learning technique, hence it takes labeled input data, which means it contains input with the corresponding output. • The best example of an ML classification algorithm is Email Spam Detector. • The main goal of the Classification algorithm is to identify the category of a given dataset, and these algorithms are mainly used to predict the output for the categorical data. • Classification algorithms can be better understood using the below diagram. In the below diagram, there are two classes, class A and Class B. These classes have features that are similar to each other and dissimilar to other classes.
  • 56.
    Classification (2) • Thereare two types of learners in machine learning classification: lazy and eager learners. • Eager learners are machine learning algorithms that first build a model from the training dataset before making any prediction on future datasets. They spend more time during the training process because of their eagerness to have a better generalization during the training from learning the weights, but they require less time to make predictions. • Most machine learning algorithms are eager learners, and below are some examples: • Logistic Regression. • Support Vector Machine. • Decision Trees. • Artificial Neural Networks. • Lazy learners or instance-based learners, on the other hand, do not create any model immediately from the training data, and this is where the lazy aspect comes from. They just memorize the training data, and each time there is a need to make a prediction, they search for the nearest neighbor from the whole training data, which makes them very slow during prediction. Some examples of this kind are: • K-Nearest Neighbor. • Case-based reasoning.
  • 62.
    1. Expert Systems:Rule-based systems are widely used in expert systems for tasks like medical diagnosis, legal advice, and troubleshooting technical issues. 2. Decision Support Systems: They are applied in decision support systems in industries like finance and insurance to provide recommendations based on historical data. 3. Control Systems: Used in automated industrial processes, such as quality control and environmental monitoring, where specific actions are taken based on sensor readings. 4. Personal Assistants: Basic AI chatbots use rule-based systems to respond to user queries with pre-defined answers. Applications of Rule-Based Systems
  • 63.
     In AI,reasoning is the process of deriving conclusions or making decisions based on available knowledge. There are various types of reasoning used in AI, each with its specific approach and applications.  Types of reasoning in AI: 1. Deductive Reasoning 2. Inductive Reasoning 3. Abductive Reasoning 4. Analogical Reasoning 5. Common-Sense Reasoning 6. Non-Monotonic Reasoning 7. Probabilistic Reasoning 8. Fuzzy Logic Reasoning 9. Forward Reasoning 10.Backward Reasoning REASONING in AI
  • 64.
     It isa technique that begins with known facts or data and applies inference rules to derive new conclusions or outcomes. It is a data- driven approach, meaning that reasoning starts with available information (facts) and then moves forward through inference rules to reach a conclusion.  This reasoning technique is often used in rule-based systems or expert systems, where a system applies rules to input data to draw conclusions, typically in a step-by-step manner. Forward Reasoning (Chaining) in AI
  • 65.
     Data-driven: Startswith the available data or facts.  Sequential: Inferences are made step-by-step by applying rules to data.  Goal discovery: Forward reasoning may eventually lead to discovering a goal or conclusion but does not start with the goal.  Suitable for dynamic environments: Useful when facts are frequently changing, and you need to infer conclusions based on new inputs. Characteristics of Forward Chaining
  • 66.
    1. Start withFacts: The system begins with a set of facts or known information. 2. Apply Rules: The system checks which rules can be applied to the given facts. 3. Generate New Facts: Once a rule is applied, it generates new information (inferred facts). 4. Repeat: This process repeats by applying additional rules to the new facts until no more rules can be applied or the desired conclusion is reached. Steps in Forward Reasoning(Chaining)
  • 67.
     A medicaldiagnosis system uses forward reasoning. The system starts with symptoms as facts, applies rules based on those symptoms, and eventually diagnoses a disease.  Facts:  The patient has a cough.  The patient has a fever.  The patient is experiencing difficulty breathing.  Rules: 1. Rule 1: IF a patient has a cough AND fever, THEN the patient might have a respiratory infection. 2. Rule 2: IF a patient has a respiratory infection AND difficulty breathing, THEN the patient might have pneumonia. 3. Rule 3: IF a patient has pneumonia, THEN suggest a chest X-ray.  Process: 1. The system starts with the facts: cough, fever, and difficulty breathing. 2. It applies Rule 1: Since the patient has a cough and fever, the system infers that the patient might have a respiratory infection. 3. The system applies Rule 2: Since the patient has a respiratory infection and difficulty breathing, the system infers that the patient might have pneumonia. 4. The system applies Rule 3: Since the patient might have pneumonia, it suggests getting a chest X-ray.  Conclusion:  Based on the given facts and the applied rules, the system concludes that the patient should get a chest X-ray to confirm pneumonia. Example of Forward Reasoning
  • 68.
     In AI,reasoning is the process of deriving conclusions or making decisions based on available knowledge. There are various types of reasoning used in AI, each with its specific approach and applications.  Types of reasoning in AI:  Deductive  Inductive  Abductive  Analogical  Common-Sense  Non-Monotonic Reasoning  Probabilistic  Fuzzy Logic  Forward and Backward Reasoning REASONING in AI
  • 69.
  • 70.
  • 71.