0% found this document useful (0 votes)
49 views50 pages

AI Unit 1

Uploaded by

Lavanya H M
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)
49 views50 pages

AI Unit 1

Uploaded by

Lavanya H M
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/ 50

INTRODUCTION TO AI

Unit I
WHAT IS AI?

 An AI system is a machine that is designed to accomplish the task which humans perform with their
natural intelligence.
 This comes with learning which involves garnering the rules and information for using the data. It also
comes with self-correction and reasoning which involves following the rules to gain appropriate
conclusions.
 Software technologies that make a computer or robot perform equal to or better than normal human
computational ability in accuracy, capacity, and speed.
 It has produced increasingly powerful applications that make complex decisions, evaluate investment
opportunities, and help in developing new products. Other uses include robotics, human-language
understanding, and computer vision.
INTELLIGENT AGENTS
 An intelligent agent (IA) is an entity that makes a decision, that enables artificial intelligence to be
put into action. It can also be described as a software entity that conducts operations in the place of
users or programs after sensing the environment. It uses actuators to initiate action in that
environment.
 This agent has some level of autonomy that allows it to perform specific, predictable, and repetitive
tasks for users or applications.
 It’s also termed as ‘intelligent’ because of its ability to learn during the process of performing tasks.
 The two main functions of intelligent agents include perception and action. Perception is done
through sensors while actions are initiated through actuators.
 Intelligent agents consist of sub-agents that form a hierarchical structure. Lower-level tasks are
performed by these sub-agents.
 The higher-level agents and lower-level agents form a complete system that can solve difficult
problems through intelligent behaviors or responses.
Characteristics of intelligent agents
• They have some level of autonomy that allows them to perform certain tasks on their own.
• They have a learning ability that enables them to learn even as tasks are carried out.
• They can interact with other entities such as agents, humans, and systems.
• New rules can be accommodated by intelligent agents incrementally.
• They exhibit goal-oriented habits.
• They are knowledge-based. They use knowledge regarding communications, processes, and
entities.
The structure of intelligent agents
1. Architecture: This refers to machinery or devices that consists of actuators and sensors. The
intelligent agent executes on this machinery. Examples include a personal computer, a car, or a
camera.
2. Agent function: This is a function in which actions are mapped from a certain percept sequence.
Percept sequence refers to a history of what the intelligent agent has perceived.
3. Agent program: This is an implementation or execution of the agent function. The agent function
is produced through the agent program’s execution on the physical architecture.
AGENTS AND ENVIRONMENT
 An agent is anything that can perceive its environment through sensors and acts upon that
environment through effectors.
• A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to
the sensors, and other organs such as hands, legs, mouth, for effectors.
• A robotic agent replaces cameras and infrared range finders for the sensors, and various
motors and actuators for effectors.
• A software agent has encoded bit strings as its programs and actions.
AGENT TERMINOLOGY
• Performance Measure of Agent − It is the criteria, which determines how successful an
agent is.
• Behavior of Agent − It is the action that agent performs after any given sequence of
percepts.
• Percept − It is agent’s perceptual inputs at a given instance.
• Percept Sequence − It is the history of all that an agent has perceived till date.
• Agent Function − It is a map from the precept sequence to an action.
RATIONALITY
 Rationality is 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).
THE STRUCTURE OF INTELLIGENT AGENTS
Agent’s structure can be viewed as −
• Agent = Architecture + Agent Program
• Architecture = the machinery that an agent executes on.
• Agent Program = an implementation of an agent function.

Simple Reflex Agents


• They choose actions only based on the current percept.
• They are rational only if a correct decision is made only on the basis of current precept.
• Their environment is completely observable.

Condition-Action Rule − It is a rule that maps a


state (condition) to an action.

These agents perform actions using the current percept,


rather than the percept history.
The condition-action rule is used as the basis for the
agent function.
In this category, a fully observable environment is ideal for
the success of the agent function.
Model Based Reflex Agents
 They use a model of the world to choose their actions. They maintain an internal state.
 Model − knowledge about “how the things happen in the world”.
 Internal State − It is a representation of unobserved aspects of current state depending on
percept history.
 Updating the state requires the information about −
• How the world evolves.
• How the agent’s actions affect the world.

Unlike simple reflex agents, model-based reflex


