0% found this document useful (0 votes)
10 views155 pages

18csc305j Ai Unit1

The document provides an overview of Artificial Intelligence (AI), covering its definitions, techniques, and applications. It discusses the differences between human intelligence and AI, the role of rational agents, and various problem-solving methods within AI, including constraint satisfaction problems. Additionally, it outlines the foundational disciplines of AI, such as mathematics, psychology, and computer engineering, while highlighting both the advantages and disadvantages of AI technologies.

Uploaded by

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

18csc305j Ai Unit1

The document provides an overview of Artificial Intelligence (AI), covering its definitions, techniques, and applications. It discusses the differences between human intelligence and AI, the role of rational agents, and various problem-solving methods within AI, including constraint satisfaction problems. Additionally, it outlines the foundational disciplines of AI, such as mathematics, psychology, and computer engineering, while highlighting both the advantages and disadvantages of AI technologies.

Uploaded by

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

18CSC305J

ARTIFICIAL INTELLIGENCE
UNIT – 1

CLR1 : Provide a broad understanding of the basic techniques for building intelligent computer systems and an understanding of
how AI is applied to problems.

CLO1 : Formulate a problem and build intelligent agents


Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
What is Artificial Intelligence?

• A.I. is the study of how to make computers do


things at which, at the moment, people are better.
Intelligence vs Artificial Intelligence

• Intelligence is a property/ability attributed to people, such as to know, to think, to


talk, to learn, to understand.

Intelligence = Knowledge + ability to perceive, feel, comprehend,process,


communicate, judge, learn.

• Artificial Intelligence is an interdisciplinary field aiming at developing techniques


and tools for solving problems that people are good at.
Intelligence
Definitions of AI

Existing definitions advocate everything from replicating human intelligence to simply


solving knowledge-intensive tasks. Examples:

• “Artificial Intelligence is the design, study and construction of computer programs


that behave intelligently.” --Tom Dean.
• “Artificial Intelligence is the enterprise of constructing a physical symbol system that
can reliably pass the Turing test.” --Matt Ginsberg.
What is Artificial Intelligence ?

THOUGHT Systems that thinkSystems that think


like humans rationally

Systems that act Systems that act


BEHAVIOUR like humans rationally

HUMAN RATIONAL
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)
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 to be intelligent.
Systems that act like humans

• The Turing Test approach


– a human questioner cannot tell if
• there is a computer or a human answering his
question, via teletype (remote communication)
– The computer must behave intelligently
• Intelligent behavior
– to achieve human-level performance in all
cognitive tasks
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
The total Turing Test

• Includes two more issues:


– Computer vision
• to perceive objects (seeing)
– Robotics
• to move objects (acting)
What is Artificial Intelligence ?

THOUGHT Systems that thinkSystems that think


like humans rationally

Systems that act Systems that act


BEHAVIOUR like humans rationally

HUMAN RATIONAL
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)
What is Artificial Intelligence ?

THOUGHT Systems that thinkSystems that think


like humans rationally

Systems that act Systems that act


BEHAVIOUR like humans rationally

HUMAN RATIONAL
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)
What is Artificial Intelligence ?

THOUGHT Systems that thinkSystems that think


like humans rationally

Systems that act Systems that act


BEHAVIOUR like humans rationally

HUMAN RATIONAL
Systems that act rationally:
“Rational agent”
• Rational behavior: doing the right thing
• The right thing: that which is expected to
maximize goal achievement, given the
available information
• Giving answers to questions is ‘acting’.
• I don't care whether a system:
– replicates human thought processes
– makes the same decisions as humans
– uses purely logical reasoning
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
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
Rational agents

An agent is an entity that perceives and acts

This course is about designing rational agents

Abstractly, an agent is a function from percept histories to actions:



[f: P*  A]

For any given class of environments and tasks, we seek the


agent (or class of agents) with the best performance

Caveat: computational limitations make perfect rationality


unachievable
 design best program for given machine resources

• Artificial
– Produced by human art or effort, rather than
originating naturally.
• Intelligence
• is the ability to acquire knowledge and use it"
[Pigford and Baur]
• So AI was defined as:
– AI is the study of ideas that enable computers
to be intelligent.
– AI is the part of computer science concerned
with design of computer systems that exhibit
human intelligence(From the Concise Oxford
Dictionary)
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.
Goals of AI

• To make computers more useful by letting


them take over dangerous or tedious tasks
from human
• Understand principles of human intelligence
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
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)
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
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.
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.
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
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)
Some 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
The Disadvantages

– increased costs
– difficulty with software development - slow and
expensive
– few experienced programmers
– few practical products have reached the market
as yet.
AI – Social Companion
AI in Movies
AI Applications
AI Defined

● Textbook definition:

