0% found this document useful (0 votes)
11 views71 pages

Chapter 1

Artificial Intelligence (AI) is defined as the science and engineering of creating intelligent machines that can perform tasks requiring human-like intelligence. The document outlines the four approaches to AI, the categorization of intelligent systems into narrow, general, and super intelligence, and the essential components of AI including perception, learning, reasoning, and natural language processing. It also describes the concept of agents, their architecture, and provides examples of various AI applications and problem-solving scenarios.

Uploaded by

kashishj405
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)
11 views71 pages

Chapter 1

Artificial Intelligence (AI) is defined as the science and engineering of creating intelligent machines that can perform tasks requiring human-like intelligence. The document outlines the four approaches to AI, the categorization of intelligent systems into narrow, general, and super intelligence, and the essential components of AI including perception, learning, reasoning, and natural language processing. It also describes the concept of agents, their architecture, and provides examples of various AI applications and problem-solving scenarios.

Uploaded by

kashishj405
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/ 71

Artificial

Intelligence
Introduction to Artificial
Intelligence
John McCarthy who has coined the word “Artificial
Intelligence” in 1956, has defined AI as “the
science and engineering of making intelligent
machines”, especially intelligent computer
programs.
Artificial Intelligence (AI) is relevant to any
intellectual task where the machine needs to take
some decision or choose the next action based on
the current state of the system, in short act
intelligently or rationally. As it has a very wide
range of applications, it is truly a universal field.
Introduction to Artificial
Intelligence
 In simple words, Artificial Intelligent System works
like a Human Brain, where a machine or software
shows intelligence while performing given tasks;
such systems are called intelligent systems or
expert systems. You can say that these systems
can “think” while generating output!!!

 AI is the study of how to make machines do thing


which at the moment people do better. Following are
the four approaches to define AI.
Four Approaches to define
AI
 Acting Humanly : The Turing Test
Approach
 Thinking Humanly : The Cognitive
Modelling Approach
 Thinking Rationally : The “Laws of
Thought” Approach
 Acting Rationally : The Rational Agent
Approach
Acting Humanly : The Turing Test
Approach

 Definition 1 : “The art of creating machines


that perform functions that requires
intelligence when performed by people.”
(Kurzweil, 1990)

 Definition2 : “The study of how to make


computers do things at which, at the moment,
people are better.” (Rich and Knight, 1991)
Turing Test Environment
For this test, the computer would need to
possess the following capabilities

1. Natural Language Processing (NLP) : This unit enables


computer to interpret the English language and communicate
successfully.
2. Knowledge Representation : This unit is used to store
knowledge gathered by the system through input devices.
3. Automated Reasoning: This unit enables to analyze the
knowledge stored in the system and makes new inferences to
answer questions.
4. Machine Learning: This unit learns new knowledge by taking
current input from the environment and adapts to new
circumstances, thereby enhancing the knowledgebase of the
Turing Test

 To pass total Turing test, the computer will also need


to have computer vision, which is required to
perceive objects from the environment and
Robotics, to manipulate those objects.
Categorization of Intelligent
Systems
Artificial Narrow Intelligence/ Weak AI
 Weak AI is AI that specializes in one area. It is not a general
purpose intelligence. An intelligent agent is built to solve a
particular problem or to perform a specific task is termed as
narrow intelligence or weak AI.
 For example, it took years of AI development to be able to beat
the chess grandmaster, and since then we have not been able to
beat the machines at chess.
But that is all it can do, which is does extremely
well.
Categorization of Intelligent
Systems
 Artificial General Intelligence / Strong AI
 Strong AI or general AI refers to intelligence
demonstrated by machines in performing any
intellectual task that human can perform.
Developing strong AI is much harder than
developing weak AI.
 Using artificial general intelligence machines can
demonstrate human abilities like reasoning,
planning, problem solving, comprehending complex
ideas, learning from self experiences, etc.
Categorization of Intelligent
Systems
 Artificial Super Intelligence
 As defined by a leading AI thinker Nick Bostrom, “Super
intelligence is an intellect that is much smarter than the
best human brains in practically every field, including
scientific creativity, general wisdom and social skills.”
 Super intelligence ranges from a machine which is just a
