Ai Handout
Ai Handout
Introduction
• How we think, perceive, understand, predict, and manipulate.
• Different types and degrees of intelligence occur in people,
several animals, and a few machines.
• AI goes further - it attempts not just to understand but also to
build intelligent entities.
• McCarthy coined the term artificial intelligence in 1955, and
he created the computer programming language LISP in 1958
which was initially used primarily by the AI community.
• AI currently encompasses a huge variety of subfields.
What is Problem?
• A problem is an obstacle that is troublesome to attain a
desired goal, or an issue that is unresolved.
• Each problem has an answer or solution.
• A procedure that makes the problem navigation
towards the goal is called solution.
• It can be algorithm or a hard-core implementation
to achieve the goal defined by the problem.
Structured problem
• Structural problems are the ones for which there exists a
specific algorithm to achieve the goal.
• The same algorithm is run against variety input data still
giving a guarantee of the problem being solved.
• Since the structure of the solution (that is in the algorithm)
remains the same, even if the input data changes, these
problems are called structured problems.
• For example-
– To sort the students according to their total marks, the details about
the students may be stored in the database, the sort algorithm will
then get the details of students from the database and will solve the
problem.
Unstructured problem
• Unstructured problems are the problems for which there does
not exist a specific algorithm to achieve the goal.
• What step to take to achieve the goal depends on what is the
current state of the problem.
• AI is an attempt to make a computer to solve unstructured
problems.
• For example-
– A problem of playing chess or a problem to write a program to
perform heart surgery, etc., are unstructured problems, because there
does not exist any specific algorithm to solve it. Such problems are
solved using a Knowledge Base.
What is AI?
• The study of mental facilities through the use of
computational models. - Charniak and McDermott, 1985.
• The study of how to make computer do things at which at the
moment, people are better. – Rich and Knight 1991
• The scientific understanding of the mechanisms underlying
thought and their intelligent behavior and their embodiment
in machines. - American Association of Artificial Intelligent
(AAAI)
• AI strives to understand and build intelligent entities (also
help us to learn more about ourselves – Russell and Norvig.
• AI is The science and engineering of making intelligent
machines, especially intelligent programs. - John McCarthy,
father of Artificial Intelligence.
What is AI
• Top - thought
processes and
reasoning,
• Bottom - behaviour.
• Left - measure success
in terms of fidelity to
human performance.
• Right - measure
against an ideal
performance measure,
called rationality.
• A system is rational if
it does the “right
thing,” given what it
knows.
Branches of AI
AI - State of the Art
➢Game playing
➢Mathematics
➢Autonomous control
➢Diagnosis
➢ Logistics planning
➢Autonomous planning and scheduling
➢Language understanding and problem solving
➢Robotics
➢Natural Language Generation
Applications of AI
➢Speech recognition
➢Virtual agents
➢Text analytics and NLP
➢Robotic process automation
➢Biometrics
➢Deep learning platforms
➢Decision management
➢AI-optimized hardware
➢Machine-learning platforms
AI Programming languages
• A number of programming languages exist that are used to build AI
systems.
• Here are some languages that are most typically used for creating the
AI projects:
➢ PROLOG
➢ LISP
➢ R
➢ Python
➢ Java
➢ C++
Intelligent Agents
Agents and Environments
• Intelligent Agent (IA) is a self sufficient substance which
watches and follows up on a situation and coordinates its
movement towards accomplishing objectives.
• An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators.
• These may be extremely straight forward or extremely
complex.
• Small set of design principles for building successful
agents systems that can reasonably be called intelligent.
Agent terminology
1. Performance measure : It is the criteria determining the success of
an agent.
2. Action : It is the action performed by an agent after any specified
sequence of the percepts.
3. Percept : It is defined as an agent’s perceptual inputs at a specified
instance.
4. Percept sequence : It is defined as the history of everything that an
agent has perceived till date.
5. Agent function (F) : It is defined as a map from the precept
sequence to an action.
Agent function, a = F(p)
where p is the current percept, a is the action carried out, and F is
the agent function
Agent terminology
• If P is the set of all precepts, and A is the set of all actions
then F maps precepts to actions.
F : P → A
• Generally, an action may be dependent of all the precepts
observed, not only the current percept,
ak = F( p0 p1 p2 … pk )
Where p0 , p1, p2, … ,pk is the sequence of percepts recorded
till date, ak is the resulting action carried out and F now
maps percept sequences to action
F : P * → A
• The agent program implements the agent function - the mapping from percepts to actions.
THE STRUCTURE OF AGENTS
THE STRUCTURE OF AGENTS
• Four types of agent programs that embody the
principles underlying almost all intelligent
systems:
‣ Simple reflex agents
‣ Model-based reflex agents
‣ Goal-based agents
‣ Utility-based agents
‣ Learning agent
Simple
Reflex
Agents
Limitations
• Intelligence level in these agents is very limited.
• It works only in a fully observable environment.
• It does not hold any knowledge or information of
non perceptual parts of state.
• Because of the static knowledge based, it is usually
too big to generate and store.
• If any change in the environment happens, the
collection of the rules are required to be updated.
Model
Based
Agents
Goal-based agents
• Knowing something about the current state of the
environment is not always enough to decide what to do.
• The agent needs some sort of goal information that describes
situations the final destination.
• The agent program can combine this with the model based
reflex agent to choose actions that achieve the goal.
• Goal-based action selection may be straightforward or
tricky. Searching and planning are the area of study to find
action sequence that achieve agents goal.
• They are more adaptable and flexible.
• One can specify another goal rather than reprogramming all
the rules.
Goal-
based
agents
Goal-based agents
• Goal-based agent appears less efficient but it is more flexible due to
the knowledge that supports its decisions is represented explicitly
and can be modified.
• This will automatically cause all of the relevant behaviors to be
altered to suit the new conditions.
• The goal-based agent’s behavior can easily be changed to go to a
different destination, simply by specifying that destination as the
goal.
• For the reflex agent, on the other hand, we would have to rewrite
many condition–action rules.
• The reflex agent’s rules for when to turn and when to go straight will
work only for a single destination; they must all be replaced to go
somewhere new.
•
Learning agent
• By actively exploring and experimenting with their environment, the most
powerful agents are able to learn.
• A learning agent can be further divided into the four conceptual components
• performance element - responsible for selecting external actions.
• learning element - responsible for making improvements
• problem generator - responsible for suggesting actions that will lead to
new and informative experiences
• Critic - Provides feedback on how agent is doing and determines how the
performance element should be modified to do in future.
• The performance element is what we have previously considered to be the
entire agent, it takes in percepts and decides on actions.
• The learning element uses feedback from the critic on how the agent is doing
and determines how the performance element should be modified to do
better in the future.
Learning agent
Components of Agent Programs
• Representations along an axis of increasing
complexity and expressive power - atomic,
factored, and structured.
Components of Agent Programs
• Atomic - Each state of the world is indivisible, it has no internal
structure.
• Factored - splits up each state into a fixed set of variables or
attributes, each of which can have a value.
• Two different atomic states have nothing in common and can share
some attributes (GPS location) and not others (fuel status), this
makes it much easier to work out how to turn one state into another.
• We would need a structured representation, in which objects and
their various and varying relationships can be described explicitly.
• Structured representations underlie relational databases and first-
order logic In fact, almost everything that humans express in natural
language concerns objects and their relationships.
PROBLEM SOLVING
- Solving problem by searching
Introduction
• In AI, the term problem solving is given to the analysis
of how computers can be made to find solutions in
restricted environments.
• Problem solving is defined as the way in which an
agent finds a sequence of actions that achieves its
goals, when no single action will do.
• Problem formulation requires abstracting real-world
details to define a state space that can be explored.
• This step of abstraction is performed by an agent
called as a problem-solving agent.
• Intelligent agents are supported to act in such a way
that the environment goes through a sequence of states
that maximises the performance measures.
State-space Representation
• State space is a tree which represents all the possible
states in the problem.
• It is complete set of states including start and goal
states, other valid states and transitions, where the
answer of the problem is to be searched.
• A state–space representation allows for the formal
definition of a problem, which makes the movement
from initial state to the goal state quite easily.
• State–space search is a process in AI, in which
successive configurations or states of an instance are
considered, with the goal of finding a goal state with a
desired property.
State-space Representation
• AI problem can be solved using following steps:
‣ Describe states
‣ Identify initial state
‣ Identify set of rules (all possible action)
‣ Identify goal state
‣ Path cost
• When these steps are followed in problem formulation
then a problem is said to be formulated by an approach
called as state space approach.
• Find Problem solution path in the state space.
• Various problems like planning, learning, theorem
proving, etc, are all essentially search problems.
Problem Definition :
• The eight tile puzzle
consist of a 3 × 3
square frame board
which holds eight
movable tiles
numbered 1 to 8.
• One square is empty,
allowing the adjacent
tiles to be shifted.
• Find a sequence of tile
movements that leads
from a starting
configuration to a goal
configuration.
Search Strategies
• Searching is the process to find the solution for a given set of
problems. This in AI can be done by using either uninformed
searching strategies or informed searching strategies.
• Uninformed Search / Blind Search :
• This method has no information about the number of steps or path cost
from the current state to goal state.
• Not aware that search process is moving in the direction of the goal or
in the opposite direction.
• It only checks for the state generated is goal or not. If so it will stop
otherwise continues to generate next state.
• Informed Search :
• This method knows whether one goal state is more promising than
other is called a heuristic / informed search techniques.
• They are aware if the search is moving in the right direction or opposite
direction
• It can choose the non goal state that is most closest to the goal as the
next state.
• If the state generated is a goal state, the search process stops else
continues to generate next state in a state space.