agents consider the percept history in their actions.
The agent function can still work well even in an
environment that is not fully observable. These agents
use an internal model that determines the percept
history and effect of actions. They reflect on certain
aspects of the present state that have been unobserved.
Goal Based Agents
 They choose their actions in order to achieve goals. Goal-based approach is more flexible
than reflex agent since the knowledge supporting a decision is explicitly modeled, thereby
allowing for modifications.
 Goal − It is the description of desirable situations.

These agents have higher capabilities than model-based


reflex agents. Goal-based agents use goal information
to describe desirable capabilities. This allows them to
choose among various possibilities. These agents select
the best action that enhances the attainment of the goal.
Utility Based Agents
 They choose actions based on a preference (utility) for each state.
 Goals are inadequate when −
• There are conflicting goals, out of which only few can be achieved.
• Goals have some uncertainty of being achieved and you need to weigh likelihood of success
against the importance of a goal.

These agents make choices based on utility. They are


more advanced than goal-based agents because of an
extra component of utility measurement. Using a
utility function, a state is mapped against a certain
measure of utility. A rational agent selects the action
that optimizes the expected utility of the outcome.
Learning agents
 These are agents that have the capability of learning from their previous experience.
 Learning agents have the following elements.
• The learning element: This element enables learning agents to learn from previous experiences.
• The critic: It provides feedback on how the agent is doing.
• The performance element: This element decides on the external action that needs to be taken.
• The problem generator: This acts as a feedback agent that performs certain tasks such as making
suggestions (new) and keeping history.
How intelligent agents work
THE STRUCTURE OF AGENTS

Intelligent agents work through three main components: sensors, actuators, and effectors.
 Sensors: These are devices that detect any changes in the environment. This information is sent to other devices. In artificial
intelligence, the environment of the system is observed by intelligent agents through sensors.
• Actuators: These are components through which energy is converted into motion. They perform the role of controlling and moving
a system. Examples include rails, motors, and gears.
• Effectors: The environment is affected by effectors. Examples include legs, fingers, wheels, display screen, and arms.

 The following diagram shows how these components are positioned in the AI system.
NATURE OF ENVIRONMENT
 Some programs operate in the entirely artificial environment confined to keyboard input,
database, computer file systems and character output on a screen.
 In contrast, some software agents (software robots or softbots) exist in rich, unlimited softbots
domains. The simulator has a very detailed, complex environment. The software agent needs
to choose from a long array of actions in real time. A softbot designed to scan the online
preferences of the customer and show interesting items to the customer works in the real as well
as an artificial environment.
 The most famous artificial environment is the Turing Test environment, in which one real and
other artificial agents are tested on equal ground. This is a very challenging environment as it is
highly difficult for a software agent to perform as well as a human.
Turing Test
 The success of an intelligent behavior of a system can be measured with Turing Test.
 Two persons and a machine to be evaluated participate in the test. Out of the two persons, one
plays the role of the tester. Each of them sits in different rooms. The tester is unaware of who is
machine and who is a human. He interrogates the questions by typing and sending them to both
intelligences, to which he receives typed responses.
 This test aims at fooling the tester. If the tester fails to determine machine’s response from the
human response, then the machine is said to be intelligent.
PROPERTIES OF ENVIRONMENT
 The environment has multifold properties −
• Discrete / Continuous − If there are a limited number of distinct, clearly defined, states of the environment, the
environment is discrete (For example, chess); otherwise it is continuous (For example, driving).
• Observable / Partially Observable − If it is possible to determine the complete state of the environment at
each time point from the percepts it is observable; otherwise it is only partially observable.
• Static / Dynamic − If the environment does not change while an agent is acting, then it is static; otherwise it is
dynamic.
• Single agent / Multiple agents − The environment may contain other agents which may be of the same or
different kind as that of the agent.
• Accessible / Inaccessible − If the agent’s sensory apparatus can have access to the complete state of the
environment, then the environment is accessible to that agent.
• Deterministic / Non-deterministic − If the next state of the environment is completely determined by the
current state and the actions of the agent, then the environment is deterministic; otherwise it is non-
deterministic.
• Episodic / Non-episodic − In an episodic environment, each episode consists of the agent perceiving and
then acting. The quality of its action depends just on the episode itself. Subsequent episodes do not depend on
the actions in the previous episodes. Episodic environments are much simpler because the agent does not
need to think ahead.
PROBLEM SOLVING: PROBLEM-SOLVING AGENTS

 On the basis of the problem and their working domain, different types of problem-solving agent
