Docsity

Logic Programming and Artifical Intelligence, Lecture Notes - Computer Science 1, Study notes of Computer Numerical Control

Toggle sidebar
bg1
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

Partial preview of the text

Download Logic Programming and Artifical Intelligence, Lecture Notes - Computer Science 1 and more Study notes Computer Numerical Control in PDF only on Docsity!

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 k is 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.

  1. [4 marks] Show that the following sentence of propositional logic is a tautology. ((l ⇒ e) ∧ (n ⇒ u)) ⇒ ((l ⇒ u) ∨ (n ⇒ e))
  2. [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.

  1. [2 marks] Where did Stuart Russell do his first degree and what subject did he study.
  2. [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.