Você está na página 1de 6

Q1

Ans. i) Traveling Salesman Problem

Travelling salesman problem : Start at A, visit all cities, return to A. Links show cost of each trip (distance, money).
Find trip with minimum cost.
Solution is a path. e.g. [A,D,C,B,E,A]

Representing Travelling salesman problem as state-space problem. Given n cities, (n-1) choices for 1st stop, (n-2)
choices for next stop, etc. (Assume don't, or not allowed, visit same city twice.)
(n-1)! Paths. With many cities or nodes this soon becomes intractable.

(i) Water-Jug Problem

Example: The water jugs problem:

Given: 2 jugs:
Problem: fill the 4 l jug with 2 l of water.
Representation:
 a state:
[content of large jug, content of small jug]
 initial state:
[ 0, 0 ]
 goal state:
[ 2, x ]
(ii) Human Cannibal River-Crossing Problem
• The puzzle presents a farmer who has to transport a goat, a wolf, and some cabbages across a river in a boat
that will only hold the farmer and one of the cargo items.
– In this scenario, the cabbages will be eaten by the goat, and the goat will be eaten by the wolf, if left
together unattended.
• Solutions to river-crossing puzzles usually involve multiple trips with certain items brought back and forth
between the riverbanks.

wolf goat
cabbage
farmer

(0,0,0,0)
• Goal test: reached state (0,0,0,0).
• Path cost: number of crossings made.
• States: a state is composed of four numbers representing the number of goats, wolfs, cabbages, boat trips. At
the start state there is (1,1,1,1)
• Operators: from each state the possible operators are: move wolf, move cabbages, move goat. In total, there
are 4 operators. (also, farmer himself).
Missionaries and Cannibals
There are 3 missionaries, 3 cannibals, and 1 boat that can carry up to two people on one side of a river.
• Goal: Move all the missionaries and cannibals across the river.
• Constraint: Missionaries can never be outnumbered by cannibals on either side of river, or else the
missionaries are killed.
• State: configuration of missionaries and cannibals and boat on each side of river.
• Operators: Move boat containing some set of occupants across the river (in either direction) to the other side.

Q2
Ans. The hypotheses states:
"A physical symbol system has the necessary and sufficient means for intelligent action."
A physical symbol system "consists of a set of entities, called symbols, which are physical patterns that can occur as
components of another type of entity called an expression (or symbol structure). Thus, a symbol structure is composed
of a number of instances (or tokens) of symbols related in some physical way (such as one token being next to
another). At any instant of time the system will contain a collection of these symbol structures. Besides these
structures, the system also contains a collection of processes that operate on expressions to produce other expressions:
processes of creation, modification, reproduction and destruction. A physical symbol system is a machine that
produces through time an evolving collection of symbol structures. Such a system exists in a world of objects wider
than just these symbolic expressions themselves."
"Two notions are central to this structure of expressions, symbols, and objects: designation and interpretation."
"Designation. An expression designates an object if, given the expression, the system can either affect the object itself
or behave in ways dependent on the object. ... In either case, access to the object via the expression has been obtained,
which is the essence of designation."
"Interpretation. The system can interpret an expression if the expression designates a process and if, given the
expression, the system can carry out the process. ...Interpretation implies a special form of dependent action: given an
expression the system can perform the indicated process, which is to say, it can evoke and execute its own processes
from expressions that designate them."
"Additional requirements involve completeness and closure. (1) A symbol may be used to designate any expression
whatsoever. That is, given a symbol, it is not prescribed a priori what expressions it can designate. This arbitrariness
pertains only to symbols; the symbol tokens and their mutual relations determine what object is designated by a
complex expression. (2) There exist expressions that designate every process of which the machine is capable. (3)
There exist processes for creating any expression and for modifying any expression in arbitrary ways. (4) Expressions
are stable; once created they will continue to exist until explicitly modified or deleted. (5) The number of expressions
that the system can hold is essentially unbounded."

Q3
(i) (setq X ’(B C)): binds x to (B C) and returns (B C)

(ii) (defun foo (x)


(setq x (+ x 7))
(+ x 5))

Sol: returns x+7+5 because in the first step of function definition setq binds x to x+7 and in the second step, it returns
x+5 with new value of x.

(iii) (mapcar #’not (nil nil t nil t))


Sol: nil

(iv) (reverse ’((a b c) d e))


Sol: (e d (a b c))

Q4a:Complete game tree for a two player game

+1 ( 1,4)

+1 (2,4)
+1 (2,3)

(4,3) (1,3) -
+1 1

-
1 (1,2) (1,4) ?
(3,2)
-
1

-1
(3,1) (3,4) ?

(2,4) ?

Q4 b.
The “?” values are handled by assuming that an agent with a choice between winning the
game and entering a ? state mark will always choose a win . That is min (-1 ?) is -1 and max
(+1,?) is +1. If all successors are “?” , then the backed up value is “?”.

Q5 Ans:
5(iv) is true
5(v) is false
5(vi) is true
5(vii) is false
5(x) is true

Q6. Write a LISP function that converts temperature in Centigrade to equivalent temperature in Fahrenheit.
(defun convert ()
(format t "Enter Fahrenheit ")
(let ((fahr (read)))
(format t "Celsius is <126>D"
(truncate (*(-fahr 32)
(/ 5 9))))))

Q7 a) Discuss briefly limitations of an Expert System.


1. Difficulty in capturing deep knowledge of the problem domain
2. Lack of robustness and flexibility. If human are presented with a problem instance that they cannot solve
immediately, they can generally return ato an examination of first principles and come up with some strategy for (1,4)
attacking the problem. Expert systems generally lack this ability.
3. Inability to provide deep explanation: because expert systems lack deep knowledge of their problem domains, their
explanations are generally restricted to a description of the steps they look in finding a solution. They cannot tell why
a certain approach was taken
4. Difficulties in verification: Though the correctness of any large computer system is difficult to prove, expert
systems are particularly difficult to verify. This is a serious problem, as expert system technology is being applied to
critical applications such as air traffic control, nuclear reactor operations, and weapon systems.
5. Little learning from experience: Current expert systems are handcrafted; once the system is completed, its
performance will not improve without further attention from its programmers.

Q 7 b)
Zakir:
Sub-class : Professor
Subject : Mathematics
Age : 52
University : Delhi University