defined and use at an atomic level without any internal state visible with a problem-solving
algorithm.
 The problem-solving agent performs precisely by defining problems and several solutions. So
we can say that problem solving is a part of artificial intelligence that encompasses a number of
techniques such as a tree, B-tree, heuristic algorithms to solve a problem.
 We can also say that a problem-solving agent is a result-driven agent and always focuses on
satisfying the goals.
 Steps problem-solving in AI: The problem of AI is directly associated with the nature of
humans and their activities. So we need a number of finite steps to solve a problem which makes
human easy works.
These are the following steps which require to solve a problem :
1. Goal Formulation-Set of one or more (desirable) world states.(eg.Checkmate in Chess)
2. Problem Formulation-What actions and states to consider given a goal and an initial state
3. Search for solution-Given the problem, search for a solution--a sequence of actions to achieve the goal
starting from initial state
4. Execution of the solution
Goal Formulation
Specify the objectives to be achieved
goal - a set of desirable world states in which the objectives have been achieved
current / initial situation - starting point for the goal formulation
actions - cause transitions between world states
Problem Formulation
 Actions and states to consider
states - possible world states
accessibility - the agent can determine via its sensors in which state it is
consequences of actions - the agent knows the results of its actions
levels - problems and actions can be specified at various levels
constraints - conditions that influence the problem-solving process
performance - measures to be applied
costs - utilization of resources
Problem Types:Not all problems are created equal

 single-state problem

 multiple-state problem

 contingency problem

 exploration problem

Single-state problem
exact prediction is possible
state - is known exactly after any sequence of actions
accessibility of the world all essential information can be obtained through sensors
consequences of actions are known to the agent
goal - for each known initial state, there is a unique
goal state that is guaranteed to be reachable via
an action sequence
simplest case, but severely restricted
Example:Vacuum world,
Limitations:
 Can’t deal with incomplete accessibility

 incomplete knowledge about consequences changes in the world

 indeterminism in the world, in action


 Multiple-state problem

semi-exact prediction is possible


state is not known exactly, but limited to a set of possible states after each action
accessibility of the world not all essential information can be obtained through sensors
reasoning can be used to determine the set of possible states
consequences of actions are not always or completely known to the agent; actions or the environment might exhibit randomness
goal due to ignorance, there may be no fixed action sequence that leads to the goal
less restricted, but more complex
Example:Vacuum world, but the agent has no sensors
The action sequence right, suck, left, suck is guaranteed to reach the goal state from any initial state
Limitations:
 Can’t deal with changes in the world during execution (“contingencies”)

Contingency problem

exact prediction is impossible


state unknown in advance, may depend on the outcome of actions and changes in the
environment
accessibility of the world some essential information may be obtained through sensors only at execution time
consequences of action may not be known at planning time
goal instead of single action sequences, there are trees of actions
contingency branching point in the tree of actions
agent design different from the previous two cases:the agent must act on incomplete plans
search and execution phases are interleaved
Example: Vacuum world, The effect of a suck action is random.
 Exploration problem

effects of actions are unknown


state the set of possible states may be unknown
accessibility of the world some essential information may be obtained through sensors only at execution time
consequences of actions may not be known at planning time
goal can’t be completely formulated in advance because states and consequences may not be
known at planning time
discovery what states exist
experimentation what are the outcomes of actions
learning remember and evaluate experimentsagent design different from the previous cases: the agent must experiment
search requires search in the real world, not in an abstract model
realistic problems, very hard
 Performance Measuring

for problem solving


success
Has a solution been found?
quality
Is it a good solution?
What are the criteria?
optimal solution
may be difficult to find and not necessary
cost
sum of
• search cost (time, resources to find a solution)
• path cost (as defined above)
SEARCHING FOR SOLUTION
 Searching is the universal technique of problem solving in AI. There are some single-player games
such as tile games, Sudoku, crossword, etc. The search algorithms help you to search for a particular
position in such games.
Single Agent Pathfinding Problems
 The games such as 3X3 eight-tile, 4X4 fifteen-tile, and 5X5 twenty four tile puzzles are single-
