SlideShare a Scribd company logo
1 of 33
AI3391
ARTIFICAL INTELLIGENE
B.TECH
II YEAR – III SEM (R18)
(2023-2024)
Prepared
By
Asst.Prof.M.Gokilavani
Department of Artificial Intelligence and Data Science
DEPARTMENT OF ARTIFICIAL INTLLIGENCE AND DATA SCIENCE
UNIT I
Intelligent Agents: Introduction to AI, Agents and Environment, concept of rationality, nature of
environments, Problem-Solving Agents, Structure of agents, search algorithms Searching for Solutions,
Uninformed Search Strategies: Breadth-first search, Uniform cost search, Depth-first search, Iterative
deepening Depth-first search, Bidirectional search.
1. INTRODUCTION TO AI:
 AI is one of the fascinating and universal fields of Computer science which has a great
scope in future. AI holds a tendency to cause a machine to work as a human.
 Artificial Intelligence is composed of two words Artificial and Intelligence, where
Artificial defines "man-made," and intelligence defines "thinking power", hence AI
means "a man-made thinking power."
 Artificial Intelligence exists when a machine can have human based skills such as
learning, reasoning, and solving problems.
 With Artificial Intelligence you do not need to preprogram a machine to do some work,
despite that you can create a machine with programmed algorithms which can work with
own intelligence, and that is the awesomeness of AI.
 It is believed that AI is not a new technology, and some people says that as per Greek
myth, there were Mechanical men in early days which can work and behave like humans.
Turing Test in AI:
 In 1950, Alan Turing introduced a test to check whether a machine can think like a
human or not, this test is known as the Turing Test.
 In this test, Turing proposed that the computer can be said to be an intelligent if it can
mimic human response under specific conditions.
 Turing Test was introduced by Turing in his 1950 paper, "Computing Machinery and
Intelligence," which considered the question, "Can Machine think?".
 The Turing test is based on a party game "Imitation game," with some modifications.
 This game involves three players in which one player is Computer, another player is
human responder, and the third player is a human Interrogator, who is isolated from
other two players and his job is to find that which player is machine among two of
them.
 Consider, Player A is a computer, Player B is human, and Player C is an interrogator.
Interrogator is aware that one of them is machine, but he needs to identify this on the
basis of questions and their responses.
 The conversation between all players is via keyboard and screen so the result would
not depend on the machine's ability to convert words as speech.
 The test result does not depend on each correct answer, but only how closely its
responses like a human answer. The computer is permitted to do everything possible
to force a wrong identification by the interrogator.
 The questions and answers can be like:
o Interrogator: Are you a computer?
o Player A (Computer): No
o Interrogator: Multiply two large numbers such as
(256896489*456725896)
o Player A: Long pause and give the wrong answer.
 In this game, if an interrogator would not be able to identify which is a machine and
which is human, then the computer passes the test successfully, and the machine is said
to be intelligent and can think like a human.
 "In 1991, the New York businessman Hugh Loebner announces the prize competition,
offering a $100,000 prize for the first computer to pass the Turing test. However, no
AI program to till date, come close to passing an undiluted Turing test".
Goals of Artificial Intelligence:
Following are the main goals of Artificial Intelligence:
1. Replicate human intelligence
2. Solve Knowledge-intensive tasks
3. An intelligent connection of perception and action
4. Building a machine which can perform tasks that requires human intelligence such
as:
o Proving a theorem
o Playing chess
o Plan some surgical operation
o Driving a car in traffic
5. Creating some system which can exhibit intelligent behavior, learn new things by
itself, demonstrate, explain, and can advise to its user.
Application of AI:
 Artificial Intelligence has various applications in today's society. It is becoming essential
for today's time because it can solve complex problems with an efficient way in multiple
industries, such as Healthcare, entertainment, finance, education, etc. AI is making our
daily life more comfortable and fast.
 Following are some sectors which have the application of Artificial Intelligence:
1. AI in Astronomy
 Artificial Intelligence can be very useful to solve complex universe problems. AI
technology can be helpful for understanding the universe such as how it works, origin,
etc.
2. AI in Healthcare
 In the last, five to ten years, AI becoming more advantageous for the healthcare
industry and going to have a significant impact on this industry.
 Healthcare Industries are applying AI to make a better and faster diagnosis than humans.
 AI can help doctors with diagnoses and can inform when patients are worsening so that
medical help can reach to the patient before hospitalization.
3. AI in Gaming
 AI can be used for gaming purpose. The AI machines can play strategic games like
chess, where the machine needs to think of a large number of possible places.
4. AI in Finance
 AI and finance industries are the best matches for each other.
 The finance industry is implementing automation, Chabot, adaptive intelligence,
algorithm trading, and machine learning into financial processes.
5. AI in Data Security
 The security of data is crucial for every company and cyber-attacks are growing very
rapidly in the digital world. AI can be used to make your data more safe and secure.
 Some examples such as AEG bot, AI2 Platform, are used to determine software bug
and cyber-attacks in a better way.
6. AI in Social Media
 Social Media sites such as Face book, Twitter, and Snap chat contain billions of user
profiles, which need to be stored and managed in a very efficient way.
 AI can organize and manage massive amounts of data.
 AI can analyze lots of data to identify the latest trends, hash tag, and requirement of different
users.
7. AI in Travel & Transport
 AI is becoming highly demanding for travel industries.
 AI is capable of doing various travel related works such as from making travel
arrangement to suggesting the hotels, flights, and best routes to the customers.
 Travel industries are using AI-powered chat bots which can make human-like
interaction with customers for better and fast response.
8. AI in Automotive Industry
 Some Automotive industries are using AI to provide virtual assistant to their user for
better performance. Such as Tesla has introduced TeslaBot, an intelligent virtual
assistant.
 Various Industries are currently working for developing self-driven cars which can
make your journey more safe and secure.
9. AI in Robotics:
 Artificial Intelligence has a remarkable role in Robotics.
 Usually, general robots are programmed such that they can perform some repetitive
task, but with the help of AI, we can create intelligent robots which can perform tasks
with their own experiences without pre-programmed.
 Humanoid Robots are best examples for AI in robotics, recently the intelligent
Humanoid robot named as Erica and Sophia has been developed which can talk and
behave like humans.
10. AI in Entertainment
 We are currently using some AI based applications in our daily life with some
entertainment services such as Netflix or Amazon.
 With the help of ML/AI algorithms, these services show the recommendations for
programs or shows.
11. AI in Agriculture
 Agriculture is an area which requires various resources, labor, money, and time for
best result. Now a day's agriculture is becoming digital, and AI is emerging in this
field. Agriculture is applying AI as agriculture robotics, solid and crop monitoring,
predictive analysis. AI in agriculture can be very helpful for farmers.
12. AI in E-commerce
 AI is providing a competitive edge to the e-commerce industry, and it is becoming
