2 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Ai sheet 2 answer

Question 1: Define the following terms:


a) State Space Graph.
Answer:
We can use graphs to model the deeper structure of a problem
where the nodes of a state space graph represent possible stages
of a problem solution and the arcs of the graph represent
inferences or other steps in a problem solution.

b) Exhaustive Search.
Answer:
Exhaustive Search is a technique for systematically cover all the
states through a state space to reach the goal.

c) Heuristics.
Answer:
Judgmental rules that limit the exploration of search space to
those portions of state space that seem somehow promising.

d) Path.
Answer:

Minders’21 AC
A path through a graph connects a sequence of nodes through
successive arcs.

e) Rooted Graph.
Answer:
A graph has a unique node, called the root, such that there is a
path from the root to all nodes within the graph.

f) Tree.
Answer:
Is a graph in which two nodes have at most one path between
them. Trees often have roots, in which case they are usually
drawn with the root at the top, like a rooted graph.

Question 2: Describe using drawing the Kongsberg problem


"Euler Tour."

Answer:
“Konigsberg problem.” The city of Konigsberg occupied both
banks and two islands of a river. The islands and the riverbanks
were connected by seven bridges, as indicated in the following
photo:

Minders’21 AC
The bridges of Konigsberg problem asks if there is a walk around the
city that crosses each bridge exactly once. Although the residents had
failed to find such a walk and doubted that it was possible, no one had
proved its impossibility. Devising a form of graph theory, Euler created
an alternative representation for the map.
The riverbanks (rb1 and rb2) and islands (i1 and i2) are described by the
nodes of a graph; the bridges are represented by labeled arcs between
nodes (b1, b2, …. .., b7 ). The graph representation preserves the
essential structure of the bridge system, while ignoring extraneous
features such as bridge lengths, distances, and order of bridges in the
walk.

Question 3: Determine whether goal-driven or Data-driven


search would be preferable for solving each of the following
problems. Justify your
Answer:
A) You have met a person who claims to be your distant cousin,
with a common ancestor named John Doe. You would like to
verify her claim.
Minders’21 AC
Answer:
In this case we better use Data-driven search because:
o The data are given in the initial problem statement.
o It’s difficult to form a goal or hypothesis.

B) Another person claims to be your distant cousin. He doesn't know


the common ancestor's name but knows that it was no more than
eight generations back. You would like to either find this ancestor or
determine that she didn't exist.
Answer:
In this case we better use Goal-driven search because:
o A goal is given in the problem statement.
o There are a large number of rules to produce new facts.
o Problem data are not given but acquired.
C) A theorem prover for plane geometry.
Answer:
In this case we better use Goal-driven search because:
o A goal is given in the problem statement.
o There are a large number of rules to produce new facts.

Question 4: Answer the following Questions:

A) Discuss briefly the techniques used to reduce the search


complexity when solving the Traveling Salesman Problem.
Minders’21 AC
Answer:
DataDrivenSearch: (Forward chaining)
Start searching from the given data of a problem instance Toward
a goal.

GoalDrivenSearch: (Backward chaining)


Start Searching from A goal state to Fact for Data of The Given
problem.

C) Briefly discuss the advantages and disadvantages of depth


and breadth first search. What sort of problem is each
appropriate for?
Answer:
Depth first search Breadth first search
Advantages 1. Used to 1. Consume
find the s less memory
shortest path 2. Finds the
between larger distant
vertices element (from
2. Always source vertex)
finds optimal in less time.
solutions.
3. There is
nothing like
useless path in
BFS, since it
searches level
by level.

Minders’21 AC
4. Finds the
closest goal in
less time

Disadvantage 1. All the 1. May not


s connected find optimal
vertices must solution to the
be stored in problem.
memory. So 2. May get
consumes trapped in
more memory searching
useless path.

Sort of
1. DFS is used to 1. BFS is used to
problem
find the path find the shortest
between two path between
nodes. two nodes.
2. It can be used to 2. It’s used to find
do topological neighboring
sorting, which locations in GPS
can be used to systems.
schedule the jobs 3. It’s also used in
from given finding all the
dependencies neighboring
among them. nodes in a peer-
3. It can be also be to-peer network
used to find the like Bit Torrent.

Minders’21 AC
solution to a
puzzle — e.g.,
finding a path
out of a maze,
with the path
stored in a stack.

D)How does the use of a closed node list reduce the amount
of search required in graph search?
Answer:
As the closed list is a collection of all expanded nodes. This means
that those are nodes that were already "searched".
So, this prevents the search from visiting nodes again so that we
reduce the amount of search required in graph search.

F) The state space of many two-player games (e.g. chess,


checkers, and tic-tac-toe) can conveniently be represented as
and/or trees. Why? Give an example, stating which nodes are
and which are Or.
Answer:
Because it is increasing the search depth and improves the
chance of picking the best move.
As in the Two-person games there is two player we should
decide who will win so we represented it in the and-or tree by
Minders’21 AC
using disjunction to represent the first player's alternative
moves and using conjunction to represent all the second
player's moves.
Example:

In tic-tac-toe, this would be the empty grid with no Xs or Os


played yet. Under root, on the second level, there are the possible
states that can result from the first player's moves, be it X or O.
We call these nodes the “children” of the root node.

Each node on the second level, would further have as its children
nodes the states that can be reached from it by the opposing
player's moves. This is continued, level by level, until reaching
states where the game is over. In tic-tac-toe, this means that
either one of the players gets a line of three and wins, or the
board is full and the game ends in a tie.

Minders’21 AC

You might also like