Unit1 Ai
Unit1 Ai
22CS5PCAIN
Course Instructor
Dr. Umadevi V
Department of CSE, BMSCE
Four Approaches to AI
I am
Who are Computer.
you ?
Alan Turing
The Turing Test, proposed by Alan Turing (1950),
was designed to provide a satisfactory
operational definition of intelligence
2 October 2024 BMSCE 7
Acting Rationally:
□ This approach focuses on building artificial intelligence systems
that can act rationally. The goal is to create systems that can
make decisions and take actions that are consistent with the
principles of rational thinking and that achieve their goals
efficiently and effectively.
Acting Rationally:
Acting Humanly:
Systems that act Rationally
Systems that act like Humans
Example: Reinforcement learning
Example: Self-driving cars, Facial
algorithms, Games AI
Recognition systems
Acting rationally — the study of
rational agents: agents that
Acting humanly — the Turing
maximize the expected value
Test approach.
of their performance measure
given what they currently know.
2 October 2024 BMSCE 9
2 October 2024 BMSCE 10
Question
Generic Agent
t
Environmen
Microphones
Touch
`
Motors
Voice
Game
U
YO
Agent
Its Own
Moves
□ Agent Program
Function REFLEX-VACUUM-AGENT([location, status]) returns an action
PEAS Description
□ Performance measure: Price, quality,
appropriateness, efficiency……
□ Environment: Current Website, Customers,
Shippers……
□ Actuators: Display to user, follow URL, fill in
form……
□ Sensors: HTML pages (text, graphics, scripts)
The Wumpus world is a cave with 16 rooms (4×4). Each room is connected to others through walkways (no rooms
are connected diagonally). The knowledge-based agent starts from Room[1, 1]. The cave has – some pits,
a treasure and a beast named Wumpus. The Wumpus can not move but eats the one who enters its room. If the
agent enters the pit, it gets stuck there. The goal of the agent is to take the treasure and come out of the cave. The
agent is rewarded, when the goal conditions are met. The agent is penalized, when it falls into a pit or being eaten
by the Wumpus.
Some elements support the agent to explore the cave, like -The wumpus’s adjacent rooms are stenchy. -The agent
is given one arrow which it can use to kill the wumpus when facing it (Wumpus screams when it is killed). – The
adjacent rooms of the room with pits are filled with breeze. -The treasure room is always glittery.
Write the PEAS description and properties of the task environment
Problems:
□ The table can become very large.
□ It usually takes a very long time for the
designer to specify it.
□ . . . practically impossible!
Example:
It senses the room temperature and
Thermostat turns the heater on or off based on a
pre-set temperature range
Light sensor in a street It detects darkness and triggers the
lamp lamp to turn on
You select a product, and the
Vending machine machine dispenses it based on your
button press
Example:
Drawbacks:
□ There is an increased level of complexity.
□ The agent’s performance relies heavily on the accuracy
of its internal model.
□ There is always an issue of limited learning. Because,
these AI agents rely on pre-programmed rules and don’t
exhibit true learning capabilities.
Example:
A robot might use a goal-based approach to
Robot path planning plan its path around obstacles to reach a
specific location
Chess programs or AI opponents in strategy
Game-playing AI games employ goal-based decision-making to
achieve victory
These apps use goal-based algorithms to find
Navigation apps
the best route for you to reach your destination
❑ Yes
❑ No
Problem Solving – Route Map
Problem Solving – Route Map
Problem Solving by Search
Problem Solving Agent or Goal Based Agent
action
Agent:
On holiday in Romania, currently in Arad.
Flight leaves tomorrow from Bucharest
Initial state
Route Map
Route Map
Route Map
What is Search?
□ Search is the systematic examination of states to find
path from the start/root state to the goal state.
□ The set of possible states, together with operators
defining their connectivity constitute the search space.
□ The output of a search algorithm is a solution, that is, a
path from the initial state to a state that satisfies the
goal test.
2 October 2024 BMSCE 146
Problem Solving by Search
A well-defined problem can be described by:
□ Initial state
□ Operator or successor function - For any state
x returns s(x), the set of states reachable from
x with one action
□ State space - All states reachable from initial
state by any sequence of actions
□ Path - Sequence through state space
□ Path cost - Function that assigns a cost to a
path. Cost of a path is the sum of costs of
individual actions along the path
□ Goal test - Test to determine if at goal state
Goal:
No dirt in the rooms
Path costs:
One unit per action
States:
• The state is determined by both the agent location and the dirt locations.
• The agent is in one of two locations, each of which might or might not
contain dirt.
• Thus, there are 2 × 22 = 8 possible world states.
Initial state: Any state can be designated as the initial state.
Actions: Each state has just three actions: Left, Right, and “Pick Dust”.
Transition model:
• The actions have their expected effects, except that moving Left in the
leftmost square, moving Right in the rightmost square, and “Pick Dust” in a
clean square have no effect.
• The transition model defines a state space.
Goal test: This checks whether all the squares are clean.
Path cost: Each step costs 1, so the path cost is the number of steps in the
path.
5 4 1 2
6 1 8 3 4 5
7 3 2 6 7 8
• The 8-puzzle consists of a 3×3 board with eight numbered tiles and a blank space.
• A tile adjacent to the blank space can slide into the space.
• The object is to reach a specified goal state.
5 4 1 2
6 1 8 3 4 5
7 3 2 6 7 8
Example 2:
Input: X = 3, Y = 5, Z = 4
Output: 6
Explanation:
□ Fill a 5-litres jug to its maximum capacity.
□ Transfer 3 litres from 5-litre jug to 3-litre jug.
□ Empty the 3-litre jug.
□ Transfer 2-litres from 5-litre jug to 3-litres jug.
□ Fill a 5-litres jug to its maximum capacity.
□ Pour water into a 3L jug from a 5L jug until it’s full.
Note: If at any time the Cannibals outnumber the Missionaries on either bank of the
river, they will eat the Misssionaries
Sibiu Bucharest
2 October 2024 BMSCE 182
Tree Search Algorithms
Basic idea:
□ Offline, simulated exploration of state space
□ By generating successors of already-explored
states (a.k.a. expanding states)