more demanding in the e-commerce business.
 AI is helping shoppers to discover associated products with recommended size, color, or even
brand.
13. AI in education:
 AI can automate grading so that the tutor can have more time to teach.
 AI Chabot can communicate with students as a teaching assistant.
 AI in the future can be work as a personal virtual tutor for students, which will be
accessible easily at any time and any place.
2. INTELLIGENT AGENTS:
Types of AI Agents:
 Agents can be grouped into five classes based on their degree of perceived
intelligence and capability. All these agents can improve their performance and
generate better action over the time. These are given below:
o Simple Reflex Agent
o Model-based reflex agent
o Goal-based agents
o Utility-based agent
o Learning agent
i. Simple Reflex agent:
 The Simple reflex agents are the simplest agents. These agents take decisions on the
basis of the current percepts and ignore the rest of the percept history.
 These agents only succeed in the fully observable environment.
 The Simple reflex agent does not consider any part of percepts history during their
decision and action process.
 The Simple reflex agent works on Condition-action rule, which means it maps the
current state to action. Such as a Room Cleaner agent, it works only if there is dirt
in the room.
 Problems for the simple reflex agent design approach:
o They have very limited intelligence
o They do not have knowledge of non-perceptual parts of the current state
o Mostly too big to generate and to store.
o Not adaptive to changes in the environment.
ii. Model-based reflex agent:
 The Model-based agent can work in a partially observable environment, and track
the situation.
 A model-based agent has two important factors:
o Model: It is knowledge about "how things happen in the world," so it is called
a Model-based agent.
o Internal State: It is a representation of the current state based on percept
history.
 These agents have the model, "which is knowledge of the world" and based on the
model they perform actions.
 Updating the agent state requires information about:
o How the world evolves
o How the agent's action affects the world.
iii. Goal-based agents
 The knowledge of the current state environment is not always sufficient to decide
for an agent to what to do.
 The agent needs to know its goal which describes desirable situations.
 Goal-based agents expand the capabilities of the model-based agent by having the
"goal" information.
 They choose an action, so that they can achieve the goal.
 These agents may have to consider a long sequence of possible actions before
deciding whether the goal is achieved or not.
 Such considerations of different scenario are called searching and planning, which
makes an agent proactive.
iv. 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.
 The utility function maps each state to a real number to check how efficiently each action
achieves the goals.
v. 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:
1. Learning element: It is responsible for making improvements by learning from
environment
2. Critic: Learning element takes feedback from critic which describes that how
well the agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. 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.
AGENTS:
 An AI system can be defined as the study of the rational agent and its environment.
The agents sense the environment through sensors and act on their environment
through actuators. An AI agent can have mental properties such as knowledge, belief,
intention, etc.
What is an Agent?
An agent can be anything that perceive its environment through sensors and act upon that
environment through actuators. An Agent runs in the cycle of perceiving, thinking,
and acting.
An agent can be:
o Human-Agent: A human agent has eyes, ears, and other organs which work for
sensors and hand, legs, vocal tract work for actuators.
o Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for
sensors and various motors for actuators.
o Software Agent: Software agent can have keystrokes, file contents as sensory
input and act on those inputs and display output on the screen.
Hence the world around us is full of agents such as thermostat, cell phone, camera, and
even we are also agents. Before moving forward, we should first know about sensors,
effectors, and actuators.
 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.
 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.
 Effectors: Effectors are the devices which affect the environment. Effectors can
be legs, wheels, arms, fingers, wings, fins, and display screen.
What is Intelligent Agents?
 An intelligent agent is an autonomous entity which acts upon an environment using
sensors and actuators for achieving goals. An intelligent agent may learn from the
environment to achieve their goals. A thermostat is an example of an intelligent agent.
Following are the main four rules for an AI agent:
o Rule 1: An AI agent must have the ability to perceive the environment.
o Rule 2: The observation must be used to make decisions.
o Rule 3: Decision should result in an action.
o Rule 4: The action taken by an AI agent must be a rational action.
What is Rational Agent?
 A rational agent is an agent which has clear preference, models uncertainty, and acts
in a way to maximize its performance measure with all possible actions.
 A rational agent is said to perform the right things. AI is about creating rational agents
to use for game theory and decision theory for various real-world scenarios.
 For an AI agent, the rational action is most important because in AI reinforcement
learning algorithm, for each best possible action, agent gets the positive reward and for
each wrong action, an agent gets a negative reward.
Define Rationality.
 The rationality of an agent is measured by its performance measure. Rationality can
be judged on the basis of following points:
o Performance measure which defines the success criterion.
o Agent prior knowledge of its environment.
o Best possible actions that an agent can perform.
o The sequence of percepts.
Structure of an AI Agent
 The task of AI is to design an agent program which implements the agent function.
The structure of an intelligent agent is a combination of architecture and agent
program. It can be viewed as:
Agent = Architecture + Agent program
Following are the main three terms involved in the structure of an AI agent:
 Architecture: Architecture is machinery that an AI agent executes on.
 Agent Function: Agent function is used to map a percept to an action.
F: P* → A
 Agent program: Agent program is an implementation of agent function. An agent
program executes on the physical architecture to produce function f.
Define PEAS Representation.
 PEAS is a type of model on which an AI agent works upon. When we define an AI agent
or rational agent, then we can group its properties under PEAS representation model. It
is made up of four words:
o P: Performance measure
o E: Environment
o A: Actuators
o S: Sensors
Here performance measure is the objective for the success of an agent's behavior.
Example: PEAS for self-driving cars:
Let's suppose a self-driving car then PEAS representation will be:
 Performance: Safety, time, legal drive, comfort
 Environment: Roads, other vehicles, road signs, pedestrian
 Actuators: Steering, accelerator, brake, signal, horn
 Sensors: Camera, GPS, speedometer, odometer, accelerometer, sonar.
Properties of Task Environment:
 An environment is everything in the world which surrounds the agent, but it is not a
part of an agent itself. An environment can be described as a situation in which an
agent is present.
 The environment is where agent lives, operate and provide the agent with something
to sense and act upon it. An environment is mostly said to be non-feministic.
Features of Environment
 As per Russell and Norvig, an environment can have various features from the point
of view of an agent:
1. Fully observable vs Partially Observable
2. Static vs Dynamic
3. Discrete vs Continuous
4. Deterministic vs Stochastic
5. Single-agent vs Multi-agent
6. Episodic vs sequential
7. Known vs Unknown
1. Fully observable vs Partially Observable:
• When an agent sensor is capable to sense or access the complete state of an agent
at each point in time, it is said to be a fully observable environment else it is
partially observable.
• Maintaining a fully observable environment is easy as there is no need to keep
track of the history of the surrounding.
• An environment is called unobservable when the agent has no sensors in all
environments.
Examples:
• Chess – the board is fully observable, and so are the opponent’s moves.
• Driving – the environment is partially observable because what’s around the
corner is not known.
2. Static vs Dynamic:
 An environment that keeps constantly changing itself when the agent is up with
