AIML Unit-1
AIML Unit-1
Engineering®
Unit-1
Artificial Intelligence and Machine
learning
21AI52
® Outline
▪Introduction
→ What is AI ?
→ Foundation of Artificial Intelligence
→ History of Artificial Intelligence
→ The State of the Art
▪Intelligent Agents
→ Introduction
→ How Agents should Act
→ Structure of Intelligent Agents
▪Problem Solving
→ Solving the Problems by Searching
→ Search Strategies
→ Avoiding the Repeated States
2
®
Introduction
3
® What is AI ?
▪ Artificial Intelligence (AI) takes the
advantages of the computers, and machines
to mimic the problem solving, and decision
making capabilities of the human beings
• Computer: Intelligence enough to process
and analyse the data
• Machine: Contains no intelligence, waiting
for the instructions from the user or
computer
▪ The definitions vary in two main dimensions
▪ First: Concerned with thought processes
and reasoning
▪ Second: Concerned with the behavior
▪ Remember: AI system is rational if it does the
right thing
4
® What is AI ? (Contd.)
1 2
3 4
5
® What is AI ? (Contd.)
▪ Definition of AI are categorized into following four categories
7
® What is AI ? (Contd.)
Acting Humanly: The Turing Test Approach
• Natural Language Processing (NLP): to enable it to communicate successfully in
English (or some other human language)
• Knowledge Representation: to store information provided before or during the
interrogation;
• Automated Reasoning to use the stored information to answer questions and to
draw new conclusions;
• Machine Learning (ML) to adapt to new circumstances and to detect and
extrapolate patterns
▪ Turing's test deliberately avoided direct physical interaction between the
interrogator and the computer, because physical simulation of a person is
unnecessary for intelligence
▪ However, total Turing Test includes a video signal so that the interrogator can
test the subject's perceptual abilities, as well as the opportunity for the
interrogator to pass physical objects "through the hatch.
8
® What is AI ? (Contd.)
Acting Humanly: The Turing Test Approach
▪ To pass the total Turing Test, the computer will need
• Computer Vision to perceive objects, and
• Robotics to manipulate the objects (move arround)
▪ Acting like a human comes up primarily when AI programs
interact with people, as when an expert system explains how it
came to its diagnosis, or a natural language processing system
has a dialogue with a user.
▪ These programs must behave according to certain normal
conventions of human interaction in order to make themselves
understood.
9
® What is AI ? (Contd.)
Thinking Humanly: The Cognitive Modelling Approach
▪ If the program is said to be thinking like human, some ways to
determine the human thinking need to be listed
▪ There are two ways to understand the actual working of the human
minds
• Through Introspection: Trying to catch the human thoughts as they go
by
• Through Psychological Experiments
▪ Once we have a sufficiently precise theory of the mind, it becomes
possible to express the theory as a computer program.
▪ If the program’s input/output and timing behavior matches human
behavior, that is evidence that some of the program's mechanisms
may also be operating in humans.
10
® What is AI ? (Contd.)
Thinking Humanly: The Cognitive Modelling
Approach
▪ The interdisciplinary field of Cognitive Science brings together
Computer Models from AI and experimental techniques from
Psychology to try to construct precise and testable theories of
the workings of the human mind.
▪ Real Cognitive Science, is based on experimental investigation of
actual humans or animals
▪ AI and Cognitive Science continue to fertilize each other,
especially in the areas of vision, natural language, and learning
11
® What is AI ? (Contd.)
⇒Thinking Rationally: The laws of thought Approach
▪ Logicians in the 19th century developed a precise notation for statements about all
kinds of objects in the world and the relations among them.
▪ By 1965, programs existed that could, given enough time and memory, take a
description of a problem in logical notation and find the solution to the problem, if one
exists
▪ Logicist tradition within artificial intelligence hopes to build on such programs to create
intelligent systems.
▪ There are two main obstacles to this approach
• It is not easy to take informal knowledge and state it in the formal terms required by
logical notation
• There is a big difference between being able to solve a problem and doing so in
practice
▪ Even problems with just a few dozen facts can exhaust the computational resources of
any computer unless it has some guidance as to which reasoning steps to try first
▪ Although both of these obstacles apply to any attempt to build computational reasoning
systems, they appeared first in the Logicist tradition because the power of the
representation and reasoning systems are well-defined and fairly well understood
12
® What is AI ? (Contd.)
Acting rationally: The rational agent approach
▪ An Agent is just something that perceives and acts
▪ Acting Rationally: Doing right things
▪ In this approach, AI is viewed as the study and construction of
rational agents
▪ In the “Laws of Thought” approach to AI, the whole emphasis was
on correct inferences.
▪ Making correct inferences is sometimes part of being a rational
agent, because one way to act rationally is to reason logically to
the conclusion that a given action will achieve one's goals, and
then to act on that conclusion.
13
® What is AI ? (Contd.)
Acting rationally: The Rational Agent Approach
▪ On the other hand, correct inference is not all of rationality,
because there are often situations where there is no provably
correct thing to do, yet something must still be done
▪ There are also ways of acting rationally that cannot be
reasonably said to involve inference. For example, pulling one's
hand off of a hot stove is a reflex action that is more successful
than a slower action taken after careful deliberation
▪ To allow Rational Actions, all of the “Cognitive Skills" required for
the Turing Test are present.
▪ Thus, we need the ability to represent knowledge and reason
with it because this enables us to reach good decisions in a wide
variety of situations.
14
® What is AI ? (Contd.)
Acting rationally: The Rational Agent Approach
▪ One important point to keep in mind: Achieving perfect rationality
—always doing the right thing—is not possible in complicated
environments. The computational demands are just too high.
▪ Limited Rationality- Acting appropriately when there is not
enough time to do all the computations one might like.
15
® The Foundation of AI
▪ This section provide a brief history of AI
▪ Although AI itself is a young field, it has inherited many ideas,
viewpoints, and techniques from other disciplines.
• From over 2000 years of tradition in philosophy, theories of
reasoning and learning have emerged, along with the viewpoint that
the mind is constituted by the operation of a physical system.
• From over 400 years of mathematics, which comprises of formal
theories of logic, probability, decision making, and computation.
• From psychology, the tools to investigate the human mind, and a
scientific language to express the resulting theories. From linguistics,
the theories of the structure and meaning of language.
• Finally, from computer science, the tools with which to make AI a
reality.
16
® The Foundation of AI (Contd.)
Foundation of AI
Neuroscienc
Philosophy Mathematics Psychology
e
1. Can formal rules be 1. What are the rules to 1. How do brain process 1. How do brain
used to draw valid draw the valid the information ? process the
conclusions ? Conclusions ? information ?
2. Where does knowledge 2. What can be
come from ? computed ?
3. How does the 3. How do we reason with
knowledge lead toEconomics Computer
uncertain information ?
Linguistics
action Engineering
1. How to we make 1. How can we build an 1. How does language
decisions so as to Efficient Computer ? relate to thought ?
maximize the payoff?
2. How should we do this Different fields have contributed to AI, in terms
when others may not go of Ideas, Viewpoints, and Techniques
along ?
17
®
Intelligent Agents
18
® Introduction
▪ An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that environment
through effectors.
▪ A Human Agent has eyes, ears, and other organs for sensors, and
hands, legs, mouth, and other body parts for effectors
▪ A Robotic Agent substitutes cameras and infrared range finders
for the sensors and various motors for the effectors.
▪ A generic agent is diagrammed in shown in below Figure.
▪ Examples for Agents
▪ Human Agent
▪ Robotic Agent
21
®How Agent should Act (Contd.)
Rational Agent
• Assumptions
o Performance measure: 1 point for each clean square at
each time step
o Environment: is known a priori
o Actions = {left, right, suck, no-op}
o Agent is able to perceive the location and dirt in that location
22
How Agent should Act (Contd.)
®
23
®How Agent should Act (Contd.)
⇒ Specifying the Task Environment
▪ Specifying the Task Environment is the first step in AI, and it is
based on PEAS (Performance, Environment, Actuators, Sensors)
▪ PEAS Description of the Task Environment for an Automated taxi
26
How Agent should Act (Contd.)
®
31
Structure of the Agent (Contd.)
®
34
Structure of the Agent (Contd.)
®
35
Structure of the Agent (Contd.)
®
36
Structure of the Agent (Contd.)
®
⇒ Utility-based agents
▪ These agents are similar to the goal-based agent but provide an extra
component of utility measurement which makes them different by
providing a measure of success at a given state
▪ Utility-based agent act based not only goals but also the best way to
achieve the goal.
▪ The Utility-based agent is useful when there are multiple possible
alternatives, and an agent has to choose in order to perform the best
action.
37
Structure of the Agent (Contd.)
®
⇒ Utility-based agents
38
Structure of the Agent (Contd.)
®
⇒ Learning Agents
▪ A learning agent in AI is the type of agent which can learn from its past
experiences, or it has learning capabilities
▪ It starts to act with basic knowledge and then able to act and adapt
automatically through learning
▪ A learning agent has mainly four conceptual components, which are:
• Learning Element: It is responsible for making improvements by learning
from environment
• Critic: Learning element takes feedback from critic which describes that how
well the agent is doing with respect to a fixed performance standard.
• Performance Element: It is responsible for selecting external action
• Problem Generator: This component is responsible for suggesting actions
that will lead to new and informative experiences.
▪ Hence, learning agents are able to learn, analyze performance, and
look for new ways to improve the performance
39
Structure of the Agent (Contd.)
®
⇒ Learning Agents
40
®
Problem Solving
41
® Problem-Solving Agents
▪ In Artificial Intelligence, Search techniques are universal problem-solving methods
▪ Rational agents or Problem-solving agents in AI mostly used these search
strategies or algorithms to solve a specific problem and provide the best result.
▪ Problem-solving agents are the Goal-based agents
▪ Terminologies used in Search Algorithms
• Search: Searching is a step by step procedure to solve a
search-problem
• Search Tree: A tree representation of search problem is Root node
called Search tree. The root of the search tree is the root
node which is corresponding to the Initial state
Edges
• Path Cost: It is a function which assigns a numeric cost to
each path
• Solution: It is an action sequence which leads from the
start node to the goal node
• Optimal Solution: If a solution has the lowest cost
among all solution Leaf node
42
® Search Strategies (Contd.)
⇒ Properties of Search Algorithms
▪ Completeness: A search algorithm is said to be complete if it
guarantees to return a solution if at least any solution exists for
any random input.
▪ Optimality: If a solution found for an algorithm is guaranteed to
be the best solution (lowest path cost) among all other solutions,
then such a solution for is said to be an optimal solution.
▪ Time Complexity: Time complexity is a measure of time for an
algorithm to complete its task.
▪ Space Complexity: It is the maximum storage space required at
any point during the search, as the complexity of the problem.
43
® Search Strategies
⇒ Uniformed Search
▪ The uninformed search does not contain any domain knowledge such
as closeness, the location of the goal. It operates in a brute-force way
as it only includes information about how to traverse the tree and how
to identify leaf and goal nodes.
▪ It is also called Blind search. It examines each node of the tree until it
achieves the goal node.
⇒ Informed Search
▪ Informed search algorithms use domain knowledge. In an informed
search, problem information is available which can guide the search.
▪ Informed search strategies can find a solution more efficiently than an
uninformed search strategy.
▪ Informed search is also called a Heuristic Search
44
® Search Strategies (Contd.)
Search
Strategies
45
® Uninformed Search (Contd.)
▪ Breadth First Search (BFS) is the most common search strategy for
traversing a tree or graph.
▪ This algorithm searches breadthwise in a tree or graph, so it is called
breadth-first search.
▪ BFS algorithm starts searching from the root node of the tree and
expands all successor node at the current level before moving to
nodes of next level.
▪ Breadth-first search implemented using FIFO queue data structure.
▪ Advantage
• If there are more than one solutions for a given problem, then BFS will
provide the minimal solution which requires the least number of steps.
▪ Dis-Advantages
• It requires lots of memory since each level of the tree must be saved into
memory to expand the next level.
• BFS needs lots of time if the solution is far away from the root node
46
® Uninformed Search (Contd.)
▪ In BFS, root node is expanded first, then all the successors of the root
node are expanded next, then their successors, and so on.
▪ Breadth-first search can be implemented by calling TREE-SEARCH with
an empty fringe that is a first-in-first-out (FIFO) queue, assuring that
the nodes that are visited first will be expanded first. In other words,
calling TREE-SEARCH(Problem, FIFO-QUEUE()) results in a breadth-first
search.
▪ The FIFO queue puts all
newly generated successors
at the end of the queue,
which means that shallow
nodes are expanded before
deeper nodes
47
® Uninformed Search (Contd.)
⇒ Depth First Search
▪ Depth-first search is a recursive algorithm for traversing a tree or
graph data structure
▪ Depth-first search starts from the root node and follows each path to
its greatest depth node before moving to the next path
▪ DFS uses a stack data structure for its implementation
▪ Advantage
• DFS requires very less memory as it only needs to store a stack of the nodes on the
path from root node to the current node.
• It takes less time to reach to the goal node than BFS algorithm (if it traverses in the
right path).
▪ Disadvantage
• There is the possibility that many states keep re-occurring, and there is no
guarantee of finding the solution.
• DFS algorithm goes for deep down searching and sometime it may go to the infinite
loop
48
® Uninformed Search (Contd.)
▪ It will start searching from root node S, and traverse A, then B, then D
and E, after traversing E, it will backtrack the tree as E has no other
successor and still goal node is not found. After backtracking it will
traverse node C and then G, and here it will terminate as it found goal
▪ In
node.
the below search tree, we have
shown the flow of depth-first
search, and it will follow the order
as:
49
® Uninformed Search (Contd.)
⇒ Depth-limited Search
▪ A depth-limited search algorithm is similar to depth-first search with a
predetermined limit. Depth-limited search can solve the drawback of the
infinite path in the Depth-first search
▪ In this algorithm, the node at the depth limit will treat as it has no
successor nodes further
▪ Depth-limited search can be terminated with two Conditions of failure
• Standard failure value: It indicates that problem does not have any solution
• Cutoff failure value: It defines no solution for the problem within a given
depth limit
▪ Advantages
• Depth-limited search is Memory efficient
▪ Disadvantages
• It may not be optimal if the problem has
more than one solution
50
® Uninformed Search (Contd.)
⇒ Iterative Deepening Depth-First Search
▪ The iterative deepening algorithm is a combination of DFS and BFS
algorithms
▪ This search algorithm finds out the best depth limit and does it by
gradually increasing the limit until a goal is found
▪ This algorithm performs depth-first search up to a certain “Depth Limit",
and it keeps increasing the depth limit after each iteration until the goal
node is found
▪ This Search algorithm combines the benefits of Breadth-first search's
fast search and depth-first search's memory efficiency
▪ The iterative search algorithm is useful uninformed search when search
space is large, and depth of goal node is unknown
▪ Advantages
• It combines the benefits of BFS and DFS search algorithm in terms of fast search
and memory efficiency
▪ Disadvantages 51
® Uninformed Search (Contd.)
▪ Example
Following tree structure is showing the
iterative deepening depth-first search.
IDDFS algorithm performs various
iterations until it does not find the goal
node. The iteration performed by the
algorithm
1'st is Agiven as
Iteration →
2'nd Iteration → A, B, C
3'rd Iteration → A, B, D, E, C, F, G
4'th Iteration → A, B, D, H, I, E, C, F, K, G
52
®
Thank You