Sakina:
Sub-class : Zakir
Relation : Wife

Yusuf:
Sub-class : Zakir
Relation : Son

Jamila:
Sub-class : Zakir
Relation : Daughter
Q8 Explain each of the following w.r.t. the discipline of AI
(i) Learning: Machine Learning is the study of how to build computer systems that adapt and improve with
experience. It is a subfield of Artificial Intelligence and intersects with cognitive science, information theory, and
probability theory, among others.
Classical AI deals mainly with deductive reasoning, learning represents inductive reasoning. Deductive reasoning
arrives at answers to queries relating to a particular situation starting from a set of general axioms, whereas inductive
reasoning arrives at general axioms from a set of particular instances.
Classical AI often suffers from the knowledge acquisition problem in real life applications where obtaining and
updating the knowledge base is costly and prone to errors. Machine learning serves to solve the knowledge acquisition
bottleneck by obtaining the result from data by induction.
(ii) Understanding: Understanding a fact means the ability to grab the actual meaning of the fact or the problem.
Understanding is implicit in human beings. They are capable of understanding a fact or problem inspite of
ambiguities, incompleteness and inconsistencies in the statements. Understanding is important concept in artificial
intelligence as the aim of artificial intelligence is to make computers intelligent like human beings, so the ability of
understanding is to be inculcated in them.
(iii) The Turing Test : Consider the following setting. There are two rooms, A and B. One of the rooms contains a
computer. The other contains a human. The interrogator is outside and does not know which one is a computer. He
can ask questions through a teletype and receives answers from both A and B. The interrogator needs to identify
whether A or B are humans. To pass the Turing test, the machine has to fool the interrogator into believing that it is
human.
iv) Uncertainty: Uncertainty is a fundamental and unavoidable feature of daily life; in order to deal with uncertainly
intelligently, we need to be able to represent it and reason about it. Natural language abounds with vague and
imprecise concepts, such as “Sally is tall," or "It is very hot today." Such statements are difficult to translate into more
precise language without losing some of their semantic value: for example, the statement "Sally's height is 152 cm."
does not explicitly state that she is tall, and the statement "Sally's height is 1.2 standard deviations about the mean
height for women of her age in her culture" is fraught with difficulties: would a woman 1.1999999 standard deviations
above the mean be tall? Which culture does Sally belong to, and how is membership in it defined? The solution to
tacked uncertainty is to use fuzzy logic. Fuzzy systems are an alternative to traditional notions of set membership and
logic that has its origins in ancient Greek philosophy, and applications at the leading edge of Artificial Intelligence.
v) A.I. problem: Artificial intelligence (AI) is a branch of computer science that studies the computational
requirements for tasks such as perception, reasoning, and learning, and develops systems to perform those tasks. AI is
a diverse field whose researchers address a wide range of problems, use a variety of methods, and pursue a spectrum
of scientific goals."
vi) Combinatorial explosion: An increase in coding complexity, combining with other game elements to produce
even greater complexity. A significant problem for designers, who must choose whether to restrict combinations
somehow, use simultaionrules to accomodate unforseen combinations, or simplify.
For instance, if a game includes four kinds of weather that are reflected in room descriptions, the author will have to
write four descriptions for every room. If the game also includes four times of day which change independently of
weather, he might end up facing sixteen descriptions per room.
Often the result of a designer adding new verbs or objects to a game; as the number of commands and objects
increases, so does the number of actions that a player should reasonably be allowed to try. For example, if a designer
creates one puzzle that involves burning an object, it will naturally lead players to try burning other objects despite the
context (underwater, while holding flammable substances, etc.). This will require the designer to do one of two things:
• implement how fire interacts with every object in the game world
• come up with a plausible in-game reason to prevent the PC from using fire without damaging the mimesis
Also known as the combinatorial factor problem.

Q9 (a)Write a LISP function that finds the factorial of a given natural number
fact (1) = 1 (the stopping/termination condition)
fact (n) = n*fact (n-1) (the recursive step)
In LISP, the above function is expressed as

? (defun fact (n)


( cond
(
( ( = n 1) 1 )
( t ( * n fact ( – n 1)))))
)
FACT
? ( fact 5 )

(b) Write a LISP function that counts the number of atoms in a list.
Ans.
COUNT-ATOMS
Define function that counts the atoms in a list (at all levels)
> (defun count-atoms(L)
(cond ((null l) 0)
((atom l) 1)
(t (+ (count-atoms (car l))
(count-atoms (cdr l))))))
COUNT-ATOMS

> (count-atoms '(a b c))


3
> (count-atoms '(a (b c)))
3
> (count-atoms '(((a))))
1

Você também pode gostar