Unit 1 - KSK
Unit 1 - KSK
01/30/2025 1
Introduction to AI
According to Rich and Knight,
“AI is the study of how to make computers do things which at the
moment, people do better”
01/30/2025 2
Introduction to AI
Horizon of AI includes,
Knowledge Transmission
Knowledge Representation
Automated Reasoning
01/30/2025 3
Wha i AI
t s?
Stuart J.01/30/2025
Russell, Peter Norwig , Artificial Intelligence –A Modern approach 42
01/30/2025 5
01/30/2025 6
01/30/2025 7
01/30/2025 8
The Turing Test
• 1950 – Alan Turing devised
a test for intelligence called
the Imitation Game
• Ask questions of two
entities, receive answers
from both
• If you can’t tell which of the Questions
entities is human and which Answers Answers
is a computer program, then
you are fooled and we
should therefore consider
the computer to be
intelligent
Which is the person?
01/30/2025 Which is the computer? 9
Problems with Symbolic AI
Approaches
• Scalability
• It can take dozens or more than-years to create a useful
systems
• It is often the case that systems perform well up to a certain
threshold of knowledge (approx. 10,000 rules), after which
performance (accuracy and efficiency) degrade
• Brittleness
• Most symbolic AI systems are programmed to solve a specific
problem, move away from that domain area and the system’s
accuracy drops rapidly rather than achieving a graceful
degradation
• this is often attributed to lack of common sense, but in truth, it is a
lack of any knowledge outside of the domain area
• No or little capacity to learn, so performance (accuracy) is
static
• Lack of real-time performance
01/30/2025 10
Problems with Connectionist AI
Approaches
• No “memory” or sense of temporality
• The first problem can be solved to some extent
• The second problem arises because of a fixed sized input but
leads to poor performance in areas like speech recognition
• Learning is problematic
• Learning times can greatly vary
• Overtraining leads to a system that only performs well on the
training set and undertraining leads to a system that has not
generalized
• No explicit knowledge-base
• So there is no way to tell what a system truly knows or how it
knows something
• No capacity to explain its output
• Explanation is often useful in an AI system so that the user can
trust the system’s answer
01/30/2025 11
So What Does AI Do?
• Most AI research has fallen into one of two categories
• Select a specific problem to solve
• study the problem (perhaps how humans solve it)
• come up with the proper representation for any knowledge needed to
solve the problem
• acquire and codify that knowledge
• build a problem solving system
• Select a category of problem or cognitive activity (e.g.,
learning, natural language understanding)
• theorize a way to solve the given problem
• build systems based on the model behind your theory as experiments
• modify as needed
• Both approaches require
• one or more representational forms for the knowledge
• some way to select proper knowledge, that is, search
01/30/2025 12
Areas of AI and Some
Dependencies
Knowledge
Search Logic Representation
Machine
Planning
Learning
Expert
NLP Vision Robotics Systems
01/30/2025 13
What is Artificial
Intelligence ?
• making computers that think?
• the automation of activities we associate with human thinking,
like decision making, learning ... ?
• the art of creating machines that perform functions that
require intelligence when performed by people ?
• the study of mental faculties through the use of computational
models ?
01/30/2025 14
What is Artificial
Intelligence ?
• the study of computations that make it possible to
perceive, reason and act ?
• a field of study that seeks to explain and emulate
intelligent behaviour in terms of computational processes ?
• a branch of computer science that is concerned with the
automation of intelligent behaviour ?
• anything in Computing Science that we don't yet know how
to do properly ? (!)
01/30/2025 15
ARTIFICIAL INTELLIGENCE
EXAMPLES
• Manufacturing robots
• Self-driving cars
• Smart assistants
• Healthcare management
• Automated financial investing
• Virtual travel booking agent
• Social media monitoring
• Marketing chatbots
What is Artificial
Intelligence ?
HUMAN RATIONAL
01/30/2025 17
Systems that act like humans:
Turing Test
• “The art of creating machines that perform
functions that require intelligence when
performed by people.” (Kurzweil)
• “The study of how to make computers do things at
which, at the moment, people are better.” (Rich
and Knight)
01/30/2025 18
Systems that act like humans
?
• You enter a room which has a computer terminal.
You have a fixed period of time to type what you
want into the terminal, and study the replies. At
the other end of the line is either a human being
or a computer system.
• If it is a computer system, and at the end of the
period you cannot reliably determine whether it is
a system or a human, then the system is deemed
01/30/2025
to be intelligent. 19
Systems that act like humans
01/30/2025 20
Systems that act like humans
• These cognitive tasks include:
• Natural language processing
• for communication with human
• Knowledge representation
• to store information effectively & efficiently
• Automated reasoning
• to retrieve & answer questions using the stored information
• Machine learning
• to adapt to new circumstances
01/30/2025 21
The total Turing Test
• Includes two more issues:
• Computer vision
• to perceive objects (seeing)
• Robotics
• to move objects (acting)
01/30/2025 22
What is Artificial
Intelligence ?
HUMAN RATIONAL
01/30/2025 23
Systems that think like humans:
cognitive modeling
• Humans as observed from ‘inside’
• How do we know how humans think?
• Introspection vs. psychological experiments
• Cognitive Science
• “The exciting new effort to make computers think
… machines with minds in the full and literal
sense” (Haugeland)
• “[The automation of] activities that we associate
with human thinking, activities such as decision-
making, problem solving, learning …” (Bellman)
01/30/2025 24
What is Artificial
Intelligence ?
HUMAN RATIONAL
01/30/2025 25
Systems that think ‘rationally’
"laws of thought"
• Humans are not always ‘rational’
• Rational - defined in terms of logic?
• Logic can’t express everything (e.g. uncertainty)
• Logical approach is often not feasible in terms of
computation time (needs ‘guidance’)
• “The study of mental facilities through the use of
computational models” (Charniak and McDermott)
• “The study of the computations that make it
possible to perceive, reason, and act” (Winston)
01/30/2025 26
What is Artificial
Intelligence ?
HUMAN RATIONAL
01/30/2025 27
Systems that act rationally:
“Rational agent”
01/30/2025 28
Systems that act rationally
• Logic only part of a rational agent, not all of rationality
• Sometimes logic cannot reason a correct conclusion
• At that time, some specific (in domain) human knowledge or information is
used
• Thus, it covers more generally different situations of problems
• Compensate the incorrectly reasoned conclusion
01/30/2025 29
Systems that act rationally
• Study AI as rational agent –
2 advantages:
• It is more general than using logic only
• Because: LOGIC + Domain knowledge
• It allows extension of the approach with more scientific methodologies
01/30/2025 30
Rational agents
An agent is an entity that perceives and acts
01/30/2025 32
From the above two definitions, we can see that AI has two major
roles:
• Study the intelligent part concerned with humans.
• Represent those actions using computers.
01/30/2025 33
Goals of AI
• To make computers more useful by letting them take over dangerous
or tedious tasks from human
• Understand principles of human intelligence
01/30/2025 34
The Foundation of AI
• Philosophy
• At that time, the study of human intelligence began with no formal expression
• Initiate the idea of mind as a machine and its internal operations
01/30/2025 35
The Foundation of AI
Mathematics formalizes the three main area of AI: computation,
logic, and probability
Computation leads to analysis of the problems that can be computed
complexity theory
Probability contributes the “degree of belief” to handle uncertainty in AI
Decision theory combines probability theory and utility theory (bias)
01/30/2025 36
The Foundation of AI
• Psychology
• How do humans think and act?
• The study of human reasoning and acting
• Provides reasoning models for AI
• Strengthen the ideas
• humans and other animals can be considered as information processing machines
01/30/2025 37
The Foundation of AI
• Computer Engineering
• How to build an efficient computer?
• Provides the artifact that makes AI application possible
• The power of computer makes computation of large and difficult problems
more easily
• AI has also contributed its own work to computer science, including: time-
sharing, the linked list data type, OOP, etc.
01/30/2025 38
The Foundation of AI
• Control theory and Cybernetics
• How can artifacts operate under their own control?
• The artifacts adjust their actions
• To do better for the environment over time
• Based on an objective function and feedback from the environment
• Not limited only to linear systems but also other problems
• as language, vision, and planning, etc.
01/30/2025 39
The Foundation of AI
• Linguistics
• For understanding natural languages
• different approaches has been adopted from the linguistic work
• Formal languages
• Syntactic and semantic analysis
• Knowledge representation
01/30/2025 40
The main topics in AI
Artificial intelligence can be considered under a number of
headings:
• Search (includes Game Playing).
• Representing Knowledge and Reasoning with it.
• Planning.
• Learning.
• Natural language processing.
• Expert Systems.
• Interacting with the Environment
(e.g. Vision, Speech recognition, Robotics)
We won’t have time in this course to consider all of these.
01/30/2025 41
AI – History and Foundations
AI entered mainstream before 60 years
In 1940 Zuse developed artificial chess playing using high level
language called Plankalkul.
01/30/2025 42
AI – History and Foundations
Alan Turing, British mathematician and WWII code-breaker, is widely
credited as being one of the first people to come up with the idea of
machines that think in 1950.
He even created the Turing test, which is still used today, as a
benchmark to determine a machine’s ability to “think” like a human.
Though his ideas were ridiculed at the time, they set the wheels in
motion, and the term “artificial intelligence” entered popular
awareness in the mid- 1950s, after Turing died.
01/30/2025 43
AI – History and Foundations
Isaac Asimov, was an American writer and professor of biochemistry at Boston
University.
The Three Laws of Robotics. The rules were introduced in his 1950 short story
"Runaround" and "I,Robot“
First Law
A robot may not injure a human being or, through inaction, allow a human being to come to harm.
Second Law
A robot must obey the orders given it by human beings except where such orders would conflict
with the First Law.
Third Law
A robot must protect its own existence as long as such protection does not conflict with the First
or Second Law.
01/30/2025 44
AI – History and Foundations
1951 – First AI based program was written
a checkers-playing program written by Christopher Strachey and a chess-
playing program written by Dietrich Prinz.
1955 – First self learning game playing
competing against human players in the game of Checkers
1959 – MIT – AI based lab setup
1961 – First Robot is introduced into GM’s assembly line
01/30/2025 45
AI – History and Foundations
1964 – First demo of AI program which understand natural language
1965 – First chat bot Eliza was invented
1974 – First Autonomous vehicle is created
1989 – Carnegie Mellon created the first autonomous vehicle using
neural networks
ALVINN, which stands for Autonomous Land Vehicle In a Neural Network
01/30/2025 46
AI – History and Foundations
1996 – IBM’s deep blue – chess playing game
Deep Blue won its first game against world champion Garry Kasparov in game
one of a six-game match on 10 February 1996.
1999 – Sony introduces AIBO – self learning entertaining robot
01/30/2025 47
AI – History and Foundations
1999 – MIT AI lab – first emotional AI is demonstrated
01/30/2025 49
AI – History and Foundations
AI was started long back
Big data
Computing Power
01/30/2025 50
Birth of AI
Initially, AI dealt with simple reasoning and reaction problems. It
requires only very less knowledge base
01/30/2025 51
Examples
Building intelligent systems,
Water tap
When tank gets filled, switch off
Washing machines
Stops water after reaching particular level
Fuzzy logic takes necessary amount of water only
Traffic control
Automatically, dynamically adjust signal timing, info to nearby signals, etc…
01/30/2025 52
Examples
So, the basics of AI,
01/30/2025 53
Advantages of Artificial Intelligence
• more powerful and more useful computers
• new and improved interfaces
• solving new problems
• better handling of information
• relieves information overload
• conversion of information into knowledge
01/30/2025 54
12
Th Disadvanta
e ges
• increased costs
• difficulty with software development - slow and expensive
• few experienced programmers
• few practical products have reached the market as yet.
01/30/2025 55
13
AI Techniques
01/30/2025 56
Data Acquisition and Learning
Aspects in AI
Knowledge discovery
Data Mining
Machine learning
Computational learning theory
Study and analyse of algorithms
Lot of mathematical models
Neural and Evolutionary computation
Neural: mimics the neural behaviour of human beings
Evolutionary: Biological behaviours
Intelligent agents and multi-agent systems
Agent: a software which is flexible and supports users
01/30/2025 57
Problem solving
• Given situation -> Desired situation
01/30/2025 58
Types of problem solving
• Knowledge based • Search based
• Memory based
• Rule based
01/30/2025 59
Search based method – state
space
State Space
01/30/2025 60
Search based method – state
space
State Space
01/30/2025 61
Search based method – state
space
State Space
01/30/2025 62
Search based method – state
space
State Space
01/30/2025 63
Search based method – state
space
State Space
D
Move
S
01/30/2025 64
Search based method – state
space
• Movegen(S) – find all possible neighbours
D
Move
S
01/30/2025 65
PROBLEM SOLVING
Problem solving – area of finding answers for unknown situation
Understanding
Representation
Formulation
Solving
Types,
Simple – Can be solved using deterministic approach
Complex – Lack of full information
Humans?
Able to perceive, learn, use statistical methods, mathematical modelling to
solve
AI do the same for the machine
01/30/2025 66
PROBLEM SOLVING PROCESS
Problem? – desired objective is not obvious
Problem solving?
process of generating solution for given situation
Sequence of well defined methods that can handle doubts, inconsistency,
uncertainty and ambiguity
01/30/2025 67
Vacuum Cleaner
–
problem solving
01/30/2025 68
Introduction
• well-known search problem for an agent which works on Artificial
Intelligence
01/30/2025 69
Understanding
• Two rooms and one vacuum cleaner
01/30/2025 70
Representation
• Two rooms
01/30/2025 71
Representation
• Two rooms – with dirt
DIRT DIRT
01/30/2025 72
Representation
• Two rooms – with dirt
VC DIRT DIRT
• State representation
01/30/2025 73
8 possible states
1 – Dirt – both rooms – Vacuum cleaner – Left room
VC DIRT DIRT
DIRT VC DIRT
01/30/2025 74
8 possible states
3 – Dirt - right room – Vacuum cleaner – Left room
VC DIRT
VC DIRT
01/30/2025 75
8 possible states
5 – Dirt – left room – Vacuum cleaner – Left room
VC DIRT
DIRT VC
01/30/2025 76
8 possible states
7 – No Dirt – both rooms – Vacuum cleaner – Left room
VC
VC
01/30/2025 77
Formulation
• Possible action
• Move Left
• Move Right
• Clean Dirt
01/30/2025 78
01/30/2025 79
Solving
01/30/2025 80
Solving
01/30/2025 81
Solving
01/30/2025 82
Solving
01/30/2025 83
Solving
01/30/2025 84
Solving
01/30/2025 85
Solving
01/30/2025 86
Solving
01/30/2025 87
Solving
01/30/2025 88
Solving
01/30/2025 89
Solving
01/30/2025 90
Solving
01/30/2025 91
Solving
01/30/2025 92
Solving
01/30/2025 93
Solving
01/30/2025 94
Solving
01/30/2025 95
Solving
01/30/2025 96
Solving
01/30/2025 97
Solving
01/30/2025 98
Solving
01/30/2025 99
Solving
01/30/2025 100
Solving
01/30/2025 101
Solving
01/30/2025 102
Solving
01/30/2025 103
Problem
• In AI, formally define a problem as
• a space of all possible configurations where each configuration is called a state
• The state-space is the configuration of the possible states and how they connect
to each other e.g. the legal moves between states.
• an initial state
• one or more goal states
• a set of rules/operators which move the problem from one state to the next
• In some cases, we may enumerate all possible states
• but usually, such an enumeration will be overwhelmingly large so we only
generate a portion of the state space, the portion we are currently examining
• we need to search the state-space to find an optimal path from a start state to a
goal state.
01/30/2025 104
17
Parag Kulkarni, Prachi Joshi, Artificial Intelligence –Building Intelliegent Systems
State space: Tic-Tac-
Toe
01/30/2025 107
Problem Types
01/30/2025 108
Problem Types
1. Deterministic or observable(Single-state problems)
• Each state is fully observable and it goes to one
definite state after any action.
• Here , the goal state is reachable in one single action
or sequence of actions.
• Deterministic environments ignore
uncertainty.
• Ex- Vacuum cleaner with sensor.
01/30/2025 109
Problem Types
2. Non-observable(Muliple-state problems) / conformant problems
• Problem – solving agent does not have any information about the
state.
• Solution may or may not be reached.
• Ex- In case of vacuum cleaner , the goal state is to clean the floor rather clean floor. Action is
to suck if there is dirt. So , in non-observable condition , as there is no sensor , it will have to
suck the dirt , irrespective of whether it is towards right or left . Here , the solution space is
the states specifying its movement across the floor.
01/30/2025 110
Problem Types
3. Non-deterministic(partially observable) /
contingency problem
• The effect of action is not clear.
• Percepts provide new information about the
current state.
• Ex- If we take Vacuum cleaner , and now assume that the sensor is
attached to it , then it will suck if there is dirt. Movement of the
cleaner will be based on its current percept.
01/30/2025 111
Problem Types
4. Unknown state space problems
• Typically exploration problems
• States and impact of actions are not known
• Ex- online search that involves acting without compete knowledge
of the next state or scheduling without map.
01/30/2025 112
Problem Solving with AI
“ Formulate , Search , Execute “ design for agent
01/30/2025 114
Characteristics of AI
• AI problems have large number of combination of solution
• Ability to learn
01/30/2025 117
Representation
• State Representation and Initial State
• tuple (x, y) where x represents the amount of water in the 4-gallon jug
and y represents the amount of water in the 3-gallon jug.
01/30/2025 118
Production rules - Formulation
01/30/2025 119
Production rules - Formulation
01/30/2025 120
Production rules - Formulation
01/30/2025 121
Production rules - Formulation
7. Pour water from 3-gal jug (x,y) → (4, y - (4 - x)) to fill 4-gal jug x+y ≥ 4
and y > 0
8. Pour water from 4-gal jug (x,y) → (x - (3-y), 3) to fill 3-gal-jug x+y ≥ 3
and x > 0
01/30/2025 122
Production rules - Formulation
9. Pour all of water from 3-gal jug (x,y) → (x+y, 0) into 4-gal jug 0 < x+y ≤
4 and y ≥ 0
10. Pour all of water from 4-gal jug (x,y) → (0, x+y) into 3-gal jug 0 < x+y
≤ 3 and x ≥0
01/30/2025 123
One solution
Gals in 4-gal jug Gals in 3-gal jug Rule Applied
0 0
1. Fill 4
4 0
8. Pour 4 into 3 to fill
1 3
4. Empty 3
1 0
10. Pour all of 4 into 3
0 1
1. Fill 4
4 1
8. Pour into 3
2 3
01/30/2025 124
Problem types
• single-state problem-Agent knows exactly what each of its actions
does and it can calculate exactly which state it will be in after any
sequence of actions.
• multiple-state problem-when the world is not fully accessible, the
agent must reason about sets of states that it might get to, rather
than single states.
• contingency problem-the agent may be in need to now calculate a
whole tree of actions, rather than a single action sequence in which
each branch of the tree deals with a possible contingency that might
arise.
• exploration problem-the agent learns a "map“ of the environment,
which it can then use to solve subsequent problems.
01/30/2025 125
Problem Characteristics
• To choose the most appropriate method
• Its necessary to analyse the problem
01/30/2025 126
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 127
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 128
Is the problem Decomposable?
• Decomposable problem:
AND logic
01/30/2025 129
Is the problem Decomposable?
• Non - Decomposable problem:
01/30/2025 130
Is the problem Decomposable?
• Non - Decomposable problem:
01/30/2025 131
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 132
Can solution steps to be ignored or
undone?
• Consider following 3 problems
01/30/2025 133
Can solution steps to be ignored or
undone?
• Consider following 3 problems
2: 8 puzzle problem
- Recoverable problem
01/30/2025 134
Can solution steps to be ignored or
undone?
• Consider following 3 problems
3: chess problem
- Irrecoverable problem
01/30/2025 135
Can solution steps to be ignored or
undone?
• Proving a theorem or lemma
• Ignorable
• 8 puzzle problem
• Recoverable
• Chess game
• Irrecoverable
Recovery of the problem plays an important role in determining the complexity
of the control structure
01/30/2025 136
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 137
Is the problem’s universe
predictable?
• 8 puzzle problem – next step is always predictable – normal planning -
certain outcome
01/30/2025 138
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 139
Is the good solution is absolute or
relative?
• Consider this example: Given some facts
1. Deena is a man.
2. Deena is a worker in a company.
3. Deena was born in 1905.
4. All men are mortal.
5. All workers in a factory died when there was an accident in 1952.
6. No mortal lives longer than 100 years.
“Is Deena alive”
01/30/2025 140
Is the good solution is absolute or
relative?
1. Deena is a man.
2. Deena is a worker in a company.
3. Deena was born in 1905.
4. All men are mortal.
5. All workers in a factory died when there was an accident in 1952.
6. No mortal lives longer than 100 years.
“Is Deena alive”
Solution 1:
1. Deena is a man.
Solution 2:
2. Deena was born in 1905.
1. Deena is a worker in the company.
3. All men are mortal.
2. All workers in the company died in
4. Now it is 2020, so Siva’s age is 105 years.
1952.
5. No mortal lives longer than 100 years.
01/30/2025 141
Is the good solution is absolute or
relative?
Consideration 2 : Travelling Salesman problem
01/30/2025 142
Is the good solution is absolute or
relative?
Solution:
01/30/2025 143
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 144
Is the solution a state or a path?
Consideration 1: Inference from the statement
Solution: state
01/30/2025 145
Is the solution a state or a path?
Consideration 2 : Path problem
01/30/2025 146
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 147
What is the role of knowledge?
• Chess playing
– rules for determining legal moves + some simple control
mechanisms
• News paper story
– scan all daily newspapers + how many supports
Modi jee + how many supports Soina jee for upcoming
election
01/30/2025 148
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 149
Does the task require interaction
with a person?
• Solitary:
• Computer is given with a problem description
• no intermediate communication
• no demand for an explanation
• Conversational:
• Intermediate conversations between person to computer
• User need to provide additional information
• Robotics
01/30/2025 150
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
01/30/2025 151
• https://youtu.be/iaAbUhqXmNo
01/30/2025 152
01/30/2025 153
Problem Analysis and
Representation
• Problem definition must satisfy these criteria:
1. Compactness: Solution space should be clearly defined
2. Utility: Compatible with existing systems
3. Soundness: Should not raise false alarm
4. Completeness: Should have all the past details
5. Generality: Able to handle all similar events
6. Transparency: Reasoning should be visible to the user
01/30/2025 154
Performance Measuring
• Various factors needs to be considered in problem solving
• Three outcomes of problem solver
• Finding a solution
• Terminating with failure after search space is exhausted
• Terminating after certain number of iterations
• Reward: if the problem is solved but the amount of time and resource
used needs to be considered
01/30/2025 155
Performance Gain
• Performance gain,
01/30/2025 156
Problem Space and Search
• Problem is represented as state space
• Search is a general algorithm for finding path in state space
• The identified path will either lead to solution or dead end
• Search algorithm makes use of control strategy like forward or backward
search
• forward search(data directed)
• Starts search from initial state towards goal state.
• Ex: locating a city from current location
•backward search(goal directed)
• Search stars from goal state towards a Solvable initial state
• Ex: start from target city
01/30/2025 157
Problem Space and Search
• Strategies to explore the states
• Informed search – No guarantee for solution but high probability of getting solution
-heuristic approach is used to control the flow of solution path
-heuristic approach is a technique based on common sense, rule of
thumb, educated guesses or intuitive judgment
• Uninformed search – generates all possible states in the state space and checks for
the goal state.
- time consuming due to large state space
- used where error in the algorithm has severe consequences
01/30/2025 158
21
Parag Kulkarni, Prachi Joshi, Artificial Intelligence –Building Intelliegent Systems
Informed Search
• Does not guarantee a solution
• But it ensures high probability of arriving at solution
• Heuristic is a problem specific knowledge or guidance used to
constrain the search and lead to the goal
• Heuristic is based on common sense or rule of thumb, educated
guesses or intuitive judgement
• It helps us to choose the right path when multiple path exist for a
problem
01/30/2025 159
Uninformed Search
• Uninformed search is also referred as blind search
• Generates all possible states in state space and checks for goal state
• It will always find a solution if it exists
• But the method is time consuming since search space is huge
• It is used to benchmark results of other algorithms
01/30/2025 160
Problems in design of search
programs
• State representation and identifying relationships between states
• Rule selection
01/30/2025 161
Toy problems
1. 8 puzzle problem
• 3x3 board with eight numbered tiles and a blank space.
• A tile adjacent to the blank space can slide into the space.
• objective-to reach the configuration shown on the right of the figure.
01/30/2025 162
Toy problems
1. 8 puzzle problem – search space
01/30/2025 163
Toy problems
1. 8 puzzle problem
Problem formulation:
• States: a state description specifies the location of each of the eight tiles in one of the nine
squares. For efficiency, it is useful to include the location of the blank.
• Initial state: Numbers are not arranged in clockwise order
• Operators: blank moves left, right, up, or down.
• Goal state: state matches the goal configuration shown in previous Figure
• Path cost: each step costs 1, so the path cost is just the length of the path.
01/30/2025 164
Toy problems
2. Tic-tac-toe problem
• Each player marks a 3*3 grid by 'x' and 'o' in turn.
• The player who puts respective mark in a horizontal, vertical or diagonal line
wins the game
•If both players fail to reach above criteria and all boxes in the grid are filled,
then the game is draw
01/30/2025 165
Toy problems
2. Tic-tac-toe problem
01/30/2025 166
Toy problems
2. Tic-tac-toe problem
Formulating Tic-tac-toe problem
• Initial state – state in previous figure
• States – Next figure with 'x' and 'o' positions constitutes the states in space
• Operators – Adding 'x' or 'o' in cells one by one
• Goal – To reach final/winning position
• Path cost – Each step costs 1 so that path cost is length of path
01/30/2025 167
Toy problems
3. Missionaries and Cannibals
• Three missionaries and cannibals
• Need to move all the six people from one bank of river to the other
• The boat has a capacity of one of two people
01/30/2025 168
Toy problems
3. Missionaries and Cannibals
Formulating the problem in state space search
• States – sequence of 3 numbers representing number of missionaries,
cannibals and boat.
•Goal state - missionaries and cannibals have reached other side of river
(3,3,1)
•Initial state - (3,3,0)
•Operator - Putting missionary and cannibal in boat such that cannibal
does not outnumber missionary and one/two people in boat
• Path cost – number of crossings
01/30/2025 169
Toy problems
4. The 8-queens problem
• Place eight queens on a chessboard such that no queen attacks any other.
• There are two main kinds of formulation
• The incremental formulation involves placing queens one by one
• The complete-state formulation starts with all 8 queens on the board and moves them around.
•Goal test: 8 queens on board, none attacked
01/30/2025 170
Toy problems
4. The 8-queens problem
Formulating the problem in state space search
Consider the following for incremental formulation:
• States: Any arrangement of 0 to 8 queens on board.
• Initial state: No queens in the board
• Goal state: Queens in each column without targeting
other queens
• Operators: add a queen to any square.
• Path cost: Number of moves
01/30/2025 171
Toy problems
5. Vacuum cleaner problem
Assume that the agent knows its location and the locations of all the pieces of dirt,
and the suction is still in good working order.
• States: It is based on Vacuum cleaner location and dirt location
• Initial state: Any state can be assumed as initial state
• Operators: move left, move right, suck.
• Goal state: no dirt left in any square.
• Path cost: each action costs 1.
01/30/2025 172
Toy problems
5. Vacuum cleaner problem
01/30/2025 173
Real-world problems
• Route finding:
• Defined in terms of locations and transitions along links between
them
• Applications: routing in computer networks, automated travel
advisory systems, airline travel planning systems
01/30/2025 174
Real-world problems
• Touring and traveling salesperson problems:
• “Visit every city on the map at least once and end in Bucharest”
• Needs information about the visited cities
• Goal: Find the shortest tour that visits all cities
• NP-hard, but a lot of effort has been spent on improving the capabilities of
TSP algorithms
01/30/2025 175
Real-world problems
• VLSI layout:
• Place cells on a chip so they don’t overlap and there is room for connecting
wires to be placed between the cells
• Robot navigation:
• Generalization of the route finding problem
• No discrete set of routes
• Robot can move in a continuous space
• Infinite set of possible actions and states
01/30/2025 176
Real-world problems
• Assembly sequencing:
• Automatic assembly of complex objects
• The problem is to find an order in which to assemble the parts of some object
01/30/2025 177