ISDT
ISDT
ISDT
Introduction to AI
1
What is AI ?Amity School of Engineering and Technology
• Artificial Intelligence is the science and engineering of making
intelligent machines.
2
What is AI ?Amity School of Engineering and Technology
• Artificial Intelligence is concerned with the design of
intelligence in an artificial device.
3
Amity School of Engineering and Technology
What is Intelligence?
• Intelligence is what we use when we don’t know what to do.
• Intelligence relates to tasks involving higher mental
processes.
4
Amity School of Engineering and Technology
Amity School of Engineering and Technology
Approaches toAmity
AI School of Engineering and Technology
• Hard or Strong AI
• Soft or Weak AI
• Applied AI
• Cognitive AI
7
Hard or StrongAmity
AI School of Engineering and Technology
9
Applied AI Amity School of Engineering and Technology
• Aims to produce commercially viable "smart"
systems such as, for example, a security
system that is able to recognize the faces of
people who are permitted to enter a
particular building.
• Applied AI has already enjoyed considerable
success.
10
Cognitive AIAmity School of Engineering and Technology
• Computers are used to test theories about
how the human mind works--for example,
theories about how we recognize faces and
other objects, or about how we solve abstract
problems.
11
Cognitive science
Amity School of Engineering and Technology
12
CyberneticsAmity School of Engineering and Technology
• Cybernetics” comes from a Greek word meaning “the art of
steering”.
• Cybernetics is about having and taking action to achieve that
goal. Knowing whether you have reached your goal (or at least
are getting closer to it) requires “”, a concept that comes from
cybernetics.
• Cybernetics grew from a desire to understand and build
systems that can achieve goals, whether complex human goals
or just goals like maintaining the temperature of a room under
changing conditions.
13
Goals of AI Amity School of Engineering and Technology
• The definition of AI gives four possible goals to pursue:
1. Systems that think like humans
2. Systems that think rationally
3. Systems that act like humans
4. Systems that act rationally
• Traditionally, all four goals have been followed and the approaches
were:
14
Systems that think likeAmityhumans
School of Engineering and Technology
15
Systems that act likeAmity
humans
School of Engineering and Technology
16
Systems that think rationally
Amity School of Engineering and Technology
17
Systems that act rationally
Amity School of Engineering and Technology
18
General AI Goals
Amity School of Engineering and Technology
19
AI Goal Amity School of Engineering and Technology
20
Major components of an AI system
Amity School of Engineering and Technology
Knwoledge Heuristic
Representation Search
AI Program
AI
Programming AI Hardware
languages and
tools
21
Major components of an AI system
Amity School of Engineering and Technology
• The quality of the result depends on how much knowledge the system
possesses. The available knowledge must be represented in a very
efficient way. Hence, knowledge representation is vital component of the
system.
• It is not merely enough that knowledge is represented efficiently. The
inference process should also be equally good for satisfactory results. The
inference process is broadly divided into brute and heuristic search
procedure.
• Today, just like we have specialized languages and programs for data
processing and scientific applications, we encounter specialized languages
and tools for AI programming. AI languages provide the basic functions for
AI programming and tools for the right environment.
• Today, most of the AI programs in India are implemented on Von
Neumann machines only. However dedicated workshops have emerged
for AI programming.
22
Applications areaAmity
ofSchool
AI of Engineering and Technology
• Perception
– Machine vision
– Speech understanding
– Touch ( tactile or haptic) sensation
• Robotics
• Natural Language Processing
– Natural Language Understanding
– Speech Understanding
– Language Generation
– Machine Translation
• Planning
• Expert Systems
• Machine Learning
• Theorem Proving
• Symbolic Mathematics
• Game Playing 24
The Turing Test
Amity School of Engineering and Technology
Human
Human ?
Interrogator
AI system
24
Turing test Amity School of Engineering and Technology
• To conduct Turing test, we need two people and the machine
to be evaluated. One person plays the role of the interrogator,
who is in a separate room from the computer and the other
person.
• The interrogator can ask questions of either the person or the
computer by typing questions and receiving typed responses.
however, the integrator knows only as A and B and aims to
determine which is the person and which is the machine.
• The goal of the machine is to fool the interrogator into
believing that it is the person. If the machine succeeds at this,
then we will conclude that the machine can think. The
machine is allowed to do whatever it can to fool the
interrogator.
35
Information, Knowledge,Amity
Intelligence
School of Engineering and Technology
• Information is a message that contains relevant meaning,
implication, or input for decision and/or action. Information
comes from both current (communication) and historical
(processed data or ‘reconstructed picture’) sources. In
essence, the purpose of information is to aid in making
decisions and/or solving problems or realizing an opportunity.
• Knowledge is the cognition or recognition (know-what),
capacity to act (know-how), and understanding (know-why)
that resides or is contained within the mind or in the brain.
The purpose of knowledge is to better our lives.
• Intelligence (also called intellect) is an umbrella term used to
describe a property of the mind that encompasses many
related abilities, such as the capacities to reason, to plan, to
solve problems, to think abstractly, to comprehend ideas, to
use language, and to learn. 36
Human intelligence Vs. Artificial intelligence
Amity School of Engineering and Technology
Human intelligence Artificial intelligence
Human intelligence revolves around The field of Artificial intelligence focuses
adapting to the environment using a on designing machines that can mimic
combination of several cognitive human behavior.
processes.
37
Intelligent Computing Vs. conventional
Amity Schoolcomputing
of Engineering and Technology
28
Amity School of Engineering and Technology
The AI Problem
29
The AI Problem
Amity School of Engineering and Technology
30
Formal TasksAmity School of Engineering and Technology
• Games
– Chess
– Backgammon
– Checkers-Go
• Mathematics
– Geometry
– Logic
– Internal calculus
– Proving properties of programs
31
Mundane Tasks
Amity School of Engineering and Technology
• Perception
– Vision
– Speech
• Natural language
– Understanding
– Generation
– Translation
• Commonsense reasoning
• Robot control
32
Expert TasksAmity School of Engineering and Technology
• Engineering
– Design
– Fault finding
– Manufacturing planning
• Scientific analysis
• Medical diagnosis
• Financial analysis
33
Limits of AI Today
Amity School of Engineering and Technology
Today’s AI systems have been able to achieve limited success in some
of these tasks.
• In Computer vision, the systems are capable of face recognition
• In Robotics, we have been able to make vehicles that are mostly
autonomous.
• In Natural language processing, we have systems that are capable of
simple machine translation.
• Today’s Expert systems can carry out medical diagnosis in a narrow
domain
• Speech understanding systems are capable of recognizing several
thousand words continuous speech
• Planning and scheduling systems had been employed in scheduling
experiments with the Hubble Telescope.
• The Learning systems are capable of doing text categorization into
about a 1000 topics
• In Games, AI systems can play at the Grand Master level in chess
(world champion), checkers, etc.
34
What can AI systems NOT do yet?
Amity School of Engineering and Technology
35
Amity School of Engineering and Technology
What is an AI technique
36
What is an AI technique
Amity School of Engineering and Technology
37
Examples of AI
Amity School of Engineering and Technology
39
Problem solving
Amity School of Engineering and Technology
40
General Problem solving
Amity School of Engineering and Technology
41
Problem Characteristics
Amity School of Engineering and Technology
42
1. Is the problem decomposable?
Amity School of Engineering and Technology
43
1. Is the problem decomposable?
Amity School of Engineering and Technology
(x2 + 3x + sin2x.cos2x)dx
(1 − cos2x)cos2xdx
cos2xdx −cos4xdx
44
2. Can solution steps beAmity
ignored or
School of Engineering and Technology
undone?
Theorem Proving
A lemma that has been proved can be ignored for next steps.
Ignorable!
45
2. Can solution steps beAmity
ignored or
School of Engineering and Technology
undone?
The 8-Puzzle
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
Recoverable!
46
2. Can solution steps beAmity
ignored or
School of Engineering and Technology
undone?
Playing Chess
Moves cannot be retracted.
Irrecoverable!
47
2. Can solution steps beAmity
ignored or
School of Engineering and Technology
undone?
• Ignorable problems can be solved using a simple
control structure that never backtracks.
• Recoverable problems can be solved using backtracking.
• Irrecoverable problems can be solved by recoverable style
methods via planning.
48
Amity School of Engineering and Technology
3. Is the universe predictable?
The 8-Puzzle
Every time we make a move, we know exactly what will
happen.
Certain outcome!
49
Amity School of Engineering and Technology
3. Is the universe predictable?
Playing Bridge
We cannot know exactly where all the cards are or what
the other players will do on their turns.
Uncertain outcome!
50
Amity School of Engineering and Technology
3. Is the universe predictable?
• For certain-outcome problems, planning can used to generate a
sequence of operators that is guaranteed to lead to a solution.
• For uncertain-outcome problems, a sequence of generated
operators can only have a good probability of leading to a
solution.
Plan revision is made as the plan is carried out and the
necessary feedback is provided.
51
Amity School of Engineering and Technology
4. Is a good solution absolute or relative?
52
4. Is a good solution absolute or
Amity School of Engineering and Technology
relative?
1. Marcus was a man.
2. Marcus was a Pompeian.
3. Marcus was born in 40 A.D.
4. All men are mortal.
5. All Pompeians died when the volcano
erupted in 79 A.D.
6. No mortal lives longer than 150 years.
7. It is now 2004 A.D.
Is Marcus alive?
53
4. Is a good solution absolute or
Amity School of Engineering and Technology
relative?
1. Marcus was a man.
2. Marcus was a Pompeian.
3. Marcus was born in 40 A.D.
4. All men are mortal.
5. All Pompeians died when the volcano
erupted in 79 A.D.
6. No mortal lives longer than 150 years.
7. It is now 2004 A.D.
Is Marcus alive?
Different reasoning paths lead to the answer. It does not
matter which path we follow.
54
4. Is a good solution absolute or
Amity School of Engineering and Technology
relative?
The Travelling Salesman Problem
We have to try all paths to find the shortest one.
55
4. Is a good solution absolute or
Amity School of Engineering and Technology
relative?
• Any-path problems can be solved using heuristics that suggest
good paths to explore.
56
Amity School of Engineering and Technology
5. Is the solution a state or a path?
Finding a consistent intepretation
“The bank president ate a dish of pasta salad with
the fork”.
– “bank” refers to a financial situation or to a side of a river?
– “dish” or “pasta salad” was eaten?
– Does “pasta salad” contain pasta, as “dog food” does not
contain “dog”?
– Which part of the sentence does “with the fork” modify?
What if “with vegetables” is there?
57
Amity School of Engineering and Technology
5. Is the solution a state or a path?
The Water Jug Problem
The path that leads to the goal must be reported.
58
Amity School of Engineering and Technology
5. Is the solution a state or a path?
• A path-solution problem can be reformulated as a state-
solution problem by describing a state as a partial path to a
solution.
59
Amity School of Engineering and Technology
6. What is the role of knowledge
Playing Chess
Knowledge is important only to constrain the search for a
solution.
Reading Newspaper
Knowledge is required even to be able to recognize a solution.
60
7. Does the task require human-
Amity School of Engineering and Technology
interaction?
• Solitary problem, in which there is no intermediate
communication and no demand for an explanation of the
reasoning process.
61
State space representation
Amity School of Engineering and Technology
• Before a solution can be found, the prime condition is that the
problem must be very precisely defined. By defining it
properly, one converts the abstract problem into real workable
states that are really understood.
• A set of all possible states for a given problem is known as the
state space of the problem.State space representations are
highly beneficial in AI because they provide all possible states,
operations and goals.
• If the entire state space representations for a problem is given,
it is possible to trace the path from the initial state to the goal
state and identify the sequence of operators necessary for
doing it.
• The major deficiency of this method is that it is not possible to
visualize all states for a given problem. Moreover, the
resources of the computer system are limited to handle huge
state-space representation.
State space representation of coffee
Amity School of Engineering and Technology
making
63
8- puzzle problem
Amity School of Engineering and Technology
64
Initial and goal state
Amity School of Engineering and Technology
65
State space of the 8 puzzle problem
Amity School of Engineering and Technology
66
Amity School of Engineering and Technology
70
Solution Amity School of Engineering and Technology
71
A Water Jug Problem
Amity School of Engineering and Technology
• You have a 4-
gallon and a 3-
gallon water jug
74
Water Jug Problem...
Amity School of Engineering and Technology
7. (x, y) → (4, y − (4 − x)) pour water from the 3- gallon jug into the 4-
gallon jug until the 4-gallon jug is full
if x + y 4, y 0
pour water from the 4- gallon jug into the 3-
8. (x, y) → (x − (3 − y), 3) gallon jug until the 3-gallon jug is full
if x + y 3, x 0
9. (x, y) → (x + y, 0) pour all the water from the 3-gallon jug into
if x + y 4, y 0 the 4-gallon jug
0 0 2
0 3 9
3 0 2
3 3 7
4 2 5
0 2 9
2
76
Missionaries and cannibals
Amity School of Engineering and Technology
77
Missionaries and cannibals
Amity School of Engineering and Technology
MM C M C
M C C M
C C
M
78
States Amity School of Engineering and Technology
79
OperationsAmity School of Engineering and Technology
• An operation takes us from one state to another
• Here are five possible operations:
– boat takes 1 missionary across river (1m)
– boat takes 1 cannibal across river (1c)
– boat takes 2 missionaries across river (2m)
– boat takes 2 cannibals across river (2c)
– boat takes 1 missionary and 1 cannibal across river (1m1c)
80
The state space
Amity School of Engineering and Technology
3m, 2c etc.
1c etc.
2c 3m, 1c
3m, 3c,
1m
2m, 3c
boat
2m
3m, 2c, etc.
1m, 3c
1m1c 1m boat
2m, 2c
1c 2m, 3c, etc.
boat
1m1c
81
Solution Amity School of Engineering and Technology
1. (3, 3,0) → (0,0,1) Initial state
2. (3, 1,0) → (0,2,1) two cannibal will go
3. (3,2,0) → (0,1,1) one cannibal will return
4. (3,0,0) →(0,3,1) two cannibal will go
5. (3,1,0) →(0,2,1) one cannibal will return
6. (1,1,0) →(2,2,1) two Missionaries will go
7. (2,2,0) →(1,1,1) one cannibal and one Missionaries
will return
8. (0,2,0) →(3,1,1) two Missionaries will go
9. (0,3,0) → (3,0,1) one cannibal will return
10. (0,1,0) →(3,2,1) two cannibal will go
11. (0,2,0) → (3,1,1) one cannibal will return
12. (0,0,0) →(3,3,1) two cannibal will go
82
Farmer river crossingAmity
Problem
School of Engineering and Technology
83
Solution
Amity School of Engineering and Technology
• A set of all possible states for a problem is
known as the state space of the problem.
There are 16 sub-states of the man , wolf, goat
and cabbage.
• Some of the 16 states such as GC-MW are
fatal and may never be entered by the system.
MWGC-φ → initial state
φ –MWGC → goal state
84
Sequence of steps for crossing river
Amity School of Engineering and Technology
1. First man crosses the river with goat.
2. Man comes back.
3. Man takes either cabbage (or wolf) with him
to another side.
4. Man comes back with goat to first side.
5. Man takes wolf (or cabbage) with him to
another side.
6. Man comes back.
7. Man takes goat with him to another side.
85
State space representation
Amity School of Engineering and Technology
86
n-queens Amity School of Engineering and Technology
95
Production system
Amity School of Engineering and Technology
Since search forms the core of many intelligent processes, it is useful to structure AI
programs in a way that facilitates describing and performing the search process.
Production systems provide such structures.
A production system consist of:-
✓ A set of rules, each consisting of a left side (pattern) that determines the applicability
of the rule and a right side describing the operation to be performed.
✓ One or more knowledge/databases that contain whatever information is appropriate
for the particular task.
✓ A control strategy that specifies the order in which the rules will be compared to the
database and a way of resolving the conflicts that arise when several rules match at
once.
✓ A rule applier which is the computational system that
implements the control strategy and applies the rules.
96
Classes of ProductionAmitySystem
School of Engineering and Technology
91
Amity School of Engineering and Technology
Example
(0, 0)
(4, 0) (0, 3)
92
Search Strategies
Amity School of Engineering and Technology
93
Brute Force or Uninformed Search
Amity School of Engineering and Technology
Strategies
❖ These are commonly used search procedure which
explore all the alternatives during the search process.
❖ They do not have any domain specific knowledge.
❖ They need the initial state, the goal state and a set of
legal operators.
❖ The strategy gives the order in which the search space is
searched
❖ The followings are example of uninformed search
– Depth First Search (DFS)
– Breadth First Search (BFS)
94
Search Strategies: Blind Search
Amity School of Engineering and Technology
• Breadth-first search
Expand all the nodes of
one level first.
• Depth-first search
Expand one of the nodes at
the deepest level.
95
Depth First Search
Amity School of Engineering and Technology
103
Amity School of Engineering and Technology
97
Amity School of Engineering and Technology
98
Amity School of Engineering and Technology
99
Amity School of Engineering and Technology
100
Amity School of Engineering and Technology
101
Amity School of Engineering and Technology
102
Amity School of Engineering and Technology
103
Amity School of Engineering and Technology
104
Depth-first search
Amity School of Engineering and Technology
105
Amity School of Engineering and Technology
106
Amity School of Engineering and Technology
107
Algorithm for Depth First Search
Amity School of Engineering and Technology
108
Time and space complexity
Amity School of Engineering and Technology
Time Complexity :
1 + b + b2 + b3 +…+……bd.
Hence Time complexity = O (bd)
Where b-> branching factor
d-> Depth of a tree
Space Complexity :
Hence Space complexity = O (d)
109
Advantages of Depth-First Search
Amity School of Engineering and Technology
110
Disadvantages of Depth-First Search
Amity School of Engineering and Technology
111
Breadth First Search
Amity School of Engineering and Technology
112
Amity School of Engineering and Technology
113
Amity School of Engineering and Technology
114
Amity School of Engineering and Technology
115
Amity School of Engineering and Technology
116
Breadth-first search
Amity School of Engineering and Technology
Time Complexity :
1 + b + b2 + b3 +…+……bd.
Hence Time complexity = O (bd)
Space Complexity :
1 + b + b2 + b3 +…+……bd.
Hence Space complexity = O (bd)
Advantages of Breadth-First Search
Amity School of Engineering and Technology
It is one in which by luck solution can While in BFS all parts of the tree must
be found without examining much of be examined to level n before any
the search space at all. nodes on level n+1 can be examined.
It does not give optimal solution. It gives optimal solution.
DFS may find a long path to a solution BFS guarantees to find a solution if it
in one part of the tree, when a shorter exists. Furthermore if there are
path exists in some other, unexplored multiple solutions, then a minimal
part of the tree. solution will be found.
Time complexity: O(bd ) Time complexity: O(bd )
where b : branching factor, d: depth where b : branching factor, d: depth
Space complexity: O(d) , d: depth Space complexity: O(bd )
where b : branching factor, d: depth
131
Amity School of Engineering and Technology
•Knowledge engineer and domain expert work in coherence to define the problem
2 Knowledge base is created (component 1) All of the knowledge collected from the experts is
organised and stored in the knowledge base.
3 Inference Engine is created (component 2) This allows the knowledge base to be searched by the
user.
The inference engine poses questions to the user and then analyses the answers by running a set of
rules that have been programmed into the engine.
Amity School of Engineering and Technology
Examples of questions that a medical diagnosis expert system might pose to a user:
Do you have a runny nose? YES/NO Do you have a sore throat? YES/NO
Examples of rules that allow the inference engine to come up with an answer or a conclusion to a
problem:
IF the patient has a runny nose AND a sore throat THEN the diagnosis is a cold IF the animal has
4 legs AND a tail AND barks THEN the species is a dog.
4 User Interface is created (component 3) This allows the user to communicate with the expert
system. The user interface gives the user the ability to answer questions posed by the system.
Common ways of doing this are:
Text boxes Check boxes / Option buttons Submit buttons
5 Testing Finally the expert system is tested to make sure that the correct answers to problems or
questions are being generated.
Amity School of Engineering and Technology
Thank You
Amity School of Engineering and Technology
Intelligent Agents
Amity School of Engineering and Technology
Agent in AI
• Agent perceives environment through sensors and act upon
that environment through actuators.
• An Agent runs in the cycle of perceiving, thinking,
and acting.
– Human Agent: eyes, ears, and other organs, o/p leg movement
– Robotic agent: cameras, infrared range finder, NLP for sensors
– Software agent: keystrokes, file contents as sensory input
Amity School of Engineering and Technology
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.
Amity School of Engineering and Technology
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
Amity School of Engineering and Technology
Effectors:
• Effectors are the devices which affect the environment.
Effectors can be legs, wheels, arms, fingers, wings, fins, and
display screen
Amity School of Engineering and Technology
Agent
Amity School of Engineering and Technology
Conclusion
• Agent perceives environment through sensors and act upon
that environment through actuators
• Agents can solve or provide solution to a given problem
Rules of AIAmity School of Engineering and Technology
Problem solving
• Defining the objective i.e goal state
Goal
formulation • Limiting the objective
Problem formulation
• a problem-solving is a part of artificial intelligence which
encompasses
• a number of techniques such as algorithms.
• heuristics to solve a problem.
Amity School of Engineering and Technology
State space
• Initial state, actions, and transition model together define
the state-space of the problem implicitly.
• State-space of a problem is a set of all states which can be
reached from the initial state followed by any sequence of
actions.
• The state-space forms a directed map or graph where nodes are
the states, links between the nodes are actions, and the path is a
sequence of states connected by the sequence of actions.
Amity School of Engineering and Technology
Design thinking in AI
• Successful AI implementations
• Figure out why, where, and how they can apply AI to
specific business problems.
• Probe deeper into the problem statement and its possible
solutions.
• Accelerate their AI adoption process
• Reduce the resistance to change.
Amity School of Engineering and Technology
Design thinking in AI
• Machine • Semenatic
learning web
Human
thinking
like
optimal acting
• airplanes • Dancing
• autopilot bots
Amity School of Engineering and Technology
Thinking
ideate
prototype
• Design a prototype to test all or part of your solution
Amity School of Engineering and Technology
testing
• Understand the impediments
• What works?
• Role play
• Iterate quickly
Amity School of Engineering and Technology
Conclusion
• It helps keep a human element at the centre of the process
• It takes the guesswork out of what your client’s needs are
• It allows you to prioritize solutions
• It generates revolutionary ideas by creating a “yes, and…”
mentality during brainstorming
• It helps teams learn quickly by allowing the team to fail faster
and build out ideas more effectively
• It’s flexible, allowing you to move forward and backward
through the process to prototype and iterate faster