– AI may be defined as the branch of computer science that


is concerned with the automation of intelligent behavior
Applied Areas of AI

• Heuristic Search
• Computer Vision
• Adversarial Search (Games)
• Fuzzy Logic
• Natural Language Processing
• Knowledge Representation
• Planning
• Learning
Examples

• Playing chess • Recognizing speech


• Driving on the highway • Diagnosing diseases
• Mowing the lawn • Translating languages
• Answering questions • Data mining
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
AI Techniques

• AI technique is a method that achieves knowledge. The main AI techniques are:


– Search
– Use of knowledge
– Abstraction
1. Search:-
• Search provides a way of solving problems for which no more direct approach is available
as well as a framework into which any direct techniques that are available can be
embedded. A search program finds a solutions for a problem by trying various sequences
of actions or operators until a solution is found.
Advantages
• It is the best way so far as no better way has been found to solve the problems.
• To solve a problem using search, it is only necessary to code the operator that can be used;
the search will find the sequence of actions that will provide the desired results.
Disadvantages
• Most problems have search spaces so large that it is impossible to search for the whole
space.
AI Techniques

2. Use of knowledge:-
• The use of knowledge provides a way of solving complicated problems by manipulating the structures
of the objects that are concerned.
• The way in which knowledge can be represented for usage in AI techniques:
AI technique is a method that achieves knowledge that should be represented in such a way that:-
• Knowledge captures generalization. This meaning grouping situations that share important properties
rather than representing each situation separately with such an arrangement of knowledge, an
unreasonable amount of memory, and updating will no longer be required. Anything without this
property is called data rather than knowledge.
• It should be represented in such a way that it can be understood by the people who must prepare it. For
many programs, the size of the data can be achieved automatically by taking a reading from a number of
instruments, but in many AI areas, most of the knowledge a program has must be provided by people in
terms that they understand it.
• It could easily be adjusted to correct errors end to demonstrate changes in the world.
• It can be used to overcome its own through volume by helping to restrict the range of possibilities that
must usually be considered or discussed.
• It could be used in different situations even though it may not entirely be complete.
3. Abstraction:-
• Abstraction finds a way of separating important features and notifications from the unimportant ones
that would otherwise confuse any process.
AI Techniques
AI technique is a method that exploits knowledge that should be represented in
such a way that:
1. The knowledge captures generalizations
2. It can be understood by people who must
provide it.
3. It can easily be modified to correct errors
4. It can be used in a great many situations even if
it is not totally accurate or complete
5. It can be used to help overcome its own sheer
bulk by helping to narrow the range of
possibilities that must usually be considered.
AI Techniques

• An AI technique is a method that exploits knowledge that is represented so that:


 The knowledge captures generalizations that share properties, are grouped
together, rather than being allowed separate representation.
•  It can be understood by people who must provide it—even though for many
programs bulk of the data comes automatically from readings.
•  In many AI domains, how the people understand the same people must supply
the knowledge to a program.  It can be easily modified to correct errors and
reflect changes in real conditions.  It can be widely used even if it is incomplete
or inaccurate.  It can be used to help overcome its own sheer bulk by helping to
narrow the range of possibilities that must be usually considered. In order to
characterize an AI technique let us consider initially OXO or tic-tac-toe and use a
series of different approaches to play the game. The programs increase in
complexity, their use of generalizations, the clarity of their knowledge and the
extensibility of their approach. In this way they move towards being
representations of AI techniques.
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Problem Solving with AI
Problem Solving In AI : Introduction

• Problem Solving in games such as “Sudoku” can be an example. It can be done by building
an artificially intelligent system to solve that particular problem. To do this, one needs to
define the problem statements first and then generating the solution by keeping the
conditions in mind.
• Some of the most popularly used problem solving with the help of artificial intelligence
are:
– Chess.
– Travelling Salesman Problem.
– Tower of Hanoi Problem.
– Water-Jug Problem.
– N-Queen Problem.
• Problem Searching
• In general, searching refers to as finding information one needs.
• Searching is the most commonly used technique of problem solving in artificial
intelligence.
• The searching algorithm helps us to search for solution of particular problem.
Problem Solving In AI : Introduction

Problem
• Problems are the issues which comes
across any system. A solution is
needed to solve that particular
problem.
• Steps : Solve Problem Using Artificial
Intelligence
• The process of solving a problem
consists of five steps. These are:
Problem Solving In AI : Introduction

• Defining The Problem: The definition of the problem must be included


