LMU ☀️ CMSI 3300
ARTIFICIAL INTELLIGENCE
Final Exam

The test is open-everything with the sole limitation that you neither solicit nor give help while the exam is in progress.

  1. Write a set of constraints that describe a solution to the n-queens problem. As a CSP, why are algorithms based on an incremental formulation generally much, much, much, worse than a complete-state formulation?
  2. Show, by resolution, that

    {~p ⇒ r, q ∨ s, ~(p ∧ q), r ⇒ ~s, p ∨ s} ⊨ ~(q ∨ r)

  3. Convert to CNF

    ∃x ∀y P(x, y) ⇒ ∀y ∃x P(x,y)

  4. Write sentences in a first-order knowledge representation language that would allow one to calculate the price of a bag of items given the price per kilo for that kind of item.
  5. Given the following joint probability distribution

     a~a
    b~bb~b
    c.43.15.1.04
    ~c.02.09.11.06

    Compute

    1. P(a)
    2. P(C)
    3. P(A | c)
    4. P(C | a∨~b)

    Be careful to note the difference between bold and non-bold P.

  6. Do parts (a) through (c) of Problem 6 on http://www.cs.berkeley.edu/~russell/classes/cs188/f05/oldexams/fe-f05.pdf.
  7. For the following grammar, intended to capture a part of English, with the syntax categories defined as in text, give three sentences of bad English generated by the grammar and three valid sentences of English that cannot be captured. Use a reasonable lexicon.
        S -> NP VP
        S -> S Conjunction S
        NP -> Pronoun
        NP -> Article NP
        VP -> Verb Adv
        Adv -> Adv Adv
        Adv -> PP
        PP -> Prep NP
        NP -> Noun
        NP -> NP RelClause
        RelClause -> (that|which|who) VP
    
  8. Write functions (or methods) in Perl, Python, Java, C, Ruby, or ML for:
    1. The Gaussian function of two variables
    2. The convolution of two two-dimensional functions
  9. A robot has a sensor that can see through walls, but it cannot travel through them. It needs to move from its current location to a destination location, and guess what? The environment is discrete, because you are taking a test! The robot moves in the following 10x10 grid, where column 4 is "one way" going up:

    robotenv.png

    The robot can only move horizontally and vertically from (x,y) to (x',y') where each coordinate is an integer in the range 0..9 inclusive. The robot starts at (1,0) and wants to end at (2,9).

    1. How many valid states are there in the state space?
    2. How many actions?
    3. How many legal actions are there from state (3,5)?
    4. How many distinct paths are there from start to finish that do not repeat locations?
    5. Assuming the Manhattan distance heuristic, give the first 20 nodes of the search tree produced by running A*.
  10. In the previous problem,
    1. Would you use IDA* or A* or BFS or DFID for this problem?
    2. Now imagine the robot lost its x-ray vision, but it retained its GPS system and obtained a bump sensor. Describe the agent function of a rational agent that can move through this space.
    3. If the robot could move diagonally, draw the shortest path from start to finish. How many actions are in that path?
    4. Now imagine the environment is continuous. Draw the Vornoi diagram for the environment.