little smarter than a human to a machine that is trillion
times smarter.
 Artificial super intelligence is the ultimate power of AI.
Components of AI

1. Perception
2. Knowledge representation
3. Learning
4. Reasoning
5. Problem solving
6. Natural language processing
(Language-understanding)
Components of AI
Perception
 In order to work in the environment, intelligent
agents need to scan the environment and the
various objects in it.
 Agent scans the environment using various
sense organs like camera, temperature sensor,
etc. This is called as perception.
 After capturing various scenes, perceiver
analyses the different objects in it and extracts
their features and relationships among them.
Knowledge representation

 The information obtained from environment


through sensors may not be in the format required
by the system.
 Hence, it need to be represented in standard
formats for further processing like learning various
patterns, deducing inference, comparing with past
objects, etc.
 There are various knowledge representation
techniques like Prepositional logic and first order
logic.
Learning

 Learning is a very essential part of AI and it happens in


various forms. The simplest form of learning is by trial and
error.
 In this form the program remembers the action that has
given desired output and discards the other trial actions and
learns by itself. It is also called as unsupervised learning.
 In other case, solution to few of the problems is given as
input to the system, basis on which the system or program
needs to generate solutions for new problems. This is
known as supervised learning.
Reasoning

 Reasoning is also called as logic or generating inferences form


the given set of facts. Reasoning is carried out based on strict
rule of validity to perform a specified task. Reasoning can be of
two types, deductive or inductive.
 The deductive reasoning is in which the truth of the premises
guarantees the truth of the conclusion while, in case of
inductive reasoning, the truth of the premises supports the
conclusion, but it cannot be fully dependent on the premises.
 In programming logic generally deductive inferences are used.
Reasoning involves drawing inferences that are relevant to the
given problem or situation.
Problem-solving

 AI addresses huge variety of problems. For example, finding out


winning moves on the board games, planning actions in order to
achieve the defined task, identifying various objects from given
images, etc.
 As per the types of problem, there is variety of problem solving
strategies in AI. Problem solving methods are mainly divided
into general purpose methods and special purpose
methods.
 General purpose methods are applicable to wide range of
problems while, special purpose methods are customized to
solve particular type of problems
Natural Language Processing(NLP)

 Natural Language Processing, involves machines


or robots to understand and process the language
that human speak, and infer knowledge from the
speech input. It also involves the active
participation from machine in the form of dialog
 i.e.NLP aims at the text or verbal output from the
machine or robot. The input and output of an NLP
system can be speech and written text
respectively.
What is Agents?

 Agent is something that perceives its environment through


sensors and acts upon that environment through effectors or
actuators
 Take a simple example of a human agent. It has five senses :
Eyes, ears, nose, skin, tongue. These senses sense the
environment are called as sensors. Sensors collect percepts or
inputs from environment and passes it to the processing unit.
 Actuators or effectors are the organs or tools using which
the agent acts upon the environment. Once the sensor senses
the environment, it gives this information to nervous system
which takes appropriate action with the help of actuators.
Agent and Environment
Generic robotic agent
architecture
Sensors and actuators in human
and robotic agent
Agent program

 Agent program is a computer program that


implements agent function in an architecture suitable
language.
 Agent programs needs to be installed on a device in order
to run the device accordingly. That device must have
some form of sensors to sense the environment and
actuators to act upon it.
 Hence agent is a combination of the architecture
hardware and program software.
 Agent = Architecture + Program
Vacuum cleaner agent

There are two blocks A and B having some dirt. Vacuum cleaner agent
supposed to sense the dirt and collect it, thereby making the room clean.
Vacuum cleaner agent

 Hence the sensor for vacuum cleaner agent can be


camera, dirt sensor and the actuator can be motor
to make it move, absorption mechanism. And it can
be represented as :
[A, Dirty], [B, Clean], [A, absorb],[B, Nop], etc.

 Based on the percepts, actions will be performed.


For example : Move left, Move right, absorb, No
Operation.
Intelligent Agent

 Intelligent agent is the one which can take input from the