precisely. It should contain the possible initial as well as final situations
which should result in acceptable solution.
• Analyzing The Problem: Analyzing the problem and its requirement
must be done as few features can have immense impact on the
resulting solution.
• Identification Of Solutions: This phase generates reasonable amount of
solutions to the given problem in a particular range.
• Choosing a Solution: From all the identified solutions, the best solution
is chosen basis on the results produced by respective solutions.
• Implementation: After choosing the best solution, its implementation is
done.
Broad Categorisation of AI problems

 Structed Problem
 Well structed – Yield a right answer
 Ill structed – Do not yield a particular answer
 Unstructed Problem
 Very hard to formulate the problem
 Ambiguous in nature
 Linear Problem
 Have clear solution
 All kind of classification problems
 Non linear Problem
 Relationships between input and output is non linear
 Further decision can’t be taken like in linear problem

50
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Types of agents
• Problem solving with AI
• Other aspects of agents
• AI Models, Data acquisition and
learning aspects in AI • Constraint satisfaction
• Problem solving- Problem solving problems(CSP)
process, Formulating problems • Crypto arithmetic puzzles

• Problem types and characteristics • CSP as a search problem-


• Problem space and search
constrains and representation
• CSP-Backtracking, Role of
• Intelligent agent
heuristic
• Rationality and Rational agent with
performance measures
• CSP-Forward checking and
• Flexibility and Intelligent agents constraint propagation
• Task environment and its properties • CSP-Intelligent backtracking
AI Models

• One important aspect of building AI solutions


is modelling the problem.
(i) Dunker introduced ‘Maze Hypothesis’.
(ii) logic theory machines.

52
AI Models

iii) Advent of NLP & man-machine dialogue.


iv) Formal models proposed to solve AI
problems.
V) Human behaviour & psychological study-
based inductive dynamic models for creative
problem solving slowly became popular.

53
AI Models

• Semiotic Models
- Based on Sign processes / signification and communication.
- Code is specific which gives meaning to each sign based on the sound or letters
that human use to form words or movements.

• Statistical Models
- Refers to representation and formulation of relationships through statistical
techniques.
- Statistical model employs probabilistic approaches and is typically a collection of
probability density function and distribution functions.

54
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Data acquisition and learning aspects in AI

Various AI –related topics on data acquisition and machine learning

• Knowledge discovery – Data mining and machine learning


• Computational learning theory (COLT)
• Neural and evolutionary computation
• Intelligent agents and multi-agent systems
• Multi-perspective integrated intelligence
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Problem – Solving Process
Problem Solving with AI
“ Formulate , Search , Execute “ design for agent

A simple problem-solving agent. It first formulates a goal and a problem,


searches for a sequence of actions that would solve the problem, and then executes the actions
one at a time. When this is complete, it formulates another goal and starts over.
Problem Solving with AI
Components of a problem – Example
A simplified road map of part of Romania.
Problem Solving with AI
Components of a problem
A problem can be defined formally by five components:

• The initial state that the agent starts in /Starting state which agent knows
itself.
• Ex- The initial state for our agent in Romania might be described as In(Arad)

• A description of the possible actions/operators available to the agent. Given a


particular state s, ACTIONS(s) returns the set of actions that can be executed in s.
We say that each of these actions is applicable in s.
• Ex- from the state In(Arad), the applicable actions are {Go(Sibiu), Go(Timisoara),
Go(Zerind)}.
• A description of what each action does; the formal name for this is the transition
model, specified by a function RESULT(s, a) that returns the state that results from
doing action a in state s. We also use the term successor to refer to any state
reachable from a given state by a single action.
• Ex- RESULT(In(Arad),Go(Zerind)) = In(Zerind)
Problem Solving with AI
Components of a problem

• Together, the initial state, actions, and transition model implicitly


define the state space of the problem—the set of all states
reachable from the initial state by any sequence of actions. The state
space forms a directed network or 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.
• Ex- The map of Romania shown can be interpreted as a state-space graph if we view each
road as standing for two driving actions, one in each direction.
• The goal test, which determines whether a given state is a goal
state. Sometimes there is an explicit set of possible goal states, and
the test simply checks whether the given state is one of them.
• Ex- The agent’s goal in Romania is the singleton set {In(Bucharest )}
Problem Solving with AI
Components of a problem
• 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 step cost of taking action a to go from one state ‘s’ to reach state ‘y’
is denoted by c(s, a, y).

Ex- For the agent trying to get to Bucharest, time is of the essence, so the cost of a
path might be its length in kilometres. We assume that the cost of a path can be
described as the sum of the costs of the individual actions along the path. The step
costs for Romania are shown in Figure as route distances. We assume that step costs
are nonnegative.

• 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.
Formulating Problems

• Problem Formulation : Choosing relevant set of states &


feasible set of operators for moving from one state to another.

• Search : Is a process of imagining sequences of


operators(actions) applied to initial state and to see which state
reaches goal state.
Toy Problems vs Real-world Problems

• A toy problem is intended to illustrate or exercise


