0% found this document useful (0 votes)
21 views44 pages

Unit I

Uploaded by

meheyat469
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views44 pages

Unit I

Uploaded by

meheyat469
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Introduction to

Artificial Intelligence
By
Krunal C. Pawar
Definitions Of AI
• Artificial intelligence, or AI, is technology that enables computers
and machines to simulate human intelligence and problem-solving
capabilities.
• Artificial intelligence (AI) refers to computer systems capable of performing complex
tasks that historically only a human could do, such as reasoning, making decisions,
or solving problems.
• AI is the branch of computer science which deals with the Symbolic, Non
Algorithmic method of problem solving. It is the study of how to make computer to
things at a movement like as human.
• Artificial Intelligence is concerned with the design of intelligence in an artificial
device. The term was coined by John McCarthy (Father of AI) in 1956.
• There are two ideas in the definition.
1. Intelligence
2. Artificial device
Definitions Of AI
• A system with intelligence is expected to behave as intelligently as a
human and a system with intelligence is expected to behave in the
best possible manner.
• Artificial intelligence is about designing systems that are as intelligent
as humans. This involves trying to understand human thought and an
effort to build machines that emulate the human thought process.
This view is the cognitive science approach to AI.
Turing test
• The Turing test was developed by Alan Turing(A
computer scientist) in 1950. He proposed that the
“Turing test is used to determine whether or not a
computer(machine) can think intelligently like
humans”?
• 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.
• 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:
Interrogator: Are you a computer?
Player A (Computer): No
Interrogator: Multiply two large numbers such as
(256896489*456725896)
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.
AI Problems
• AI Problem is solved by using AI Technique. The problem which is solve by using
knowledge & logic is called as AI problem.
• Knowledge consist of
1. Facts
2. Concepts
3. Theories
4. Procedures
5. Relationships between them
• AI Problem requires knowledge to solve it, without knowledge this problem is
not solvable. AI problem is solved by using AI technique, which is non-
algorithmic (dynamic steps) and symbolic approach of problem solution.
Examples of AI problems are chess playing, driving a car etc.
• Non AI Problem may or may not require knowledge to solve it,
without knowledge this problem is may be solvable. Non AI problem
is solved by using Non AI technique, which is algorithmic (static steps)
and non-symbolic approach of problem solution. Examples of Non AI
problems are addition of numbers, simple computer program etc.
AI Techniques
• In the real world, the knowledge has some unwelcomed properties
1. Its volume is huge, next to unimaginable.
2. It is not well-organized or well-formatted.
3. It keeps changing constantly
• AI Technique is a technique which is used to solve AI problem.
• AI Technique is a manner to organize and use the knowledge efficiently. It is a
Method that exploits knowledge that should represent in such a way that-
1. The knowledge captures generalization.
2. It can be understood by people, who provide it.
3. It can be easily modified to correct errors & to reflect the changes in world.
State Space Search in Artificial
Intelligence
• State space search is a problem-solving technique
used in Artificial Intelligence (AI) to find the solution
path from the initial state to the goal state by exploring
the various states. The state space search approach
searches through all possible states of a problem to find
a solution. It is an essential part of Artificial Intelligence
and is used in various applications, from game-playing
algorithms to natural language processing.
• To begin the search process, we set the current state to the initial
state.
• We then check if the current state is the goal state. If it is, we
terminate the algorithm and return the result.
• If the current state is not the goal state, we generate the set of
possible successor states that can be reached from the current
state.
• For each successor state, we check if it has already been visited. If
it has, we skip it, else we add it to the queue of states to be visited.
• Next, we set the next state in the queue as the current state and
check if it's the goal state. If it is, we return the result. If not, we
repeat the previous step until we find the goal state or explore all
the states.
• If all possible states have been explored and the goal state still
needs to be found, we return with no solution.
Problem Characteristics In Artificial Intelligence
• To choose an appropriate method for a particular problem
first we need to categorize the problem based on the
following characteristics.
1.Is the problem decomposable into small sub-problems
which are easy to solve?
2.Can solution steps be ignored or undone?
3.Is the universe of the problem is predictable?
4.Is a good solution to the problem is absolute or relative?
5.Is the solution to the problem a state or a path?
6.What is the role of knowledge in solving a problem using AI
7.Does the task of solving a problem require human
interaction?
Is the problem decomposable?
• The question of whether a problem is decomposable
refers to whether it can be broken down into smaller,
independent subproblems.
• Decomposable problems can be solved by tackling each
subproblem individually, and their solutions can then be
combined to solve the overall problem.
• However, not all problems are decomposable, and some
may require addressing as a whole without breaking
them down into independent parts.
Example: In this case, the problem is divided into smaller
problems. The smaller problems are solved independently.
Finally, the result is merged to get the final result.
Can solution steps be ignored or
undone?
• The reversibility of solution steps refers to whether they
can be ignored or undone if they prove to be unwise or
lead to a dead end.
• In some problems, certain solution steps can be ignored
without affecting the final result.
• Ex. In the Theorem Proving problem.
• a lemma that has been proved can be ignored for the
next steps.
• Lemma- A statement that is thought to be true and is used as
the basis of testing the truth of another statement
• In recoverable problems, solution steps can be undone
to explore alternative paths.
• Ex. in the 8-puzzle, moves can be undone to try
different arrangements of tiles.
• On the other hand, some problems have irreversible
solution steps, like in chess, where once a move is
made, it cannot be undone.
• So, Ignorable problems can be solved using a simple
control structure that never
backtracks. Recoverable problems can be solved using
backtracking. Irrecoverable problems can be solved
by recoverable style methods via planning.
Is the problem’s universe
predictable?
• In Playing Bridge, We cannot know exactly where all the
cards are or what the other players will do on their turns.
• For certain-outcome problems, planning can be used
to generate a sequence of operators that is guaranteed
to lead to a solution.
• Ex. 8-puzzle Problem.
• For uncertain-outcome problems, a sequence of
generated operators can only have a good probability of
leading to a solution. Plan revision is made as the plan is
carried out and the necessary feedback is provided.
Is a good solution absolute or
relative?
• The nature of a good solution can be either absolute or relative.
• An absolute solution is one where finding a single correct path
or outcome is sufficient to achieve the desired goal.
• In problems like the water jug puzzle, finding any valid path to
the solution is considered good enough.
• On the other hand, a relative solution is one that requires
evaluating multiple possible paths or outcomes to find the best
or optimal solution.
• Problems like the traveling salesman problem seek the shortest
route among all possible routes, making it a relative solution.
Is the solution a state or a path?
• The solution to a problem can be either a state or a path,
depending on the nature of the problem.
• In some problems, the desired outcome is a specific state
or configuration that satisfies the problem’s requirements.
• For instance, in the 8-puzzle, the solution is a specific
arrangement of tiles in the goal state.
• In other problems, the solution involves finding a path or
sequence of steps to reach the desired goal state.
• For example, in maze-solving, the solution is the path
from the starting point to the exit.
What is the role of knowledge?
• Playing Chess
• Consider again the problem of playing chess.
• Suppose you had unlimited computing power available. How
much knowledge would be required by a perfect program?
• The answer to this question is very little—just the rules for
determining legal moves and some simple control mechanism
that implements an appropriate search procedure.
• Knowledge is important only to constrain the search for a
solution.
• News Paper
Does the task of solving a problem require
human interaction?

• The level of human interaction required in problem-solving depends on the


problem’s complexity and the capabilities of the problem-solving methods
being used.
• In some cases, computers can autonomously find solutions to problems
without any interaction with humans.
• For example, algorithms can efficiently solve mathematical equations or
perform certain optimization tasks.
• However, in more complex and uncertain problems, human interaction may
be necessary to provide additional information, preferences, or guidance.
• Conversational problem-solving, where the computer interacts with users to
gather information or provide assistance, can be valuable in addressing
such challenges.
• Ex. Chess.
What is a Production System in
AI?
• Every automatic system with a specific algorithm must have
rules for its proper functioning and functioning differently.
• The production systems in artificial intelligence are rules
applied to different behaviors and environments.
• In artificial intelligence (AI), a production system refers to a
type of rule-based system that is designed to provide a
structured approach to problem solving and decision-making.
• Production system or production rule system is a computer
program typically used to provide some form of artificial
intelligence, which consists primarily of a set of rules about
behavior but it also includes the mechanism necessary to
follow those rules as the system responds to states of the
world.
WATER – JUG PROBLEM
• What is Water Jug Problem in AI? The Water Jug Problem
in Artificial Intelligence is a classic puzzle in AI and
mathematics that focuses on optimizing the use of two
or more water jugs to measure a specific quantity of
water.
• It is a fundamental problem in the domain of
optimization and decision-making.
• This problem comes in various forms with different jug
capacities and target measurements, making it a
versatile tool for learning AI problem-solving techniques.
1. (x,y) is X<4 -> (4, Y) Fill the 4-litre jug

2. (x, y) if Y<3 -> (x, 3) Fill the 3-litre jug

Pour some water from a 4-litre


3. (x, y) if x>0 -> (x-d, d)
jug

Pour some water from a 3-litre


4. (x, y) if Y>0 -> (d, y-d)
jug

5. (x, y) if x>0 -> (0, y) Empty 4-litre jug on the ground

6. (x, y) if y>0 -> (x,0) Empty 3-litre jug on the ground


Pour water from a 3-litre
7. (x, y) if X+Y >= 4 and y>0 -> (4, y-(4-x jug into a 4-litre jug until it
is full
Pour water from a 3-litre
8. (x, y) if X+Y>=3 and x>0 -> (x-(3-y), 3)) jug into a 4-litre jug until it
is full

Pour all the water from a 3-


9. (x, y) if X+Y <=4 and y>0 -> (x+y, 0
litre jug into a 4-litre jug

Pour all the water from a 4-


10. (x, y) if X+Y<=3 and x>0 -> (0, x+
litre jug into a 3-litre jug

Pour 2-litre water from 3-


11. (0, 2) -> (2, 0)
litre jug into 4-litre jug

Empty 2-litre in the 4-litre


12. (2, Y) -> (0, y)
jug on the ground.
• The Solution to the Water Jug Problem in Artificial Intelligence
• Current state (0,0)
• Loop till the goal state (2,0) is reached.
• Apply a rule when the left side matches the current state
• Set the new current state to the resulting state
• Start state (0,0)
• (0,3) Apply Rule 2, Fill the 3-litre Jug
• (3,0) Apply Rule 9: Pour all the water from a 3-litre jug into a 4-
litre jug
• (3,3) Apply Rule 2, Fill the 3-litre Jug
• (4,2) Apply Rule 7: Pour water from a 3-litre jug into a 4-litre jug
until it is full
• (0,2) Apply Rule 5, Empty 4-litre jug on the ground
• (2,0) Apply Rule 9: Pour all the water from a 3-litre jug into a 4-
litre jug
• Another water jug problem solution is:
• (0, 0) – Start State
• (4, 0) – Rule 1: Fill the 4-litre jug
• (1, 3) – Rule 8: Pour water from the 4-litre jug into the 3-
litre jug until the 3-litre jug is full.
• (1, 0) – Rule 6: Empty the 3-litre jug on the ground
• (0, 1) – Rule 10: Pour all the water from the 4-litre jug
into the 3-litre jug.
• (4, 1) – Rule 1: Fill the 4-litre jug
• .(2, 3) – Rule 8: Pour water from the 4-litre jug into the
3-litre jug until the 3-litre jug is full.
• Goal State reached
Breadth First Search (BFS)
• It starts from the root node, explores the the next level neighbors
• It generates one tree at a time until the solution is found.
• BFS searches breadth-wise in the problem space.
• Breadth-First search is like traversing a tree where each node is a
state which may be a potential candidate for solution.
• It expands nodes from the root of the tree and then generates one
level of the tree at a time until a solution is found
Breadth-First Search (BFS)
• BFS is Uninformed Search Technique.
• It also called blind search technique.
• It uses FIFO(Queue) data structure.
• Shallowest Node (Level search technique)
• This technique gives us Complete answers
• It gives optimal Result.
Breadth-First Search (BFS)
• In artificial intelligence, the Breadth-First Search (BFS) algorithm is an
essential tool for exploring and navigating various problem spaces.
• By systematically traversing graph or tree structures, BFS solves
tasks such as pathfinding, network routing, and puzzle solving.
• The Breadth-First Search is a traversing algorithm used to satisfy a
given property by searching the tree or graph data structure.
• It belongs to uninformed or blind search AI algorithms as It operates
solely based on the connectivity of nodes and doesn’t prioritize any
particular path over another based on heuristic knowledge or
domain-specific information.
• it doesn’t include any additional information beyond the structure of
the search space.
• It is optimal for unweighted graphs and is particularly
suitable when all actions have the same cost.
• Due to its systematic search strategy, BFS can
efficiently explore even infinite state spaces.
• Originally it starts at the root node, then it expands all of its
successors, it systematically explores all its neighboring
nodes before moving to the next level of nodes.
• As shown in the above image, It starts from the root node A
then expands its successors B.
• This process of extending the root node’s immediate
neighbors, then to their neighbors, and so on, lasts until all
the nodes within the graph have been visited or until the
specific condition is met.
• From the above image we can observe that after visiting the
node B it moves to node C.
• when the level 1 is completed, it further moves to the next
level i.e. 2 and explore node D. it will move systematically to
node E, node F and node G. After visiting the node G it will
terminate.
Key characteristics of BFS
• First-in-First-Out (FIFO):
• The FIFO queue is typically preferred in BFS because the FIFO
queue will be faster than a priority queue and often results in the
correct order of nodes.
• A priority queue is a type of queue that arranges elements
based on their priority values.
• Cost-optimal: BFS always aims to find a solution with a
minimum cost prioritizing the shortest path, when BFS generates
nodes at a certain depth, it has already explored and generated
all the nodes at the previous depth d-1.
• Consequently, if a solution exists within a search space, BFS can
discover it as soon as it reaches that depth level.
• Therefore, BFS is said to be a cost-optimal solution.
Depth First Search (DFS)
• DFS is Uninformed Search Technique.
• It also called blind search technique.
• It uses LIFO(stack) data structure.
• deepest Node
• This technique gives us incomplete answers
• It gives non optimal Result.
Depth First Search
Depth First Search (DFS) for Artificial
Intelligence
• Depth-first search is a traversing algorithm used in tree
and graph-like data structures.
• It generally starts by exploring the deepest node in the
frontier.
• Starting at the root node, the algorithm proceeds to
search to the deepest level of the search tree until
nodes with no successors are reached.
• Suppose the node with unexpanded successors is
encountered then the search backtracks to the next
deepest node to explore alternative paths.
• Originally it starts at the root node, then it expands all
of its one branch until it reaches a dead end, then
backtracks to the most recent unexplored node,
repeating until all nodes are visited or a specific
condition is met.
• This systematic exploration continues until all nodes are
visited or the search terminates. (In our case after
exploring all the nodes of B. DFS explores the right side
node i.e. C then F and then G. After exploring the node
G. All the nodes are visited. It will terminate.
Key characteristics of DFS
• In simple terms, the DFS algorithms in AI holds the power of
extending the current path as deeply as possible before
considering the other options.
• DFS is not cost-optimal since it doesn’t guarantee to find
the shortest paths.
• DFS uses the simple principle to keep track of visited
nodes: It uses a stack to keep track of nodes that have been
visited so far which helps in the backtracking of the graph.
When the DFS encounters a new node, it adds it to the stack
to explore its neighbours. If it reaches a node with no
successors (leaf node), it works by backtracking such as
popping nodes off the stack to explore the alternative paths.
• Backtracking search
A* Algorithm
• It is a searching algorithm that is used to find the shortest path
between an initial and a final point.
• It is a handy algorithm that is mostly used for map traversal to find
the shortest path to be taken.
• A* was initially designed as a graph traversal problem, to help build a
robot that can find its own course.
• It is a searching algorithm that is used to find the shortest
path between an initial and a final point.
• The A* algorithm is widely used in various domains for
pathfinding and optimization problems.
• It has applications in robotics, video games, route planning,
logistics, and artificial intelligence.
A* Algorithm- Inform Search
Technique

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy