Upload
ims1
View
214
Download
0
Embed Size (px)
Citation preview
8/8/2019 Artificial Intelligence#Lect-9 (2)
1/48
IM Study Peshawar University
Artificial Intelligence
Lecture# 9,10
Problem Solving
Compiled by Bilal Mustafa
8/8/2019 Artificial Intelligence#Lect-9 (2)
2/48
The Two-One Problem
In order to explain the four components of
problem solving we have an interesting problem
called The Two-One Problem.
Problem statement to the problem is:
8/8/2019 Artificial Intelligence#Lect-9 (2)
3/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
4/48
The Two-One Problem
You are given a rectangular container that has 5 slots init.
The left most container is the Start state while the rightmost is the Goal state.
Each slot can hold only one coin at a time.
Our goal is to place the Rs. 1 coins into the right slotsand to place Rs. 2 coins into the left slots.
The Rules say that Rs. 1 coins can slide or hop onlytoward right and Rs. 2 coins can slide or hop towards the
left.
You can only move one coin at a time.
8/8/2019 Artificial Intelligence#Lect-9 (2)
5/48
The Two-One Problem
Let us try to solve the problem by using a hit andtrail method without addressing the problem in asystematic manner.
8/8/2019 Artificial Intelligence#Lect-9 (2)
6/48
The Two-One ProblemTrials to solve the problem
Trial One
8/8/2019 Artificial Intelligence#Lect-9 (2)
7/48
8/8/2019 Artificial Intelligence#Lect-9 (2)
8/48
The Two-One ProblemTrials to solve the problem
Trial One
8/8/2019 Artificial Intelligence#Lect-9 (2)
9/48
The Two-One ProblemTrials to solve the problem
Trial One
8/8/2019 Artificial Intelligence#Lect-9 (2)
10/48
The Two-One ProblemTrials to solve the problem
Trial One
8/8/2019 Artificial Intelligence#Lect-9 (2)
11/48
The Two-One ProblemTrials to solve the problem
Trial One
8/8/2019 Artificial Intelligence#Lect-9 (2)
12/48
The Two-One ProblemTrials to solve the problem
Trial One
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
13/48
The Two-One ProblemTrials to solve the problem
Trial One Trial Two
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
14/48
The Two-One ProblemTrials to solve the problem
Trial One Trial Two
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
15/48
The Two-One ProblemTrials to solve the problem
Trial One Trial Two
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
16/48
The Two-One ProblemTrials to solve the problem
Trial One Trial Two
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
17/48
The Two-One ProblemTrials to solve the problem
Trial One Trial Two
Stuck!!!
Stuck!!!
8/8/2019 Artificial Intelligence#Lect-9 (2)
18/48
The Two-One Problem
Hence solving the problem on Hit and Trial
might not give us the solution.
Let us now try to address the problem in asystematic manner.
8/8/2019 Artificial Intelligence#Lect-9 (2)
19/48
The Two-One Problem onsider the diagram below:
Starting from the goal state if we hop, we get stuck. If we
slide we can further carry on. Keeping this observation in
mind let us now try to develop all the possible combinations
that can happen after we slide.
8/8/2019 Artificial Intelligence#Lect-9 (2)
20/48
8/8/2019 Artificial Intelligence#Lect-9 (2)
21/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
22/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
23/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
24/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
25/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
26/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
27/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
28/48
The Two-One Problem
8/8/2019 Artificial Intelligence#Lect-9 (2)
29/48
The Two-One Problem
Therefore, if a problem is represented like this
that is called solution space which gives us the
entire information about a problem.
Information like what is the starting state? What
are the dead ends? and how to reach the goal state?
That was a type of well structured problem.
8/8/2019 Artificial Intelligence#Lect-9 (2)
30/48
Tree and Graph Terminology
8/8/2019 Artificial Intelligence#Lect-9 (2)
31/48
Tree and Graph Terminology
One of the good representation mechanism of
problem is Graph and Trees.
Graphs determines that how nodes are connectedto teach other?
Every graph can be converted into a tree.
If a graph is converted into tree representation itcan captured the solution space that easily lead us
to the goal state.
8/8/2019 Artificial Intelligence#Lect-9 (2)
32/48
Tree and Graph Terminology
8/8/2019 Artificial Intelligence#Lect-9 (2)
33/48
Tree and Graph Terminology
Graphs can be directed or undirected.
8/8/2019 Artificial Intelligence#Lect-9 (2)
34/48
Tree and Graph Terminology
Graphs can be directed or undirected.
8/8/2019 Artificial Intelligence#Lect-9 (2)
35/48
Tree and Graph Terminology
Graphs can be used to represent city routes.
8/8/2019 Artificial Intelligence#Lect-9 (2)
36/48
Tree and Graph Terminology
Graphs can be used to represent city routes.
8/8/2019 Artificial Intelligence#Lect-9 (2)
37/48
Tree and Graph Terminology
Example: You are landed on a new city airport and youwant to reach the hotel.
8/8/2019 Artificial Intelligence#Lect-9 (2)
38/48
Tree and Graph Terminology
Example: You are landed on a new city airport and youwant to reach the hotel.
8/8/2019 Artificial Intelligence#Lect-9 (2)
39/48
Tree and Graph Terminology
Graphs can be used to plan actions.
8/8/2019 Artificial Intelligence#Lect-9 (2)
40/48
Tree and Graph Terminology
Graphs can be used to plan actions.
8/8/2019 Artificial Intelligence#Lect-9 (2)
41/48
Tree and Graph Terminology
Every graphs can be converted into a tree.
Consider the following example.
8/8/2019 Artificial Intelligence#Lect-9 (2)
42/48
Tree and Graph Terminology
Every graphs can be converted into a tree.
Consider the following example.
8/8/2019 Artificial Intelligence#Lect-9 (2)
43/48
8/8/2019 Artificial Intelligence#Lect-9 (2)
44/48
Tree and Graph Terminology
Now if we can develop understanding of algorithms fortree searching and traversal then we will be able to solve
problems efficiently.
8/8/2019 Artificial Intelligence#Lect-9 (2)
45/48
Searching
All the problems that we have looked at can beconverted to a form where we have to start from a
start state and search for a goal state by traveling
through a solution space.
Searching is a formal mechanism to explore
alternatives.
8/8/2019 Artificial Intelligence#Lect-9 (2)
46/48
Summary
So for we have seen three examples of problem space.
Where we had represented the problems that made iteasier for us to understand the problem immediately.
8/8/2019 Artificial Intelligence#Lect-9 (2)
47/48
Summary
8/8/2019 Artificial Intelligence#Lect-9 (2)
48/48
Q & A