various problem solving methods. It can be given a
concise, exact description.

• A real world problem is one whose solutions


people actually care about. Such problems tend not to
have a single agreed-upon description, but we can give the
general flavor of their formulations.
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Problem Types

1. Deterministic or observable (single-state)


2. Non-observable (multiple-state)
3. Non-deterministic or partially observable
4. Unknown state space
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.

68
Problem Types
2. Non-observable(Multiple-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.
Problem Types
3. Non-deterministic(partially observable) 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.
Problem Types

Fully observable/ partially observable / Single agent/ Multiagent


unobservable

Static, Discrete: Crossword puzzle.


Dynamic, Continuous: Taxi Driving

Competitive/ Cooperative
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.
Problem Characteristics
1. Is the problem decomposable ?
2. Can Solution steps be ignored or undone ?
3. Is the Universe Predictable?
4. Is a good solution 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 ?
Problem Characteristics- 1. Is the problem decomposable ?
BLOCKS WORLD
Problem Characteristics: 2. Can Solution steps be ignored or undone ?
The 8 – Puzzle

●How would you use AI techniques


to solve the 8-puzzle problem?
Important Classes of Problem

• Ignorable Ex. Theorem Proving


• Recoverable Ex. The 8-Puzzle
• Irrecoverable Ex. Chess
Problem Characteristics
3. Is the Universe Predictable?

❖ Difference between certain outcome (e.g. 8-Puzzle)


and uncertain outcome (e.g. play bridge ) .
❖ In case of certain outcome, we can make a plan to
generate a sequence of operation that guaranteed to
lead to a solution. So, that the outcome is very
certain.
❖ In case of uncertain outcome problems, we follow
the process of plan revision as the plan is carried
out and the necessary feedback is provided. The
disadvantage is that the planning in this case is
often very expensive.
Problem Characteristics
4. Is a good solution absolute or relative ?
● The facts can be represented using
a formal language called
“Predicate Logic”.
● There may be “n” different solutions.
If one solution is found , there is no
need to go back and see if some path
might also lead to a solution.
● Ex: P -> Q
●If marks = 92 -> Grade = O
RELATIVE SOLUTION : Ex. TSP
(Explore all possible solutions)
Problem Characteristics
5. Is the solution a state or a path ?
● To solve a problem, of finding
interpretation, we need to produce
only the interpretation itself.
Record of processing by how the
interpretation was arrived is NOT
required.
Ex: The President ate Food with a
fork.
● In contrast, if we must produce,
the final state along with the path
that we found to that state along
with sequence of operations to
produce the final state.
Problem Characteristics
6. What is the role of knowledge ?
Is the lots of knowledge required to solve a problem or is knowledge only
to constrain solutions?

● Ex: Newspaper reading (by a computer) illustrate difference between


problems for which a lot of knowledge is important only to constrain a
search for solution and those for which a lot of knowledge is required
to recognise a solution.
● Ex: Scanning newspapers to find who support Party A or Party B in
upcoming elections.
● Assume unlimited computer power.
● The following has to be known at the time to arrive at an answer
– (i) Name of Party candidates
– (ii) Taxes lowered
– (iii) Improved education, etc.
Problem Characteristics
7. Does the task require interaction with a person ?

There are 2 types of problems:


● Solitary : in which computer is given a problem
description and with NO DEMAND FOR
EXPLANATION of the reasoning process.
● Conversational: in which there is intermediate
communication between a person and the
computer either to provide additional assistance to
computer or to provide additional information to
user or both.
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Formal Description of a Problem
• In AI, we will formally define a problem as
– a space of all possible configurations where each
configuration is called a state
• thus, we use the term state space
– 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
(see monkey & banana problem on the next slide)
– 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
The Monkey & Bananas Problem
• A monkey is in a cage and bananas are suspended from
the ceiling, the monkey wants to eat a banana but cannot
reach them
– in the room are a chair and a stick
– if the monkey stands on the chair and waves the stick, he can
knock a banana down to eat it
– what are the actions the monkey should take?

Initial state:
monkey on ground
with empty hand
bananas suspended
Goal state:
monkey eating
Actions:
climb chair/get off
grab X
wave X
eat X
• • Problem solving: The term, Problem Solving relates to analysis in AI.
Problem solving may be characterized as a systematic search through a
range of possible actions to reach some predefined goal or solution.
Problem-solving methods are categorized as special purpose and general
purpose.
• • A special-purpose method is tailor-made for a particular problem, often
exploits very specific features of the situation in which the problem is
embedded.
• • A general-purpose method is applicable to a wide variety of problems.
One General-purpose technique used in AI is ‘means-end analysis’: a
step-bystep, or incremental, reduction of the difference between current
state and final goal.
Example – Toy Problems
Vacuum Cleaner World
Program implements the agent function tabulated

Function Reflex-Vacuum-Agent([location,status]) return


an action
If status = Dirty then return Suck
else if location = A then return Right
else if location = B then return left
Toy Problems vs Real-world Problems

• A toy problem is intended to illustrate or exercise


various problem solving methods. It can be given a
concise, exact description.

• A real world problem is one whose solutions


people actually care about. Such problems tend not to
have a single agreed-upon description, but we can give the
general flavor of their formulations.

87
Toy Problem- 1
Vacuum Cleaner World -Problem Formulation

• State - agent is in one of two locations, each of which might or might


not contain dirt. Thus there are 2 × 22 = 8 possible world states. A
larger environment with n locations has n ・ 2n states

• Initial State
– Any one of 8 states

• Actions
– In this simple environment, each state has just three actions: Left , Right ,Suck.
Larger environments might also include Up , Down
Toy Problem- 1
Vacuum Cleaner World -Problem Formulation

• Transition model: The actions have their expected effects, except that
moving Left in the leftmost square, moving Right in the rightmost square,
and Sucking in a clean square have no effect. The complete state space is
shown in the figure .

• State Space for the Vacuum World


Labels on Arcs denote L: Left, R: Right, S: Suck

• Goal Test
– This checks whether all the squares are clean
• Path Cost
– Number of steps (each step costs a value of 1)
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle)

The 8-puzzle, an instance of which is shown below, consists of a


3×3 board with eight numbered tiles and a blank space. A tile
adjacent to the blank space can slide into the space. The object is
to reach a specified goal state, such as the one shown on the right
of the figure.
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle)

States: A state description specifies the location of each of the eight


tiles and the blank in one of the nine squares.

Initial state: Any state can be designated as the initial state.

Successor function: This generates the legal states that result from
trying the four actions (blank moves Left, Right, Up, or Down).

Goal test: This checks whether the state matches the goal
configuration (Other goal configurations are possible.)

Path cost: Each step costs 1, so the path cost is the number of steps
in the path.
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
• hf= +1 for every correct position
• Solution of this problem is “movement of tiles” in order to reach
goal state.
• The transition function or legal move is any one tile movement
by one space in any direction.
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
Toy Problem- 3
Water – Jug Problem

A Water Jug Problem: You are given two jugs,


a 4-gallon one and a 3-gallon one, a pump
which has unlimited water which you can use
to fill the jug, and the ground on which water
may be poured. Neither jug has any
measuring markings on it. How can you get
exactly 2 gallons of water in the 4-gallon jug?
Toy Problem- 3
Water – Jug Problem
Solution:
The state space for this problem can be described as the set of
ordered pairs of integers (x,y)

Where,

X represents the quantity of water in the 4-gallon jug X=


0,1,2,3,4
Y represents the quantity of water in 3-gallon jug Y=0,1,2,3

Note
0 ≤ X ≤ 4, and 0 ≤ Y ≤ 3

Start State:(2,(0,0)
n) for any n. Attempting to end up in a goal state.
Goal State:( since the problem doesn‘t specify the quantity of
water in 3-gallon jug)
Toy Problem- 3
Water – Jug Problem
Generate production rules for the water jug problem
Production Rules:

1. (x,y) -> (4,y) Fill x


2. (x,y) -> (x,3) Fill y
3. (x,y) -> (x-d, y) Pour water out from X
4. (x,y) -> (x,y-d) Pour water from y
5. (x,y) -> (0,y) Empty x
6. (x,y) -> (x,0) Empty y
7. (x,y) -> (4,y-(4-x)) Pour water from y into x until x is full
8. (x,y) -> (x – (3-y), 3) Pour water from x into y until y is full.
9. (x,y) -> (x+y, 0) Pour all water from y to x
10. (x,y) -> (0, x+y) Pour all water from x to y
11. (0,2) -> (2,0) Pour 2 Gallon of water from y to x
12. (2, y) -> (0,y) Pour 2 Gallon of water from x to ground.
Toy Problem- 3
Water – Jug Problem

First solution
1. (x,y) -> (4,y) Fill x
2. (x,y) -> (x,3) Fill y
3. (x,y) -> (x-d, y) Pour water out from X
Initial 4. (x,y) -> (x,y-d) Pour water from y
5. (x,y) -> (0,y) Empty x
R2 6. (x,y) -> (x,0) Empty y
R9 7. (x,y) -> (4,y-(4-x)) Pour water from y into x until x
R2 is full
8. (x,y) -> (x – (3-y), 3) Pour water from x into y until y
R7
is full.
R5 9. (x,y) -> (x+y, 0) Pour all water from y to x
R9 10. (x,y) -> (0, x+y) Pour all water from x to y
11. (0,2) -> (2,0) Pour 2 Gallon of water from y
to x
12. (2, y) -> (0,y) Pour 2 Gallon of water from x
to ground.
Toy Problem- 4(a)
4-queens problem

