0% found this document useful (0 votes)
12 views64 pages

AI Unit-1

Uploaded by

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

AI Unit-1

Uploaded by

dhupativarshini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Unit-1

Introduction To AI Problems
Presented By:
Sindhu. Patchigolla
Assistant Professor©
Content
• Introduction to AI problems
– AI Techniques
– Criteria for Success
• Problems
• Problem Space and Search
– Defining the problem as state space search
– Production as a System
– Problem Characteristics
– Production system characteristics
Introduction to AI problems
• A problem is a situation, condition, or issue that
presents a challenge or difficulty that requires a
solution.
• Following categories of Tasks are considered as AI
problems.
1. Mundane tasks - Perception (Vision and Speech), Natural language
(Understanding, Generation, Translation, Common sense reasoning, Robot
control)

2. Formal tasks - Games (Chess, etc.), Mathematics (Geometry, Logic,


Integral calculus, etc.)

3. Expert tasks - Engineering (Design, Fault finding, Manufacturing


planning), Scientific analysis, Medical diagnosis, Financial analysis
Contd…

Ordinary Problems
1.Perception
➢ Vision
➢ Voice Recognition
➢ Speech Recognition
2.Natural Language
➢ Understanding
➢ Generation
➢ Translation
3.Robot Control
Contd…
Formal Problems
➢ Game Playing
➢ Solving complex mathematical Problem
Expert Problems
➢ Design
➢ Fault Finding
➢ Scientific Analysis
➢ Medical Diagnosis
➢ Financial Analysis
AI Technique
There are three important AI techniques:
• Search
– Provides a way of solving problems for which no direct
approach is available.
– It also provides a framework into which any direct techniques
that are available can be embedded.
• Use of knowledge
– Provides a way of solving complex problems by exploiting the
structure of the objects that are involved.
• Abstraction
– Provides a way of separating important features and variations
from many unimportant ones that would otherwise overwhelm
any process.
Criteria for Success
• One of the most important questions to answer
in any scientific or engineering research
project is "How will we know if we have
succeeded?". So how in Al we have to ask
ourselves, how will we know if we have
constructed a machine that is intelligent? The
question is hard as unanswerable question
"What is Intelligence?"
Contd…
• To measure the progress we use proposed method known as
Turing Test. Alan Turing suggested this method to
determine whether the machine can think. To conduct this
test, we need two people and the machine to be evaluated.
One person act as interrogator, who is in a separate room
from the computer and the other person. The interrogator
can ask questions of either the person or computer by typing
questions and received typed responses. However the
interrogator knows them only as A and B and aims to
determine which is the person and which is the machine.
The goal of the machine is to fool the interrogator into
believing that it is the person. If the machine succeeds at
this, then we will conclude that the machine can think.
Problems
• A problem can be defined by five components:
– initial state
– actions
– transition model
– goal test
– path cost.
• INITIAL STATE: The initial state that the agent starts in.
• ACTIONS:
– A description of the possible actions available to the agent.
– Given a particular state s, ACTIONS(s) returns the set of actions that can be
executed in s.
– Each of these actions is applicable in s.
Contd…
TRANSITION MODEL: A description of what each action
does is known as the transition model
• A function RESULT(s,a) that returns the state that results from
doing action a in state s.
• The term successor to refer to any state reachable from a
given state by a single
• The state space of the problem is the set of all states
reachable from the initial state by any sequence of actions.
• The state space forms a graph in which the nodes are states
and the links between nodes are actions.
• A path in the state space is a sequence of states connected by
a sequence of actions.
Contd…
• GOAL TEST: The goal test determines whether a given state is a
goal state.
• PATH COST:
– A path cost function that assigns a numeric cost to each path.
– The problem-solving agent chooses a cost function that reflects its own
performance measure.
– The cost of a path can be described as the sum of the costs of the
individual actions along the path.
– The step cost of taking action a in state s to reach state s′ is denoted by
c(s, a, s′).
• A SOLUTION to a problem is an action sequence that leads from
the initial state to a goal state.
• Solution quality is measured by the path cost function, and an
OPTIMAL SOLUTION has the lowest path cost among all
solutions.
Steps Used to solve AI Problems
• Define the problem in detail is known as a Problem Space
• To solve different types of AI problems, there are different
types of AI techniques. These techniques use following
steps
1. Define the problem : This definition must include precise
specifications of what the initial situation(s) will be as well as
what final situations constitute. By defining it properly, one
can convert it into the real workable states.
2. Analyze the problem: Identify the techniques to be used to
solve the given problem. A few important features can have
different techniques for solving the problem
Contd…
3. Isolate and represent the task knowledge that is
necessary to solve the problem
4. Choose the best problem solving technique and apply
on particular problem
Defining the problem as state
space search
• A set of all possible states for a given problem is known as
state space of the problem.
• Representation of states is highly beneficial in AI because
they provide all possible states, operations and the goals.
• If the entire sets of possible states are given, it is possible
to trace the path from the initial state to the goal state and
identify the sequence of operators necessary for doing it.
• Representation allows for a formal definition of a problem
using a set of permissible operations as the need to convert
some given situation into some desired situation.
Contd…
• We are free to define the process of solving a
particular problem as a combination of known
techniques, each of which are represented as a
rule defining a single step in the space, and
search, the general technique of exploring the
space to try to find some path from the current
state to a goal state.
Steps in State Space Search
State Space Representation
• State space Representation involves defining an INITIAL
STATE and a GOAL STATE and then determining a sequence
of actions, called states, to follow.
• State: A state can be an Initial State, a Goal State, or any other
possible state that can be generated by applying rules between
them.
• Space: In an AI problem, space refers to the exhaustive
collection of all conceivable states.
• Search: This technique moves from the beginning state to the
desired state by applying good rules while traversing the space
of all possible states.
• Search Tree:
To visualize the search issue, a search tree is used, which is a tree-like
structure that represents the problem. The initial state is represented by
the root node of the search tree, which is the starting point of the tree.
• Transition Model:
This describes what each action does, while Path Cost assigns a cost
value to each path, an activity sequence that connects the beginning
node to the end node. The optimal option has the lowest cost among all
alternatives.
Tiger, Goat and Grass Problem