agent-path-finding challenges. They consist of a matrix of tiles with a blank tile. The player is
required to arrange the tiles by sliding a tile either vertically or horizontally into a blank space with
the aim of accomplishing some objective.
 The other examples of single agent pathfinding problems are Travelling Salesman Problem, Rubik’s
Cube, and Theorem Proving.
 Based on the search problems we can classify the search algorithms into uninformed (Blind
search) search and informed search (Heuristic search) algorithms.
Uninformed/Blind Search:
The uninformed search does not contain any domain knowledge such as closeness, the location of the goal.
It operates in a brute-force way as it only includes information about how to traverse the tree and how to
identify leaf and goal nodes. Uninformed search applies a way in which search tree is searched without any
information about the search space like initial state operators and test for the goal, so it is also called blind
search.It examines each node of the tree until it achieves the goal node.
Informed search algorithms use domain knowledge. In an informed search, problem information is available which can guide
the search. Informed search strategies can find a solution more efficiently than an uninformed search strategy. Informed
search is also called a Heuristic search.
A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in
reasonable time.
UNINFORMED SEARCH STRATEGIES

 Uninformed search is a class of general-purpose search algorithms which do not have additional
information about state or search space other than how to traverse the tree, so it is also called blind search.
 Breadth-first search (BFS)
 It is a simple search strategy where the root node is expanded first, then covering all other successors of the
root node, further move to expand the next level nodes and the search continues until the goal node is not
found.
 BFS expands the shallowest (i.e., not deep) node first using FIFO (First in first out) order. Thus, new nodes
(i.e., children of a parent node) remain in the queue and old unexpanded node which are shallower than the
new nodes, get expanded first.
 In BFS, goal test (a test to check whether the current state is a goal state or not) is applied to each node
at the time of its generation rather when it is selected for expansion.
 In the above figure, it is seen that the nodes are expanded level

by level starting from the root node A till the last node I in the tree.
Therefore, the BFS sequence followed is: A->B->C->D->E->F->G->I.
• The biggest disadvantage of BFS is that it requires a lot of memory space, therefore it is a memory
bounded strategy.
• BFS is time taking search strategy because it expands the nodes breadthwise.
 Note: BFS expands the nodes level by level, i.e., breadthwise, therefore it is also known as a Level
search technique.
Depth-first search
 This search strategy explores the deepest node first, then backtracks to explore other nodes. It
uses LIFO (Last in First Out) order, which is based on the stack, in order to expand the
unexpanded nodes in the search tree. The search proceeds to the deepest level of the tree where it has
no successors. This search expands nodes till infinity, i.e., the depth of the tree.
 DFS works starting from the initial node

A (root node) and traversing in one direction


deeply till node I and then
backtrack to B and so on.
Therefore, the sequence will be
A->B->D->I->E->C->F->G.
 Disadvantages of DFS
• It may get trapped in an infinite loop.
• It is also possible that it may not reach the goal state.
• DFS does not give an optimal solution.
 Note: DFS uses the concept of backtracking to explore each node in a search tree.

Depth-limited search
 This search strategy is similar to DFS with a little difference. The difference is that in depth-limited search, we limit
the search by imposing a depth limit l to the depth of the search tree. It does not need to explore till infinity.
 As a result, the depth-first search is a special case of depth-limited search. when the limit l is infinite.
 In the above figure, the depth-limit is 1.
 So, only level 0 and 1 get expanded in A->B->C DFS sequence,
 starting from the root node A till node B.
 It is not giving satisfactory result because we could not reach the goal
 node 1

+
INFORMED SEARCH
 Best First Search
 A* Algorithm
CONSTRAINT SATISFACTION

 In CSPs, the problem is to search for a set of values for the features (variables) so that the
values satisfy some conditions (constraints). – i.e., a goal state specified as conditions on the
vector of feature values.
 states and goal test conform to a standard, structured and simple representation
 general-purpose heuristic

CSP is defined by 3 components (X, D, C):


 state: a set of variables X, each Xi , with values from domain Di
 goal test: a set of constraints C, each Ci involves some subset of the variables and specifies the allowable
combinations of values for that subset
 Each constraint Ci consists of a pair <scope, rel>, where scope is a tuple of variables and rel is the relation, either
represented explicitly or abstractly
 X1 and X2 both have the domain {A, B}

 Constraints:

 <(X1, X2), [(A, B), (B, A)]>, or

 <(X1, X2), X1 ≠ X2>