The N Queen is the problem of placing N chess queens on an N×N chessboard so


that no two queens attack each other.
Given a 4 x 4 chessboard and number the rows and column of the
chessboard 1 through 4.

Since, we have to place 4 queens such as q1 q2 q3 and q4 on the


chessboard, such that no two queens attack each other. In such a
conditional each queen must be placed on a different row, i.e., we put
queen "i" on row "i."
Toy Problem- 4(a)
4-queens problem
One possible solution for the 4-queens problem is (2,4,1,3) i.e ,
Toy Problem- 4(a)
4-queens problem
The implicit tree for 4 - queen problem for a solution (2, 4, 1, 3) is as follows:
Toy Problem- 4(a)
4-queens problem

Another solution for 4 - queens problems is (3, 1, 4, 2) i.e


Toy Problem- 4(b)
8-queens problem
“We have 8 queens and an 8x8 Chess board having
alternate black and white squares. The queens are
placed on the chessboard.

Any queen can attack any other queen placed on


same row, or column or diagonal. We have to find
the proper placement of queens on the Chess board
in such a way that no queen attacks other queen”.
Toy Problem- 4(b)
8-queens problem
possible board configuration of 8 queen problem

In figure , the possible board configuration for 8-queen problem has been shown. The board
has alternative black and white positions on it. The different positions on the board hold the
queens. The production rule for this game is you cannot put the same queens in a same row
or same column or in same diagonal. After shifting a single queen from its position on the
board, the user have to shift other queens according to the production rule. Starting from the
first row on the board the queen of their corresponding row and column are to be moved
from their original positions to another position. Finally the player has to be ensured that no
rows or columns or diagonals of on the table is same.
Toy Problem- 4(b)
8-queens problem
The first incremental formulation one might try is the following:
• States: Any arrangement of 0 to 8 queens on the board is a
state.
• Initial state: No queens on the board.
• Actions/Successor function : Add a queen to any empty
square.
• Transition model: Returns the board with a queen added to the
specified square.
• Goal test: 8 queens are on the board, none attacked.
• Path cost: Zero (search cost only exists)

In this formulation, we have 64 ・ 63 ・ ・ ・ 57 ≈ 1.8×1014 possible


sequences to investigate.
Toy Problem- 5
BLOCK WORLD
What is the Blocks World? -- The world consists of:
•A flat surface such as a tabletop
•An adequate set of identical blocks which are identified by
letters.
•The blocks can be stacked one on one to form towers of
apparently unlimited height.
•The stacking is achieved using a robot arm which has
fundamental operations and states which can be assessed using
logic and combined using logical operations.
•The robot can hold one block at a time and only one block can
be moved at a time.
Toy Problem- 5
Toy Problem- 5
Blocks World Problem – Ex .

hf = -10 hf = +10

Heuristic
Toy Problem- 5
Blocks World Problem – Ex .

Step 1
Toy Problem- 5
Blocks World Problem – Ex .
Step 2
Toy Problem- 5
Blocks World Problem – Ex .
Step 3

hf = -1
Toy Problem- 5
Blocks World Problem – Ex .
Step 4
Toy Problem- 5
Blocks World Problem – Ex .
Step 5

hf = +3
Toy Problem- 5
Blocks World Problem – Ex .
Step 6

hf = +10

Global solution for block world


Toy Problem- 5
BLOCK WORLD - STRIPS
(STanford Research Institute Problem Solver)

• STRIPS - an action-centric representation ,for


each action , specifies the effect of an action.
Toy Problem- 5
BLOCK WORLD - STRIPS
(STanford Research Institute Problem Solver)

• STRIPS - an action-centric representation ,for


each action , specifies the effect of an action.
The STRIPS representation for an action consists of three lists,
• Pre_Cond list contains predicates which have to be true
before operation.
• ADD list contains those predicates which will be true after
operation
• DELETE list contain those predicates which are no longer true
after operation
Toy Problem- 6
Tic Tac Toe
The game Tic Tac Toe is also known
as Noughts and Crosses or Xs and Os ,the player needs to take
turns marking the spaces in a 3x3 grid with their own marks,
if 3 consecutive marks (Horizontal, Vertical,Diagonal) are
formed then the player who owns these moves get won.

Assume ,
So,a player who gets 3
Player 1 - X consecutive marks first,they will
Player 2 - O win the game .
Toy Problem- 6
Tic Tac Toe
Toy Problem- 7
Missionaries and Cannibals
Let Missionary is denoted by ‘M’ and Cannibal, by ‘C’.
These rules are described below:

