
Logic Programming and Artificial Intelligence
18 January 2010
LPA Problem Sheet 1
Due: 10:15, 27 January
Note: Questions 1 and 2 are based on material taught prior to LPA.
1. [18 marks] A colouring of a graph is an assignment of a colour to each node of the
graph such that no edge of the graph connects two nodes of the same colour. if kis a
positive integer then a k-colouring of a graph is a colouring that uses no more than k
different colours. The graph-colouring problem is: given a graph and a positive integer,
determine whether the graph has a k-colouring.
(a) [12 marks] Give an algorithm that solves the graph-colouring problem. Your algo-
rithm need not be efficient, but it must be correct.
(b) [3 marks] What is the asymptotic time complexity of your algorithm?
(c) [3 marks] Could there exist a polynomial-time algorithm to solve the graph-colouring
problem. Justify your answer.
2. [4 marks] Show that the following sentence of propositional logic is a tautology.
((lāe)ā§(nāu)) ā((lāu)āØ(nāe))
3. [8 marks] (From Exercises 2.5 and 2.6 of Artificial Intelligence: A Modern Approach.)
Consider a robot soccer player agent.
(a) [4 marks] For this agent develop a PEAS description of the task environment.
(b) [4 marks] Characterise the environment of this agent according to the properties
given in Sec 2.3 of the book.
4. [2 marks] Where did Stuart Russell do his first degree and what subject did he study.
5. [challenge problem] A fundamental problem of computer science is to show that a given
algorithm is guaranteed to terminate. Interestingly, this problem often boils down to
the somewhat surprising fact that the following process is guaranteed to terminate. And
this is your challenge: to show that this process is guaranteed to terminate.
Start with a sack containing any finite number of balls, each of which is labelled with a
positive integer. Repeatedly select any ball from the sack. If the selected ball is labelled
ā1ā then simply remove it from the sack. Otherwise, remove the selected ball from the
sack and replace it with any finite number of balls, each of which is labelled with a
number strictly less then that on the selected ball. Stop when the sack is empty.
1