some action is said to be dynamic.
 A roller coaster ride is dynamic as it is set in motion and the environment keeps
changing every instant.
 An idle environment with no change in its state is called a static environment.
 An empty house is static as there’s no change in the surroundings when an agent
enters.
3. Discrete vs Continuous:
 If an environment consists of a finite number of actions that can be deliberated in
the environment to obtain the output, it is said to be a discrete environment.
 The game of chess is discrete as it has only a finite number of moves. The number
of moves might vary with every game, but still, it’s finite.
 The environment in which the actions are performed cannot be numbered i.e. is not
discrete, is said to be continuous.
 Self-driving cars are an example of continuous environments as their actions are
driving, parking, etc. which cannot be numbered.
4. Deterministic vs Stochastic:
• When a uniqueness in the agent’s current state completely determines the next state
of the agent, the environment is said to be deterministic.
• The stochastic environment is random in nature which is not unique and cannot be
completely determined by the agent.
Examples:
• Chess – there would be only a few possible moves for a coin at the current
state and these moves can be determined.
• Self-Driving Cars- the actions of a self-driving car are not unique, it varies
time to time.
5. Single-agent vs Multi-agent:
 An environment consisting of only one agent is said to be a single-agent
environment.
 A person left alone in a maze is an example of the single-agent system.
 An environment involving more than one agent is a multi-agent environment.
 The game of football is multi-agent as it involves 11 players in each team.
6. Episodic vs sequential:
 In an Episodic task environment, each of the agent’s actions is divided into atomic
incidents or episodes. There is no dependency between current and previous
incidents. In each incident, an agent receives input from the environment and then
performs the corresponding action.
 Example: Consider an example of Pick and Place robot, which is used to detect
defective parts from the conveyor belts. Here, every time robot (agent) will make
the decision on the current part i.e. there is no dependency between current and
previous decisions.
 In a Sequential environment, the previous decisions can affect all future decisions.
The next action of the agent depends on what action he has taken previously and
what action he is supposed to take in the future.
Example:
Checkers- Where the previous move can affect all the following moves.
7. Known vs Unknown:
 In a known environment, the output for all probable actions is given. Obviously,
in case of unknown environment, for an agent to make a decision, it has to gain
knowledge about how the environment works.
3. 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 and use atomic representation. In this topic, we
will learn various problem-solving search algorithms.
Well define problem and Solution:
A problem can be defined formally by five components:
• The initial state that the agent starts in.
• A description of the possible actions available to the agent.
• A description of what each action does; the formal name for this is the transition
model.
• The goal test, which determines whether a given state is a goal state. Sometimes
there is an explicit set of possible goal states, and the test simply checks whether
the given state is one of them.
• A path cost function that assigns a numeric cost to each path. The problem-
solving agent chooses a cost function that reflects its own performance measure.
Example: 1 Romania
• On holiday in Romania; currently in Arad.
• Flight leaves tomorrow from Bucharest
• Formulate goal:
• be in Bucharest
• Formulate problem:
• states: various cities
• actions: drive between cities
• Find solution:
• sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest
Example: 2 Toy problems
• Those intended to illustrate or exercise various problem-solving methods
• E.g., puzzle chess, etc.
Example: 3 Real-world problems
• Tend to be more difficult and whose solutions people actually care about
• E.g., Design, planning, etc.
Example: 4 Toy Problem
Possible states of Vacuum Cleaner (Toy Problem):
Example: 5 8* Puzzle Problem
Possible Moves for 8 Queen Problems:
4. SEARCHING FOR SOLUTIONS:
The goal of the 8-
queens problem is to
place eight queens on
a chess-board such
that no queen attacks
any other.
• States: Any
arrangement of 0
•
•
•
•
• Finding out a solution is done by
• searching through the state space
• All problems are transformed
• as a search tree
• generated by the initial state and
successor function
Search Tree:
• Initial state
• The root of the search tree is a search
node
• Expanding
• applying successor function to the
current state
• thereby generating a new set of states
• leaf nodes
• the states having no successors
Fringe: Set of search nodes that have not been expanded yet.
Search tree Components:
• A node is having five components:
• STATE: which state it is in the state space
• PARENT-NODE: from which node it is generated
• ACTION: which action applied to its parent-node to generate it
• PATH-COST: the cost, g(n), from initial state to the node n itself
• DEPTH: number of steps along the path from the initial state
Search Algorithm Terminologies:
 Search: Searching is a step by step procedure to solve a search-problem in a given
search space. A search problem can have three main factors:
a. Search Space: Search space represents a set of possible solutions, which
a system may have.
b. Start State: It is a state from where agent begins the search.
c. Goal test: It is a function which observe the current state and returns
whether the goal state is achieved or not.
 Search tree: A tree representation of search problem is called Search tree. The
root of the search tree is the root node which is corresponding to the initial state.
 Actions: It gives the description of all the available actions to the agent.
 Transition model: A description of what each action do, can be represented as a
transition model.
 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 solutions.
i. Properties of Search Algorithms (or) measuring problem Solving performance:
Following are the four essential properties of search algorithms to compare the
efficiency of these 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.
5. TYPES OF SEARCH ALGORITHMS:
Based on the search problems we can classify the search algorithms into uninformed
(Blind search) search and informed search (Heuristic search) algorithms.
i. Uninformed/Blind 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.
 Uninformed search applies a way in which search tree is searched without any
information about the search space like initial state operators and test for the goal,
so it is also called blind search.
 It examines each node of the tree until it achieves the goal node.
It can be divided into five main types:
o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search
ii. 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.
 A heuristic is a way which might not always be guaranteed for best solutions but
guaranteed to find a good solution in reasonable time.
 Informed search can solve much complex problem which could not be solved in
another way.
 An example of informed search algorithms is a traveling salesman problem.
1. Greedy Search
2. A* Search
6. BREADTH-FIRST SEARCH (BFS):
 Breadth-first search 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 nodes at the current level before moving to nodes of next level.
 The breadth-first search algorithm is an example of a general-graph search
algorithm.
 Breadth-first search implemented using FIFO queue data structure.
Algorithm:
• Step 1: SET STATUS = 1 (ready state) for each node in G
• Step 2: Enqueue the starting node A and set its STATUS = 2 (waiting state)
• Step 3: Repeat Steps 4 and 5 until QUEUE is empty
• Step 4: Dequeue a node N. Process it and set its STATUS = 3 (processed state).
• Step 5: Enqueue all the neighbours of N that are in the ready state (whose
STATUS = 1) and set
their STATUS = 2
(Waiting state)
[END OF LOOP]
• Step 6: EXIT
Example: 1
In the below tree structure, we have shown the traversing of the tree using BFS
algorithm from the root node S to goal node K. BFS search algorithm traverse in
layers, so it will follow the path which is shown by the dotted arrow, and the
traversed path will be:
Solution: S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K
Example: 2
Queue Structure:
Solution: 40,10,20,30,60,50,70
Example 3:
Practice problem:
Advantages:
 BFS will provide a solution if any solution exists.
 If there is more than one solution for a given problem, then BFS will provide
