SlideShare a Scribd company logo
1 of 32
Agents and Problem Formulation
CSI 341 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Agents
2
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Agents >> Structure
agent = architecture + program
Agent program >> It implements the agent function – the mapping from percepts to actions.
Architecture >> It is some sort of computing device with physical sensors and actuators on which agent program will run.
Architecture makes the percepts from the sensors available to the program, runs the program, and feeds the program’s
action choices to the actuators as they are generated.
3
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Agents >> Table-Driven-Agent program
4
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Agents >> Table-Driven-Agent program
Problems>>
▸Let P be the set of possible percepts and let T be the lifetime of the agent. The lookup table will contain
σ 𝑡=1
𝑇
𝑃 𝑡
entries. So no physical agent in this universe will have the space to store the table.
▸The designer would not have time to create the table.
▸No agent could ever learn all the right table entries from its experience.
▸If the environment is simple enough to yield a feasible table size, the designer still has no guidance about
how to fill in the table entries.
5
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Agents >> Types
>> The key challenge for AI is to find out how to write programs that to the extent possible, produce rational
behavior from a smallish program rather than from a vast table.
>> 5 kinds 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 agents
6
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Simple Reflex Agents
▸ The Simple reflex agents are the simplest agents. These agents take decisions on the basis of the current
percepts and ignore the rest of the percept history.
▸ These agents only succeed in the fully observable environment.
▸ The Simple reflex agent does not consider any part of percepts history during their decision and action
process.
▸ The Simple reflex agent works on Condition-action rule, which means it maps the current state to action.
Such as a Room Cleaner agent, it works only if there is dirt in the room.
▸ Problems for the simple reflex agent design approach:
▹ They have very limited intelligence
▹ They do not have knowledge of non-perceptual parts of the current state
▹ Not adaptive to changes in the environment.
7
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Simple Reflex Agents
8
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Model-based Reflex Agents
▸The Model-based agent can work in a partially observable environment, and track the situation.
▸A model-based agent has two important factors:
Model: It is knowledge about "how things happen in the world," so it is called a Model-based agent.
Internal State: It is a representation of the current state based on percept history.
▸These agents have the model, "which is knowledge of the world" and based on the model they perform
actions.
▸Updating the agent state requires information about:
▹How the world evolves
▹How the agent's action affects the world.
9
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Model-based Reflex Agents
10
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Goal-based Agents
▸The knowledge of the current state environment is not always sufficient to decide for an agent to what to do.
▸The agent needs to know its goal which describes desirable situations.
▸Goal-based agents expand the capabilities of the model-based agent by having the "goal" information.
▸They choose an action, so that they can achieve the goal.
▸These agents may have to consider a long sequence of possible actions before deciding whether the goal is
achieved or not. Such considerations of different scenario are called searching and planning, which makes an
agent proactive.
11
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Goal-based Agents
12
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Utility-based Agents
▸These agents are similar to the goal-based agent but provide an extra component of utility measurement
which makes them different by providing a measure of success at a given state.
▸Utility-based agent act based not only goals but also the best way to achieve the goal.
▸The Utility-based agent is useful when there are multiple possible alternatives, and an agent has to choose in
order to perform the best action.
▸The utility function maps each state to a real number to check how efficiently each action achieves the goals.
13
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Utility-based Agents
14
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Learning Agents
▸A learning agent in AI is the type of agent which can learn from its past experiences, or it has learning
capabilities.
▸It starts to act with basic knowledge and then able to act and adapt automatically through learning.
▸A learning agent has mainly four conceptual components, which are:
- Learning element: It is responsible for making improvements by learning from environment
- Critic: Learning element takes feedback from critic which describes that how well the agent is
doing with respect to a fixed performance standard.
- Performance element: It is responsible for selecting external action
- Problem generator: This component is responsible for suggesting actions that will lead to new
and informative experiences.
Hence learning agents are able to learn, analyze performance, and look for new ways to improve the
performance.
15
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Learning Agents
16
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
17
Solving Problems by Searching
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Problem-Solving Agents [Goal-based Agent]
Problem solving steps:
1. Goal Formulation
- Formulate goals based on the current situation and the agent’s performance.
2. Problem Formulation
- It is the process of deciding what actions and states to consider, given a goal.
3. Search for Solution
- The process of looking for a sequence of actions that reaches the goal is called search.
- A search algorithm takes a problem as input and returns a solution in the form of an action sequence.
4. Execution
- The process of executing the first action from the solution’s action sequence.
Assumptions:
Fully observable, Single agent, Discrete, Deterministic, Static
18
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Traveling in Romania
19
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Traveling in Romania
▸Formulate goal:
- be in Bucharest
▸Formulate problem:
- states: various cities
- actions/operators: drive between cities
▸Find solution
- By searching through states to find a goal
- sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest
▸Execute states that lead to a solution
20
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Well-defined Problems >> Traveling in Romania
A problem can be defined formally by 5 components:
▸Initial State:
- The state from which the agent starts; here Initial state= In(Arad)
▸Actions:
- A description of the possible actions available to the agent.
- ACTIONS(s) = the set of actions that can be executed in s
- For this example, ACTIONS( In(Arad) ) = { GO(Sibiu), GO(Timisoara), GO(Zerind) }
▸Transition Model:
- A description of what each action does
- It is specified by a function RESULT(s, a) that returns the state that results from doing action a in state s.
- For this example, RESULT( IN(Arad), GO(Zerind) ) = IN(Zerind)
- 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 graph in which the nodes are states and the links between nodes are actions.
▸Goal Test
- It determines whether a given state is a goal state; for this example, Goal States = { IN(Bucharest) }
▸Path cost
- Sum of the costs of the individual actions along the path.
21
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Vacuum World Problem
States >>
The agent is one of two locations and each of which might or might not contain dirt. So there are 2 x 22 = 8 world states.
A larger environment with n locations has n.2n states.
Initial State >> any state can be the initial state
Actions >> { Left, Right, Suck }
Transition Model >> It is represented as a state-space graph shown in the next slide.
Goal Test >> This checks whether all the squares are clean?
Path Cost >> Each step cost is 1, so the path cost is the number of steps in the path.
22
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Vacuum World Problem
23
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> 8-puzzle
States >> each state describes the location of each of the 8 tiles and the blank. So in total 9! no of states.
Initial State>> Any state can be the initial state
Actions >> Left, Right, Up or Down
Transition Model >> If we apply Left to the start state the resulting state has the 5 and the blank switched.
Goal Test >> Checks whether the current state matched the goal state?
Path Cost >> Each step costs 1, so the path cost is the number of steps in the path.
24
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> 8-queen
States >> any arrangements of 0 to 8 queens on the board, total = 64.63. … … .57 = 1.8 x 1014 possibilities
or,
all possible arrangements of n queens one per column in the leftmost n columns, with no queen attacking another
Initial State >> No queens on the board
Actions >> 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 >> 1 per move.
25
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Water Jug problem
▸You have a 4-gallon and a 3-gallon water jug
▸You have a faucet with an unlimited amount of water
▸You need to get exactly 2 gallons in 4-gallon jug
26
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Example >> Water Jug problem
States >> Each state is represented as (x,y) where x =contents of 4 gallon and y = contents of 3 gallon, in total=5x4=20 states.
Initial State >> (0,0)
Actions and Transition Model >> following, Goal Test>> state = (2, n) ?? Path Cost >> 1 per step
27
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
(x,y)  (4,y) if x < 4 Fill the 4-gallon jug
(x,y)  (x,3) if y < 3 Fill the 3-gallon jug
(x,y)  (0,y) if x > 0 Empty 4-gallon jug on ground
(x,y)  (x,0) if y > 0 Empty 3-gallon jug on ground
(x, y)  (4, y-(4-x) ) if y>0 and x+y>=4 Pour water from 3-gallon to fill 4-gallon
(x, y)  (x-(3-y), 3) if x>0 and x+y>=3 Pour water from 4-gallon to 3-gallon to fill it
(x, y)  (x+y, 0) if x+y<=4 and y>0 Pour all of water from 3-gallon to 4-gallon
(x, y)  (0, x+y) if x+y<=3 and x>0 Pour all of water from 4-gallon to 3-gallon
Example >> Water Jug problem
One Solution>>
28
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Previous Questions
29
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Previous Questions
30
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Previous Questions
31
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
32
THANKS!
Any questions?
You can find me at imam@cse.uiu.ac.bd

