Artificial Intelligence
Prof. Surabhi Solanki, Assistant Professor
Computer Science & Engineering Department
Books
1. Artificial Intelligence: A 2. Artificial Intelligence 3. Artificial Intelligence-
New Synthesis, Harcourt (TextBook) By Elaine Structures and Strategies
Publishers (TextBook) By Rich and Kevin Knight | For Complex Problem
N. J. Nilsson | Harcourt TMH Solving By George F. Luger |
Publishers
Pearson Education / PHI
Books
4. Artificial Intelligence-A Modern
Approach By Stewart Russell and
Peter Norvig | Pearson Education/
Prentice Hall of India | 2
5. Artificial Intelligence – A
Practical Approach By Patterson |
Tata McGraw Hill | 3
CHAPTER-1
Introduction of Artificial Intelligence
Artificial Intelligence
“Artificial Intelligence (AI) is the field of computer science that
aims to create systems that can perform tasks that typically
require human intelligence, such as learning, problem-solving,
decision-making, and perception. AI systems utilize advanced
algorithms and techniques to mimic human cognitive abilities.”
What is Intelligence??
• According to [Link], “the capacity, for learning, reasoning,
understanding, and similar forms of mental activity.”.
• Intelligence = Knowledge + Search strategy for exploring KB to
draw useful conclusions.
• Thus, in AI our objective is to simulate KB and the search
strategies in computers so that they can behave in a way similar to
the humans.
Example of Intelligence
• How a three year old child learns with it’s
surrounding and experience them, finally
uses those perceptions intelligently with
acquired knowledge. e.g.: Giving you a
cassette, or asking to play a particular track
mentioned on CD , Using electronic gadgets
without the ability of reading and writing, or
moreover asking you intelligently to play his
favorite cartoon channel.
Definition of Artificial Intelligence
• Definition based on two dimension
1. Upper dimension concerned with “Thought Processes” &
Reasoning.
2. Lower dimensions incorporating “Behaviour” in m/c to make
them intelligent like humans.
(A) Definitions Based on success in terms of fidelity to
human performance
(i) Systems that think humanly (ii) Act Humanly
(B) Definitions based on Rationality
(i) Systems that think Rationally (ii) Act Rationally
Acting Humanly: The Turing Test Approach
• The study of how to make computers do thing at which, at the
moment, people are better”( Rich+ Knight, 1991)
• NLP- To communicate successfully in human language.
• Knowledge Representation- To answer questions and draw new
conclusion.
• Automated Reasoning- To answer questions and draw new
conclusion.
• Machine Learning- To adapt to new circumstances and to detect
extrapolate patterns.
• Computer Vision: & speech recognition to perceive the world.
• Robotics: To manipulate objects & move about.
Acting Humanly: The Turing Test Approach
• The Turing (1950) "Computing machinery and
intelligence":
• Operational test for intelligent behavior: the
Imitation Game
• "Can machines think?" ,"Can machines
behave intelligently?"
• Predicted that by 2000, a machine might have a 30% chance of
fooling a lay person for 5 minutes
• Suggested major components of AI: knowledge, reasoning, language
understanding, learning.
Contd…
• Total Turing Test:
• Turing viewed the physical simulation of a person as unnecessary
to demonstrate patterns.
• However researchers have proposed total Turing Test, which
requires interaction with objects and people in the real world.
• To pass the Total Turing Test, a robot will need computer vision,
robotics.
Thinking Humanly: The Cognitive Modeling Approach
• Human think in three ways:
1. Introspection: Trying to catch our own
thought as they go by;
2. Psychological experiments: Observing a
person in action
3. Brain imaging: observing the brain in
action.
• Cognitive Science: Cognitive science brings
together computer models from AI and
experimental techniques from psychology to
construct precise and testable theories of the
human mind.
Thinking Rationally: The “Law of Thought” Approach
• Aristotle: What are correct arguments/thought processes?
• Several Greek schools developed various forms of logic:
notation and rules of derivation for thoughts; may or may not
have proceeded to the idea of mechanization.
• Direct line through mathematics and philosophy to modern AI
Problems:
1. Not all intelligent behavior is mediated by logical deliberation
2. What is the purpose of thinking? What thoughts should I
have?
Acting Rationally: The Rational Agent Approach
• Agent: An Agent is just something that acts. e.g., computer
program, human
• Rational Agent:
Rational Agent is one that act so as to achieve the best outcome
or, when there is uncertainty the best expected outcome.
AI focuses on the study & construction of agents that “ do the
right things”.
• “Law of thought”: correct inference to achieve rationality.
Major Areas of Artificial Intelligence
Artificial Intelligence Techniques
Figure: Flow chart of AI computing
Techniques of Artificial Intelligence
Machine
Learnin
g
Natural
Languag
Expert
e
System
Processi
ng
Reinforc
Deep
ement Artificial
Learnin
Learnin Intelligence
g
g
Comput
Data
er
Science
Vision
Robotic
s
Techniques of Artificial Intelligence
Deep Learning Natural Language Processing (NLP)
•Definition: A subset of •Definition: The ability of a computer
machine learning involving program to understand human
neural networks with language as it is spoken.
many layers. •Key Tasks:
•Components: Neurons, • Text analysis
layers, backpropagation. • Machine translation
•Applications: • Sentiment analysis
Autonomous vehicles, •Applications: Virtual assistants,
natural language chatbots, language translation
processing, game playing. services.
Techniques of Artificial Intelligence
Computer Vision Robotics
•Definition: The field of AI that •Definition: The branch of AI that
trains computers to interpret involves the design, construction,
and understand the visual world. operation, and use of robots.
•Key Techniques: •Components:
• Image classification • Sensors
• Object detection • Actuators
• Image generation • Control systems
•Applications: Facial recognition, •Applications: Manufacturing
medical imaging, autonomous automation, surgical robots,
driving. drone technology.
Techniques of Artificial Intelligence
Expert Systems • Machine Learning
•Definition: AI systems that •Definition: A subset of AI that
use reasoning capabilities to enables machines to learn from data
reach a conclusion. and improve from experience.
•Components: •Types:
• Knowledge base • Supervised Learning
• Inference engine • Unsupervised Learning
•Applications: Diagnostic • Reinforcement Learning
systems, financial analysis, •Applications: Image recognition,
process control systems. speech recognition, medical
diagnosis.
Techniques of Artificial Intelligence
Data Science Reinforcement Learning
•Definition: Data Science involves using • Definition: Reinforcement Learning
scientific methods, processes, (RL) is a type of machine learning
algorithms, and systems to extract where an agent learns to make
knowledge and insights from structured decisions by performing actions in an
and unstructured data. environment to maximize cumulative
•Key Features: reward. Components:
• Data Mining • Agent
• Predictive Analytics • Environment
• Data Visualization • Actions
• Data Cleaning • Rewards Policy
• Applications: Healthcare, Finance, •Applications: Gaming Robotics,
Marketing, Retail, Sports. Autonomous Vehicle, Health care.
History of Artificial Intelligence
Artificial Intelligence (AI) has a rich and fascinating history, tracing its roots
back to the mid-20th century. From the early pioneers who laid the
foundations to the rapid advancements in recent decades, AI has come a
long way in its quest to emulate and enhance human intelligence.
History of Artificial Intelligence
1943 McCulloch & Pitts: Boolean circuit model of brain
1950 Turing's "Computing Machinery and Intelligence"
1956 Dartmouth meeting: "Artificial Intelligence" adopted
1952—69 Look, no hands!
1950s Early AI programs, including Samuel's checkers program, Newell & Simon's
Logic Theorist, Gelernter's Geometry Engine
1965 Robinson's complete algorithm for logical reasoning
1966—73 AI discovers computational complexity Neural network research almost
disappears
1969—79 Early development of knowledge-based systems
1980-- AI becomes an industry
1986-- Neural networks return to popularity
1987-- AI becomes a science
1995-- The emergence of intelligent agents, genetic algorithms
History of Artificial Intelligence
Early Pioneers of AI:
Alan Turing John McCarthy Marvin Minsky
Considered the father of Credited with coining the A co-founder of the
computer science, term "Artificial MIT AI lab, Minsky
Turing's seminal work on Intelligence" in 1956, made significant
the Turing machine and McCarthy was a key figure contributions to the
the Turing test laid the in the field, pioneering field, including work
groundwork for the field work in logic-based on neural networks
of AI. approaches to AI. and the theory of
intelligence.
History of Artificial Intelligence
1. ALVINN:
Autonomous Land Vehicle In a Neural Network
In 1989, Dean Pomerleau at CMU created ALVINN. This is a system
which learns to control vehicles by watching a person drive
2. Deep Blue:
In 1997, the Deep Blue chess program created by IBM, beat the
current world chess champion, Gary Kasparov.
3. Machine translation:
A system capable of translations between people speaking different
languages will be a remarkable achievement of enormous economic
and cultural benefit
History of Artificial Intelligence
4. Autonomous agents:
In space exploration, robotic space probes autonomously monitor
their surroundings, make decisions and act to achieve their goals.
5. Internet agents:
The explosive growth of the internet has also led to growing interest
in internet agents to monitor users' tasks, seek needed information,
and to learn which information is most useful
Artificial Intelligence Problem
Artificial Intelligence Problem
• Understand natural language robustly (e.g., read and understand
articles in a newspaper)
• Surf the web
• Interpret an arbitrary visual scene
• Learn a natural language
• Construct plans in dynamic real-time domains
• Exhibit true autonomy and intelligence
Agent
• What is an agent ?
An agent is anything that perceiving its
environment through sensors and
acting upon that environment through
actuators
Example:
• Human is an agent
• A robot is also an agent with cameras and
motors
• A thermostat detecting room temperature.
Diagram of Agent
What AI should fill
Contd…
Simple Terms
Percept
Agent’s perceptual inputs at any given instant
Percept sequence
Complete history of everything that the agent has ever perceive
• Agent function & program
• Agent’s behavior is mathematically described by
Agent function
A function mapping any given percept sequence to
an action
• Practically it is described by
An agent program
The real implementation
Vacuum-cleaner world
Perception: Clean or Dirty?
where it is in?
Actions: Move left, Move
right, suck, do nothing
Vacuum-cleaner world
Program implements the agent function
tabulated in Fig. 2.3
Function Reflex-Vacuum-
Agent([location,status]) return an action
If status = Dirty then return Suck
else if location = A then return Right
else if location = B then return left
Concept of Rationality
Rational agent
One that does the right thing
= every entry in the table for the agent function is
correct (rational).
What is correct?
The actions that cause the agent to be most
successful
So we need ways to measure success.
Performance measure
Performance measure
An objective function that determines
How the agent does successfully
E.g., 90% or 30% ?
An agent, based on its percepts
action sequence :
if desirable, it is said to be performing well.
No universal performance measure for all agents
Performance measure
A general rule:
Design performance measures according to
What one actually wants in the environment
Rather than how one thinks the agent should behave
E.g., in vacuum-cleaner world
We want the floor clean, no matter how the agent
behave
We don’t restrict how the agent behaves
Rationality
What is rational at any given time depends on
four things:
The performance measure defining the criterion of
success
The agent’s prior knowledge of the environment
The actions that the agent can perform
The agents’s percept sequence up to now
Rational Agent
For each possible percept sequence,
an rational agent should select
an action expected to maximize its performance
measure, given the evidence provided by the percept
sequence and whatever built-in knowledge the agent
has
E.g., an exam
Maximize marks, based on
the questions on the paper & your knowledge
Example of Rational Agent
Actions that can perform
Left, Right, Suck and NoOp
Percept sequences
Where is the agent?
Whether the location contains dirt?
Under this circumstance, the agent is rational.
Omniscience
An omniscient agent
Knows the actual outcome of its actions in advance
No other possible outcomes
However, impossible in real world
An example
crossing a street but died of the fallen cargo door
from 33,000ft irrational?
Omniscience
Based on the circumstance, it is rational.
As rationality maximizes
Expected performance
Perfection maximizes
Actual performance
Hence rational agents are not omniscient.
Learning
Does a rational agent depend on only current
percept?
No, the past percept sequence should also be used
This is called learning
After experiencing an episode, the agent
should adjust its behaviors to perform better for the
same job next time.
Learning
Does a rational agent depend on only current
percept?
No, the past percept sequence should also be used
This is called learning
After experiencing an episode, the agent
should adjust its behaviors to perform better for the
same job next time.
Autonomy
If an agent just relies on the prior knowledge of its
designer rather than its own percepts then the agent
lacks autonomy
A rational agent should be autonomous- it should learn
what it can to compensate for partial or incorrect prior
knowledge.
E.g., a clock
No input (percepts)
Run only but its own algorithm (prior knowledge)
No learning, no experience, etc.
Software Agents
Sometimes, the environment may not be the
real world
E.g., flight simulator, video games, Internet
They are all artificial but very complex environments
Those agents working in these environments are
called
Software agent (softbots)
Because all parts of the agent are software
Task environments
Task environments are the problems
While the rational agents are the
solutions
Performance Environment
Specifying the task environment
PEAS description as fully as possible
In designing an agent, the first step must always be Actuators Sensors
to specify the task environment as fully as possible.
Use automated taxi driver as an
example
Task environments
Performance measure
How can we judge the automated driver?
Which factors are considered?
getting to the correct destination
minimizing fuel consumption
minimizing the trip time and/or cost
minimizing the violations of traffic laws
maximizing the safety and comfort, etc.
Task environments
Environment
A taxi must deal with a variety of roads
Traffic lights, other vehicles, pedestrians, stray
animals, road works, police cars, etc.
Interact with the customer
Task environments
Actuators (for outputs)
Control over the accelerator, steering, gear shifting and
braking
A display to communicate with the customers
Sensors (for inputs)
Detect other vehicles, road situations
GPS (Global Positioning System) to know where the
taxi is
Many more devices are necessary
Task environments
Task environments are the problems
While the rational agents are the solutions
Properties of task environments
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
the environment is effectively and fully observable
if the sensors detect all aspects
That are relevant to the choice of action
Properties of task environments
Partially 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.
Example:
A local dirt sensor of the cleaner cannot tell
Whether other squares are clean or not
Properties of task environments
Deterministic vs. stochastic
next state of the environment Completely determined by the
current state and the actions executed by the agent, then the
environment is deterministic, otherwise, it is Stochastic.
Strategic environment: deterministic except for actions of
other agents
-Cleaner and taxi driver are:
Stochastic because of some unobservable aspects noise or
unknown
Properties of task environments
Episodic vs. sequential
An episode = agent’s single pair of perception & action
The quality of the agent’s action does not depend on other
episodes
Every episode is independent of each other
Episodic environment is simpler
The agent does not need to think ahead
Sequential
Current action may affect all future decisions
-Ex. Taxi driving and chess.
Properties of task environments
Static vs. dynamic
A dynamic environment is always changing over time
E.g., the number of people in the street
While static environment
E.g., the destination
Semidynamic
environment is not changed over time
but the agent’s performance score does
Properties of task environments
Discrete vs. continuous
If there are a limited number of distinct states,
clearly defined percepts and actions, the
environment is discrete
E.g., Chess game
Continuous: Taxi driving
Properties of task environments
Single agent VS. multiagent
Playing a crossword puzzle – single agent
Chess playing – two agents
Competitive multiagent environment
Chess playing
Cooperative multiagent environment
Automated taxi driver
Avoiding collision
Properties of task environments
Known vs. unknown
This distinction refers not to the environment itslef but to the
agent’s (or designer’s) state of knowledge about the
environment.
-In known environment, the outcomes for all actions are
given. ( example: solitaire card games).
- If the environment is unknown, the agent will have to learn
how it works in order to make good decisions.( example:
new video game).
Examples of Task Environments
Structure of agents
Agent = architecture + program
Architecture = some sort of computing device
(sensors + actuators)
(Agent) Program = some function that implements
the agent mapping = “?”
Agent Program = Job of AI
Agent programs
Skeleton design of an agent program
Types of agent programs
Four types
Simple reflex agents
Model-based reflex agents
Goal-based agents
Utility-based agents
Simple reflex agents
It uses just condition-action rules
The rules are like the form “if
… then …”
efficient but have narrow
range of applicability
Because knowledge
sometimes cannot be stated
explicitly
Work only
if the environment is
fully observable
A Simple Reflex Agent in Nature
percepts
(size, motion)
RULES:
(1) If small moving object,
then activate SNAP
(2) If large moving object,
then activate AVOID and inhibit SNAP
ELSE (not moving) then NOOP
needed for
completeness Action: SNAP or AVOID or NOOP
Model-based Reflex Agents
For the world that is partially observable
the agent has to keep track of an internal state
That depends on the percept history
Reflecting some of the unobserved aspects
E.g., driving a car and changing lane
Requiring two types of knowledge
How the world evolves independently of the agent
How the agent’s actions affect the world
Model-based Reflex Agents
Model-based Reflex Agents
The agent is with memory
Goal-based agents
Current state of the environment is always not
enough
The goal is another issue to achieve
Judgment of rationality / correctness
Actions chosen goals, based on
the current state
the current percept
Goal-based agents
Conclusion
Goal-based agents are less efficient
but more flexible
Agent Different goals different tasks
Search and planning
two other sub-fields in AI
to find out the action sequences to achieve its goal
Goal-based agents
Utility-based agents
it is said state A has higher utility
If state A is more preferred than others
Utility is therefore a function
that maps a state onto a real number
the degree of success
Utility-based agents
Utility-based agents
it is said state A has higher utility
If state A is more preferred than others
Utility is therefore a function
that maps a state onto a real number
the degree of success
Utility-based agents
Utility has several advantages:
When there are conflicting goals,
Only some of the goals but not all can be achieved
utility describes the appropriate trade-off
When there are several goals
None of them are achieved certainly
utility provides a way for the decision-making
Learning Agents
After an agent is programmed, can it work
immediately?
No, it still need teaching
In AI,
Once an agent is done
We teach it by giving it a set of examples
Test it by using another set of examples
We then say the agent learns
A learning agent
Learning Agents
Four conceptual components
Learning element
Making improvement
Performance element
Selecting external actions
Critic
Tells the Learning element how well the agent is doing with respect
to fixed performance standard.
(Feedback from user or examples, good or not?)
Problem generator
Suggest actions that will lead to new and informative experiences.
Learning Agents
AI Applications in Medicine
AI-powered AI-enabled wearable
AI algorithms can AI-driven design and
systems can analyze devices and sensors
accelerate the drug manufacturing
medical images, can continuously
discovery process by techniques are enabling
patient data, and monitor patients' vital
identifying promising the creation of highly
symptoms to assist signs, activity levels,
drug candidates, customized prosthetic
clinicians in making and other health
simulating drug limbs that better fit and
more accurate and indicators, allowing
interactions, and function for individual
timely diagnoses, for earlier
optimizing clinical patients, enhancing
improving patient intervention and more
trials. their quality of life.
outcomes. proactive care.
AI Applications in E-Commerce
• Personalized Product Recommendations:
– AI analyzes past customer behavior, browsing history, and
purchase history to suggest relevant products.
– Features like “People also purchased” or “Customers also
viewed” enhance the shopping experience1.
• Chatbots and Virtual Assistants:
– AI-powered chatbots handle customer inquiries, provide
support, and assist with order tracking.
– They improve response time and enhance customer
satisfaction.
AI Applications in E-Commerce
• Fraud Detection and
Prevention:
– AI algorithms identify
suspicious transactions,
patterns, and anomalies.
– This helps prevent
fraudulent activities and
protects both customers and
businesses.
AI Applications in E-Commerce
• Dynamic Pricing:
– AI adjusts prices based on real-time data, competitor
pricing, and demand fluctuations.
– Businesses can maximize revenue while remaining
competitive.
• Customer Churn Prediction:
– AI analyzes customer behavior to predict potential churn
(when customers stop buying).
– Businesses can take proactive measures to retain customers.
AI Applications in E-Commerce
• Inventory Management:
– AI optimizes inventory levels by predicting demand and
automating restocking.
– It ensures products are available when needed without
overstocking.
• Generative AI:
– AI generates product descriptions, marketing content, and
even designs.
– It enhances creativity and efficiency in content creation.
AI Representation
• Representation in AI refers to how
knowledge, data, and information are
encoded and structured within an
intelligent system. This internal
representation is crucial for effective
reasoning, decision-making, and problem-
solving capabilities.
• Knowledge representation techniques like
machine learning models, NLP, and
knowledge graphs capture the complexities
of the real world, allowing AI systems to
understand context, infer relationships, and
make intelligent inferences.
Properties of Internal Representation
4 5 6
Future Scope of AI
Future Scope of AI
AI problems
1- Common-Place Tasks: Recognizing People and Objects:
– Humans and some animals can effortlessly identify faces, objects, and
scenes.
– Challenges in AI: Developing systems that can reliably and accurately
perform visual recognition.
• Communicating Through Natural Language:
– Humans naturally understand and generate language.
– Challenges in AI: Achieving accurate natural language processing and
understanding.
• Navigating Around Obstacles:
– Humans and animals navigate environments without collisions.
– Challenges in AI: Creating autonomous systems that can navigate
dynamic and unstructured environments safely.
AI problems
2- Expert Tasks:
• Medical Diagnosis:
– Requires specialized knowledge and training.
– Achievements in AI: Systems capable of diagnostic assistance and
analysis.
• Mathematical Problem Solving:
– Involves high-level cognitive skills.
– Achievements in AI: Algorithms for symbolic integration, theorem
proving.
• Playing Games like Chess:
– Requires strategic thinking and planning.
– Achievements in AI: Development of AI systems that can compete with
human champions in chess.
STATE SPACE SEARCH
Introduction
Problem and Problem Solving
• The steps that are required to build a system to solve a particular problem
are:
1. Problem Definition that must include precise specifications of what the
initial situation will be, as well as what final situations constitute
acceptable solutions to the problem.
2. Problem Analysis, this can have immense impact on the appropriateness
of various possible techniques for solving the problem.
3. Isolate and Represent the task knowledge required to solve the
problem.
4. Selection of the best technique(s) for solving the particular problem.
• Problem solving is a process of generating solutions from the observed data.
State and State Space Representation
• A state is a representation of problem elements at a given moment.
• A state space is the set of all possible states reachable from the initial state.
• A state space forms a graph in which the nodes are states and the arcs between nodes
are actions.
• In a state space, a path is a sequence of states connected by a sequence of actions.
• The solution of a problem is a part of the graph formed by the state space.
Chess - Initial
Position Position after a legal move
Define the Problem as State Space Search
To provide a formal description of a problem, we need to do the
following:
1. Define a state space that contains all the possible configurations of the
relevant objects.
2. Specify one or more states that describe possible situations, from which the
problem solving process may start. These states are called initial states.
3. Specify one or more states that would be acceptable solution to the
problem. These states are called goal states.
Specify a set of rules that describe the actions (operators) available.
The problem can then be solved by using the rules, in combination
with an appropriate control strategy, to move through the problem
space until a path from an initial state to a goal state is found. This
process is known as ‘search’.
State Space Representation - Play Chess
Consider the problem of “Playing Chess”, to build a program that
could play chess, we have to specify,
1. The starting position of the chess board,
2. The rules that define legal moves.
3. And the board position that represent a win.
1. Initial Position of the chess board : The starting position can be
described by an 8 X 8 array square in which each element square
(x, y) describes the board position of an appropriate piece in the
official chess opening position.
State Space Representation - Play Chess
2. The rules that define legal moves
The legal moves provide the way of getting from initial state of final state.
It can be described as a set of rules consisting of two parts: A left side that
gives the current position and the right side that describes the change to be
made to the board position.
3. The board position that represents a win
The goal is any board position in which the opponent does not have a legal
move and his or her “king” is under attack.
State Space Representation – Water Jug
Problem Definition: You are given two jugs, a 4-gallon one and a 3-
gallon one, a pump which has unlimited water which you can use to
fill the jug, and the ground on which water may be poured. Neither
jug has any measuring markings on it. How can you get exactly 2
gallons of water in the 4-gallon jug?
1. Initial State
We will represent a state of the problem as a tuple (x, y), where x represents
the amount of water in the 4-gallon jug and y represents the amount of
water in the 3-gallon jug.
Note that 0 ≤ x ≤ 4, and 0 ≤ y ≤ 3.
Here the initial state is (0, 0). The goal state is (2, n) for any value of n.
State Space Representation – Water Jug
2. Production Rules
Sr. Current state Next state Description
1 (x, y) If x<4 (4, y) fill the 4- gallon jug
2 (x, y) If x<3 (x,3) fill the 3-gallon jug
3 (x, y) If x>0 (x-d, y) pour some water out of the
4- gallon jug
4 (x, y) If y>0 (x, y-d) pour some water out of
the 3- gallon jug
5 (x, y) If x>0 (0, y) empty the 4- gallon jug
on the ground
6 (x, y) If y>0 (x, 0) empty the 3- gallon jug
on the ground
State Space Representation – Water Jug
2. Production Rules
Sr. Current state Next state Desc
Description
7 (x, y) If x + y >= 4 & y>0 (4,y-(4-x)) pour water from the 3-
gallon jug into the 4-gallon
jug until the 4-gallon jug is
full
(x, y) If x + y >= 3 & x>0 (x-(3-y),3)) pour water from the 4-gallon
8
jug into the 3-gallon jug until
the 3-gallon jug is full
9 (x, y) If x + y <= 4 & y>0 (x+y,0) pour all the water from the
3-gallon jug into the 4-
gallon jug
State Space Representation – Water Jug
2. Production Rules
Sr. Current state Next state
Description
10 (x, y) If x + y <= 3 & x>0 (0,x+y) pour all the water
from the 4-gallon jug
into the 3-gallon jug
11 (0,2) (2,0) pour the 2-gallon
from the 3–gallon jug
into the 4-gallon jug
12 (2,y) (0, x) empty the 2 gallon in
the 4 gallon on the
ground
Water Jug – Solution
3. Productions for the water jug problem
Gallons in the 4- gallon Jug Gallons in the 3- gallon
Rule Applied
0 0
0 3
2 3 0
9
3 3
2 4 2
7
0 2
5 or 12
2 0
9 or 11
State Space Representation – 8 Puzzle
Problem Definition: The 8 puzzle consists of eight numbered,
movable tiles set in a 3x3 frame. One cell of the frame is always
empty thus making it possible to move an adjacent numbered tile
into the empty cell. Such a puzzle is illustrated in following diagram.
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
Initial Goal
State State
State Space Representation – 8 Puzzle
A solution to the problem is an appropriate sequence of moves,
such as “move tiles 5 to the right, move tile 7 to the left ,move tile 6
to the down” etc…
2 8 3 2 8 3
1 6 4 1 4
7 5 7 6 5
Initial Next
State State after
one legal
move
1 2 8 3
1 6 4
7 5
8 Puzzle - Game Tree
2 8 3 2 2 8 3 2 8 3
1 6 4 1 4 1 6 4
7 5 7 6 5 7 5
3 2 8 3 4 2 3 2 8 3
1 4 1 8 4 1 4
7 6 5 7 6 5 7 6 5
8 3 2 8 3 5 2 3 2 3
2 1 4 7 1 4 1 8 4 1 8 4
7 6 5 6 5 7 6 5 7 6 5
6 1 2 3
8 4
7 6 5
7 1 2 3 1 2 3
8 4 7 8 4
7 6 5 6 5
Problem Characteristics
1. Is the problem decomposable into a set of independent smaller or
easier sub-problems?
2. Can solution steps be ignored or at least undone if they prove
unwise?
3. Is the problem’s universe predictable?
4. Is a good solution to the problem obvious without comparison to
all other possible solutions?
5. Is the desired solution a state of the world or a path to a state?
6. Is a large amount of knowledge absolutely required to solve the
problem or is knowledge important only to constrain the search?
7. Can a computer that is simply given the problem return the
solution or will the solution of the problem require interaction
between the computer and a person?
Chess Analysis with Respect to Seven Problem
Characteristics
Satisfi
Problem Characteristics Justification
ed
Is the problem decomposable ? No Dependent moves
Can solution steps be ignored or at least
No Wrong move can’t be undone
undone
Is the problem’s universe predictable No Moves of other player can not be predicted
Absolut
Is a good solution absolute or relative? Winning position need not be compared
e
Is the solution a state or a path? Path Not only solution but how it is achieved also matters
Domain specific knowledge is required to constrain
What is the role of knowledge?
search
Does the task require Interaction with a
No Once all rules are defined, no need for interaction
person?
8 Puzzle Analysis with Respect to Seven Problem
Characteristics
Satisfi
Problem Characteristics Justification
ed
Is the problem decomposable ? No Dependent moves
Can solution steps be ignored or at least
Yes We can undo the previous move
undone
Problem Universe is predictable, it is a single person
Is the problem’s universe predictable Yes
game
Absolut
Is a good solution absolute or relative? Winning position need not be compared
e
Is the solution a state or a path? Path Not only solution but how it is achieved also matters
Domain specific knowledge is required to constrain
What is the role of knowledge?
search
Does the task require Interaction with a
No In 8 puzzle additional assistance is not required
person?
Production System
Production systems provide appropriate structures for performing
and describing search processes.
A production system has four basic components:
1. A set of rules each consisting of a left side that determines the applicability
of the rule and a right side that describes the operation to be performed if
the rule is applied.
2. A database of current facts established during the process of inference.
3. A control strategy that specifies the order in which the rules will be
compared with facts in the database and also specifies how to resolve
conflicts in selection of several rules or selection of more facts.
4. A rule applier.
Production systems provide us with good ways of describing the
operations that can be performed in a search for a solution to a
problem.
Production System Characteristics
1. A monotonic production system is a production system in which
the application of a rule never prevents the later application of
another rule that could also have been applied at the time the first
rule was selected.
2. A non-monotonic production system is one in which this is not
true. This production system increases the problem-solving
efficiency of the machine by not keeping a record of the changes
made in the previous search process.
3. A partially communicative production system is a production
system with the property that if the application of a particular
sequence of rules transforms state P into state Q, then any
combination of those rules that is allowable also transforms state
P into state Q.
4. A commutative production system is a production system that is
both monotonic and partially commutative. These type of
Issues in the Design of Search Programs
1. The direction in which to conduct the search (forward versus
backward reasoning). If the search proceeds from start state
towards a goal state, it is a forward search or we can also search
from the goal, i.e., backward search.
2. How to select applicable rules (Matching). Production systems
typically spend most of their time looking for rules to apply. So, it
is critical to have efficient procedures for matching rules against
states.
3. How to represent each node of the search process (knowledge
representation problem).
MCQ:
1. Which of the following best defines Artificial Intelligence (AI)?
A) The study of computer algorithms that improve automatically through experience.
B) The simulation of human intelligence processes by machines, especially computer
systems.
C) The creation of computer programs that can solve problems without human
intervention.
D) The development of hardware systems that can perform complex calculations.
Answer: B) The simulation of human intelligence processes by machines, especially
computer systems.
2. Which of the following is NOT a major area of Artificial Intelligence?
A) Machine Learning
B) Natural Language Processing
C) Data Encryption
D) Robotics
Answer: C) Data Encryption
4. Which AI technique involves using past experiences to make decisions in new
situations?
A) Heuristic Search
B) Neural Networks
C) Case-Based Reasoning
D) Genetic Algorithms
Answer: C) Case-Based Reasoning
5. Who is known as the "father of Artificial Intelligence"?
A) Alan Turing
B) John McCarthy
C) Marvin Minsky
D) Herbert Simon
Answer: B) John McCarthy
6. Which of the following is an example of a typical AI problem?
A) Data compression
B) Natural language translation
C) Signal transmission
D) Web browsing
Answer: B) Natural language translation
7. What is a production system in AI?
A) A system that produces hardware components.
B) A system that uses a set of rules to control its operations.
C) A system for producing multimedia content.
D) A manufacturing automation system.
Answer: B) A system that uses a set of rules to control its operations.
Problem Characteristics
8. Which characteristic is NOT typically considered in AI problem-solving?
A) Complexity
B) Modularity
C) Economic feasibility
D) Decomposability
Answer: C) Economic feasibility
Intelligent Agents
9. What is an intelligent agent in the context of AI?
A) A person who develops AI algorithms.
B) A machine or software that perceives its environment and takes actions.
C) A hardware device that performs automated tasks.
D) A software application for managing databases.
Answer: B) A machine or software that perceives its environment and takes actions.
AI Applications (E-Commerce & Medicine)
10. How is AI typically used in e-commerce?
A) To encrypt customer data.
B) To enhance product search and recommendation engines.
C) To design user interfaces.
D) To manage inventory storage.
Answer: B) To enhance product search and recommendation engines.
11. In medicine, AI can be used for:
A) Diagnosing diseases.
B) Performing surgical operations without human assistance.
C) Managing hospital logistics.
D) Developing new pharmaceuticals without clinical trials.
Answer: A) Diagnosing diseases.
References
1. "Artificial Intelligence: A Modern Approach" by Stuart Russell and Peter Norvig
This is one of the most comprehensive and widely used textbooks on AI, covering both the theoretical
foundations and practical applications of AI.
2. "Deep Learning" by Ian Goodfellow, Yoshua Bengio, and Aaron Courville
This book provides an in-depth introduction to deep learning, a key area within AI, and covers a range of
topics from basic neural networks to advanced architectures.
3. "Superintelligence: Paths, Dangers, Strategies" by Nick Bostrom
This book explores the potential future of AI, particularly the concept of superintelligent AI, and discusses
the ethical and strategic challenges that could arise.
4. "Human Compatible: Artificial Intelligence and the Problem of Control" by Stuart Russell
In this book, Stuart Russell discusses the alignment problem in AI and proposes ways to ensure that AI
systems are beneficial to humanity.
5. "The Master Algorithm: How the Quest for the Ultimate Learning Machine Will Remake Our World" by
Pedro Domingos
This book provides an accessible overview of machine learning and explores different approaches to
developing a universal learning algorithm.
[Link]