Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

November 2023

FACULTY OF ENGINEERING

Third Year Examination for the Degrees of

Bachelor of Science and Master of Engineering

COMS30013 ***SAMPLE ANSWERS 1***

ARTIFICIAL INTELLIGENCE

Units Examined - COMS30013 & COMS30072

Part I - Answer all 15 questions. Each question is worth 1 Mark.

1.   Which one of the following is a well-formed Prolog term?

A. _r(_a)

B.  R(a,B)

C.  r_(a_)

D. R'

2.   What is the standard logical interpretation of the Prolog operator ";"?

A.  OR

B.  XOR

C.  IF

D.  AND

3.   Which one of the following is a unifier of the Prolog terms p(W,f(W,X)) and p(Y,f(a,Z))?

A.  { W/a }

B.   { W/Y , Y/a, Z/X }

C.  { W/a, Y/a, X/V, Z/V }

D.  { }

4.   If (x,y) are the coordinates of an agent in a modified GridWorld where agents can move one square at a time up, down, left, right OR diagonally, which one of the following is an admissible heuristic for the length of the shortest path back to the origin (0,0)?

A.  (x*x) + (y*y)

B.  x+y

C.  x*y

D.  x

5.   Which one of the following statements is FALSE?

A.  A* will never return a worse solution than breadth-first search

B.  breadth-first search will never visit more nodes than A*

C.  breadth-first search will never return a worse solution than depth-first search

D.  depth-first search may visit fewer nodes than A*

6.   During the execution of a simulated annealing algorithm, the temperature:

A.  increases with time

B.  decreases with time

C.  increases with fitness

D.  decreases with fitness

7.   What is an “allele”?

A.  A value taken by a gene

B.  A loci

C.  A chromosome

D.  A genotype

8.   Which of the following examples are major evolutionary transitions?

A.  Unicellular to Multi-cellular Creatures

B.  Asexual to Sexual Creatures

C.  Solitary Individuals to Social Colonies

D.  All of the above

9.   The fitness score assigned to individual I in generation G of a GA's execution is X before fitness sharing is applied but becomes Y afterwards. If Y

A.  Other individuals in G are similar to I

B.  I is suboptimal

C.  Fitness sharing must have reduced the fitness score of other individuals in G

D.  Both A and C

10. Which of the following operations in a genetic algorithm always introduce stochasticity:

A.  Mutation and Selection

B.  Crossover and Selection

C.  Crossover and Mutation

D.  Mutation and Elitism

11. Proactive agents anticipate changes in the environment.

A.  TRUE

B.  FALSE

12. Consider a smart home as an agent. The smart home agent is programmed to switch off the lights in a room when the room's occupants leave the room. The behaviour that the smart agent exhibits is an example of areactive behaviour.

A.  TRUE

B.  FALSE

13. In a norm lifecycle, which of these is anon-terminal state?

A.  Violated

B.  Satisfied

C.  Expired

D.  Conditional

14. Which of these statements about the environment and environmental properties is FALSE?

A. The environment in a chess game is deterministic

B. For a card game in which each player draws one card in each round and the player drawing the highest card is declared the winner of the round, the environment is episodic

C. The environment through which a space probe travels is dynamic

D. None of the above (i.e. A, B and C are all true statements)

15. The government’s Christmas guidance for university students includes the following statement: “Universities should move learning online by 9 December so students can continue their education while also having the option to return home to study from there.”

Provide a normative representation (norm type, subject, object, antecedent, consequent) for the above-mentioned Christmas guidance statement.

A.  Authorization(Government, University, CurrentDate > 9 Dec 2020, Move-Learning-Online)

B.  Commitment(University, Student, True, Move-Learning-Online)

C.  Commitment(Student, University, CurrentDate > 9 Dec 2020, Move-Learning-Online)

D.  Commitment(University, Student, CurrentDate > 9 Dec 2020, Move-Learning-Online)

Part II - Answer TWO of the three questions. Each is worth 15 Marks.

II.1 Logic Programming

You are given the following Prolog program, which aims to characterise the parity of natural numbers represented in Peano notation - where successive   integers are denoted by the terms 0, s(0), s(s(0)), s(s(s(0))), … .

The program consists of one fact (stating that the number zero is even) and    two rules (one stating the double-successor of any even number is also even; and another stating that a number is odd is it is not even) :