SOLUTION

 Each state in a CSP is defined by an assignment of values to some or all of the variables
 An assignment that does not violate any constraints is called a consistent or legal assignment
 A complete assignment is one in which every variable is assigned
 A solution to a CSP is consistent and complete assignment
 Allows useful general-purpose algorithms with more power than standard search algorithms
Example: Map Coloring
 Variables: X = {WA, NT, Q, NSW, V, SA, T }

 Domains: Di = {red, green, blue}

 Constraints: adjacent regions must have different colors

 Solution--?
SOLUTION: COMPLETE AND CONSISTENT ASSIGNMENT

 Variables: X = {WA, NT, Q, NSW, V, SA, T }

 Domains: Di = {red, green, blue}

 Constraints: adjacent regions must have different colors

 Solution? {WA = red, NT = green, Q = red, NSW = green, V = red,SA = blue, T = red}.
CONSTRAINT GRAPH
 Constraint graph: nodes are variables, arcs are constraints

 Binary CSP: each constraint relates two variables

 CSP conforms to a standard pattern a set of variables with assigned values

 generic successor function and goal test

 generic heuristics

 reduce complexity

CSP as a Search Problem


 Initial state:

{} – all variables are unassigned


 Successor function:

a value is assigned to one of the unassigned variables with no conflict


 Goal test:

a complete assignment
 Path cost:

a constant cost for each step


Solution appears at depth n if there are n variables
Depth-first or local search methods work well
CSP SOLVERS CAN BE FASTER

 CSP solver can quickly eliminate large part of search space

 If {SA = blue}

 Then 35 assignments can be reduced to 25 assignments, a reduction of 87%

 In a CSP, if a partial assignment is not a solution, we can immediately discard further refinements of it
EXAMPLE
Consider the problem of crossword puzzle: fitting words into a rectangular grid. Assume that a list of words is provided
and that the task is to fill in the blank squares using any subset ofthe list. Formulate this problem precisely in two ways:
 As a general search problem. Choose an appropriate search algorithm.

 As a constraint satisfaction problem.

 Word vs. letters

Problem formulation as CSP:


Class scheduling: There is a fixed number of professors and classrooms,
a list of classes to be offered, and a list of possible time slots for classes.
Each professor has a set of classes that he or she can teach.
Real-World CSPs
 Assignment problems e.g., who teaches what class

 Timetabling problems e.g., which class is offered when and where?

 Transportation scheduling

 Factory scheduling
CONSTRAINT SATISFACTION
PROBLEMS
 Sudoku:
 Each of these constraints is over 9 variables, and they are all the same constraint:
 Any assignment to these 9 variables such that each variable has a unique value satisfies the
constraint.
 Any assignment where two or more variables have the same value falsifies the constraint.
 Such constraints are often called ALL-DIFF constraints.
Sudoku is played on a grid of 9 x 9 spaces. Within the rows and columns are 9 “squares” (made up of 3 x 3
spaces). Each row, column and square (9 spaces each) needs to be filled out with the numbers 1-9, without
repeating any numbers within the row, column or square.

Solve it
BACKTRACKING SEARCH FOR CSPS

 CSPs can be solved by a specialized version of depth first search.

Key intuitions:
 We can build up to a solution by searching through the space of partial assignments.
 Order in which we assign the variables does not matter---eventually they all have to be
assigned.
 If during the process of building up a solution we falsify a constraint, we can immediately
reject all possible ways of extending the current partial assignment
 These ideas lead to the backtracking search algorithm
BACKTRACKING SEARCH ALGORITHM

 Backtracking (BT) Algorithm:

BT(Level)
If all variables assigned
PRINT Value of each Variable
RETURN or EXIT (RETURN for more solutions)
(EXIT for only one solution)
V := PickUnassignedVariable()
Variable[Level] := V
Assigned[V] := TRUE
for d := each member of Domain(V)
Value[V] := d
OK := TRUE
for each constraint C such that
V is a variable of C
and all other variables of C are assigned.
if C is not satisfied by the current set of assignments
if(OK)
BT(Level+1)
●Heuristics are used to determine which variable to assign next “PickUnassignedVariable”.
●The choice can vary from branch to branch
e.g., under the assignment V1=a we might choose to assign V4 next, while under V1=b we might choose to assign
V5 next.
●This “dynamically” chosen variable ordering has a tremendous impact on performance.
Example:
● N-Queens. Place N Queens on an N X N chess board so that no Queen can attack any other Queen.
■ N Variables, one per row. Value of Qi is the column the Queen in row i is placed.
Constrains:
 Vi ≠ Vj for all i ≠ j (cannot put two Queens in same column)
 |Vi-Vj| ≠ |i-j| (Diagonal constraint)