All or some of these production rules will have to be used in a particular


sequence to find the solution of the problem.
Toy Problem- 7
Missionaries and Cannibals
Rules applied and their sequence in Missionaries and
Cannibals problem
Toy Problem- 7
Formalization of the M&C Problem

State space: triple (x,y,z) with 0 ≤ x,y,z ≤ 3, where x,y, and z


represent the number of missionaries, cannibals and boats
currently on the original bank.
Initial State: (3,3,1)
Successor function: From each state, either bring one
missionary, one cannibal, two missionaries, two cannibals,
or one of each type to the other bank.
Note: Not all states are attainable (e.g., (0,0,1)), and some
are illegal.
Goal State: (0,0,0) Path Costs: 1 unit per crossing
Toy Problem- 8
Travelling Salesman Problem(Path Finding Problems)

“Given ‘n’ cities connected by roads, and distances between each


pair of cities. A sales person is required to travel each of the cities
exactly once. We are required to find the route of salesperson so
that by covering minimum distance, he can travel all the cities and
come back to the city from where the journey was started”.

Diagrammatically, it is shown below

Fig : Cities and paths connecting


these
Toy Problem- 8
Travelling Salesman Problem(Path Finding Problems)

The basic travelling salesperson problem comprises of computing the shortest route
through a given set of cities.

Following Table shows number of cities and the possible routes mentioned
against them.
Toy Problem- 9
Monkey Banana Problem

“A monkey is in a room. A bunch of bananas is


hanging from the ceiling. The monkey cannot
reach the bananas directly. However , in the room
there is one chair and a stick. The monkey can
reach the banana standing on the chair. We have to
find the sequence of events by which monkey can
reach the bananas.”
Toy Problem- 9
Monkey Banana Problem
Solution of this problem means finding the sequence of actions for the monkey
to reach the banana.

Monkey standing on the chair and catching the bananas with the stick.
Summary of Problem Solving with AI –
Toy Problems

1. Block World
2. 4 Queens/ 8 Queens
3. Tic Tac Toe
4. Water Jug
5. Monkey Banana
6. 8 Puzzle
7. TSP
8. Vacuum Cleaner
9. Missionaries and Cannibals
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Intelligent Agents
• An agent is anything that can be viewed as perceiving
its environment through sensors and acting upon
that environment through actuators

• Human agent: eyes, ears, and other organs for


sensors;
• hands,legs, mouth, and other body parts for
actuators
• Robotic agent: cameras and infrared range finders
for sensors;
• various motors for actuators
Agents and Environment

• The agent function maps from percept histories


to actions:
[f: P* 🡪 A]
• The agent program runs on the physical
architecture to produce f
• agent = architecture + program
Diagram of an Agent

What AI should
fill
Simple Terms

Percept
●Agent’s perceptual inputs at any given instant
Percept sequence
●Complete history of everything that the agent
has ever perceived.
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Rationality

• Rationality. Rationality is nothing but status


of being reasonable, sensible, and having
good sense of judgment. Rationality is
concerned with expected actions and results
depending upon what the agent has
perceived. Performing actions with the aim of
obtaining useful information is an important
part of rationality.
What is Ideal Rational Agent?

• An ideal rational agent is the one, which is capable of doing expected actions to
maximize its performance measure, on the basis of −
• Its percept sequence
• Its built-in knowledge base
• Rationality of an agent depends on the following −
• The performance measures, which determine the degree of success.
• Agent’s Percept Sequence till now.
• The agent’s prior knowledge about the environment.
• The actions that the agent can carry out.
• A rational agent always performs right action, where the right action means the
action that causes the agent to be most successful in the given percept sequence.
The problem the agent solves is characterized by Performance Measure,
Environment, Actuators, and Sensors (PEAS).
Rational Agents

• Rational Agent: one that does the right thing


• Criteria: Performance measure
• Performance measures for
– Web search engine?
– Tic-tac-toe player? Chess player?
• How does when performance is measured play a
role?
– short vs. long term
Rational Agents

• Omniscient agent
– Knows the actual outcome of its actions
– What information would a chess player need to
have to be omniscient?
• Omniscience is (generally) impossible
– A rational agent should do the right thing based
on the knowledge it has
Rational Agents

• What is rational depends on four things:


– Performance measure
– Percept sequence: everything agent has seen so far
– Knowledge agent has about environment
– Actions agent is capable of performing
• Ideal Rational Agent
– Does whatever action is expected to maximize its
performance measure, based on percept sequence and
built-in knowledge
Ideal Mapping

• Percept sequence is only varying element of


rationality
– Percept Sequence  Action
• In theory, can build a table mapping percept
sequence to action
– Sample table for chess board
• Ideal mapping describes behavior of ideal
agents
The Mapping Table

