



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




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.
True.
False. A Chart parser is more efficient because it caches partial solutions in a chart, thereby avoiding re-expending portions of the search tree.
False. A rational agent selects actions that maximize expected performance measure.
True.
False. A complete algorithm is guaranteed to find a solution if one exists.
False. A corpus is a collection of documents used to create a language model.
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.
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’.
Can a reflex agent solve this problem? If so, provide pseudocode for how such an agent might work. (You may use the back of the page if needed.) If not, explain precisely why it cannot solve this problem. No -
a reflex agent has no memory. Recognizing a palindrome requires memorizing past characters to ensure that a particular pattern has been seen.
For our second task, we want to build an agent that can find anagrams. That is, rearrangements of a phrase that are also a phrase. For example, “scab” can be rearranged to “cabs”, and “artificial intelligence” can be rearranged to make (among other things): “Intergalactic lie? Fie! Nil!” (punctuation added).
Let’s assume that we want to build a goal-based agent that will use search to find an anagram for an arbirtary input phrase. Your task in this problem will be to formulate the problem precisely enough so that it can be implemented. In grading this, I’ll ask two questions. 1) Is the answer correct? 2) Could I write a program from this answer without any additional information?
An input string, and an empty output string.
look up each word in a dictionary. If all letters are used and all words are in the dictionary, the goal is reached.
For a given index i, return n-i new strings with the letters at positions i and n-i exchanged.
Assume that the search tree has a branching factor of b, the solution is at depth d, and the tree has a maximum depth of n.
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. Yes. Moving h disks requires 2 h^ − 1 moves. This is larger
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. h2 dominates h1, so it should be used. (I’ll leave the proof as an
know that A* is optimal if it uses an admissible heuristic, which is a heuristic that always underestimates the distance to the goal. Uniform-cost search uses only path cost, and so the heuristic is always 0, which is less than or equal to the true cost.
Consider a corpus of 10 documents that consists entirely of the following words and document frequencies:
cat: 8 dig : 5 fish : 3 snail : 1 puppy: 10 artichoke: 2 kangaroo: 3
Suppose we have the following documents: d1: cat snail cat cat puppy kangaroo d2: fish fish cat kangaroo puppy snail a) For each word in d1 and d2, indicate their TFIDF scores. : d1: cat: 3 * log(10/8) = 0.96, snail: 1 * log(10/1) = 3.32, puppy: 1 * log(10/10) = 0, kangaroo: 1 * log(10/3) = 1. d2: fish: 2 * log(10/3) = 3.47, cat: 1 * log(10/8) = 0.32, kangaroo: 1 * log(10/3) = 1.74, puppy: 1 * log(10/10) = 0, snail: 1 * log(10/1) = 3.
b) What is the cosine similarity between d1 and d2? numerator: 0.96 * 0.32 + 3.32 * 3.32 + 1.74 * 1.74 = 14. Denominator: 3.87 * 5.18 = 20. sim: 0.