the minimal solution which requires the least number of steps.
Disadvantages:
 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.
7. DEPTH-FIRST SEARCH (DFS):
 Depth-first search is a recursive algorithm for traversing a tree or graph data
structure.
 It is called the depth-first search because it 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.
 The process of the DFS algorithm is similar to the BFS algorithm.
Implementation steps for DFS:
• First, create a stack with the total number of vertices in the graph.
• Now, choose any vertex as the starting point of traversal, and push that vertex into
the stack.
• After that, push a non-visited vertex (adjacent to the vertex on the top of the stack)
to the top of the stack.
• Now, repeat steps 3 and 4 until no vertices are left to visit from the vertex on the
stack's top.
• If no vertex is left, go back and pop a vertex from the stack.
• Repeat steps 2, 3, and 4 until the stack is empty.
Algorithm:
• Step 1: SET STATUS = 1 (ready state) for each node in G
• Step 2: Push the starting node A on the stack and set its STATUS = 2 (waiting
state)
• Step 3: Repeat Steps 4 and 5 until STACK is empty
• Step 4: Pop the top node N. Process it and set its STATUS = 3 (processed state)
• Step 5: Push on the stack all the neighbors of N that are in the ready state (whose
STATUS = 1) and set their STATUS = 2 (waiting state)
[END OF LOOP]
• Step 6: EXIT
Example 1:
In the below search tree, we have shown the flow of depth-first search, and it will follow
the order as:
Root node--->Left node ----> right node.
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 node.
Solution: S,A,B,D,E,C,G,H,I,K,J.
Example 2:
Example 3:
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.
Difference between BFS and DFS:
8. DEPTH-LIMITED SEARCH ALGORITHM
 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:
o Standard failure value: It indicates that problem does not have any solution.
o Cutoff failure value: It defines no solution for the problem within a given depth
limit.
Advantages:
Depth-limited search is Memory efficient.
Disadvantages:
o Depth-limited search also has a disadvantage of incompleteness.
o It may not be optimal if the problem has more than one solution.
9. UNIFORM-COST SEARCH ALGORITHM:
 Uniform-cost search is a searching algorithm used for traversing a weighted
tree or graph. This algorithm comes into play when a different cost is available
for each edge.
 The primary goal of the uniform-cost search is to find a path to the goal node
which has the lowest cumulative cost.
 Uniform-cost search expands nodes according to their path costs from the root
node. It can be used to solve any graph/tree where the optimal cost is in demand.
 A uniform-cost search algorithm is implemented by the priority queue.
 It gives maximum priority to the lowest cumulative cost. Uniform cost search
is equivalent to BFS algorithm if the path cost of all edges is the same.
Advantages:
Uniform cost search is optimal because at every state the path with the least
cost is chosen.
Disadvantages:
It does not care about the number of steps involve in searching and only
concerned about path cost. Due to which this algorithm may be stuck in an
infinite loop.
10. 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.
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 is given as:
Solution:
1'st Iteration-----> A
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
In the fourth iteration, the algorithm will find the goal node.
Advantages:
o It combines the benefits of BFS and DFS search algorithm in terms of fast search
and memory efficiency.
Disadvantages:
o The main drawback of IDDFS is that it repeats all the work of the previous phase.
11. BIDIRECTIONAL SEARCH ALGORITHM:
 Before moving into bidirectional search let’s first understand a few terms.
 Forward Search: Looking in-front of the end from start.
 Backward Search: Looking from end to the start back-wards.
 Bidirectional search replaces one single search graph with two small sub graphs
in which one starts the search from an initial vertex and other starts from goal
vertex.
 The search stops when these two graphs intersect each other.
 Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.
Example: In the below search tree, bidirectional search algorithm is applied. This
algorithm divides one graph/tree into two sub-graphs. It starts traversing from node 1 in
the forward direction and starts from goal node 16 in the backward direction. The
algorithm terminates at node 9 where two searches meet.
Advantages:
o Bidirectional search is fast.
o Bidirectional search requires less memory
Disadvantages:
o Implementation of the bidirectional search tree is difficult.
o In bidirectional search, one should know the goal state in advance.

More Related Content

What's hot

Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmHema Kashyap
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AIvikas dhakane
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchDheerendra k
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...Asst.prof M.Gokilavani
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligencesandeep54552
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence Lalit Birla
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEKhushboo Pal
 
Local search algorithms
Local search algorithmsLocal search algorithms
Local search algorithmsbambangsueb
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic ReasoningJunya Tanaka
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search TechniquesJismy .K.Jose
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Minmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesMinmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesSamiaAziz4
 

What's hot (20)

Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Planning
PlanningPlanning
Planning
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
 
A* algorithm
A* algorithmA* algorithm
A* algorithm
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Adversarial search
Adversarial search Adversarial search
Adversarial search
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
 
Local search algorithms
Local search algorithmsLocal search algorithms
Local search algorithms
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic Reasoning
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Expert system
Expert systemExpert system
Expert system
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Minmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesMinmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slides
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 

Similar to AI3391 ARTIFICIAL INTELLIGENCE Unit I notes.pdf

Unit-II-Introduction of Artifiial Intelligence.pptx
Unit-II-Introduction of Artifiial Intelligence.pptxUnit-II-Introduction of Artifiial Intelligence.pptx
Unit-II-Introduction of Artifiial Intelligence.pptxHarsha Patel
 
Artificial Intelligence fundamentals | Machine Learning | Deep Learning
Artificial Intelligence fundamentals | Machine Learning | Deep LearningArtificial Intelligence fundamentals | Machine Learning | Deep Learning
Artificial Intelligence fundamentals | Machine Learning | Deep LearningKrishnaMildain
 
Chapter Three, four, five and six.ppt ITEtx
Chapter Three, four, five and six.ppt ITEtxChapter Three, four, five and six.ppt ITEtx
Chapter Three, four, five and six.ppt ITEtxgadisaAdamu
 
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...abdraefreq
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligencesnehal_152
 
Unit 1 AI.pptx
Unit 1 AI.pptxUnit 1 AI.pptx
Unit 1 AI.pptxRamSam33
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNINGINTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNINGsowmyamPSGRKCW
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceVishalLoungani
 
Artificial intelligence ppt
Artificial intelligence pptArtificial intelligence ppt
Artificial intelligence pptRamhariYadav
 
