2. CE623 – Artificial Intelligence
Books
– Artificial Intelligence, Third Edition, Tata-Mc Graw
Hill Author(s): E.Rich & K. Knight (text book)
– Artificial Intelligence – A New Synthesis Author(s):
Nils J. Nilsson, Tom M Mitchell by Kaufmann
Publishers.
Unit 1
Prepared by: Chhaya Patel
2
3. Unit 1
Introduction to Artificial
Intelligence
Definition of an AI
– AI is subset of Data Science.
– Data science works with statistics, probability and
linear algebra.
– Artificial = man-made
– Intelligence = thinking power
– AI = a man-made thinking power
Unit 1
Prepared by: Chhaya Patel
3
5. Definition of an AI
– “AI is a branch of computer science by which we
can create intelligent machines which can behave like
a human, think like humans, and able to make
decisions.”
OR
– AI is the simulation of human intelligence processes
by machines, especially computer systems.
Unit 1
Prepared by: Chhaya Patel
5
6. Characteristics of AI
– AI make a machine to acquire information from
experiences.
– AI makes machine to operate humans-like-activities.
– Capable of predicting and adapting.
– Makes decisions on its own.
– AI continuous learning.
Unit 1
Prepared by: Chhaya Patel
6
7. Advantages of AI
– Reduction in human error
– Available 24×7
– Helps in repetitive work
– Digital assistance
– Faster decisions
– Medical applications
– Improves Security
– Efficient Communication etc..
Unit 1
Prepared by: Chhaya Patel
7
9. 1. Expert Systems
– An expert system is AI software that uses knowledge
stored in a knowledge base.
– Knowledge Engineering is the term used to define the
process of building an Expert System.
– For example, the expert system provides
suggestions for spelling and errors in Google
Search Engine.
–
Unit 1
Prepared by: Chhaya Patel
9
10. 1. Expert Systems
– It is mainly used in the medical field to operate
medical facilities and detect virus infections.
– It is also used in the banking sector for loan and
investment analysis.
– Example:
• Dendral
• Mycin
• CaDet
• DXplain
Unit 1
Prepared by: Chhaya Patel
10
11. 2. Robotics
– Robotics is an interdisciplinary field of science and
engineering incorporated with mechanical
engineering, electrical engineering, computer
science, and many others.
– It deals with computer systems for their control,
intelligent outcomes, and information transformation.
– Robot can perform like humans, if enabled with AI.
– Example: Sophia,
Unit 1
Prepared by: Chhaya Patel
11
12. 3. Machine Learning
– Machine learning (ML) is a type of AI that allows
software applications to become more accurate at
predicting outcomes without being explicitly
programmed to do so.
– Machine learning algorithms use historical data as input
to predict new output values.
Unit 1
Prepared by: Chhaya Patel
12
13. 3. Machine Learning
– There are three major categories of Machine Learning:
Supervised Learning
Model trained with labelled dataset.
Classification - Classification is the process of
categorizing a given set of data into classes.
Regression - model the relationship between a
dependent (output) and independent (input)
variables with one or more independent variables.
Unit 1
Prepared by: Chhaya Patel
13
14. 3. Machine Learning
– There are three major categories of Machine Learning:
Un supervised Learning
Models are trained using unlabelled dataset and are
allowed to act on that data without any supervision.
Clustering: identify and group similar data points
in larger datasets without concern for the specific
outcome.
Unit 1
Prepared by: Chhaya Patel
14
15. 3. Machine Learning
– There are three major categories of Machine Learning:
Semi supervised Learning
learn from a small amount of labeled data and train
model for large amount of unlabeled.
Unit 1
Prepared by: Chhaya Patel
15
16. 4. Neural Network / Deep Learning
– Deep Learning is a type of machine learning based on
artificial neural networks in which multiple layers of
processing are used to extract higher level features
from data.
– This wonderful branch of AI is also responsible for
virtual assistant apps such as “Alexa and Siri”.
Unit 1
Prepared by: Chhaya Patel
16
17. 4. Neural Network / Deep Learning
– ANN – used to solve numerical problems.
– CNN – used to solve problems with images.
– RNN – used to solve problem with time series.
Unit 1
Prepared by: Chhaya Patel
17
18. 5. Fuzzy Logic
– Fuzzy Logic Systems (FLS) produce acceptable but
definite output in response to incomplete, ambiguous,
or inaccurate (fuzzy) input.
– Fuzzy Logic helps to offer a certain level of reasoning
flexibility when faced with uncertainties.
– Applications: Automatic Gearboxes, Four-Wheel
Steering, Vehicle environment control, Microwave
Ovens, Refrigerators, Toasters etc.
Unit 1
Prepared by: Chhaya Patel
18
19. 6. Natural Language Processing
– NLP is a field of AI with the ability of a computer to
understand, analyze, manipulate, and potentially
generate human language.
– This is simply the process of making computer
systems to understand basic human interactions.
– Example: google assistant, Siri, Alexa, chatbots for
customer support.
Unit 1
Prepared by: Chhaya Patel
19
20. Application of AI
– Google’s AI-powered predictions (E.g.: Google Maps)
– Ride-sharing applications (E.g.: Uber, Lyft)
– AI Autopilot in Commercial Flights
– Spam filters on E-mails
– Plagiarism checkers and tools
– Facial Recognition
– Search recommendations
– Voice-to-text features
– Smart personal assistants (E.g.: Siri, Alexa)
– Fraud protection and prevention.
Unit 1
Prepared by: Chhaya Patel
20
21. Problem and Problem Solving
To build system to solve particular problem, we need to
do 4 things:
Define problem precisely.
Analyze the problem.
Represent task knowledge.
Choose the best problem solving technique.
Problem solving is a process of generating solutions
from the observed data.
Unit 1
Prepared by: Chhaya Patel
21
22. State and State Space search
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 creates 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. Unit 1
Prepared by: Chhaya Patel
22
23. State and State Space search
Unit 1
Prepared by: Chhaya Patel
23
Chess - Initial Position Position after a legal
move
24. Define the Problem as State
Space Search
• A state space is formally represented as a tuple
S:⟨S, A, Action(s) ,Result(s, a) ,Cost(s, a)⟩
– S is the set of all possible states
– A is the set of possible actions
– Action(s) is possible action to perform in a certain state;
– Result(s,a) is a state reached performing action a in state s
– Cost(s,a) is the cost of performing an action a in state s.
Unit 1
Prepared by: Chhaya Patel
25
25. State Space Search
1 - 8 Puzzle Problem
Problem Definition: The 8 puzzle consists of eight
numbered, movable tile 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.
26
2 8 3
1 6 4
7 5
1 2 3
8 4
7 6 5
Initial State Goal State
26. State Space Search
1 - 8 Puzzle Problem
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…
Unit 1
Prepared by: Chhaya Patel
27
Initial State Next State after
one legal move
2 8 3
1 6 4
7 5
2 8 3
1 4
7 6 5
30. Problem Definition:
– You are given two jugs, 4-ltr and 3-ltr.
– Neither jug has any measuring markings on it.
– A pump which has unlimited water which you can
use to fill the jug.
– How can you get exactly 2ltr of water in the a 4-ltr
jug?
Unit 1
Prepared by: Chhaya Patel
31
State Space Search
2 - Water Jug
31. – We will represent a state of the problem as a tuple (x, y)
– x = amount of water in the 4ltr jug
– y = amount of water in the 3ltr jug
1. Initial State : (0, 0) ; 0 ≤ x ≤ 4, and 0 ≤ y ≤ 3.
2. Goal state is (2, n) for any value of n.
Unit 1
Prepared by: Chhaya Patel
32
State Space Representation
2 - Water Jug
32. State Space Representation
2 - Water Jug
Unit 1
Prepared by: Chhaya Patel
33
Production Rules
Sr. Current state Next state Description
1 (x, y) If x<4 (4, y) fill the 4- ltr jug
2 (x, y) If y<3 (x,3) fill the 3-ltr jug
3 (x, y) If x>0 (x-d, y) pour some water out of the 4-ltr jug
4 (x, y) If y>0 (x, y-d) pour some water out of the 3-ltr jug
5 (x, y) If x>0 (0, y) empty the 4-ltr jug on the ground
6 (x, y) If y>0 (x, 0) empty the 3-ltr jug on the ground
33. State Space Representation
2 - Water Jug
34
Production Rules
Sr. Current state Next state Description
7 (x, y) If x + y >= 4 & y>0 (4,y-(4-x)) pour water from the 3-ltr
jug into the 4-ltr jug until
the 4-ltr jug is full
8 (x, y) If x + y >= 3 & x>0 (x-(3-y),3)) pour water from the 4-ltr
jug into the 3-ltr jug until
the 3-ltr jug is full
9 (x, y) If x + y <= 4 & y>0 (x+y,0) pour all the water from the
3-ltr jug into the 4-ltr jug
34. State Space Representation
2 - Water Jug
35
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 -
ltr jug into the 3-ltr jug
11 (0,2) (2,0) pour the 2-ltr from the 3 – ltr jug
into the 4-ltr jug
12 (2,y) (0, y) empty the 2 ltr in the 4 ltr
on the ground
35. State Space Representation
2 - Water Jug
36
Productions for the water jug
4- ltr Jug 3- ltr Jug 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
36. State Space Representation
3 - 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.
Unit 1
Prepared by: Chhaya Patel
37
37. State Space Representation
3 - 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.
Unit 1
Prepared by: Chhaya Patel
38
38. State Space Representation
3 - Play Chess
2. legal move
Square(file e, rank 3)
is empty AND
Square(file e, rank 4)
is empty
White pawn at
Square(file e, rank 2)
Unit 1
Prepared by: Chhaya Patel
39
39. State Space Representation
3 - Play Chess
3. The board position that represents a win
Unit 1
Prepared by: Chhaya Patel
40
40. 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?
Unit 1
Prepared by: Chhaya Patel
41
41. Problem Characteristics
5. Is the desired solution is a state or a path?
6. Is a large amount of knowledge 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?
Unit 1
Prepared by: Chhaya Patel
42
42. 8 Puzzle Analysis with Respect to Seven
Problem Characteristics
Unit 1
Prepared by: Chhaya Patel
43
Problem Characteristics Satisfied Justification
Is the problem decomposable ? No Dependent moves
Can solution steps be ignored or
at least undone
Yes We can undo the previous move
Is the problem’s universe
predictable
Yes
Problem Universe is predictable, it is a
single person game
Is a good solution absolute or
relative?
Absolute
Winning position need not be
compared
Is the solution a state or a path? Path
Not only solution but how it is achieved
also matters
What is the role of knowledge?
Domain specific knowledge is required
to constrain search
Does the task require Interaction
with a person?
No
In 8 puzzle additional assistance is not
required
43. Production System
– Production systems provide appropriate structures for
performing and describing search processes.
– A production system has four basic components:
• 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.
• A database of current facts established during the process of
inference.
Unit 1
Prepared by: Chhaya Patel
44
44. Production System
• 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.
• 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.
Unit 1
Prepared by: Chhaya Patel
45