Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views5 pages

AI Notes

An agent is defined as an entity that perceives its environment and acts upon it, with rational agents selecting actions to maximize performance based on percept sequences. The document discusses various types of agents, including simple reflex, model-based, goal-based, and utility-based agents, as well as the concepts of observability, determinism, and search algorithms. It also covers search strategies like Depth First Search, Breadth First Search, and A* algorithms, emphasizing the importance of heuristics and the distinction between tree and graph search methods.

Uploaded by

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

AI Notes

An agent is defined as an entity that perceives its environment and acts upon it, with rational agents selecting actions to maximize performance based on percept sequences. The document discusses various types of agents, including simple reflex, model-based, goal-based, and utility-based agents, as well as the concepts of observability, determinism, and search algorithms. It also covers search strategies like Depth First Search, Breadth First Search, and A* algorithms, emphasizing the importance of heuristics and the distinction between tree and graph search methods.

Uploaded by

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

An agent is anything that can be viewed as perceiving its environment through

sensors and
acting upon that environment through actuators.

definition of a rational agent:


For each possible percept sequence, a rational agent should select an action that
is expected to
maximize its performance measure, given the evidence provided by the percept
sequence and
whatever built-in knowledge the agent has.

FULLY OBSERVABLE VS. PARTIALLY OBSERVABLE:


If an agent’s sensors give it access
to the complete state of the environment at each point in time, then we say that
the task
environment is fully observable.
An environment might be partially observable because of noisy and inaccurate
sensors or because parts of the state are simply missing from the sensor data.
If the agent has no sensors at all then the environment is unobservable.

Deterministic vs. nondeterministic. If the next state of the environment is


completely
determined by the current state and the action executed by the agent(s), then we
say the
environment is deterministic; otherwise, it is nondeterministic. In principle, an
agent need
not worry about uncertainty in a fully observable, deterministic environment. If
the
environment is partially observable, however, then it could appear to be
nondeterministic.

the word stochastic is used by some as a synonym for “nondeterministic,”


but we make a distinction between the two terms; we say that a model of the
environment
is stochastic if it explicitly deals with probabilities (e.g., “there’s a 25%
chance of rain
tomorrow”) and “nondeterministic” if the possibilities are listed without being
quantified
(e.g., “there’s a chance of rain tomorrow”).

STATIC VS. DYNAMIC: If the environment can change while an agent is deliberating,
then
we say the environment is dynamic for that agent; otherwise, it is static.

Simple reflex agents:


The simplest kind of agent is the simple reflex agent. These agents select actions
on the
basis of the current percept, ignoring the rest of the percept history.

Model-based reflex agents


The most effective way to handle partial observability is for the agent to keep
track of the part
of the world it can’t see now. That is, the agent should maintain some sort of
internal state that
depends on the percept history and thereby reflects at least some of the
unobserved aspects
of the current state.

Goal-based agents
Those agents which works same as model-based agents (knowing the past perception
history) as well as
knows about the goal which need to be achived.

Utility-based agents
The goal based agents which finds the goal following the most optimal path
(maximizing the utility function).
A rational utility-based agent chooses the action that maximizes the expected
utility of the action outcomes

The performance measure evaluates the behavior of the agent in an environment. A


rational agent acts so as to maximize the expected value of the performance
measure,
given the percept sequence it has seen so far.

All agents can improve their performance through learning.

when an agent consider a sequence of actions that form a path to a goal state such
an agent is
called a problem-solving agent, and the computational process it undertakes is
called
search. Problem-solving agents use atomic representations.

In an atomic representation each state of the world is indivisible—it has no


internal
structure.

A factored representation splits up each state into a fixed set of variables or


attributes,
each of which can have a value.

Agents that use factored or structured representations of states


are called planning agents.

informed algorithms, in which the agent can estimate how


far it is from the goal, and uninformed algorithms, where no such estimate is
available.

Unknown enviroment -> if the agent has no information about the enviroment (like
mape of enviroment).
Solution -> If agent finds the sequence of actions to reach a goal state.

State space -> set of all possible states of enviroment where the agent can be in.
Initial state -> where the agent starts
Goal state -> where the agent ends its search

In the state s, Actions(s) returns set of all possible actions that can be take in
that
particuler state s in enviroment by agent, we say that each action in this set is
applicable in state s.

Transitional model -> that describes what each action a does in state s,
Result(s,a) returns
a new state where the agent can be in by taking action a in state s.