• In most cases, mapping is explosively too


large to write down explicitly
• In some cases, mapping can be defined via a
specification
– Example: agent to sort a list of numbers
– Sample table for such an agent
– Lisp code
Autonomy

• “Independence”
• A system is autonomous if its behavior is
determined by its own experience
– An alarm that goes off at a prespecified time is
not autonomous
– An alarm that goes off when smoke is sensed is
autonomous
• A system without autonomy lacks flexibility
Structure of Intelligent Agents

• AI designes the agent program


• The program runs on some kind of
architecture
• To design an agent program, need to
understand
– Percepts
– Actions
– Goals
– Environment
Some Sample Agents

• What are percepts, actions, goals, and environment


for:
– Chess Player?
– Web Search Tool?
– Matchmaker?
– Musical performer?
• Environments can be real (web search tool) or
artificial (Turing test)
– distinction is about whether it is a simulation for agent or
the “real thing”
Agent Programs

• Some extra Lisp: Persistence of state (static


variables)
• Allows a function to keep track of a variable over
repeated calls.
– Put functions inside a let block
– (let ((sum 0))
(defun myfun (x)
(setf sum (+ sum x)))
(defun report ()
sum)
)
Vacuum-cleaner

Consider a Vacuum cleaner world

• Imagine that our intelligent agent is a robot vacuum cleaner.


Let's suppose that the world has just two rooms.
• The robot can be in either room and there can be dirt in zero, one, or two
rooms.
Vacuum-cleaner World
Vacuum-cleaner world

Perception: Clean or Dirty? where it is


in?
Goal formulation: intuitively, we want
all the dirt cleaned up. Formally, the goal
is
{ state 7, state 8 }.

Problem formulation(Actions):
Move Left, Move Right, Suck, NoOp(do
nothing)
Vacuum-cleaner world

Partial tabulation of a simple agent function for the vacuum-cleaner world


Vacuum-cleaner world
Program implements the agent function tabulated

Function Reflex-Vacuum-Agent([location,status]) return


an action
If status = Dirty then return Suck
else if location = A then return Right
else if location = B then return left
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI
• Types of agents
• AI Models, Data acquisition and • Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving • Constraint satisfaction
process, Formulating problems problems(CSP)
• Crypto arithmetic puzzles
• Problem types and characteristics
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent
• CSP-Backtracking, Role of
• Rationality and Rational agent with
performance measures
heuristic

• Flexibility and Intelligent agents • CSP-Forward checking and


• Task environment and its properties constraint propagation
• CSP-Intelligent backtracking
Performance Measuring

With any intelligent agent, we want it to find a


(good) solution and not spend forever doing
it.
The interesting quantities are, therefore,
•the search cost--how long the agent takes to
come up with the solution to the problem, and
•the path cost--how expensive the actions in
the solution are.
The total cost of the solution is the sum of
the above two quantities.
Performance Measures

STATES,
● TSP - Naive Solution revisited:
OPERATORS,
GOAL TEST &
1)Consider city 1 as the starting and ending
PATH COST point.
2) Generate all (n-1)! Permutations of cities.

3)Calculate cost of every permutation and


keep track of minimum cost permutation.

4) Return the permutation


with minimum
cost.
● Solution is complete, optimal, time and space
complexity = n!
Measuring problem-solving performance

● Completeness: Is the algorithm guaranteed to find


a solution when there is one?
● Optimality: Does the strategy find the
optimal solution (i.e., lowest path cost
among all solutions)
● Time complexity: How long does it take to find a
solution?
● Space complexity: How much memory is
needed to perform the search?
Real-world Problems

Example of rational action performed by any intelligent


agent:
Automated Taxi Driver:
Performance Measure: Safe, fast, legal, comfortable
trip, maximize profits.
Environment: Roads, other traffic, customers.
Actuators: Steering wheel, accelerator, brake, signal,
horn.
Sensors: Cameras, sonar, speedometer, GPS,
odometer, engine sensors, keyboard.
Unit 1 List of Topics
• Flexibility and Intelligent
• Introduction to AI-AI techniques agents
• Problem solving with AI • Task environment and its
properties
• AI Models, Data acquisition and • Types of agents
learning aspects in AI • Other aspects of agents
• Problem solving- Problem solving
process, Formulating problems • Constraint satisfaction
problems(CSP)
• Problem types and characteristics • Crypto arithmetic puzzles
• Problem space and search
• CSP as a search problem-
constrains and representation
• Intelligent agent • CSP-Backtracking, Role of
• Rationality and Rational agent heuristic
with performance measures
• CSP-Forward checking and
constraint propagation
• CSP-Intelligent backtracking
END
UNIT-1

You might also like