Professional Documents
Culture Documents
Elaborate Artificial Intelligence
Elaborate Artificial Intelligence
75431 Page 1 of 8
2. Attempt any three of the following: 15
a. Write the procedure for tree search.
function Tree-Search(problem,strategy) returns a solution,or failure initialize the search tree using
the initial state of problem
loop do
if there are no candidates for expansion then return failure
choose a leaf node for expansion according to strategy
if the node contains a goal state then return the corresponding solution
else expand the node and add the resulting nodes to the search tree
end
b. Explain the algorithm for breadth first search algorithm.
1. Create a variable called NODE-LIST and set it to initial state.
2. Until a goal state is found or NODE-LIST is empty do:
a. Remove the first element from NODE-LIST and call it E. if NODE-LIST was empty,
quit.
b. For each way that each rule can match the state described in E do:
i. Apply the rule to generate a new state.
ii. If the new state is goal state, quit and return this state.
iii. Otherwise, add the new state to the end of NODE-LIST.
75431 Page 3 of 8
b. Give the outline of min-max algorithm.
The minimax algorithm computes the minimax decision from the current state. It uses a simple
recursive computation of the minimax values of each successor state, directly implementing the
defining equations. The recursion proceeds all the way down to the leaves of the tree, and then
the minimax values are backed up through the tree as the recursion unwinds.
75431 Page 4 of 8
d. What is knowledge based agent? Explain its role and importance.
The central component of a knowledge-based agent is its knowledge base, or KB. A knowl edge
base is a set of sentences. Each sentence is expressed in a language called a knowledge
representation language and represents some assertion about the world, Sometimes we dignify a
sentence with the name axiom, when the sentence is taken as given without being derived from
other sentences. A knowledge-based agent can be built simply by TELLing it what it needs to
know. Starting with an empty knowledge base, the agent designer can TELL sentences one by
one until the agent knows how to operate in its environment.
e. Write a note on Wumpus world problem.
Wumpus agent exploring the environment shown in Figure. The first percept is :None, None,
None, None, None], from which the agent can conclude that its neighboring squares, [1,2] and
[2,1], are free of dangers—they are OK. Fig. shows the agent's state of knowledge at this point.
A cautious agent will move only into a square that it knows to be OK. Let us suppose the agent
decides to move forward to [2,1]. The agent perceives a breeze (denoted by "B") in [2,1], so
there must be a pit in a neighboring square. The pit cannot be in [1,1], by the rules of the game,
so there must be a pit in [2,2] or [3,1] or both. The notation "PT' in Figure indicates a possible
pit in those squares. At this point, there is only one known square that is OK and that has not
yet been visited. So the prudent agent will turn around, go back to [1,1], and then proceed to
[1,2].
f. Give the outline of resolution algorithm.
In resolution algorithm. First, (KB A -,a) is converted into CNF. Then, the resolution rule is
applied to the resulting clauses. Each pair that contains complementary literals is resolved to
produce a new clause, which is added to the set if it is not already present. The process continues
until one of two things happens: ■ there are no new clauses that can be added, in which case KB
does not entail a; or, ■ two clauses resolve to yield the empty clause, in which case KB entails a.
function PL-REsoLuTioN(KB, a) returns true or false
inputs: KB. the knowledge base, a sentence in propositional logic
a:, the query, a sentence in propositional logic clauses 4— the set of clauses in the CNF
representation of KB A -,cr new i }
loop do
for each pair of clauses C
in clauses do resolvents — PL-RESOLVE(Ci,Ci)
if resolvents contains the empty clause then return true new — new U resolvents
if new C clauses then return false clauses 4— clauses U new
75431 Page 5 of 8
4. Attempt any three of the following: 15
a What are predicates? Explain its syntax and semantics.
• First-order logic is used to model the world in terms of
– objects which are things with individual identities
e.g., individual students, lecturers, companies, cars ...
– properties of objects that distinguish them from other objects
e.g., mortal, blue, oval, even, large, ...
– classes of objects (often defined by properties)
e.g., human, mammal, machine, ...
– relations that hold among objects
e.g., brother of, bigger than, outside, part of, has color, occurs after, owns, a member of,
...
– functions which are a subset of the relations in which there is only one ``value''
for any given ``input''.
e.g., father of, best friend, second half.
• Predicates: P(x[1], ..., x[n])
– P: predicate name; (x[1], ..., x[n]): argument list
– A special function with range = {T, F};
– Examples: human(x), /* x is a human */
father(x, y) /* x is the father of y */
– When all arguments of a predicate is assigned values (said to be instantiated), the
predicate becomes either true or false, i.e., it becomes a proposition. Ex.
Father(Fred, Joe)
A predicate, like a membership function.
b What are Quantifiers? Explain the types with syntax and example.
Quantifiers let us do this First-order logic contains two standard quantifiers, called universal and
existential.
- Universal quantification (for-all)
- Existential quantification (there-exist)
b. Explain block world problem for the following start state and end state.
75431 Page 7 of 8
convenient, but if we strip away the "human interface" issues, the underlying concepts—objects,
relations, quantification, and so on—are the same.
f. Write a note on Truth maintenance system.
One simple approach to truth maintenance is to keep track of the order in which sentences are
told to the knowledge base by numbering them from P1 to P. When the call RETRAcT(K/3, P)
is made, the system reverts to the state just before P was added, thereby removing both P, and
any inferences that were derived from P. The sentences Pi+i through P r, can then be added
again. This is simple, and it guarantees that the knowledge base will be consistent, but retracting
.13 7. requires retracting and reasserting n — i sentences as well as undoing and redoing all the
inferences drawn from those sentences.
_____________________________
75431 Page 8 of 8