even(0).

even(s(s(N))) :- even(N).

odd(N) :- \+ even(N).

a) Draw an SLD tree for the query ?-odd(s(0)).  This query asks Prolog to verify that the number one is odd. You  should assume the default Prolog search strategy and the standard "cut-fail" definition of negation as failure.  Clearly state whether the query succeeds or fails. [3 marks]

b) Translate the above program into a well-formed formula First-Order Logic (FOL) in which each Prolog symbol is replaced by its closest classical counterpart (make sure your formula is correctly quantified and parenthesised, if necessary). [3 marks]

c) By reasoning about the structure of the possible SLD trees that result when the predicate odd/1 is called with ground and variable arguments, respectively, highlight any potential pitfalls that users should be aware of when calling this predicate.

d) Write down an alternative definition of odd/1 whose behaviour is always intuitively correct (irrespective of whether its argument is an input or an output). [1 mark]

II.2 Genetic Algorithms

Gary is interested in evolving images using a genetic algorithm. Each image is a  50-by-50 grid of coloured pixels. Each genotype is a one-dimensional array of N alleles that each explicitly specify one Red-Green-Blue colour component of one pixel. The colour of one pixel is defined by three consecutive alleles on the genotype, specifying the red, green, and blue components of the pixel's colour,  respectively. Each allele can take a floating point value in the legal range [0,1]. The first three alleles in the genotype define the colour of the top-left pixel, the next three alleles define the colour of the pixel immediately to the right of this   first pixel. The final triple of alleles defines the colour of the bottom-right pixel in the image.

a) If each allele can take one of 2^16 different values between 0 and 1, how many different images does the search space contain? [1 mark]

b) Gary implements mutation in the following way. Each allele in the genotype of a new offspring image has independent probability m of being mutated.

When an allele is mutated, the parental value is perturbed by adding a value   drawn uniformly at random from the range [-0.1, +0.1]. If the new, perturbed value is outside the legal range of [0,1] it is truncated to the nearest legal value.

When Gary runs his genetic algorithm, he is interested to see that images with  bright bold colours tend to be evolved. Explain how his mutation operator may be contributing to this result. [4 marks]

c) Gary is thinking of implementing sexual recombination. He wants to combine  two high fitness parental images to create an offspring. He has considered one- point crossover at a randomly selected position on the genotype, but he isn't convinced that this will be a good choice. Define a simple crossover operator that will take two parental genotypes and create a single offspring genotype.  The offspring genotype should comprise a rectangular section of one parent   replacing the equivalent part of the image provided by the second parent. [4 marks]

d) Gary is a little disappointed with the results generated by his genetic

algorithm. The images in the population tend to be quite similar and it takes a longtime to discover interesting images. Gary has been told by Sue that his    "direct genotype-phenotype mapping might be too simplistic", but he has not  come across this idea before. Help Gary to understand the concept of a genotype-phenotype mapping and explain how a less direct mapping could allow evolution to generate more diverse images more quickly. [6 marks]

II.3 Multi-Agent Systems

Consider a case in which two students (Grace and Judy) live together in a

rented house. They need to agree on which Internet service to sign up for from their local cable company (Example Media Co.). Grace will sign the contract   with the cable company and pay for the service but she would like to also sign a side contract with Judy in which Judy agrees to pay her share.

a) List and describe the social norms needed to characterize the interactions in this setting. Use the commitment-based notation to define the identified norms. [6 marks]

b) Describe a scenario in which one of these norms is violated. State the relevant event sequence using the notation from your answer to part (a) above. Who is accountable for this norm violation? [3 marks]

c) Grace and Judy graduate. Grace (who signed the contract with the cable

company) leaves the city. Judy finds a job in the same city and continues to stay in the same rented house. Judy takes over the contract with Example

Media Co. from Grace. Olivia and Alice join Judy as her new housemates.  Olivia and Alice sign side contracts with Judy to pay their shares of the cost for the Internet service.

Refine the initial normative specification and produce the new normative specification for the new setting. You should describe the required commitment changes and then use (some of) the ASSIGN, CANCEL,

CREATE, DECLARE, DELEGATE and RELEASE commitment operations to define the required refinement process. [6 marks]

Hint: The new normative specification can be captured by three commitments: (1) between Judy and Example Media Co., (2) between Judy and Olivia, and    (3) between Judy and Alice.