aman presentation 2.pptx
aman presentation 2.pptxaman presentation 2.pptx
aman presentation 2.pptxSanuBose
 
AI - MACHINE LEARNING.docx
AI - MACHINE LEARNING.docxAI - MACHINE LEARNING.docx
AI - MACHINE LEARNING.docxEmmanuelDouglas7
 
Presentation ppt.pptx
Presentation ppt.pptxPresentation ppt.pptx
Presentation ppt.pptxHuangKedeh
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligencePrasathP13
 

Similar to AI3391 ARTIFICIAL INTELLIGENCE Unit I notes.pdf (20)

Unit-II-Introduction of Artifiial Intelligence.pptx
Unit-II-Introduction of Artifiial Intelligence.pptxUnit-II-Introduction of Artifiial Intelligence.pptx
Unit-II-Introduction of Artifiial Intelligence.pptx
 
Artificial Intelligence fundamentals | Machine Learning | Deep Learning
Artificial Intelligence fundamentals | Machine Learning | Deep LearningArtificial Intelligence fundamentals | Machine Learning | Deep Learning
Artificial Intelligence fundamentals | Machine Learning | Deep Learning
 
Artificial Intelligence.pptx
Artificial Intelligence.pptxArtificial Intelligence.pptx
Artificial Intelligence.pptx
 
Chapter Three, four, five and six.ppt ITEtx
Chapter Three, four, five and six.ppt ITEtxChapter Three, four, five and six.ppt ITEtx
Chapter Three, four, five and six.ppt ITEtx
 
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...
7072402-AI PPT-unit-1-INTRODUCTION TO ARTIFICIAL INTELLIGENCE (AI)-by Anu to ...
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
Unit 1 AI.pptx
Unit 1 AI.pptxUnit 1 AI.pptx
Unit 1 AI.pptx
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNINGINTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
INTRODUCTION TO ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Artificial intelligence ppt
Artificial intelligence pptArtificial intelligence ppt
Artificial intelligence ppt
 
aman presentation 2.pptx
aman presentation 2.pptxaman presentation 2.pptx
aman presentation 2.pptx
 
UNIT I - AI.pptx
UNIT I - AI.pptxUNIT I - AI.pptx
UNIT I - AI.pptx
 
Artificial Intelligence.pptx
Artificial Intelligence.pptxArtificial Intelligence.pptx
Artificial Intelligence.pptx
 
AI - MACHINE LEARNING.docx
AI - MACHINE LEARNING.docxAI - MACHINE LEARNING.docx
AI - MACHINE LEARNING.docx
 
Presentation ppt.pptx
Presentation ppt.pptxPresentation ppt.pptx
Presentation ppt.pptx
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
AI basic.pptx
AI basic.pptxAI basic.pptx
AI basic.pptx
 
AI.pptx
AI.pptxAI.pptx
AI.pptx
 
AI101 guide
AI101 guideAI101 guide
AI101 guide
 
AI101 Guide
AI101 GuideAI101 Guide
AI101 Guide
 

More from Asst.prof M.Gokilavani

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfAsst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAsst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

