Unit 1 - Ai - KCS071
Unit 1 - Ai - KCS071
Unit 1 - Ai - KCS071
071)
Course Instructor : Dr. Deepak Sethi
Learning Outcomes
By the end of this course, you will be able to :
• explain search strategies and solve problems by applying a suitable
search method
• analyse and apply knowledge representation
• describe and list the key aspects of planning in artificial intelligence
• analyse and apply probability theorem and Bayesian networks
• describe the key aspects of intelligent agents
• differentiate the key aspects of evolutionary computation, including
genetic algorithms and genetic programming
• describe the key aspects of machine learning
Introduction to Artificial Intelligence (AI)
Sensor: Sensor is a device which detects the change in the environment and
sends the information to other electronic devices. An agent observes its
environment through sensors.
Actuators: Actuators are the component of machines that converts energy
into motion. The actuators are only responsible for moving and controlling
a system. An actuator can be an electric motor, gears, rails, etc.
Intelligent Agents
An Agent runs in the cycle of perceiving, thinking, and acting. An
agent can be:
• Human-Agent: A human agent has eyes, ears, and other organs which
work for sensors and hand, legs, vocal tract work for actuators.
• Robotic Agent: A robotic agent can have cameras, infrared range
finder, NLP for sensors and various motors for actuators.
• Software Agent: Software agent can have keystrokes, file contents as
sensory input and act on those inputs and display output on the screen.
Intelligent Agent
An intelligent agent is an autonomous entity which act upon an environment using sensors and actuators
for achieving goals. An intelligent agent may learn from the environment to achieve their goals.
Examples
AI assistants, like Alexa and Siri, are examples of intelligent agents as they use sensors to perceive a
request made by the user and the automatically collect data from the internet without the user's
help. They can be used to gather information about its perceived environment such as weather and time.
Structure of AI Agent
Agent = Architecture + Agent program
• Architecture: Architecture is machinery that an AI agent executes on.
• Agent Function: Agent function is used to map a percept to an action.
f:P* → A
• Agent program: Agent program is an implementation of agent
function. An agent program executes on the physical architecture to
produce function f.
PEAS Representation
PEAS is a type of model on which an AI agent works upon.
• P: Performance measure
• E: Environment
• A: Actuators
• S: Sensors
• Solution:
• The state space for this problem can be described as the set of ordered pairs of
integers (x,y)
Where,
• X represents the quantity of water in the 4-gallon jug X= 0,1,2,3,4
• Y represents the quantity of water in 3-gallon jug Y=0,1,2,3
• Start State: (0,0)
• Goal State: (2,0)
Production Rules
State Space Tree
Production Rules
Rule State Process
1 (X,Y | X<4) (4,Y)
{Fill 4-gallon jug}
2 (X,Y |Y<3) (X,3)
{Fill 3-gallon jug}
3 (X,Y |X>0) (0,Y)
{Empty 4-gallon jug}
4 (X,Y | Y>0) (X,0)
{Empty 3-gallon jug}
5 (X,Y | X+Y>=4 (4,Y-(4-X))
and Y>0) {Pour water from 3-gallon jug into 4-gallon
jug until 4-gallon jug is full}
9 (0,2) (2,0)
{Pour 2 gallon water from 3 gallon jug into 4
gallon jug}
• Initialization:
• Start State: (0,0)
• Apply Rule 2:
• (X,Y | Y<3) -> (X,3) {Fill 3-gallon jug}
• Now the state is (X,3) (0,0)->(0,3)->(3,0)->(3,3)->(4,2)->(0,2)->(2,0)
• Iteration 1:
• Current State: (X,3)
• Apply Rule 7:
• (X,Y | X+Y<=4 and Y>0)
• (X+Y,0) {Pour all water from 3-gallon jug into 4-gallon jug}
• Now the state is (3,0)
• Iteration 2:
• Current State : (3,0)
• Apply Rule 2:
• (X,Y | Y<3) -> (3,3) {Fill 3-gallon jug}
• Now the state is (3,3)
• Iteration 3:
• Current State:(3,3)
• Apply Rule 5:
• (X,Y | X+Y>=4 and Y>0)
• (4,Y-(4-X)) {Pour water from 3-gallon jug into 4-gallon jug until 4-gallon jug is full}
• Now the state is (4,2)
• Iteration 4:
• Current State : (4,2)
• Apply Rule 3:
• (X,Y | X>0)
• (0,Y) {Empty 4-gallon jug}
• Now state is (0,2)
• Iteration 5:
• Current State : (0,2)
• Apply Rule 9:
• (0,2)
• (2,0) {Pour 2 gallon water from 3 gallon jug into 4 gallon jug}
• Now the state is (2,0) // Goal Achieved.
Task : Monkey Banana Problem
References
• https://www.javatpoint.com/artificial-intelligence-tutorial
• http://asia.blog.terrapinn.com/edutech/2018/02/28/role-artificial-int
elligence-ai-education/
• https://www.geeksforgeeks.org/agents-artificial-intelligence/
• https://www.javatpoint.com/agents-in-ai
• https://www.tutorialspoint.com/artificial_intelligence/artificial_intelli
gence_natural_language_processing.htm