• A Farmer has a tiger, a goat and a bundle of grass. He is standing


at one side of the river with a very week boat which can hold
only one of his belongings at a time. His goal is to take all three
of his belongings to the other side. The constraint is that the
farmer cannot leave either goat and tiger, or goat and grass, at
any side of the river unattended because one of them will eat the
other”
• Formalize the above problem in terms of state space search. You should
i. Suggest a suitable representation for the problem
ii. State the initial state and final state
iii. List the actions for getting from one state to another state

Contd…
Solution:
• Let F represent Farmer, T represent Tiger, G represent Goat, Gr
represent Grass, A and B represent sides of the river respectively
• Initial State: Side A(T, G, Gr) Side B( )
• Goal State: Side A() Side B(T,G,Gr)
• One possible solution is
1. The F takes G from Side A to side B of the river
Side A(T, Gr) Side B(G)
2. The F crosses the river from side B to side A
Side A(T, Gr) Side B(G)
3. The F takes Gr from Side A to Side B of the river
Side A(T) Side B(G, Gr)
Contd…
4. The F takes G from Side B to Side A of the river
Side A(T, G) Side B(Gr)
5. The F takes T from Side A to Side B of the river
Side A(G) Side B(Gr, T)
6. The F crosses the river from Side B to Side A
Side A(G) Side B(Gr, T)
7. The F takes G from Side A to Side B of the river
Side A( ) Side B(Gr, T, G)
Tower of Hanoi Problem

