Docsity

Midterm Examination Questions - Artificial Intelligence Programming | CS 662, Exams of Computer Science

Toggle sidebar
bg1
Name:
CS 662 Sample Midterm
1 True/False, plus corrections
35 pts, 5 pts each
Each of the following statements is either true or false. If it is true, mark it true. If it is false, correct
the statement so that it is true. Note: Adding “not” or otherwise negating the sentence is not acceptable.
You must change the facts in the sentence if it is false. For example:
Question: The Turing Test is a test of whether a computer program is rational.
Bad answer, no credit: The Turing Test is not a test of whether a computer program is rational.
Good answer: The Turing Test is a test of whether a computer program is indistinguishable from a
human.
•A stochastic environment is one in which an action may have more than one result.
•A chart parser is more efficient than a top-down parser because it never backtracks.
•A rational agent is an agent that does what a human would do in any situation.
•A toy problem is a problem used to illustrate or study the performance of an algorithm.
•A complete algorithm is one that always finds all possible solutions to a problem.
•A corpus is something that a vampire eats.
pf3
pf4
pf5

Partial preview of the text

Download Midterm Examination Questions - Artificial Intelligence Programming | CS 662 and more Exams Computer Science in PDF only on Docsity!

Name:

CS 662 Sample Midterm

1 True/False, plus corrections

35 pts, 5 pts each

Each of the following statements is either true or false. If it is true, mark it true. If it is false, correct the statement so that it is true. Note: Adding “not” or otherwise negating the sentence is not acceptable. You must change the facts in the sentence if it is false. For example: Question: The Turing Test is a test of whether a computer program is rational. Bad answer, no credit: The Turing Test is not a test of whether a computer program is rational. Good answer: The Turing Test is a test of whether a computer program is indistinguishable from a human.

  • A stochastic environment is one in which an action may have more than one result.
  • A chart parser is more efficient than a top-down parser because it never backtracks.
  • A rational agent is an agent that does what a human would do in any situation.
  • A toy problem is a problem used to illustrate or study the performance of an algorithm.
  • A complete algorithm is one that always finds all possible solutions to a problem.
  • A corpus is something that a vampire eats.
  • A Goal-based agent selects actions that are likely to maximize its utility.

2 Agents and environments

a. 24 pts, 6 pts each

For each of the following agents and environments, characterize the environment according to the six properties used in R & N (static vs dynamic, discrete vs. continuous, fully vs. partially observable, deter- ministic vs stochastic, episodic vs. sequential, single-agent vs. multi-agent). If necessary, you may want to give a brief justification of your answers.

  • The game of checkers.
  • An autopilot that successfully lands a plane.
  • An handwriting recognition agent that reads the addresses on envelopes and places each of them in the appropriate mailbox.
  • A music-playing accompanist agent that can play along with a human piano player.

b. 6 pts

Consider the following problem: We want to build an agent that can play word games. For our first task, we would like to build an agent that can recognize palindromes. (A palindrome is a word or phrase that reads the same backwards as forwards excpeting punctuation, such as “Anna” or “Madam, I’m Adam”, or “A man, a plan, a canal - Panama!”)

Assume that our agent receives its input one letter at a time. That is, at time t=0 it sees ’a’, and and time t=1 it sees ’n’, and so on. Once the string is seen completely, the agent must output ’yes’ or ’no’.

b) 18 points - 6 points for each search

Trace BFS, DFS, and A* on the following graph. Uninformed search methods should expand nodes from left-to-right. (B should be visited before C.) Both g1 and g2 are goal states; your algorithm may stop as soon as either is expanded. Show the order in which nodes are visited. For A, also show the f,g, and h costs for each node visited. For A, the costs for each edge are indicated next to the edge, and the heuristic costs for each state are in parentheses next to the state.

A

B C

D E

F

G

H G

4 Heuristics

a. 4 pts

Consider the Tower of Hanoi problem. There are three towers, with N disks of increasing size stacked on the leftmost tower. The problem is to move the disks from the left-hand to the right-hand tower, with the constraint that a larger disk can never be placed on top of a smaller disk.

To begin, let h be the number of disks that still need to be moved. Is this heuristic admissible? If so, prove it. If not, provide a counterexample.

b. 6 pts

Next, consider the following heuristic: Number the disks according to size, where 1 is the smallest disk and n is the number of the largest disk. h is the sum of the numbers of each misplaced disk.

Which heuristic should be used? Justify your answer with a precise technical argument, using the appropriate terminology.

5 pts

c. Use an admissibility argument to show that uniform cost search is optimal.

6 NLP

Consider the following grammar and lexicon:

S -> NP VP | S -> S Conj S NP -> Noun | Article Noun VP -> Verb | Verb Adj | Verb Adv | Verb PP PP -> Prep | NP Noun -> cat | dog | fish Article -> a | the Verb -> sleeps | is | runs Adj -> happy | sad Conj -> and | but Prep -> with Adv -> quietly

For each of the following sentences, show the parse tree. If the sentence cannot be represented by this grammar, write “incorrect.”

  1. The cat is sitting
  2. A fish sleeps quietly but a dog runs with a cat
  3. A dog is happy with a fish
  4. A fish runs with a dog and a cat is happy
  5. the dog sleeps quietly