AI3391 ARTIFICIAL INTELLIGENCE Unit I notes.pdf

  • 1. AI3391 ARTIFICAL INTELLIGENE B.TECH II YEAR – III SEM (R18) (2023-2024) Prepared By Asst.Prof.M.Gokilavani Department of Artificial Intelligence and Data Science
  • 2. DEPARTMENT OF ARTIFICIAL INTLLIGENCE AND DATA SCIENCE
  • 3.
  • 4. UNIT I Intelligent Agents: Introduction to AI, Agents and Environment, concept of rationality, nature of environments, Problem-Solving Agents, Structure of agents, search algorithms Searching for Solutions, Uninformed Search Strategies: Breadth-first search, Uniform cost search, Depth-first search, Iterative deepening Depth-first search, Bidirectional search. 1. INTRODUCTION TO AI:  AI is one of the fascinating and universal fields of Computer science which has a great scope in future. AI holds a tendency to cause a machine to work as a human.  Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made thinking power."  Artificial Intelligence exists when a machine can have human based skills such as learning, reasoning, and solving problems.  With Artificial Intelligence you do not need to preprogram a machine to do some work, despite that you can create a machine with programmed algorithms which can work with own intelligence, and that is the awesomeness of AI.  It is believed that AI is not a new technology, and some people says that as per Greek myth, there were Mechanical men in early days which can work and behave like humans. Turing Test in AI:
  • 5.  In 1950, Alan Turing introduced a test to check whether a machine can think like a human or not, this test is known as the Turing Test.  In this test, Turing proposed that the computer can be said to be an intelligent if it can mimic human response under specific conditions.  Turing Test was introduced by Turing in his 1950 paper, "Computing Machinery and Intelligence," which considered the question, "Can Machine think?".  The Turing test is based on a party game "Imitation game," with some modifications.  This game involves three players in which one player is Computer, another player is human responder, and the third player is a human Interrogator, who is isolated from other two players and his job is to find that which player is machine among two of them.  Consider, Player A is a computer, Player B is human, and Player C is an interrogator. Interrogator is aware that one of them is machine, but he needs to identify this on the basis of questions and their responses.  The conversation between all players is via keyboard and screen so the result would not depend on the machine's ability to convert words as speech.  The test result does not depend on each correct answer, but only how closely its responses like a human answer. The computer is permitted to do everything possible to force a wrong identification by the interrogator.  The questions and answers can be like: o Interrogator: Are you a computer? o Player A (Computer): No o Interrogator: Multiply two large numbers such as (256896489*456725896) o Player A: Long pause and give the wrong answer.  In this game, if an interrogator would not be able to identify which is a machine and which is human, then the computer passes the test successfully, and the machine is said to be intelligent and can think like a human.
  • 6.  "In 1991, the New York businessman Hugh Loebner announces the prize competition, offering a $100,000 prize for the first computer to pass the Turing test. However, no AI program to till date, come close to passing an undiluted Turing test". Goals of Artificial Intelligence: Following are the main goals of Artificial Intelligence: 1. Replicate human intelligence 2. Solve Knowledge-intensive tasks 3. An intelligent connection of perception and action 4. Building a machine which can perform tasks that requires human intelligence such as: o Proving a theorem o Playing chess o Plan some surgical operation o Driving a car in traffic 5. Creating some system which can exhibit intelligent behavior, learn new things by itself, demonstrate, explain, and can advise to its user. Application of AI:  Artificial Intelligence has various applications in today's society. It is becoming essential for today's time because it can solve complex problems with an efficient way in multiple industries, such as Healthcare, entertainment, finance, education, etc. AI is making our daily life more comfortable and fast.  Following are some sectors which have the application of Artificial Intelligence:
  • 7. 1. AI in Astronomy  Artificial Intelligence can be very useful to solve complex universe problems. AI technology can be helpful for understanding the universe such as how it works, origin, etc. 2. AI in Healthcare  In the last, five to ten years, AI becoming more advantageous for the healthcare industry and going to have a significant impact on this industry.  Healthcare Industries are applying AI to make a better and faster diagnosis than humans.  AI can help doctors with diagnoses and can inform when patients are worsening so that medical help can reach to the patient before hospitalization. 3. AI in Gaming  AI can be used for gaming purpose. The AI machines can play strategic games like chess, where the machine needs to think of a large number of possible places. 4. AI in Finance  AI and finance industries are the best matches for each other.  The finance industry is implementing automation, Chabot, adaptive intelligence, algorithm trading, and machine learning into financial processes. 5. AI in Data Security  The security of data is crucial for every company and cyber-attacks are growing very rapidly in the digital world. AI can be used to make your data more safe and secure.  Some examples such as AEG bot, AI2 Platform, are used to determine software bug and cyber-attacks in a better way. 6. AI in Social Media  Social Media sites such as Face book, Twitter, and Snap chat contain billions of user profiles, which need to be stored and managed in a very efficient way.  AI can organize and manage massive amounts of data.  AI can analyze lots of data to identify the latest trends, hash tag, and requirement of different users. 7. AI in Travel & Transport  AI is becoming highly demanding for travel industries.  AI is capable of doing various travel related works such as from making travel arrangement to suggesting the hotels, flights, and best routes to the customers.  Travel industries are using AI-powered chat bots which can make human-like interaction with customers for better and fast response.
  • 8. 8. AI in Automotive Industry  Some Automotive industries are using AI to provide virtual assistant to their user for better performance. Such as Tesla has introduced TeslaBot, an intelligent virtual assistant.  Various Industries are currently working for developing self-driven cars which can make your journey more safe and secure. 9. AI in Robotics:  Artificial Intelligence has a remarkable role in Robotics.  Usually, general robots are programmed such that they can perform some repetitive task, but with the help of AI, we can create intelligent robots which can perform tasks with their own experiences without pre-programmed.  Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid robot named as Erica and Sophia has been developed which can talk and behave like humans. 10. AI in Entertainment  We are currently using some AI based applications in our daily life with some entertainment services such as Netflix or Amazon.  With the help of ML/AI algorithms, these services show the recommendations for programs or shows. 11. AI in Agriculture  Agriculture is an area which requires various resources, labor, money, and time for best result. Now a day's agriculture is becoming digital, and AI is emerging in this field. Agriculture is applying AI as agriculture robotics, solid and crop monitoring, predictive analysis. AI in agriculture can be very helpful for farmers. 12. AI in E-commerce  AI is providing a competitive edge to the e-commerce industry, and it is becoming more demanding in the e-commerce business.  AI is helping shoppers to discover associated products with recommended size, color, or even brand. 13. AI in education:  AI can automate grading so that the tutor can have more time to teach.  AI Chabot can communicate with students as a teaching assistant.  AI in the future can be work as a personal virtual tutor for students, which will be accessible easily at any time and any place. 2. INTELLIGENT AGENTS: Types of AI Agents:
  • 9.  Agents can be grouped into five classes based on their degree of perceived intelligence and capability. All these agents can improve their performance and generate better action over the time. These are given below: o Simple Reflex Agent o Model-based reflex agent o Goal-based agents o Utility-based agent o Learning agent i. Simple Reflex agent:  The Simple reflex agents are the simplest agents. These agents take decisions on the basis of the current percepts and ignore the rest of the percept history.  These agents only succeed in the fully observable environment.  The Simple reflex agent does not consider any part of percepts history during their decision and action process.  The Simple reflex agent works on Condition-action rule, which means it maps the current state to action. Such as a Room Cleaner agent, it works only if there is dirt in the room.  Problems for the simple reflex agent design approach: o They have very limited intelligence o They do not have knowledge of non-perceptual parts of the current state o Mostly too big to generate and to store. o Not adaptive to changes in the environment. ii. Model-based reflex agent:  The Model-based agent can work in a partially observable environment, and track the situation.  A model-based agent has two important factors:
  • 10. o Model: It is knowledge about "how things happen in the world," so it is called a Model-based agent. o Internal State: It is a representation of the current state based on percept history.  These agents have the model, "which is knowledge of the world" and based on the model they perform actions.  Updating the agent state requires information about: o How the world evolves o How the agent's action affects the world. iii. Goal-based agents  The knowledge of the current state environment is not always sufficient to decide for an agent to what to do.  The agent needs to know its goal which describes desirable situations.  Goal-based agents expand the capabilities of the model-based agent by having the "goal" information.  They choose an action, so that they can achieve the goal.  These agents may have to consider a long sequence of possible actions before deciding whether the goal is achieved or not.  Such considerations of different scenario are called searching and planning, which makes an agent proactive.
  • 11. iv. 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.  The utility function maps each state to a real number to check how efficiently each action achieves the goals. v. Learning Agents  A learning agent in AI is the type of agent which can learn from its past experiences, or it has learning capabilities.
  • 12.  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: 1. Learning element: It is responsible for making improvements by learning from environment 2. Critic: Learning element takes feedback from critic which describes that how well the agent is doing with respect to a fixed performance standard. 3. Performance element: It is responsible for selecting external action 4. 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. AGENTS:  An AI system can be defined as the study of the rational agent and its environment. The agents sense the environment through sensors and act on their environment through actuators. An AI agent can have mental properties such as knowledge, belief, intention, etc. What is an Agent? An agent can be anything that perceive its environment through sensors and act upon that environment through actuators. An Agent runs in the cycle of perceiving, thinking, and acting.
  • 13. An agent can be: o Human-Agent: A human agent has eyes, ears, and other organs which work for sensors and hand, legs, vocal tract work for actuators. o Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for sensors and various motors for actuators. o Software Agent: Software agent can have keystrokes, file contents as sensory input and act on those inputs and display output on the screen. Hence the world around us is full of agents such as thermostat, cell phone, camera, and even we are also agents. Before moving forward, we should first know about sensors, effectors, and actuators.  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.  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.  Effectors: Effectors are the devices which affect the environment. Effectors can be legs, wheels, arms, fingers, wings, fins, and display screen. What is Intelligent Agents?  An intelligent agent is an autonomous entity which acts upon an environment using sensors and actuators for achieving goals. An intelligent agent may learn from the environment to achieve their goals. A thermostat is an example of an intelligent agent. Following are the main four rules for an AI agent: o Rule 1: An AI agent must have the ability to perceive the environment. o Rule 2: The observation must be used to make decisions.
  • 14. o Rule 3: Decision should result in an action. o Rule 4: The action taken by an AI agent must be a rational action. What is Rational Agent?  A rational agent is an agent which has clear preference, models uncertainty, and acts in a way to maximize its performance measure with all possible actions.  A rational agent is said to perform the right things. AI is about creating rational agents to use for game theory and decision theory for various real-world scenarios.  For an AI agent, the rational action is most important because in AI reinforcement learning algorithm, for each best possible action, agent gets the positive reward and for each wrong action, an agent gets a negative reward. Define Rationality.  The rationality of an agent is measured by its performance measure. Rationality can be judged on the basis of following points: o Performance measure which defines the success criterion. o Agent prior knowledge of its environment. o Best possible actions that an agent can perform. o The sequence of percepts. Structure of an AI Agent  The task of AI is to design an agent program which implements the agent function. The structure of an intelligent agent is a combination of architecture and agent program. It can be viewed as: Agent = Architecture + Agent program Following are the main three terms involved in the structure of an AI agent:  Architecture: Architecture is machinery that an AI agent executes on.  Agent Function: Agent function is used to map a percept to an action. F: P* → A  Agent program: Agent program is an implementation of agent function. An agent program executes on the physical architecture to produce function f. Define PEAS Representation.  PEAS is a type of model on which an AI agent works upon. When we define an AI agent or rational agent, then we can group its properties under PEAS representation model. It is made up of four words:
  • 15. o P: Performance measure o E: Environment o A: Actuators o S: Sensors Here performance measure is the objective for the success of an agent's behavior. Example: PEAS for self-driving cars: Let's suppose a self-driving car then PEAS representation will be:  Performance: Safety, time, legal drive, comfort  Environment: Roads, other vehicles, road signs, pedestrian  Actuators: Steering, accelerator, brake, signal, horn  Sensors: Camera, GPS, speedometer, odometer, accelerometer, sonar. Properties of Task Environment:  An environment is everything in the world which surrounds the agent, but it is not a part of an agent itself. An environment can be described as a situation in which an agent is present.  The environment is where agent lives, operate and provide the agent with something to sense and act upon it. An environment is mostly said to be non-feministic. Features of Environment  As per Russell and Norvig, an environment can have various features from the point of view of an agent: 1. Fully observable vs Partially Observable 2. Static vs Dynamic 3. Discrete vs Continuous 4. Deterministic vs Stochastic 5. Single-agent vs Multi-agent 6. Episodic vs sequential 7. Known vs Unknown 1. Fully observable vs Partially Observable: • When an agent sensor is capable to sense or access the complete state of an agent at each point in time, it is said to be a fully observable environment else it is partially observable. • Maintaining a fully observable environment is easy as there is no need to keep track of the history of the surrounding. • An environment is called unobservable when the agent has no sensors in all environments. Examples: • Chess – the board is fully observable, and so are the opponent’s moves.
  • 16. • Driving – the environment is partially observable because what’s around the corner is not known. 2. Static vs Dynamic:  An environment that keeps constantly changing itself when the agent is up with some action is said to be dynamic.  A roller coaster ride is dynamic as it is set in motion and the environment keeps changing every instant.  An idle environment with no change in its state is called a static environment.  An empty house is static as there’s no change in the surroundings when an agent enters. 3. Discrete vs Continuous:  If an environment consists of a finite number of actions that can be deliberated in the environment to obtain the output, it is said to be a discrete environment.  The game of chess is discrete as it has only a finite number of moves. The number of moves might vary with every game, but still, it’s finite.  The environment in which the actions are performed cannot be numbered i.e. is not discrete, is said to be continuous.  Self-driving cars are an example of continuous environments as their actions are driving, parking, etc. which cannot be numbered. 4. Deterministic vs Stochastic: • When a uniqueness in the agent’s current state completely determines the next state of the agent, the environment is said to be deterministic. • The stochastic environment is random in nature which is not unique and cannot be completely determined by the agent. Examples: • Chess – there would be only a few possible moves for a coin at the current state and these moves can be determined. • Self-Driving Cars- the actions of a self-driving car are not unique, it varies time to time. 5. Single-agent vs Multi-agent:  An environment consisting of only one agent is said to be a single-agent environment.  A person left alone in a maze is an example of the single-agent system.  An environment involving more than one agent is a multi-agent environment.  The game of football is multi-agent as it involves 11 players in each team. 6. Episodic vs sequential:
  • 17.  In an Episodic task environment, each of the agent’s actions is divided into atomic incidents or episodes. There is no dependency between current and previous incidents. In each incident, an agent receives input from the environment and then performs the corresponding action.  Example: Consider an example of Pick and Place robot, which is used to detect defective parts from the conveyor belts. Here, every time robot (agent) will make the decision on the current part i.e. there is no dependency between current and previous decisions.  In a Sequential environment, the previous decisions can affect all future decisions. The next action of the agent depends on what action he has taken previously and what action he is supposed to take in the future. Example: Checkers- Where the previous move can affect all the following moves. 7. Known vs Unknown:  In a known environment, the output for all probable actions is given. Obviously, in case of unknown environment, for an agent to make a decision, it has to gain knowledge about how the environment works. 3. 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 and use atomic representation. In this topic, we will learn various problem-solving search algorithms. Well define problem and Solution: A problem can be defined formally by five components: • The initial state that the agent starts in. • A description of the possible actions available to the agent. • A description of what each action does; the formal name for this is the transition model. • The goal test, which determines whether a given state is a goal state. Sometimes there is an explicit set of possible goal states, and the test simply checks whether the given state is one of them. • A path cost function that assigns a numeric cost to each path. The problem- solving agent chooses a cost function that reflects its own performance measure. Example: 1 Romania • On holiday in Romania; currently in Arad. • Flight leaves tomorrow from Bucharest
  • 18. • Formulate goal: • be in Bucharest • Formulate problem: • states: various cities • actions: drive between cities • Find solution: • sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest Example: 2 Toy problems • Those intended to illustrate or exercise various problem-solving methods • E.g., puzzle chess, etc. Example: 3 Real-world problems • Tend to be more difficult and whose solutions people actually care about • E.g., Design, planning, etc. Example: 4 Toy Problem
  • 19. Possible states of Vacuum Cleaner (Toy Problem): Example: 5 8* Puzzle Problem
  • 20. Possible Moves for 8 Queen Problems: 4. SEARCHING FOR SOLUTIONS: The goal of the 8- queens problem is to place eight queens on a chess-board such that no queen attacks any other. • States: Any arrangement of 0 • • • •
  • 21. • Finding out a solution is done by • searching through the state space • All problems are transformed • as a search tree • generated by the initial state and successor function Search Tree: • Initial state • The root of the search tree is a search node • Expanding • applying successor function to the current state • thereby generating a new set of states • leaf nodes • the states having no successors Fringe: Set of search nodes that have not been expanded yet. Search tree Components: • A node is having five components: • STATE: which state it is in the state space • PARENT-NODE: from which node it is generated • ACTION: which action applied to its parent-node to generate it • PATH-COST: the cost, g(n), from initial state to the node n itself • DEPTH: number of steps along the path from the initial state Search Algorithm Terminologies:  Search: Searching is a step by step procedure to solve a search-problem in a given search space. A search problem can have three main factors: a. Search Space: Search space represents a set of possible solutions, which a system may have. b. Start State: It is a state from where agent begins the search. c. Goal test: It is a function which observe the current state and returns whether the goal state is achieved or not.  Search tree: A tree representation of search problem is called Search tree. The root of the search tree is the root node which is corresponding to the initial state.  Actions: It gives the description of all the available actions to the agent.  Transition model: A description of what each action do, can be represented as a transition model.  Path Cost: It is a function which assigns a numeric cost to each path.
  • 22.  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 solutions. i. Properties of Search Algorithms (or) measuring problem Solving performance: Following are the four essential properties of search algorithms to compare the efficiency of these 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. 5. TYPES OF SEARCH ALGORITHMS: Based on the search problems we can classify the search algorithms into uninformed (Blind search) search and informed search (Heuristic search) algorithms. i. Uninformed/Blind Search:
  • 23.  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.  Uninformed search applies a way in which search tree is searched without any information about the search space like initial state operators and test for the goal, so it is also called blind search.  It examines each node of the tree until it achieves the goal node. It can be divided into five main types: o Breadth-first search o Uniform cost search o Depth-first search o Iterative deepening depth-first search o Bidirectional Search ii. 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.  A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in reasonable time.  Informed search can solve much complex problem which could not be solved in another way.  An example of informed search algorithms is a traveling salesman problem. 1. Greedy Search 2. A* Search 6. BREADTH-FIRST SEARCH (BFS):  Breadth-first search 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 nodes at the current level before moving to nodes of next level.  The breadth-first search algorithm is an example of a general-graph search algorithm.  Breadth-first search implemented using FIFO queue data structure. Algorithm: • Step 1: SET STATUS = 1 (ready state) for each node in G • Step 2: Enqueue the starting node A and set its STATUS = 2 (waiting state) • Step 3: Repeat Steps 4 and 5 until QUEUE is empty
  • 24. • Step 4: Dequeue a node N. Process it and set its STATUS = 3 (processed state). • Step 5: Enqueue all the neighbours of N that are in the ready state (whose STATUS = 1) and set their STATUS = 2 (Waiting state) [END OF LOOP] • Step 6: EXIT Example: 1 In the below tree structure, we have shown the traversing of the tree using BFS algorithm from the root node S to goal node K. BFS search algorithm traverse in layers, so it will follow the path which is shown by the dotted arrow, and the traversed path will be: Solution: S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K Example: 2
  • 26. Practice problem: Advantages:  BFS will provide a solution if any solution exists.  If there is more than one solution for a given problem, then BFS will provide the minimal solution which requires the least number of steps. Disadvantages:  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. 7. DEPTH-FIRST SEARCH (DFS):  Depth-first search is a recursive algorithm for traversing a tree or graph data structure.  It is called the depth-first search because it 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.  The process of the DFS algorithm is similar to the BFS algorithm. Implementation steps for DFS:
  • 27. • First, create a stack with the total number of vertices in the graph. • Now, choose any vertex as the starting point of traversal, and push that vertex into the stack. • After that, push a non-visited vertex (adjacent to the vertex on the top of the stack) to the top of the stack. • Now, repeat steps 3 and 4 until no vertices are left to visit from the vertex on the stack's top. • If no vertex is left, go back and pop a vertex from the stack. • Repeat steps 2, 3, and 4 until the stack is empty. Algorithm: • Step 1: SET STATUS = 1 (ready state) for each node in G • Step 2: Push the starting node A on the stack and set its STATUS = 2 (waiting state) • Step 3: Repeat Steps 4 and 5 until STACK is empty • Step 4: Pop the top node N. Process it and set its STATUS = 3 (processed state) • Step 5: Push on the stack all the neighbors of N that are in the ready state (whose STATUS = 1) and set their STATUS = 2 (waiting state) [END OF LOOP] • Step 6: EXIT Example 1: In the below search tree, we have shown the flow of depth-first search, and it will follow the order as: Root node--->Left node ----> right node. 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 node.
  • 29. Example 3: 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. Difference between BFS and DFS:
  • 30. 8. DEPTH-LIMITED SEARCH ALGORITHM  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: o Standard failure value: It indicates that problem does not have any solution. o Cutoff failure value: It defines no solution for the problem within a given depth limit. Advantages: Depth-limited search is Memory efficient. Disadvantages: o Depth-limited search also has a disadvantage of incompleteness. o It may not be optimal if the problem has more than one solution. 9. UNIFORM-COST SEARCH ALGORITHM:  Uniform-cost search is a searching algorithm used for traversing a weighted tree or graph. This algorithm comes into play when a different cost is available for each edge.
  • 31.  The primary goal of the uniform-cost search is to find a path to the goal node which has the lowest cumulative cost.  Uniform-cost search expands nodes according to their path costs from the root node. It can be used to solve any graph/tree where the optimal cost is in demand.  A uniform-cost search algorithm is implemented by the priority queue.  It gives maximum priority to the lowest cumulative cost. Uniform cost search is equivalent to BFS algorithm if the path cost of all edges is the same. Advantages: Uniform cost search is optimal because at every state the path with the least cost is chosen. Disadvantages: It does not care about the number of steps involve in searching and only concerned about path cost. Due to which this algorithm may be stuck in an infinite loop. 10. 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.
  • 32. 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 is given as: Solution: 1'st Iteration-----> A 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 In the fourth iteration, the algorithm will find the goal node. Advantages: o It combines the benefits of BFS and DFS search algorithm in terms of fast search and memory efficiency. Disadvantages: o The main drawback of IDDFS is that it repeats all the work of the previous phase. 11. BIDIRECTIONAL SEARCH ALGORITHM:  Before moving into bidirectional search let’s first understand a few terms.  Forward Search: Looking in-front of the end from start.  Backward Search: Looking from end to the start back-wards.  Bidirectional search replaces one single search graph with two small sub graphs in which one starts the search from an initial vertex and other starts from goal vertex.
  • 33.  The search stops when these two graphs intersect each other.  Bidirectional search can use search techniques such as BFS, DFS, DLS, etc. Example: In the below search tree, bidirectional search algorithm is applied. This algorithm divides one graph/tree into two sub-graphs. It starts traversing from node 1 in the forward direction and starts from goal node 16 in the backward direction. The algorithm terminates at node 9 where two searches meet. Advantages: o Bidirectional search is fast. o Bidirectional search requires less memory Disadvantages: o Implementation of the bidirectional search tree is difficult. o In bidirectional search, one should know the goal state in advance.