Problem Statement:
• The Tower of Hanoi is a mathematical game
or puzzle . It consist of three rods and a no. Of
disks of different sizes, which can slide onto
any rod. The puzzle start with the disks in a
stack in ascending order of size on one rod, the
smallest at the top , thus making a conical
shape.
Contd…
• The objectives of the puzzle is to move the
entire stack into another rod, using following
simple constraint.
1.Only one disk can be moved at a time.
2.Each move consist of taking the upper disk from
one of the stacks and placing it on top of another
stack or on an empty rod.
3.No larger disk may be placed on top of a smaller
disk. The minimal no of moves required to solve
these problem
Contd…
Contd…
• 1.Disk 1 moved from R1 to R3
• 2. Disk 2 moved from R1 to R2
• 3. Disk 1 moved from R3 to R2
• 4. Disk 3 moved from R1 to R3
• 5. Disk 1 moved from R2 to R1
• 6. Disk 2 moved from R2 to R3
• 7.Disk 1 moved from R1 to R3
Contd…
• The state is represented as a tuple , (rod no, Sequence of disks)
->{(R1,1,2,3),(R2,Nil),(R3,Nil}Initial State
->{(R1,2,3),(R2,NIL)(R3,1)}
->{(R1,3),(R2,2),(R3,1)}
->{(R1,3),(R2,1,2),(R3,NIL)}
->{(R1,NIL),(R2,1,2),(R3,3)}
->{(R1,1),(R2,NIL),(R3,2,3)}
->{(R1,NIL),(R2,NIL),(R3,1,2,3)} Goal State
• Total No of moves are 6.
8 Puzzle Problem
Contd…
Contd…
Water Jug Problem
Production System
• A production system in AI is a framework that assists in developing
computer programs to automate a wide range of tasks.
• It significantly impacts the creation of AI-based systems like computer
software, mobile applications, and manufacturing tools.
• By establishing rules, a production system empowers machines to
demonstrate particular behaviors and adapt to their surroundings.
• In Artificial Intelligence, a production system serves as a cognitive
architecture.
• It encompasses rules representing declarative knowledge, allowing
machines to make decisions and act based on different conditions.
• Many expert systems and automation methodologies rely on the
rules defined in production systems to guide their behavior.
• A production system’s architecture consists of rules
structured as left-hand side (LHS) and right-hand side
(RHS) equations.
• The LHS specifies the condition to be evaluated, while
the RHS determines the output or action resulting from
the estimated condition.
• This rule-based approach forms the foundation of
production systems in AI, enabling machines to process
information and respond accordingly.
• The representation of knowledge in AI comprises various
components used for making intelligent machines.
Components of a Production System in AI
• For making an AI-based intelligent system that performs specific
tasks, we need an architecture.
• The architecture of a production system in Artificial Intelligence
consists of production rules, a database, and the control system.
Global Database
• A global database consists of the architecture used as a central
data structure.
• A database contains all the necessary data and information
required for the successful completion of a task.
• It can be divided into two parts as permanent and temporary.
• The permanent part of the database consists of fixed actions,
whereas the temporary part alters according to circumstances.
Production Rules
• Production rules in AI are the set of rules that operate on the
data fetched from the global database. Also, these production
rules are bound with precondition and post condition that gets
checked by the database.
• If a condition is passed through a production rule and gets
satisfied by the global database, then the rule is successfully
applied.
• The rules are of the form A®B, where the right-hand side
represents an outcome corresponding to the problem state
represented by the left-hand side.
Control System
• The control system checks the applicability of a rule.
• It helps decide which rule should be applied and
terminates the process when the system gives the
correct output.
• It also resolves the conflict of multiple conditions
arriving at the same time.
• The strategy of the control system specifies the
sequence of rules that compares the condition from
the global database to reach the correct result.
Characteristics of a Production System

• There are mainly four characteristics of the production system in AI


that is simplicity, modifiability, modularity, and knowledge-
intensive.
Simplicity
• The production rule in AI is in the form of an ‘IF-THEN’ statement. Every
rule in the production system has a unique structure.
• It helps represent knowledge and reasoning in the simplest way possible to
solve real-world problems. Also, it helps improve the readability and
understanding of the production rules.
Modularity
• The modularity of a production rule helps in its incremental improvement
as the production rule can be in discrete parts.
• The production rule is made from a collection of information and facts that
may not have dependencies unless there is a rule connecting them together.
• The addition or deletion of single information will not have a major effect
on the output.
• Modularity helps enhance the performance of the production system by
adjusting the parameters of the rules.
Modifiability
• The feature of modifiability helps alter the rules as per requirements.
• Initially, the skeletal form of the production system is created. We
then gather the requirements and make changes in the raw structure
of the production system. This helps in the iterative improvement of
the production system.
Knowledge-intensive
• Production systems contain knowledge in the form of a human
spoken language, i.e., English.
• It is not built using any programming languages.
• The knowledge is represented in plain English sentences. Production
rules help make productive conclusions from these sentences.
Disadvantages of a Production System

Opacity
• Communication between the rule interpreter and the production
rules creates difficulty for the understanding of the control system
and its strategies. This condition arises due to the impact of the
combined operation of the control program. There exist difficulties
in understanding the hierarchy of operations.
Inefficiency
• There are various rules that we employ for solving a problem. The
rules can be effective in different ways. There are conditions where
multiple rules get activated during execution. All the individual rules
apply exhaustive searches in each cycle that reduces the efficiency
of the production system.
Inability to Learn
• A simple production system based on certain rules is not capable of learning
through experience, unlike advanced AI systems. They are simply bound to
specific rules for actions. We can understand the rules and break them.
Conflict Resolution
• To satisfy a condition, various production rules are employed. The condition
may arise when there is a triggering of more than one rule. In that condition,
the control system has to determine the best possible rule from the set of
conflicting rules. This may reduce the efficiency of the production system.
Classes of a Production System
• There are four types of production systems that help in categorizing
methodologies for solving different varieties of problems. Let us
have a look at each one of them.
Monotonic Production System
• In this type of a production system, the rules can be applied
simultaneously as the use of one rule does not prevent the
involvement of another rule that is selected at the same time.
Partially Commutative Production System
• This class helps create a production system that can give the results
even by interchanging the states of rules. If using a set of rules
transforms State A into State B, then multiple combinations of those
rules will be capable to convert State A into State B.
Non-monotonic Production System
• This type of a production system increases efficiency in solving
problems. The implementation of these systems does not require
backtracking to correct the previous incorrect moves. The non-
monotonic production systems are necessary from the
implementation point of view to find an efficient solution.
Commutative System
• Commutative systems are helpful where the order of an operation is
not important. Also, problems where the changes are reversible use
commutative systems. On the other hand, partially commutative
production systems help in working on problems, where the changes
are irreversible such as a chemical process. When dealing with
partially commutative systems, the order of processes is important to
get the correct results.
Problem Characteristics
The Essence of AI Challenges
• AI problems are unique beasts. They often involve a level of
complexity and unpredictability that's not commonly found in
traditional programming. Understanding these characteristics is
key to developing effective AI solutions.
Complexity
• AI problems are typically more complex than standard
computational tasks. This complexity arises from the vast data
sets AI systems must process and the intricate algorithms they
employ.
Uncertainty
• Unlike traditional algorithms, AI often deals with uncertain and
incomplete information. This uncertainty requires AI systems to
make predictions and decisions based on probabilistic reasoning.
Adaptability
• AI systems must adapt to new data and evolving environments. This
dynamic nature challenges programmers to create flexible
algorithms that can learn and adjust over time.
Goal-oriented Design
• AI algorithms are designed to achieve specific goals. These goals
can range from simple tasks like sorting data to more complex
objectives like facial recognition or language translation.
Problem Characteristics Steps
• Navigating the complexity of AI problems requires a systematic
approach. Here's a step-by-step guide to understanding and solving
these challenges:
Defining the Problem
• The first step is to clearly define the problem. What exactly are you
trying to solve? This might involve processing large datasets,
recognizing patterns, or making predictions. A well-defined problem
is easier to tackle.
Data Collection & Preparation
• AI thrives on data. Collect relevant data and prepare it for analysis.
This involves cleaning the data, handling missing values, and
possibly transforming the data into a format suitable for AI
algorithms.
Choosing the Right Algorithm
• Different problems require different AI approaches. For example, neural networks
might be great for image recognition, while decision trees could be better for
classification tasks. Selecting the appropriate algorithm is crucial.
Training the Model
• This involves feeding the algorithm data and allowing it to learn from it. The
training process is iterative and requires constant adjustment and fine-tuning.
Evaluation & Optimization
• After training, evaluate the model's performance. Use metrics like accuracy,
precision, and recall to gauge how well your AI is performing. Based on these
evaluations, optimize the model for better performance.
Deployment & Monitoring
• Once optimized, the AI solution is deployed into a real-world environment.
Continuous monitoring is essential to ensure it adapts to new data and conditions.
• Since artificial intelligence (AI) is mainly related to the search
process, it is important to have some methodology to choose the
best possible solution.
• To choose an appropriate method for a particular problem first we
need to categorize the problem based on the following
characteristics.
– Is the problem decomposable into small sub-problems which are easy
to solve?
– Can solution steps be ignored or undone?
– Is the universe of the problem is predictable?
– Is a good solution to the problem is absolute or relative?
– Is the solution to the problem a state or a path?
– What is the role of knowledge in solving a problem using artificial
intelligence?
– Does the task of solving a problem require human interaction?
1. Is the problem decomposable into small sub-problems which are easy to
solve?
• Can the problem be broken down into smaller problems to be solved
independently?
• The decomposable problem can be solved easily.
• Example: In this case, the problem is divided into smaller problems. The
smaller problems are solved independently. Finally, the result is merged to get
the final result.
2. Can solution steps be ignored or undone?
• In the Theorem Proving problem, a lemma that has been proved can be ignored for
the next steps. Such problems are called Ignorable problems.
• In the 8-Puzzle, Moves can be undone and backtracked. Such problems are
called Recoverable problems.
• In Playing Chess, moves can be retracted. Such problems are
called Irrecoverable problems.
• Ignorable problems can be solved using a simple control structure that
never backtracks.
• Recoverable problems can be solved using backtracking.
• Irrecoverable problems can be solved by recoverable style methods
via planning.
3. Is the universe of the problem is predictable?
• In Playing Bridge, We cannot know exactly where all the cards are or
what the other players will do on their turns.
• Uncertain outcome!
• For certain-outcome problems, planning can be used to generate a
sequence of operators that is guaranteed to lead to a solution.
• For uncertain-outcome problems, a sequence of generated operators
can only have a good probability of leading to a solution. Plan revision
is made as the plan is carried out and the necessary feedback is
provided.
4. Is a good solution to the problem is absolute or relative?
• The Travelling Salesman Problem, we have to try all paths to find
the shortest one.
• Any path problem can be solved using heuristics that suggest good
paths to explore.
• For best-path problems, a much more exhaustive search will be
performed.
5. Is the solution to the problem a state or a path
• The Water Jug Problem, the path that leads to the goal must be
reported.
• A path-solution problem can be reformulated as a state-solution
problem by describing a state as a partial path to a solution. The
question is whether that is natural or not.
6. What is the role of knowledge in solving a problem using artificial intelligence?
Playing Chess
• Consider again the problem of playing chess. Suppose you had unlimited
computing power available. How much knowledge would be required by a perfect
program? The answer to this question is very little—just the rules for determining
legal moves and some simple control mechanism that implements an appropriate
search procedure.
Additional knowledge about such things as good strategy and tactics could of
course help considerably to constrain the search and speed up the execution of the
program. Knowledge is important only to constrain the search for a solution.
Reading Newspaper
• Now consider the problem of scanning daily newspapers to decide which are
supporting the Democrats and which are supporting the Republicans in some
upcoming election. Again assuming unlimited computing power, how much
knowledge would be required by a computer trying to solve this problem? This
time the answer is a great deal.
It would have to know such things as:
• The names of the candidates in each party.
• The fact that if the major thing you want to see done is have taxes
lowered, you are probably supporting the Republicans.
• The fact that if the major thing you want to see done is improved
education for minority students, you are probably supporting the
Democrats.
• The fact that if you are opposed to big government, you are probably
supporting the Republicans.
• And so on …
7. Does the task of solving a problem require human interaction?
• Sometimes it is useful to program computers to solve problems in
ways that the majority of people would not be able to understand.
• This is fine if the level of the interaction between the computer and
its human users is problem-in solution-out.
• But increasingly we are building programs that require intermediate
interaction with people, both to provide additional input to the
program and to provide additional reassurance to the user.
• The solitary problem, in which there is no intermediate
communication and no demand for an explanation of the reasoning
process.
• The conversational problem, in which intermediate communication
is to provide either additional assistance to the computer or
additional information to the user.
Tasks
1.Water Jug Problem of 8,5 and 3 Ltr Jug
• The following is a problem which can be solved by using state space
search technique. “we have 3 jugs of capacities 3,5, and 8 liters
respectively. There is no scale on the jugs. So it is only their
capacities that we certainly know. Initially the 8 liter jug is full of
water, the other two are empty. We can pour water from one jug to
another, and the goal is to have exactly 4 liters of water in any of the
jug. There is no scale on the jug and we do not have any other tools
that would help. The amount of water in the other two jugs at the
end is irrelevant.
Formalize the above problem as state space search . You should
• 1. Suggest suitable representation of the problem
• 2. State the initial and goal state of this problem
• 3. Specify the production rules for getting from one state to another
2. Missionaries and Cannibals Problem
• Statement: Three missionaries and three cannibals find
themselves on one side of a river. They have would like to
get to the other side, such that the number of missionaries
on either side of the river should never less than the number
of cannibals who are on the same side. The only boat
available can holds only two at a time. How can everyone
cross the river without the missionaries risking being eaten?
• Formalize the above problem in terms of state space search.
You should
i. Suggest a suitable representation for the problem
ii. State the initial state and final state
iii. List the actions for getting from one state to another state
Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy