14CS506/A Hall Ticket Number: III/IV B.Tech (Regular) DEGREE EXAMINATION November, 2016 Computer Science & Engineering Fifth Semester Artificial Intelligence Time: Three Hours Maximum : 60 Marks Answer Question No.1 compulsorily. (1X12 = 12 Marks) Answer ONE question from each unit. (4X12=48 Marks) 1. Answer all questions (1X12=12 Marks) a Define state space. b What is a heuristic search technique? c Mention the limitations of hill climbing search techniques. d Represent the fact “No mortal lives longer than 150 years” in predicate logic. e Differentiate between Instance and Isa relationships. f What is a control rule? g What is planning? h What is a semantic net? i Define script. j What is an expert system shell? k What is meant by rote learning? l What is a decision tree? UNIT – I 2.a By considering playing chess as an example, describe how to define a problem using state space search. 6M 2.b Discuss in detail about the characteristics of various categories of problems. 6M (OR) 3.a Write and describe the steps of A* algorithm. 6M 3.b Show how to solve robot navigation problem using Means-Ends Analysis. 6M UNIT – II 4.a Consider the following facts: a) Marcus was a man. b) Marcus was born in 40 A.D. c) All men are mortal. d) No mortal lives longer than 150 years. It is now 2016. Prove that “Marcus is not alive now.” by using forward and backward reasoning. 6M 4.b By means of suitable examples explain unification algorithm. 6M (OR) 5.a Program the interpreter for a production system. You will need to build a table that holds rules and a matcher that compares the current state to the left sides of the rules. You will need to provide an appropriate control strategy to select among competing rules. Use interpreter as the basis of a program that solves water jug problem. 6M 5.b Briefly discuss about different matching techniques. 6M UNIT – III
22
Embed
14CS506/A Hall Ticket Number: November, 2016 Computer ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Answer ONE question from each unit. (4X12=48 Marks)
1. Answer all questions (1X12=12 Marks)
a Define state space.
b What is a heuristic search technique?
c Mention the limitations of hill climbing search techniques.
d Represent the fact “No mortal lives longer than 150 years” in predicate logic.
e Differentiate between Instance and Isa relationships.
f What is a control rule?
g What is planning?
h What is a semantic net?
i Define script.
j What is an expert system shell?
k What is meant by rote learning?
l What is a decision tree?
UNIT – I
2.a By considering playing chess as an example, describe how to define a problem using state
space search.
6M
2.b Discuss in detail about the characteristics of various categories of problems. 6M
(OR)
3.a Write and describe the steps of A* algorithm. 6M
3.b Show how to solve robot navigation problem using Means-Ends Analysis. 6M
UNIT – II
4.a Consider the following facts:
a) Marcus was a man.
b) Marcus was born in 40 A.D.
c) All men are mortal.
d) No mortal lives longer than 150 years.
It is now 2016.
Prove that “Marcus is not alive now.” by using forward and backward reasoning.
6M
4.b By means of suitable examples explain unification algorithm. 6M
(OR)
5.a Program the interpreter for a production system. You will need to build a table that holds
rules and a matcher that compares the current state to the left sides of the rules. You will
need to provide an appropriate control strategy to select among competing rules. Use
interpreter as the basis of a program that solves water jug problem.
6M
5.b Briefly discuss about different matching techniques. 6M
UNIT – III
6.a With suitable examples, explain knowledge representation using conceptual dependencies. 8M
6.b Show a conceptual dependency representation of the sentence, “Joe hit the mirror with a
bat”.
4M
(OR)
7.a Consider the following blocks world problem and solve it by using goal stack planning
method.
B C B
A C D A D
Initial State Goal State
8M
7.b Write short notes on reactive systems. 4M
UNIT – IV
8.a Briefly describe Winston’s learning program and version spaces. 8M
8.b Describe Explanation based Learning. 4M
(OR)
9. Explain the knowledge acquisition techniques used by expert system. 12M
14CS506/A
III/IV B.Tech (Regular) Degree Examination
November, 2016 Computer Science & Engineering
Fifth Semester Artificial Intelligence
1. Answer all the questions.
a) Define state space.
State space is a set of legal positions. Starting at the initial state using the set of rules to move from one state to another. Attempting to end up in a goal state Problem solving = Searching for a goal state.
b) What is a heuristic search technique? Heuristic technique improves the efficiency of a search process, possibly by sacrificing claims of completeness or optimality. Heuristics are like tour guide
c) Mention the limitations of hill climbing search techniques. • Local Optimum: all neighboring states are worse or the same. • Plateau - all neighboring states are the same as the current state. • Ridge - local optimum that is caused by inability to apply 2 operators at once.
d) Represent the fact “No mortal lives longer than 150 years” in predicate logic.
∀x: ∀t1: At2: mortal(x) ∧ born(x, t1) ∧ gt(t2 - t1,150) → died(x, t2) e) Differentiate between instance and Isa relationships.
Isa and instance relationships: Two attributes isa and instance play an important role in many aspects of knowledge representation. The reason for this is that, In knowledge representation, object-oriented programming and design, is-a (isa or is a) is a subsumption relationship between abstractions (e.g. types, classes), where one class A is a subclass of another class B (and so B is a superclass of A).
The predicate instance is a binary one, whose first argument is an object and whose second argument is a class to which the object belongs. But these representations do not use an explicit isa predicate
f) What is a control rule? A set of rules of the form Ci → Ai where Ci is the condition part and Ai is the action part. The condition determines when a given rule is applied, and the action determines what happens when it is applied.
g) What is planning? The word planning refers to the process of computing several steps or a problem-solving procedure before executing any of them
h) What is a semantic net? The main idea behind semantic nets is that the meaning of a concept comes from the way in which it is connected to other concept. In a semantic net, information is represented as a set of nodes connected to each other by a set of labeled arcs which represent relationships among objects
i) Define script. Script defines the stereotyped sequences of actions
j) What is an expert system shell? A shell is a piece of software which contains the user interface, a format for declarative knowledge in knowledge base, and in inference engine
k) What is meant by rote learning? Caching has been used in AI programs to produce some surprising performance improvement. Such caching is known as rote learning
l) What is a decision tree? A decision tree or a classification tree is a tree in which each internal (non-leaf) node is labeled with an input feature. The arcs coming from a node labeled with a feature are labeled with each of the possible values of the feature. Each leaf of the tree is labeled with a class or a probability distribution over the classes.
Unit -1
2 a) By considering playing chess as an example describe how to define a problem by using state space
search. 6M
For “playing chess” problem the starting position can be described as an 8*8 array where each
position contains a symbol standing for the appropriate piece in the official chess opening
position.
The legal moves provide the way of getting from the initial state to a goal state.
They can be described easily as a set of rules consisting of two parts: a left side that serves as a
pattern to be matched against the current board position and a right side that describes the
change to be made to the board position to reflect the move.
There are several ways in which these rules can be written. If we write rules like the one above
we have to write a very large in number.
Using so many rules leads to two serious practical difficulties:
No person could ever supply a complete set of such rules. It would take too long and
could certainly not be done without mistakes.
No program could easily handle all those rules. Although a hashing scheme could be
used to find the relevant rules for each move fairly quickly just storing that many rules
poses serious difficulties.
To minimize such problems, we should look for a way to write the rules describing the legal
moves in as general a way as possible. To do this it is useful to introduce some convenient
notation for describing patterns and substitutions.
In the problem of playing chess, where each state corresponds to a legal position of the board.
The state space representation forms the basis of most of the AI methods. Its structure
corresponds to structure of problem solving in 2 important ways:
It allows for a formal definition of a problem as the need to convert some given
situation into some desired situation using a set of permissible operations.
It permits us to define the process of solving a particular problem as a combination of
known techniques and search.
2 b) discuss in detail about the characteristics of various categories of problems. 6M
Is the problem decomposable into a set of independent smaller or easier sub
problems?
At each step it checks to see whether the problem it is working on is
immediately solvable. Is so, the answer is returned directly.
If the problem is not easily solvable, the integrator checks to see whether it can
decompose the problem into smaller problems.
If it can, it creates those problems and calls itself recursively on them, using this
technique of problem decomposition.
Can solution steps be ignored or at least undone if they prove unwise?
It illustrates the differences between 3 important problems:
Ignorable, in which solution steps can be ignored.
Recoverable, in which solution steps can be undone.
Irrecoverable, in which solution steps cannot be undone.
Is the problem universe predictable?
For solving certain-outcome problems, open-loop approach will work fine since
the result of an action can be predicted perfectly.
For uncertain-outcome problems, planning can at best generate a sequence of
operators that has a good probability of leading to a solution.
Is a good solution to the problem obvious without comparison to all other possible
solutions?
For a question we follow one path successfully to an answer, there is no reason
to go back and see if some other path might also lead to a solution.
Is the desired solution a state of the world or a path to a state?
A statement of the solution to the problem must be a sequence of operations
that produce a final state.
Is a large amount of knowledge absolutely required to solve the problem, or is
knowledge important only to constraint the search?
A lot knowledge is important only to constrain the search for a solution and
those for which a lot of knowledge is required even to be able to recognize a
solution
Can a computer that is simply given the problem return the solution, or will the
solution of the problem require interaction between the computer and a person?
3 a) write and describe the steps of A* algorithm. 6M
Start with OPEN containing only the initial code. Set the node’s g value to 0, its h’ value to
whatever it is, and its f’ value to h’ +0, or h’. set CLOSED to the empty list.
Until a goal node is found, repeat the following procedure: if there are no nodes on OPEN,
report failure. Otherwise, pick the node on OPEN with the lowest f’ value. Call it BESTNODE.
Remove it from OPEN. Place it on CLOSED. See if BESTNODE is a goal node. If so, exit and report
a solution. Otherwise generate the successors of BESTNODE but do not set BESTNODE to point
to them yet. Follow each such SUCCESSOR, do the following:
Set SUCCESSOR to point back to BESTNODE. These backwards links will make it possible
to recover the path once a solution is found.
Compute g(SUCCESSOR)=g(BESTNODE)+ the cost of getting from BESTNODE to
SUCCESSOR.
See if SUUCESSOR is the same as any node on OPEN. If so, call that node OLD. Since this
node already exists in the graph, we can throw SUCCESSOR away and add OLD to the list
of BESTNODE’s successors. Now we must decide whether OLD’s parent link should be
reset to point to BESTNODE. It should be if the path we have just found to SUCCESSOR via
BESTNODE by comparing their values. If OLD is cheaper then we need do nothing. If
SUCCESSOR is cheaper, then reset old parent link to point to BESTNODE, record the new
cheaper path in g (OLD), and update f’(OLD).
If SUCCESSOR was not on OPEN, see if it is on CLOSED. If so, call the node on CLOSED OLD
and add OLD to the list of BESTNODE’s successors.
If SUCCESSOR was not already on either OPEN or CLOSED, then put it on OPEN, and add it
to the list of BESTNODE’s successors. Compute f’(.SUCCESSOR)=g(SUCCESSOR)+
h’(SUCCESSOR).
3 b) show how to solve robot navigation problem using Mean-Ends Analysis. 6M
1. Compare CURRENT to GOAL. if there are no differences between them then return.
2. Otherwise, select the most important difference and reduce it by doing the following until
success or failure is signaled:
a) Select an as yet untried operator O that is applicable to the current difference. If there
are no such operators, then signal failure.
b) Attempt to apply) to CURRENT. Generate descriptions of two states: O-START, a state in
which O’s preconditions are satisfied and O-RESULT, the state that would result if O
were applied in O-START.
c) If
(FIRST-PARTMEA (CURRENT, O-START))
And
(LAST-PARTMEMO-RESULT, GOAL)
Are successful, then signal success and return the result of concatenating
FIRST-PART, O, and LAST-PART.
Unit-2
4 a) Consider the following facts 6M
a) Marcus was a man b) Marcus was born in 40 A.D c) All man are mortal d) No mortal lives longer than 150 years.
It is now 2016.
Prove that “Marcus is not alive now ”. By using forward and backward reasoning.
a. Marcus was a man
Man (Marcus)
Again we ignore the issue of tense.
b. Marcus was born in 40 A.D
born (Marcus,40)
c. All men are mortal
∀ ( ) ( )
d. No mortal lives longer than 150 years.
∀ ∀ ∀ ( ) ∧ ( ) ∧ ( ) ( )
It is now 2016
now = 2016.
Backward Reasoning
4 b) By means of suitable examples explain unification algorithm. 6M ALGORITHM: unify (L1, L2)
If L1 or L2 are both variables or constants then:
If L1 and L2 are identical, then return NIL.
Else if L1 is a variable, then if L1 occurs in L2 then return {FAIL},else return(L2/L1).
Else if L2 is a variable, then if L2 occurs in L1 then return {FAIL},else return(L1/L2).
Else return {FAIL}.
If the initial predicate symbols in L1 and L2 are not identical ,then return {FAIL}
If L1 and L2 have a different number of arguments, then return {FAIL}.
set SUBSET to NIL
for I <- 1 to number of arguments in L1:
Call unify with the /th argument of L1 and the ith argument of L2,putting result in s.
If s contain FAIL then return{FAIL}.
If S is not equal to NIL then :
Apply S to the remainder of both L! and L2.
subset:=APPEND(S,SUBSET)
return SUBSET.
EXAMPLES:
tryassassinate(Marcus,Caesar)
hate(Marcus,Caesar)
P(x,x)
P(y,z)
y/x
hate(x,y)
hate(Marcus,z)
(Marcus/x,z/y)
(Marcus/x,y/z)
(Marcus/x, Ceaser/y, Ceaser/z)
(Marcus/x, Polonius/y, Polonius /z)
5 a) Program the interpreter for a production system. You will need to build a table that holds rules
and a matcher that compares the current state to left sides of the rules. You will need to provide an
appropriate control strategy to select among competing rules. Use interpreter as the basis of a
program that solves water jug problem. 6M
5 b) Briefly discuss about different matching techniques. 6M
INDEXING
The one way to select applicable rules is to do a simple search through all the rules, comparing each ones predictions to the current state and extracting all the ones that match.
But there 2 problems with the simple solutions.
To solve very interesting problems, it will be necessary to use a large number of rules.
Scanning through all of them at every step of the search would be hopelessly inefficient.
It is not always immediately obvious whether a rules predictions of satisfied by a
particular state.
MATCHING WITH VARIABLES
The temporal nature of data. Rules usually do not alter the state description radically. Instead, a
rule will typically add one or two elements, or perhaps delete one or two, but most of state
description remains the same. Full matching is only pursued for candidates that could be
affected by incoming or outgoing data.
Structural similarity in rules. Different rules may share a large number of preconditions.
Persistence of variable binding consistence while all the individual preconditions of a rule might be
met, there may be variable binding conflicts that prevent the rule from firing.
Son(x,y) ^ son(y,z) -> grandparent(x,y)
COMPLEX AND APPROPRIATE MATCHING
A more complex matching process is required when the predictions of rule specify required
properties that are not stated explicitly in description of the current state. In this case, a
separate set of rules must be used to describe how some properties can be inferred from
others.
An even more complex matching process is required if rules should be applied if their predictions
approximately match the current situation.
CONFLICT RESOLUTION
The result of the matching process is a list of rules whose antecedents have matched the current
state description along with whatever variable binding where generated by the matching
process. But sometimes it is useful to incorporate some of that decision making into the
matching process. This is the phase of the matching process. This phase of the matching process
is then call conflict resolution.
Assign a preference based on the rule that matched.
Assign a preference based on the object that matched.
Assign a preference based on the action that the matched rule would perform.
Unit-3
6 a) with suitable examples, explain knowledge representation using conceptual dependencies. 8M
Conceptual dependency represents the kind of knowledge about events that is usually contained in natural language sentences.
Facilitates drawing inferences from the sentences
Is independent of the language in which the sentences were originally stated.
The dependencies among conceptualizations correspond to semantic relations among the underlying concepts.
6 b) Show a Conceptual Dependency representation of the sentence, “Joe hit the mirror with a bat”. 4M
7a) consider the following blocks world problem and solve it by using goal stack planning method.8M
Initial state Goal state
To solve compound goals that may interact we use goal stack. The approach used in goal stack is STRIPS.
In STRIPS the problem solver makes use of a single stack that contains both goals and operators that been proposed to satisfy those goals.
The problem solver also relies on a database that describes the current situation and a set of operators described as PRECONDITION, ADD and DELETE lists.
We can describe the start state or Goal stack as ON (B, A) ∧ ONTABLE (A) ∧ONTABLE(C) ONTABLE (D) ∧ARMEMPTY
We can describe the goal state or Goal stack as ON(C, A) ∧ ON (B, D) ∧ ONTABLE (A) ∧ ONTABLE (D)
At each step of the problem solving process the top goal on the stack will be solved until the goal stack is empty
One last check, the original goal is compared to the finial state derived from chosen operator
Choose first alternative, predicate on top of the goal stack is ON(C,A)
Decompose the problem into four different sub problems in the goal stack ON(C,A) ON(B,D) ONTABLE(A)
ONTABLE(D)
ONTABLE (A) and ONTABLE(D) are already true in the initial state.
There are two different orders are (1) (2) ON(C,A) ON(B,D) ON(B,D) ON(C,A) ON(C,A) ∧ ON(B,D) ∧ OTAD ON(C,A) ∧ ON(B,D) ∧ OTAD.
At each step of the problem solving process the top goal on the stack will be solved until the goal stack is empty
One last check, the original goal is compared to the finial state derived from chosen operator
Choose first alternative, predicate on top of the goal stack is ON(C,A)
First check to see whether ON(C,A) is true in the current state. o It is not, so find an operator that could cause it to be true
If you Apply STACK(C,A) operator will lead the state to ON(C,A) goal
STACK(C,A) ON(B,D) ON(C,A) ON(B,D) OTAD
In order to apply STACK(C,A) operator, its preconditions must hold, so we stack those sub goals
CLEAR(A) HOLDING(C)∧
Resultant goal stack is CLEAR(A)
HOLDING(C)
CLEAR(A) ∧ HOLDING(C)
STACK(C,A)
ON(B,D)
ON(C,A) ∧ ON(B,D) ∧ OTAD
Check whether CLEAR(A) is true. It is not.
The only operator that could makes true is UNSTACK(B,A). So apply it to goal stack UNSTACK(B,A) HOLDING(C) CLEAR(A) ∧ HOLDING(C) STACK(C,A) ON(B,D) ∧ ON(C,A) ON(B,D) ∧ OTAD
Set of preconditions should be satisfied when you are applying UNSTACK(B,A) operator
are ON(B, A) ∧CLEAR(B) ∧ARMEMPTY
So goal stack is ON(B, A) CLEAR(B) ARMEMPTY ON(B, A) ∧CLEAR(B) ∧ARMEMPTY UNSTACK(B,A) HOLDING(C)
Compare the top element of the Goal stack ON(B,A) is satisfied. We see that it is satisfied. So pop it off.
Consider the next goal CLEAR(B), it is also satisfied. So pop it off.
Consider the next goal ARMEMPTY, it is also satisfied. So pop it off.
Now apply top element of goal stack, UNSTACK(B,A) operator and pop it off.
The DATABASE corresponding to the world modal at this point ONTABLE(A) ∧ ONTABLE(C) ∧ ONTABLE(D) ∧HOLDING(B) ∧ CLEAR(A)
Goal Stack now is, HOLDING(C) CLEAR(A) HOLDING(C)∧ STACK(C,A) ON(B,D) ON(C,A) ON(B,D) OTAD
So preconditions for PICKUP(C) is ONTABLE(C) CLEAR(C) ARMEMPTY ONTABLE(C) ∧CLEAR(C) ∧ARMEMPTY PICKUP(C) CLEAR(A) ∧ HOLDING(C) STACK(C,A) ON(B,D) ON(C,A) ∧ ON(B,D) ∧ OTAD
The top element of the goal stack is ONTABLE(C) satisfied. The next element CLEAR(C) also satisfied . So pop them from goal stack
The next element ARMEMPTY is not satisfied since HOLDING(B) is true ARMEMPTY ONTABLE(C) ∧CLEAR(C) ∧ARMEMPTY PICKUP(C) CLEAR(A) ∧ HOLDING(C) STACK(C,A) ON(B,D) ON(C,A) ∧ ON(B,D) ∧ OTAD
There are two operators to make ARMEMPTY is true, STACK(B,x) and PUTDOWN(B)
which operator should we choose?
If you look ahead in the goal stack the block B onto D
So we choose to apply STACK(B,D) by binding D to x.