environment through its sensors and act upon the
environment through its actuators. Its actions are always
directed to achieve a goal.
 In case of intelligent agents, the software modules are
responsible for exhibiting intelligence. Generally observed
capabilities of an intelligent agent can be given as follows:
 Ability to remain autonomous (Self-directed)
 Responsive
 Goal-Oriented
Structure of Intelligent Agents
Rational Agent

 For problem solving, if an agent makes a


decision based on some logical reasoning, then,
the decision is called as a “Rational Decision”
A rational agent is an agent that has clear
preferences, can model uncertainty via expected
values of variables or functions of variables, and
always chooses to perform the action with the
optimal expected outcome for itself from among
all feasible actions
Rationality depends on four main
criteria
 Performance measure which defines
the criterion of success for an agent
 Agent's
prior knowledge of the
environment
 Action performed by the agent
 Agent's percept sequence to date.
Example…

(a) Agent's finger is hurt (b) Agent is using nail and


while using nail and hammer hammer efficiently
Rational agent

Rational agent can be defined as an agent who makes use of its percept sequence, experience and
knowledge to maximize the performance measure of an agent for every probable action. It selects the most
feasible action which will lead to the expected results optimally.
PEAS representation for an
agent
 PEAS : PEAS stands for Performance
Measure, Environment, Actuators,
and Sensors.
 It is the short form used for
performance issues grouped under
Task Environment.
PEAS

 Performance Measure : It the objective function to judge the


performance of the agent. For example, in case of pick and
place robot, number of correct parts in a bin can be the
performance measure.
  Environment : It the real environment where the agent need
to deliberate actions.
  Actuators : These are the tools, equipment or organs using
which agent performs actions in the environment. This works as
the output of the agent.
  Sensors : These are the tools, equipment or organs using
which agent captures the state of the environment. This works
as the input to the agent.
(A) Automated car driving agent
 1. Performance measures which should be satisfied by the
automated car driver:
 (i) Safety : Automated system should be able to drive the car
safely without dashing anywhere.
 (ii) Optimum speed : Automated system should be able to
maintain the optimal speed depending upon the surroundings.
 (iii) Comfortable journey : Automated system should be able to
give a comfortable journey to the end user, i.e. depending upon the
road it should ensure the comfort of the end user.
 (iv) Maximize profits : Automated system should provide good
mileage on various roads, the amount of energy consumed to
automate the system should not be very high, etc. such features
ensure that the user is benefited with the automated features of the
system and it can be useful for maximizing the profits
2. Environment

 (i) Roads : Automated car driver should be able to drive on any


kind of a road ranging from city roads to highway.
 (ii) Traffic conditions : You will find different set of traffic
conditions for different type of roads. Automated system should be
able to drive efficiently in all types of traffic conditions. Sometimes
traffic conditions are
formed because of pedestrians, animals, etc.
 (iii) Clients : Automated cars are created depending on the client’s
environment. For example, in some countries you will see left hand
drive and in some countries there is a right hand drive. Every
country/state can have different weather conditions. Depending
upon such constraints automated car driver should be designed.
3. Actuators

Actuators are responsible for performing actions/providing


output to an environment.
 In case of car driving agent following are the actuators :
 (i) Steering wheel which can be used to direct car in
desired direction (i.e. right/left)
 (ii) Accelerator, gear, etc. can be useful to increase or
decrease the speed of the car.
 (iii) Brake is used to stop the car.
 (iv) Light signal, horn can be very useful as indicators
for an automated car.
4. Sensors

 Totake input from environment in car


driving example cameras, sonar
system, speedometer, GPS, engine
sensors, etc. are used as sensors.
(B) Part-picking ARM robot

 (i) Performance measures : Number of parts in


correct container.
 (ii) Environment : Conveyor belt used for handling
parts, containers used to keep parts.
 (iii) Actuators : Arm with tooltips, to pick and drop
parts from one place to another.
 (iv) Sensors : Camera to scan the position from
where part should be picked and joint angle sensors
which are used to sense the obstacles and move in
appropriate place.
(C) Medical diagnosis system
 (i) Performance measures
 a. Healthy patient: system should make use of sterilized
instruments to ensure the safety (healthiness) of the
patient.
 b. Minimize costs : The automated system results should
not be very costly otherwise overall expenses of the patient
may increase. Medical diagnosis system should be legal.
 (ii) Environment : Patient, Doctors, Hospital Environment
 (iii) Sensors : Screen, printer
 (iv) Actuators : Keyboard and mouse which is useful to
make entry of symptoms, findings, patient's answers to
given questions. Scanner to scan the reports, camera to
click pictures of patients.
(D) Soccer player robot

 (i)Performance measures : Number of goals,


speed, legal game.
 (ii)
Environment: Team players, opponent
team players, playing ground, goal net.
 (iii)Sensors: Camera, proximity sensors,
infrared sensors.
 (iv) Actuators : Joint angles, motors.
3*3*3 Rubik’s cube problem

 In Rubik’s cube, we have a cube with six color faces. The goal is to
arrange all the cuboids in such a way that each face of cube will show
distinct color as
Example of 8-Puzzle Problem

 It has a 3 X 3 board with tiles having 1 through 8 numbers on it.


There is a blank tile which can be moved forward, backward, to left
and to right. The aim is to arrange all the tiles in the goal state form
by moving the blank tile minimum number of times.
Example of 8-Puzzle Problem
N-queen problem :

In n-queen, the queens need to be placed on the n*n


board, in such a way that no queen can dash the other
queen, horizontally, vertically or diagonally.
N-queen problem
Missionaries and cannibals
problem
In this problem, there are three missionaries and three cannibals on the same side of a river.
 We need to get all of them to the other side of river through a canoe which can hold maximum two people
at a time.
 The condition is no time during the process of shifting, number of cannibals on any of the side should be
greater than the number of missionaries on the same side.
Missionaries and cannibals
problem
The river problem :
- In this problem, a farmer needs to carry a wolf, a duck and corn
across a river. The farmer has a small rowing boat, which can
carry at most the farmer and one other thing.
- The problem is that, the wolf will eat the duck and the duck will
eat the corn, if they are at the same side. How can the farmer
safely transport the wolf, the duck and the corn to the opposite
shore?
Water Jug Problem
Water Jug Problem
Holiday in Romania
Vacuum World Problem
AI problems

 From the above examples, it must be clear that AI problems are the
one , in which there are few conditions specified and the aim is to not
only generate the solution but also to improve performance of
the system;
 because that is where the intelligence of the system gets challenged.
The term intelligence includes many cognitive skills, like the ability to
solve problems, learn, interpret and understand language.
Problem Formulation

 Given a goal to achieve; problem formulation is the process of


deciding what states to be considered and what actions to be
taken to achieve the goal. This is the first step to be taken by any
problem solving agent.
  State Space Representation : The state space of a problem is
the set of all states reachable from the initial state by executing any
sequence of actions. State is representation of all possible outcomes.
 The state space specifies the relation among various problem states
thereby, forming a graph in which the nodes are states and the links
between nodes represent actions
Well-Defined Problems and
Solutions
Problem can be defined formally using five components as follows :
 1. Initial state
 2. Actions
 3. Successor function
 4. Goal test
 5. Path cost
Well-Defined Problems and
Solutions
 1. Initial state : The initial state is the one in which the agent starts in.
 2. Actions : It is the set of actions that can be executed or applicable in all
possible states. A description of what each action does; the formal name for this
is the transition model.
 3. Successor function : It is a function that returns a state on executing an
action on the current state.
 4. Goal test : It is a test to determine whether the current state is a goal state.
In some problems the goal test can be carried out just by comparing current state
with the defined goal state, called as explicit goal test. Whereas, in some of the
problems, state cannot be defined explicitly but needs to be generated by
carrying out some computations, it is called as implicit goal test.
 For example : In Tic-Tac-Toe game making diagonal or vertical or horizontal
combination declares the winning state which can be compared explicitly; but in
the case of chess game, the goal state cannot be predefined but it’s a scenario
called as “Checkmate”, which has to be evaluated implicitly.
Well-Defined Problems and
Solutions
 Path cost : It is simply the cost associated with each step to be taken
to reach to the goal state. To determine the cost to reach to each state,
there is a cost function, which is chosen by the problem solving agent.
 Problem solution : A well-defined problem with specification of initial
state, goal test, successor function, and path cost. It can be
represented as a data structure and used to implement a program
which can search for the goal state.
 A solution to a problem is a sequence of actions chosen by the
problem solving agent that leads from the initial state to a goal state.
Solution quality is measured by the path cost function.
 Optimal solution : An optimal solution is the solution with least path
cost among all solutions.
Example of 8-Puzzle Problem

 A typical scenario of 8-puzzle problem. It has a 3 X 3 board with tiles


having 1 through 8 numbers on it. There is a blank tile which can be
moved forward, backward, to left and to right. The aim is to arrange
all the tiles in the goal state form by moving the blank tile minimum
number of times.
Example of 8-Puzzle Problem

 This problem can be formulated as follows :


  States : States can represented by a 3 x 3 matrix data structure
with blank denoted by 0.
 1. Initial state : {{1, 2, 3},{4, 8, 0},{7, 6, 5}}
 2. Actions : The blank space can move in Left, Right, Up and Down
directions specifying the actions.
 3. Successor function : If we apply “Down” operator to the start
state in the resulting state has the 5 and the blank switched.
 4. Goal test : {{1, 2, 3},{4, 5, 6},{7, 8, 0}}
 5. Path cost : Number of steps to reach to the final state.
Example of 8-Puzzle Problem

 Solution :
 {{1, 2, 3}, {4, 8, 0}, {7, 6, 5}}
 {{1, 2, 3}, {4, 8, 5}, {7, 6, 0}}
 {{1, 2, 3}, {4, 8, 5}, {7, 0, 6}}
 {{1, 2, 3}, {4, 0, 5}, {7, 8, 6}}
 {{1, 2, 3}, {4, 5, 0}, {7, 8, 6}}
 {{1, 2, 3}, {4, 5, 6}, {7, 8, 0}}
 Path cost = 5 steps
Example of Missionaries and
Cannibals Problem
  The problem statement as discussed in the previous section. Let’s
formulate the problem first.
  States : In this problem, state can be data structure having triplet (i,j,k)
representing the number of missionaries, cannibals, and canoes on the left
bank of the river respectively.
 1. Initial state : It is (3, 3, 1), as all missionaries, cannibals and canoes
are on the left bank of the river.
 2. Actions : Take x number of missionaries and y number of cannibals
 3. Successor function : If we take one missionary, one cannibal the
other side of the river will have two missionaries and two cannibals left.
 4. Goal test : Reached state (0, 0, 0)
 5. Path cost : Number of crossings to attain the goal state.
Example of Missionaries and
Cannibals Problem
Example of Missionaries and
Cannibals Problem
Example of Missionaries and
Cannibals Problem
Example of Missionaries and
Cannibals Problem
 Solution :
 The sequence of actions within the path :
 (3,3,1) → (2,2,0) →(3,2,1) → (3,0,0) → (3,1,1) → (1,1,0) → (2,2,1) →
(0,2,0) → (0,3,1) → (0,1,0) → (0,2,1) → (0,0,0)
 Cost = 11 crossings
4 Queens Problem
State Space
Important Questions(Qbank)
 Q. Define artificial intelligence.
 Q. Write a short note on : Applications of artificial intelligence.
 Q. What are the four approaches to define AI
 Q. What is Turing test?
 Q. What are the components of AI?
 Q. Explain PEAS representation with example.
 Q. Define agent and give classification of agents.
 Q. What is intelligent agent?
 Q. Write a short note on: Rational agent.
 Q. Write a short note on : Structure of Intelligent agents.
 Q. Give types of agents.
 Q. What are various agent environments? Give PEAS representation for an agent.
 Q. What do you mean by PEAS? Explain properties of task environment.
 Q. Explain detail architecture of goal based agent.
 Q. Explain detail architecture of Model based agent
 Q. Explain Simple reflex agent architecture.
 Q. Explain learning agent architecture and its components
 Q. Write state space representation for classical AI problems

You might also like