Action cost function : Action Cost(s,a,s`) will return cost that describes by
taking action a
in state s then the agent moving to s`.
An optimal solution has the lowest path cost among all
solutions.

The state space can be represented as a graph in which the vertices are states and
the
directed edges between them are actions.

Grid world problem is a two-dimensional rectangular array of square cells in which


agents
can move from cell to cell.

A search algorithm takes a search problem as input and returns a solution, or an


indication
of failure.

Frontier -> Is the set of all discovered states (which is reached but not expended)
by an agent.

best-first search, in which we choose a node with minimum value of some evaluation
function f(n),
where n is node.

A LIFO queue or last-in-first-out queue (also known as a stack) pops first the most
recently added node; we shall see it is used in depth-first search.

A FIFO queue or first-in-first-out queue first pops the node that was added to the
queue
first; we shall see it is used in breadth-first search.

COMPLETENESS: Is the algorithm guaranteed to find a solution when there is one, and
to correctly report failure when there is not?

COST OPTIMALITY: Does it find a solution with the lowest path cost of all
solutions?

TIME COMPLEXITY: How long does it take to find a solution? This can be measured in
seconds, or more abstractly by the number of states and actions considered.

SPACE COMPLEXITY: How much memory is needed to perform the search?

/////////////////

Reflex agent -> may or may not have memory, do not consider the future consequences
of taking action,
only takes action on the based of current state.

Planning agent -> Have memory and also consider future consequences of taking
action.

▪ Optimal vs. complete planning


▪ Planning vs. replanning

Search problem consist of -> state space, start state, goal state, successor
function(s,a),
Solution -> Is the sequence of actions from start state to goal state.
World state -> includes all the states (set of all states)
Search state -> includes the requeired state that the planning agent looking for.

State space graph: A mathematical representation of a search problem


▪ Nodes are (abstracted) world configurations
▪ Arcs represent successors (action results)
▪ The goal test is a set of goal nodes (maybe only one)

▪ In a state space graph, each state occurs only


once!

A Search Tree:
▪ A “what if” tree of plans and their outcomes
▪ The start state is the root node
▪ Children correspond to successors
▪ Nodes show states, but correspond to PLANS that achieve those states

Frontier <=> fringe

Depth First Search (DFS):


Implement fringe in LIFO stack.
If b is branching factor (no. of childern) and m is tiers (no. of generations) in
tree then DFS could takes:
time: O(b^m) and space: O(bm) in the worst case.
It is not optimal but it is complete.

Breath First Search (BFS):


Implement fringe in FIFO queue.
If b is branching factor (no. of childern) and shellowest (nearest as possible)
node solution is at m which is tiers (no. of generations) in tree then BFS could
takes:
time: O(b^m) and space: O(b^m) in the worst case.
It is optimal always but every path cost must be 1.

Iterative Deepening:
Iterative Deepening Search (IDS) is a search strategy that combines the:
Space-efficiency of Depth-First Search (DFS)
Completeness and optimality of Breadth-First Search (BFS)
It works by running depth-limited DFS repeatedly, increasing the depth limit one
level at a time until the goal is found.

Uniform Cost Function:


BFS finds shortest path in terms of actions not in terms of cost of path, uniform
cost search will do this job.
Strategy: Expend a cheapest node first.
Frontier is Priority Queue.
If C* is optimal solution cost and e is arc minimum cost then tiers (generations)
are C*/e then:
it takes time: O(b^C*/e) and space as same.
It is optimal always.

A heuristic is:
▪ A function that estimates how close a state is to a goal
▪ Designed for a particular search problem
▪ Examples: Manhattan distance, Euclidean distance for pathing

A* -> UCF + Heuristic = g(x) + h(x)

Admissible (optimistic) heuristics slow down bad plans but never outweigh true
costs (optimility is garenteed).
Inadmissible (pessimistic) heuristics break optimality by trapping good plans on
the fringe (optimility is not garenteed).
So we need to select good heuristics and good heuristics are based on the type of
problem we are dealing with.

Tree search:
▪ A* is optimal if heuristic is admissible
▪ UCS is a special case (h = 0)

Graph search:
▪ A* optimal if heuristic is consistent
▪ UCS optimal (h = 0 is consistent)

▪ Consistency implies admissibility


▪ In general, most natural admissible heuristics tend to be consistent, especially
if from relaxed problems.

🟨 All consistent heuristics are admissible, but


🟥 Not all admissible heuristics are consistent.

▪ A* uses both backward costs and (estimates of) forward costs


▪ A* is optimal with admissible / consistent heuristics
▪ Heuristic design is key: often use relaxed problems

Relaxed Problems:
A relaxed problem is a simplified version of the original problem, where some
constraints are removed to make it easier to solve.
The idea is: by removing some rules, the problem becomes simpler — and you can
solve it more quickly or easily.
The cost of the solution to the relaxed problem is then used as a heuristic
estimate (h(n)) for the original problem.
Example:
Pathfinding in a Grid
Original Problem: You’re in a grid and can move only in 4 directions (up, down,
left, right), and you must avoid walls.

Relaxed Problem: Remove some constraints like:


Allow diagonal moves
Or ignore walls
Or move in any direction for free
Now it's easier to compute a solution.
The cost of this easier solution is an underestimate of the real cost — so it's
safe to use as a heuristic.

In Tree search we did not take care of discovered nodes while in graph seach we did
care of discovered nodes bcz
graph could have loops while tree did not.

A heuristic h(n) is consistent if, for every node and every successor of
generated by an action we have: h(n) ≤ c(n,a,n′) +h(n′).

You might also like