More Related Content

What's hot

Practical Natural Language Processing
Practical Natural Language ProcessingPractical Natural Language Processing
Practical Natural Language Processing
Jaganadh Gopinadhan
 
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)   Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
Archana432045
 

What's hot (20)

AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Practical Natural Language Processing
Practical Natural Language ProcessingPractical Natural Language Processing
Practical Natural Language Processing
 
Problems, Problem spaces and Search
Problems, Problem spaces and SearchProblems, Problem spaces and Search
Problems, Problem spaces and Search
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Local search algorithms
Local search algorithmsLocal search algorithms
Local search algorithms
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
 
AI simple search strategies
AI simple search strategiesAI simple search strategies
AI simple search strategies
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
 
State Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxState Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptx
 
Minimax
MinimaxMinimax
Minimax
 
I. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in aiI. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in ai
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
Scaling
ScalingScaling
Scaling
 
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)   Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
 
asymptotic notation
asymptotic notationasymptotic notation
asymptotic notation
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Min-Max algorithm
Min-Max algorithmMin-Max algorithm
Min-Max algorithm
 

Similar to AI 2 | Rational Agents and Problem Formulation

Similar to AI 2 | Rational Agents and Problem Formulation (20)

Week 3.pdf
Week 3.pdfWeek 3.pdf
Week 3.pdf
 
Slide01 - Intelligent Agents.ppt
Slide01 - Intelligent Agents.pptSlide01 - Intelligent Agents.ppt
Slide01 - Intelligent Agents.ppt
 
Intelligent Agents
Intelligent AgentsIntelligent Agents
Intelligent Agents
 
Structure of agents
Structure of agentsStructure of agents
Structure of agents
 
Artificial Intelligent Agents
Artificial Intelligent AgentsArtificial Intelligent Agents
Artificial Intelligent Agents
 
AI_02_Intelligent Agents.pptx
AI_02_Intelligent Agents.pptxAI_02_Intelligent Agents.pptx
AI_02_Intelligent Agents.pptx
 
Lecture 04 intelligent agents
Lecture 04 intelligent agentsLecture 04 intelligent agents
Lecture 04 intelligent agents
 
Agents-and-Problem-Solving-20022024-094442am.pdf
Agents-and-Problem-Solving-20022024-094442am.pdfAgents-and-Problem-Solving-20022024-094442am.pdf
Agents-and-Problem-Solving-20022024-094442am.pdf
 
AI Lesson 22
AI Lesson 22AI Lesson 22
AI Lesson 22
 
Lesson 22
Lesson 22Lesson 22
Lesson 22
 
CS 3491 Artificial Intelligence and Machine Learning Unit I Problem Solving
CS 3491 Artificial Intelligence and Machine Learning Unit I Problem SolvingCS 3491 Artificial Intelligence and Machine Learning Unit I Problem Solving
CS 3491 Artificial Intelligence and Machine Learning Unit I Problem Solving
 
Intelligence Agent - Artificial Intelligent (AI)
Intelligence Agent - Artificial Intelligent (AI)Intelligence Agent - Artificial Intelligent (AI)
Intelligence Agent - Artificial Intelligent (AI)
 
W2_Lec03_Lec04_Agents.pptx
W2_Lec03_Lec04_Agents.pptxW2_Lec03_Lec04_Agents.pptx
W2_Lec03_Lec04_Agents.pptx
 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introduction
 
Infosec
InfosecInfosec
Infosec
 
Lec 2-agents
Lec 2-agentsLec 2-agents
Lec 2-agents
 
artificial intelligence document final.pptx
artificial intelligence document final.pptxartificial intelligence document final.pptx
artificial intelligence document final.pptx
 
Agents_AI.ppt
Agents_AI.pptAgents_AI.ppt
Agents_AI.ppt
 
Chapter 5 of 1
Chapter 5 of 1Chapter 5 of 1
Chapter 5 of 1
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptx
 

More from Mohammad Imam Hossain

More from Mohammad Imam Hossain (20)

DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6
 
DS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic ProgrammingDS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic Programming
 
DS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MSTDS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MST
 
DS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path SearchDS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path Search
 
DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3
 
DS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and ConquerDS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and Conquer
 
DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2
 
DS & Algo 2 - Recursion
DS & Algo 2 - RecursionDS & Algo 2 - Recursion
DS & Algo 2 - Recursion
 
DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1
 
DS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL IntroductionDS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL Introduction
 
DBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMSDBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMS
 
DBMS 10 | Database Transactions
DBMS 10 | Database TransactionsDBMS 10 | Database Transactions
DBMS 10 | Database Transactions
 
DBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational SchemaDBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational Schema
 
DBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship ModelDBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship Model
 
DBMS 7 | Relational Query Language
DBMS 7 | Relational Query LanguageDBMS 7 | Relational Query Language
DBMS 7 | Relational Query Language
 
DBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML CommandsDBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML Commands
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
TOC 10 | Turing Machine
TOC 10 | Turing MachineTOC 10 | Turing Machine
TOC 10 | Turing Machine
 
TOC 9 | Pushdown Automata
TOC 9 | Pushdown AutomataTOC 9 | Pushdown Automata
TOC 9 | Pushdown Automata
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity CheckTOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity Check
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

AI 2 | Rational Agents and Problem Formulation

  • 1. Agents and Problem Formulation CSI 341 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 2. Agents 2 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 3. Agents >> Structure agent = architecture + program Agent program >> It implements the agent function – the mapping from percepts to actions. Architecture >> It is some sort of computing device with physical sensors and actuators on which agent program will run. Architecture makes the percepts from the sensors available to the program, runs the program, and feeds the program’s action choices to the actuators as they are generated. 3 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 4. Agents >> Table-Driven-Agent program 4 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 5. Agents >> Table-Driven-Agent program Problems>> ▸Let P be the set of possible percepts and let T be the lifetime of the agent. The lookup table will contain σ 𝑡=1 𝑇 𝑃 𝑡 entries. So no physical agent in this universe will have the space to store the table. ▸The designer would not have time to create the table. ▸No agent could ever learn all the right table entries from its experience. ▸If the environment is simple enough to yield a feasible table size, the designer still has no guidance about how to fill in the table entries. 5 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 6. Agents >> Types >> The key challenge for AI is to find out how to write programs that to the extent possible, produce rational behavior from a smallish program rather than from a vast table. >> 5 kinds 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 agents 6 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 7. Simple Reflex Agents ▸ The Simple reflex agents are the simplest agents. These agents take decisions on the basis of the current percepts and ignore the rest of the percept history. ▸ These agents only succeed in the fully observable environment. ▸ The Simple reflex agent does not consider any part of percepts history during their decision and action process. ▸ The Simple reflex agent works on Condition-action rule, which means it maps the current state to action. Such as a Room Cleaner agent, it works only if there is dirt in the room. ▸ Problems for the simple reflex agent design approach: ▹ They have very limited intelligence ▹ They do not have knowledge of non-perceptual parts of the current state ▹ Not adaptive to changes in the environment. 7 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 8. Simple Reflex Agents 8 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 9. Model-based Reflex Agents ▸The Model-based agent can work in a partially observable environment, and track the situation. ▸A model-based agent has two important factors: Model: It is knowledge about "how things happen in the world," so it is called a Model-based agent. Internal State: It is a representation of the current state based on percept history. ▸These agents have the model, "which is knowledge of the world" and based on the model they perform actions. ▸Updating the agent state requires information about: ▹How the world evolves ▹How the agent's action affects the world. 9 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 10. Model-based Reflex Agents 10 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 11. Goal-based Agents ▸The knowledge of the current state environment is not always sufficient to decide for an agent to what to do. ▸The agent needs to know its goal which describes desirable situations. ▸Goal-based agents expand the capabilities of the model-based agent by having the "goal" information. ▸They choose an action, so that they can achieve the goal. ▸These agents may have to consider a long sequence of possible actions before deciding whether the goal is achieved or not. Such considerations of different scenario are called searching and planning, which makes an agent proactive. 11 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 12. Goal-based Agents 12 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 13. Utility-based Agents ▸These agents are similar to the goal-based agent but provide an extra component of utility measurement which makes them different by providing a measure of success at a given state. ▸Utility-based agent act based not only goals but also the best way to achieve the goal. ▸The Utility-based agent is useful when there are multiple possible alternatives, and an agent has to choose in order to perform the best action. ▸The utility function maps each state to a real number to check how efficiently each action achieves the goals. 13 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 14. Utility-based Agents 14 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 15. Learning Agents ▸A learning agent in AI is the type of agent which can learn from its past experiences, or it has learning capabilities. ▸It starts to act with basic knowledge and then able to act and adapt automatically through learning. ▸A learning agent has mainly four conceptual components, which are: - Learning element: It is responsible for making improvements by learning from environment - Critic: Learning element takes feedback from critic which describes that how well the agent is doing with respect to a fixed performance standard. - Performance element: It is responsible for selecting external action - Problem generator: This component is responsible for suggesting actions that will lead to new and informative experiences. Hence learning agents are able to learn, analyze performance, and look for new ways to improve the performance. 15 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 16. Learning Agents 16 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 17. 17 Solving Problems by Searching Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 18. Problem-Solving Agents [Goal-based Agent] Problem solving steps: 1. Goal Formulation - Formulate goals based on the current situation and the agent’s performance. 2. Problem Formulation - It is the process of deciding what actions and states to consider, given a goal. 3. Search for Solution - The process of looking for a sequence of actions that reaches the goal is called search. - A search algorithm takes a problem as input and returns a solution in the form of an action sequence. 4. Execution - The process of executing the first action from the solution’s action sequence. Assumptions: Fully observable, Single agent, Discrete, Deterministic, Static 18 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 19. Example >> Traveling in Romania 19 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 20. Example >> Traveling in Romania ▸Formulate goal: - be in Bucharest ▸Formulate problem: - states: various cities - actions/operators: drive between cities ▸Find solution - By searching through states to find a goal - sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest ▸Execute states that lead to a solution 20 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 21. Well-defined Problems >> Traveling in Romania A problem can be defined formally by 5 components: ▸Initial State: - The state from which the agent starts; here Initial state= In(Arad) ▸Actions: - A description of the possible actions available to the agent. - ACTIONS(s) = the set of actions that can be executed in s - For this example, ACTIONS( In(Arad) ) = { GO(Sibiu), GO(Timisoara), GO(Zerind) } ▸Transition Model: - A description of what each action does - It is specified by a function RESULT(s, a) that returns the state that results from doing action a in state s. - For this example, RESULT( IN(Arad), GO(Zerind) ) = IN(Zerind) - 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 graph in which the nodes are states and the links between nodes are actions. ▸Goal Test - It determines whether a given state is a goal state; for this example, Goal States = { IN(Bucharest) } ▸Path cost - Sum of the costs of the individual actions along the path. 21 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 22. Example >> Vacuum World Problem States >> The agent is one of two locations and each of which might or might not contain dirt. So there are 2 x 22 = 8 world states. A larger environment with n locations has n.2n states. Initial State >> any state can be the initial state Actions >> { Left, Right, Suck } Transition Model >> It is represented as a state-space graph shown in the next slide. Goal Test >> This checks whether all the squares are clean? Path Cost >> Each step cost is 1, so the path cost is the number of steps in the path. 22 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 23. Example >> Vacuum World Problem 23 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 24. Example >> 8-puzzle States >> each state describes the location of each of the 8 tiles and the blank. So in total 9! no of states. Initial State>> Any state can be the initial state Actions >> Left, Right, Up or Down Transition Model >> If we apply Left to the start state the resulting state has the 5 and the blank switched. Goal Test >> Checks whether the current state matched the goal state? Path Cost >> Each step costs 1, so the path cost is the number of steps in the path. 24 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 25. Example >> 8-queen States >> any arrangements of 0 to 8 queens on the board, total = 64.63. … … .57 = 1.8 x 1014 possibilities or, all possible arrangements of n queens one per column in the leftmost n columns, with no queen attacking another Initial State >> No queens on the board Actions >> 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 >> 1 per move. 25 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 26. Example >> Water Jug problem ▸You have a 4-gallon and a 3-gallon water jug ▸You have a faucet with an unlimited amount of water ▸You need to get exactly 2 gallons in 4-gallon jug 26 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 27. Example >> Water Jug problem States >> Each state is represented as (x,y) where x =contents of 4 gallon and y = contents of 3 gallon, in total=5x4=20 states. Initial State >> (0,0) Actions and Transition Model >> following, Goal Test>> state = (2, n) ?? Path Cost >> 1 per step 27 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU (x,y)  (4,y) if x < 4 Fill the 4-gallon jug (x,y)  (x,3) if y < 3 Fill the 3-gallon jug (x,y)  (0,y) if x > 0 Empty 4-gallon jug on ground (x,y)  (x,0) if y > 0 Empty 3-gallon jug on ground (x, y)  (4, y-(4-x) ) if y>0 and x+y>=4 Pour water from 3-gallon to fill 4-gallon (x, y)  (x-(3-y), 3) if x>0 and x+y>=3 Pour water from 4-gallon to 3-gallon to fill it (x, y)  (x+y, 0) if x+y<=4 and y>0 Pour all of water from 3-gallon to 4-gallon (x, y)  (0, x+y) if x+y<=3 and x>0 Pour all of water from 4-gallon to 3-gallon
  • 28. Example >> Water Jug problem One Solution>> 28 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 29. Previous Questions 29 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 30. Previous Questions 30 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 31. Previous Questions 31 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 32. 32 THANKS! Any questions? You can find me at imam@cse.uiu.ac.bd