(i.e., the difference in the values assigned to Vi and Vj can’t be equal to the difference between i and j.
ADVERSARIAL SEARCH
 Adversarial search is a game-playing technique where the agents are surrounded by a
competitive environment.
 A conflicting goal is given to the agents (multiagent). These agents compete with one another
and try to defeat one another in order to win the game. Such conflicting goals give rise to
the adversarial search.
 Here, game-playing means discussing those games where human intelligence and logic
factor is used, excluding other factors such as luck factor. Tic-tac-toe, chess, checkers, etc.,
are such type of games where no luck factor works, only mind works.
 Mathematically, this search is based on the concept of ‘Game Theory.’ According to game
theory, a game is played between two players. To complete the game, one has to win the game
and the other looses automatically.’
Techniques required to get the best optimal solution
 There is always a need to choose those algorithms which provide the best optimal solution in a limited time. So, we use the
following techniques which could fulfill our requirements:
• Pruning: A technique which allows ignoring the unwanted portions of a search tree which make no difference in its final
result.
• Heuristic Evaluation Function: It allows to approximate the cost value at each level of the search tree, before reaching the goal
node.
Elements of Game Playing search
 To play a game, we use a game tree to know all the possible choices and to pick the best one out. There are following elements of
a game-playing:
• S0: It is the initial state from where a game begins.

• PLAYER (s): It defines which player is having the current turn to make a move in the state.
• ACTIONS (s): It defines the set of legal moves to be used in a state.
• RESULT (s, a): It is a transition model which defines the result of a move.
• TERMINAL-TEST (s): It defines that the game has ended and returns true.
• UTILITY (s,p): It defines the final value with which the game has ended. This function is also known as Objective
function or Payoff function. The price which the winner will get i.e.
• (-1): If the PLAYER loses.
• (+1): If the PLAYER wins.
• (0): If there is a draw between the PLAYERS.
 For example, in chess, tic-tac-toe, we have two or three possible outcomes. Either to win, to lose, or to draw
the match with values +1,-1 or 0.
 Let’s understand the working of the elements with the help of a game tree designed for tic-tac-toe. Here,
the node represents the game state and edges represent the moves taken by the players.
• INITIAL STATE (S0): The top node in the game-tree represents the initial state in the tree and shows all the
possible choice to pick out one.
• PLAYER (s): There are two players, MAX and MIN. MAX begins the game by picking one best move and
place X in the empty square box.
• ACTIONS (s): Both the players can make moves in the empty boxes chance by chance.
• RESULT (s, a): The moves made by MIN and MAX will decide the outcome of the game.
• TERMINAL-TEST(s): When all the empty boxes will be filled, it will be the terminating state of the game.
• UTILITY: At the end, we will get to know who wins: MAX or MIN, and accordingly, the price will be given
to them.
 Types of algorithms in Adversarial search
 In a normal search, we follow a sequence of actions to reach the goal or to finish the game optimally. But in
an adversarial search, the result depends on the players which will decide the result of the game. It is also
obvious that the solution for the goal state will be an optimal solution because the player will try to win the
game with the shortest path and under limited time.
 There are following types of adversarial search:
• Minmax Algorithm
• Alpha-beta Pruning.
ONLINE SEARCH AGENTS AND
UNKNOWN ENVIRONMENTS
 Online Search Agents

Agent interleaves computation and action


Good for dynamic or semi dynamic domains
When there is a penalty for sitting around and computing
Necessary if the environment is unknown
 Problem stipulates
 List of actions in state s
 Step-cost function based on

1. previous state
2. Action
3. resulting state (only known afterwards)
 Goal test for state
 Sometimes, agent has a heuristic telling it approximately how far from the goal it is
 Simple maze problem

• Agent starts at S and must reach G


• knows nothing of environment

• Competitive Ratio
Path cost over path costs if agent were to know the environment
• often infinite:
Agent can end up in a dead-end state because of an irreversible action
•While exploring, jump down a cliff

You might also like