Jeff Milloy 1. The syntax #' is used in a function call for each of the following except ___C___   A. in replace of the FUNCTION primitive B. to pass a function as a variable C. to stop evaluation of a list or object D. to create a procedure object out of a procedure name   2. The third parameter in the DOTIMES primitive is ___B___   A. the upper bound B. the result form that is evaluated at the end of function C. the lower bound D. the counting variable, or count parameter   3. The gaph-search ___D___   A. eliminates the infinite-path problem in a depth-first search by treating nodes at a certain depth as though they have no successors B. uses significantly less memory than a breadth first search C. can cause a finite tree to become infinite D. avoids repeated states in a depth-first search by detecting them and removing them from the search tree Jeff Milloy Divya Nettimi 1. What is a branching factor? (C) A. The number of legal states that can result from the action B. The maximum length of any path in the state space C. The maximum number of successors of any node D. The depth of the shallowest goal node 2. Which of the following is a correct procedure to count the number of elements in a list that are below 100? (D) A. (defun count-elements (my-list)         (let ((result 0)))              (dolist (element my-list result)                   (if (< element 100) (setf result (+ result 1))))) B. (defun count-elements (my-list)         (let ((result 0)))              (dolist (element result my-list)                   (if (< element 100) (setf result (+ result 1))))) C. (defun count-elements (my-list)         (let ((result 0))              (dolist (result my-list element)                   (if (< element 100) (setf result (+ result 1)))))) D. (defun count-elements (my-list)         (let ((result 0))              (dolist (element my-list result)                   (if (< element 100) (setf result (+ result 1)))))) 3. The predicate eql cannot be used if the argument values are   (C) A. atoms B. floating point numbers C. lists D. symbols 4. All of the following are characteristics of iterative deepening depth-first search except   (C) A. It is a combination of depth-first and breadth-first search. B. It finds the best depth limit. C. Its huge memory requirement is its disadvantage. D. It is optimal when the path cost is a nondecreasing function of the depth of the node. Divya Nettimi Austin Lin 1. What is the difference between the predicate EQUAL and the predicate, =? EQUAL determines if two argument values are the same expression while = determines if two argument values are the same number (A.). A. EQUAL determines if two argument values are the same expression while = determines if two argument values are the same number. B. EQUAL determines if two argument values are the same symbol while = determines if two argument values are the same expression. C. EQUAL determines if two argument values are the same symbol or number while = determines if two arguments are the same symbol. D. EQUAL determines if two argument values are the same symbol while = determines if the two argument values are the same symbol or number. 2.What is a problem generator? A problem generator proposes new actions that will lead to new experiences (B.). A. A problem generator looks for errors in performance. B. A problem generator proposes new actions that will lead to new experiences C. A problem generator is responsible for giving the agent feedback on how it is doing and what it should do to improve. D. A problem generator produces problems for the agent to solve. 3. Which of the following tests if an object is a nonumeric atom? symbolp (D.) A. atomp B. atom C. endp D. symbolp Austin Lin Alvin Li 1)  LISP- related question: The DOLIST primitive is most closely resembles which of the following in C++:   A) for loop B) while loop C) do loop D) nested for loop Ans: A   2) AI text related question: A hill-climbing search is also called a:   A) beam search B) greedy local search C) best-first search D) tree search Ans: B   3) LISP question: What is the difference between LOOP and DO? A) LOOP has a body and DO does not B) DO is evaluated over and over  C) LOOP has only a body D) DO has a body but LOOP does not Ans: C Alvin Li Mike Szlamowicz 1. Of the LISP predicates, which returns 'T' if two argument values are the same symbol or number? (B) A. equal B. eql C. eq D. = 2. What is an advantage of a depth-first search? (A) A. modest memory requirements B. avoidance of lockups C. speed D. assurance of completion 3. What does the following code evaluate to? (C) (setf alist '(1 2 3 4 5)) (let ((result 0)) (dolist (element alist result) (when (or (> element 4) (< element 2)) (setf result (+ result 2))))) A. 1 B. 2 C. 4 D. 8 Mike Szlamowicz 1.  Which of the following is the most efficient method (besides length) for finding the number of higher level elements in a list? B. (Ans) *   A. Tail-recursively *   B. Do-times loop *   C. Non-tail-recursively *   D. Do loop 2.  Which type of agent "thinks" about the consequences of its actions the best? D. (Ans) *   A. Simple reflex *   B. Model-based *   C. Goal-based *   D. Utility-based 3.  Which combination of properties corresponds to the task of creating a tic-tac-toe playing agent? C. (Ans) *   A. Fully Observable, single agent *   B. Partially Observable, single agent *   C. Fully Observable, multiagent *   D. Partially Observable, single agent Kevin Silas Question 1: Which of the following primitives would be easiest to use to find the factorial of a number? Answer: B A: Do B: Dotimes C: Dolist D: None of the above Question 2: Which of the following types of agents performs poorly when the environment is not fully observable? Answer: A A: Simple reflex agent B: Model-based reflex agent C: Goal-based agent D: Utility-based agent Question 3: Given the code: (if (> a b) (+ a b) nil) which of the following would be a shorter way to write it? Answer: A A: (when (> a b) (+ a b)) B: (when (> a b) nil) C: (unless (> a b) (+ a b)) D: (unless (> a b) nil) Matt Thompson 1.  Suppose, in a function, you used the setf command for the variable "theta" and set it to 45.  If you typed theta into the main command interface after running the program, the output would be:            a. ()            b. 45            c. NIL            d. theta 2.  Which of the following searches are considered to be complete?  Assume branching factor is finite.            I. Breadth-First            II. Depth-First            III. Depth-Limited            IV. Iterative Deepening                          a. I only                          b. II and III                          c. IV only                          d. I and IV 3.  If an agent cannot observe its surrounding environment, then the set of possible circumstances it has to consider as possibly being reality are the ______ of that agent.           a.  state           b.  belief state           c.  contingency           d.  internal state Chris Bengtson 1. Choose the best description for the following function written in LISP?     ; Assume arg is a list     (defun mystery (arg)     (if (null arg)           arg           (if (not (listp (first arg)))                    (append (list (first arg)) (mystery (rest arg)))                    (mystery (rest arg))))) ______ (B.) A. Returns a list which consists of only the lists in arg. B. Returns a list which consists of only the non-lists in arg. C.  An error occurs. D.  None of the above. 2.  As a human agent in real life, we decide to travel from one city to another.  However, there is no direct route from you're initial state to your goal state, and you must pass through multiple cities to reach your goal state.  What should step cost between cities so that you can determine the optimal solution? (choose the BEST answer) ______ (D.) A.  Each step should cost 1. B.  Each step should cost the distance between the two cities in a step. C.  Each step should cost the length of road traveled between the two cities in a step. D.  The cost of each step will vary based on a number of factors. 3.  Who defined the computer language LISP? ______ (C.) A.  Warren McCulloch B.  Alan Turing C.  John McCarthy D.  Noam Chomsky Justin Winkler 1. Which of the following functions will combine 'a and '(b c d) to be '(a b c d)? B. (Ans) * A. append * B. cons * C. list * D. answers b and c 2. What would a function Successor-Fn(x) return when passed a particular state x? D. (Ans) * A. * B. * C. * D. 3. Why is it a bad idea to use a breadth-first search in many cases? B. (Ans) * A. it is not complete * B. it has a time and space complexity of O(b^d) * C. it is not optimal for unit step costs * D. answers a and b Alex Keybl Justin Solomon 1: Which of the following will result from this Lisp statement: (rest '(a b)) C (Ans) A. (A B) B. B C. (B) D. ERROR 2: A/an ______ agent keeps track of its past decisions for use in later decisions. B (Ans) A. Episodic B. Sequential C. Fully observable D. Deterministic 3: Sensorless agents can _____ their environments into certain states simply by following the same procedures regardless of the current state. A (Ans) A. Coerce B. Determinize C. Search D. Interleave jeff Chaing LISP Question (defun isprime (primenum &optional (checknum 2))        (if (= checknum primenum)                NIL                (if (= (float (/ primenum checknum)) (round (/ primenum checknum)))                        NIL                        (isprime primenum '(+ 1 checknum))))) 1) Given the above function, what is returned by (isprime 11)? (A) T (B) NIL (C) 11 (D) ERROR (E) 2 Answer: (D) ERROR Reasoning: There are two things wrong with this function.  First: (if (= checknum primenum)     NIL It should be T not NIL.  If this was the only error, then (isprime 11) would return NIL.  The other error in the function is: (isprime primenum '(+ 1 checknum))))) There should be no ' before (+ 1 checknum))))).  This is what causes "ERROR" because ' causes (+ 1 checknum) to be passed as a list.  In the next iteration, when the function gets to  (if (= checknum primenum), an error will occur due to the fact that = only accepts numbers for its arguments. Analysis of Question: This question does not necessarily require that the test taker work out the function.  However, it will usually penalize them if they do not work it out.  It also may catch people who are careless and overlook a few things. The alternate question provided below forces the test taker to look at the question; there is no easy way to guess the answer without actually blindly guessing.  There are two options for the test maker.  The test maker may choose to allow people to guess an answer that looks correct and be penalized for it, or he may choose to force the test takers to look at the question and work it out (which is not necessarily a guarantee for success). Alternate Question: 1b) How many errors can be found in the function above? (A) 0 (B) 1 (C) 2 (D) 3 (E) 4 Answer: (C) 2 --------------------------------------------------------------------------- Norvig Question 2) A well-defined problem has all of the following components EXCEPT: (A) Path Cost (B) Solution (C) Initial State (D) Goal Test (E) State Space Answer: (B) Solution Reasoning: A solution is not necessary to a well-defined problem.  The essence of a well-defined problem is that the environment and goal are well described. Knowledge of how to get to the goal is not necessary, and perhaps even impossible to find. Analysis of Question: This is a relatively straightforward question and this whole concept was covered in Chapter 3 on page 62.  If the test taker is unsure of the answer, he may be inclined to select (E) State Space because the term is probably the least familiar out of all choices. --------------------------------------------------------------------------- Other Question (Norvig) 3) What is required of an agent to be determined autonomous? (A) The agent must always make the best decision (B) The agent must rely on prior information only (C) The agent must not be given any information by the designer (D) The agent must ignore the environment (E) The agent must have the ability to function correctly if prior information is incorrect Answer: (E) Ability to function correctly if prior information is incorrect Reasoning: An autonomous agent can be given basic information prior to runtime but not after that.  Key to being autonomous is the ability to learn from information gathered through its experience in the environment and make future decisions accordingly.  However, an autonomous agent is not infallible and is allowed to make mistakes.. Analysis of Question: Choices (B) and (C) are partially correct and the test taker may be inclined to stop there.  However, there are problems with each, invalidating them leaving (E) as the only correct answer.  This information was covered in Chapter 2 on pages 37-8. jeff Chaing Jason Ji 1. What is the difference between CONS and APPEND? (Answer - B) A. CONS takes two lists while APPEND takes two expressions. B. CONS takes an expression and a list while APPEND takes two lists. C. CONS takes two expressions while APPEND takes an expression and a list. D. None of the above. 2. Which type of agent selects actions on the basis of the current percept, ignoring the rest of the percept history? (A) A. Simple-reflex agent. B. Model-based agent. C. Goal-based agent. D. Agent Smith. 3. Which of the following procedure headers correctly takes two arguments and extra optional arguments? (Answer - A) A. defun extras (a, b, &optional n) B. defun extras (a, b, &optional) C. defun extras (a, b, &extra n) D. defun extras (a, b, &extra) Paul Porto 1. Question 1 The Predicate "endp" will return true for which of the following arguments? (b) o A. an atom o B. an empty list o C. a nonempty list o D. a number 2. Question 2 And agent that sets out to maximize their own expected "happiness"(c) o A. Goal-based agent o B. Learning agent o C. Utility-based agent o D. Model-based agent 3. Question 3 What does this function call do? (defun function (x y) (let ((result 1)) (dotimes (count y result) (setf result (* x result))))) (a) o A. Returns the value of x^y o B. Returns the value of xy o C. Returns the value of x!y! o D. Returns the value of x^x Nikhil Gupta 1. (setf list1 '(4 3) list2 '(3 2)) Which of the following returns T? (Ans is C) * A. ((first list1) > (+ (first list2) (last list2))) * B. (and (evenp (* (first list1) 3)) (eql (last list1) (last list2))) * C. (or (not (plusp (length list1))) (plusp (- (first list1) (last list2)))) * D. (endp list1) 2. In the dotimes primitive, the upper parameter is (Ans is B) * A. the count parameter * B. the upper-bound form * C. the result form * D. none of the above 3. The P of the PEAS of a grocery store manager could be (Ans is D) * A. aisles * B. store workers * C. customers * D. profitability The Ditmore Adding a * to the end of the functions do or let changes them in what way? a.. the binding of variables is serial rather than paralell b. the binding of variables is paralell rather than serial c. the variables are bound such that they can be used outside of the function d. the variables are bound such that they can be used only inside the function. Where b=branching factor and m=maximum depth, which of the following formulas is a most accurate representation of the memory required for a depth-first search? a. b/(m+1) b. b/(m-1) c. b(m-1) d. b(m+1) In performing a blind search, when is uniform cost search more efficient- with multiple step costs,or just one step cost? a. one step cost b. multiple step costs c. they are always equally efficient d. when the step cost variation is greater than 100 uniform cost search is no longer efficient. Robert Staubs 1. (defun FUNCT (data) (let ((result nil)) (dolist (temp (rest data) result) (setf result (append result (list (not (endp (member (first data) temp))))))) result)) Read the above Lisp function. What will (funct '(a (a) (d e) (a c))) return? ______(B) A. ERROR B. (T NIL T) C. NIL D. ((A) NIL (A C)) 2. What would be an admissable heuristic for an agent finding its way through a maze environment from its position to the exit in the shortest distance? ______(D) A. the straight-line distance from the agent's starting position to the exit B. the straight-line distance from the agent's current position to its starting position C. the total length of each path in the maze D. the straight-line distance from the agent's current position to the exit 3. Which of the following represents one method of adding an atom, N, to the end of a list, LST, to get a proper list without using the predicate LIST? ______(A) A. (reverse (cons N (reverse LST))) B. (cons N (reverse LST)) C. (cons N LST) D. (append LST N) Maxim Veytsman 1. Which search would NOT be a good choice for the following tree: __ / \ / A / / \ \ B C \/ \ \ D E C (Ans) * A. Breadth-First * B. Iterative Deepening * C. Depth-First * D. Bidirectional 2. What exactly does the ' operator do? B (Ans) * A. It stores data in a list instead of just executing it * B. It stops lisp from calling the first element of the list * C. It is the equivalent of the C system() function * D. 'foo is a shortcut for writing (eval foo) 3. What does NLP stand for? A (Ans) * A. Natural Language Processing * B. Neural Linguistic Processing * C. Neural Language Processing * D. Natural Linguistic Processing Daniel Wright 1.Question 1: What would be the result of (mapcar #not (list (atom nil) (listp nil) (zerop nil))) B: (nil nil t) (Ans) A. T B.  (nil t t) C. (nil nil t) D. nil 2.Question 2: If an environment is not completely determined by the current state and the action executed by the agent, it is ________. B: Stochastic (Ans) A. Sequential B.  Stochastic C.  Static D.  Discrete 3.Question 3: Searching algorithms are judged on _________. D: Completeness, optimality, time complexity, and space complexity. (Ans) A. Completeness, optimality, average time needed, and space complexity. B. Completeness, reliability, time complexity, and average space needed. C. Completeness, reliability, time complexity, and space complexity. D. Completeness, optimality, time complexity, and space complexity. Alex Volkovitsky 1. Which of the following is the correct LET template? C (Ans) A. (let ( ) ... ( )) B. (let (( ) ... ( ))
... ) C. (let (() ()) ... (() ()) ... ) D. (let (( ) ... ( )) #' ) 2. What is the difference between an Episodic and a Sequential environment? B (Ans) A. Episodic environments stay constant, Sequential are constantly changing. B. Episodic environments are not affected by previous decisions, Sequential environments are. C. Episodic environments are partially observable, Sequential environments are fully observable. D. There is no difference, they are two names for the same thing. 3. What does LAMBDA refer to? B. (Ans) A. A list of lists. B. A procedure that is defined anonymously. C. The weird #' that pops up once in a while in our book. D. The result of one function that is given as an argument to another function. Bryan Fleming Which of the following searches is complete? Answer: B A. Depth-first search B. Bredth-first search C. Depth-limited search D. Look-for-it search Two LISP Questions Which of the following LISP primitives returns all atoms after an atom a including a if a is an atom in a list mylist? Answer: C A. (inthere 'a mylist) B. (returnrest 'a mylist) C. (member 'a mylist) D. (rest 'a mylist) What is the name of the list primitive for iteration? Answer: D A. iterate B. for C. actiontimes D. dotimes Name: Mike Porter Period: 6 (mapcar #'+ '(1 2 3) '(4 5 6)) returns ? (5 7 9)(Ans) A.(3 3 3) B.(5 7 9) C.NIL D.t (member 3 '(1 2 3 4 5)) returns ? (3 4 5)(Ans) A.t B.NIL C.(3 4 5) D.(1 2 3 4 5) A depth first search will fail when the list is ? Intractable(Ans) A.NIL B.t C.Length 4 D.Intractable Christopher Goss 1. What does this function do? B (defun myfunction (myelement) (cond ((null myelement) 0) ((atom myelement) 1) (t (+ (myfunction (first myelement)) (myfunction (rest myelement)))))) A. Returns the length of myelement B. Returns the number of atoms in myelement C. Returns the number of atoms in (first myelement) D. Gives an error 2. What is the agent's input from the environment? C A. Reflexes B. Sensors C. Percepts D. Actuators 3. Which of the following represents the hardest task environment? A A. Stochastic, Sequential, Dynamic, Continuos B. Deterministic, Episodic, Dynamic, Continuos C. Deterministic, Sequential, Dynamic, Discrete D. Stochastic, Episodic, Static, Continuos Colin Smith - Pd. 7 10.19.03 Which will evaluate to NIL? (Ans:C) A.) * (atom 'pi) B.) * (atom pi) C.) * (numberp 'pi) D.) * (symbolp 'pi) Which is the correct order of searches, going from most memory use to least? (Ans:A) A.) Breadth-first search, Depth-first search, Backtracking search B.) Breadth-first search, Backtracking search, Depth-first search C.) Backtracking search, Breadth-first search, Depth-first search D.) They are all equal What type of agent selects actions based on the current percept? (Ans:D) A.) Model-based agent B.) Utility-based agent C.) Goal-based agent D.) Simple reflex agent Name: Curtis Kobelski Period: 6 1. (member 'what '((cool thing) (what hey))) will return: C (Ans) * A. WHAT * B. (WHAT HEY) * C. NIL * D. (WHAT) 2. An agent that makes decisions based on how happy said decision will make it is called: A (Ans) * A. A Utility-Based Agent * B. A Goal-Based Agent * C. Agent Smith * D. An Iterative-Deepening Agent 3. An artificial intelligence that passed the Turing Test would need to: D (Ans) * A. Achieve the optimal result of its task. * B. Rise up against humanity. * C. Learn from its mistakes. * D. Behave in such a way that it cannot be distinguished from a human. Name: Matt Faria Period: 6 1. Question 1 What does LISP stand for? (A) > A. List Oriented Programming > B. List Input Stream Processing > C. List Is Saved Prior > D. List and Input Standard Programming 2. Question 2 What is the most expensive search in terms of memory? (C) > A. Depth first search > B. Iterative depth first search > C. Breadth first search > D. Depth limited search 3. Question 3 Which of the following LISP functions returns a list? (C) > A. First > B. Equal > C. Rest > D. Nullp Name: Matthew Lashof-Regas Period: 6 1. In the function do-stuff, what will be returned, given the parameter (a b c d e)? (defun do-stuff (mylist) (let ((index 0) (result mylist)) (dolist (index mylist result) (append result index)))) C (Ans) o A. (e d c b a a b c d e) o B. (a b c d e a b c d e) o C. (a b c d e) o D. ((((((a b c d e) a) b) c) d) e) 2. How would you describe the environment of a game of Monopoly? D (Ans) o A. Deterministic, episodic o B. Deterministic, sequential o C. Stochastic, episodic o D. Stochastic, sequential 3. In a left-to-right breadth-first search of a binary search tree, which node would be reached by the algorithm first? A (Ans) o A. The rightmost node on level 3. o B. The leftmost node on level 5. o C. The second node from the left on level 4. o D. The middle node on level 4. Menyoung Lee 1. Evaluate this piece of code: (do ((result 1) (number 9)) ((not (zerop number)) result) (setf result (* result number)) (setf number (- number 1))) a) 9! = 362880 b) 9 c) error. infinite loop. d) 1 2. Which of the following is NOT an uninformed search strategy? a) iterative scanning bidirectional search b) backtracking search c) depth-limited search d) iterative deepening depth-first search 3. An agent that is model-based and utility-based: I. maintains a sort of internal state II. tries to achieve a specific goal III. thinks about how "happy" it will be in a certain state a) II only b) III only c) I and III only d) I, II, and III SOLUTIONS 1. d The DO loop immediately terminates when it encounters the exit condition, (not (zerop number)), because it evalutes to true. The student must understand: 1) Unlike a C-like while loop, a do loop terminates when the exit condition is true, rather than false. (distractor: a) 2) A do loop evaluates the exit condition before going through the first execution of the loop (distractor: b) From Winston & Horn Chp. 7 pages 117-9 2. a Directly from the textbook. b, c, and d are all terms that are found in Chapter 3. "Iterative," "scanning," and "bidirectional" all are terms used when talking about search strategies, but there still is no such thing as an "iterative scanning bidirectional search." From Russell & Norvig Chp. 3 Section 4 pages 73-81 3. c Model-based means that the agent internally keeps track of aspects of the environment that are not visible all the time. (I) Utility-based means that the agent tries to maximize the utility, or happiness. It an agent does both, it models the world internally and sees its own happiness in such in environment. (III) From Russell & Norvig Chp. 2 Section 4page 52 ---------- Sincerely, Menyoung Lee Name: Justin Solomon Period: 6 1.Question 1: Which of the following will result from this Lisp statement: (rest '(a b)) C (Ans) A. (A B) B. B C. (B) D. ERROR 2.Question 2: A/an ______ agent keeps track of its past decisions for use in later decisions. B (Ans) A. Episodic B. Sequential C. Fully observable D. Deterministic 3.Question 3: Sensorless agents can _____ their environments into certain states simply by following the same procedures regardless of the current state. A (Ans) A. Coerce B. Determinize C. Search D. Interleave HAmmett Dear Mr. Strong, Following three questions are created for the test bank. 1). (defun do-expt (m n) (do* ((result m (* m result)) (exponent n (- exponent 1)) (counter (- exponent 1) (- exponent 1))) ((zerop counter) result))) In this function, do-expt, why is it necessary to put '*' after 'do'? a). '*' is needed to signify parallel binding. b). '*' is needed to prevent stack-overflow. c). '*' is needed to minimize memory usage. d). '*' is needed to signify serial binding. e). '*' acts as a pointer Answer: d 2). What is 'percept sequence'? a). complete history of everything the environment has perceived b). complete history of everything the agent has perceived c). sequence of environmental changes d). sequence of the agent's actions e). complete history of everything the human user has perceived Answer: b 3). Which of the following best describes 'agent'? a). agent = sensors + environment b). agent = sensors + functions c). agent = architecture + program d). agent = architecture + functions e). agent = sensors + actuators Answer: c Eric Chang\par Period 7\par \par \par 1. What would the following template return if it was filled in with code?\par (dolist ( ) )\par \tab ANSWER: C\par \par \tab A. a list\par \tab B. whatever the primitive type is\par \tab C. NIL\par \tab D. the element parameter\par \par 2. "Once a node has been expanded, it can be removed from memory as soon as all its \par decendants have been fully explored." This statement describes a(n) ______.\par \tab ANSWER: B\par \par \tab A. queue\tab\par \tab B. depth-first search\par \tab C. breadth-first search\par \tab D. binary tree\par \par 3. "Using a problem-solving technique in which the most appropriate solution of several \par found by alternative methods is selected at successive stages of a program for use."\par \tab ANSWER: A\par \par \tab A. heuristic A.I.\par \tab B. fuzzy logic\par \tab C. neural networks\par \tab D. stupid A.I.\par } -Jeffrey Chiang --------------------------------------------------------------------------- LISP Question (defun isprime (primenum &optional (checknum 2)) (if (= checknum primenum) NIL (if (= (float (/ primenum checknum)) (round (/ primenum checknum))) NIL (isprime primenum '(+ 1 checknum))))) 1) Given the above function, what is returned by (isprime 11)? (A) T (B) NIL (C) 11 (D) ERROR (E) 2 Answer: (D) ERROR Reasoning: There are two things wrong with this function. First: (if (= checknum primenum) NIL It should be T not NIL. If this was the only error, then (isprime 11) would return NIL. The other error in the function is: (isprime primenum '(+ 1 checknum))))) There should be no ' before (+ 1 checknum))))). This is what causes "ERROR" because ' causes (+ 1 checknum) to be passed as a list. In the next iteration, when the function gets to (if (= checknum primenum), an error will occur due to the fact that = only accepts numbers for its arguments. Analysis of Question: This question does not necessarily require that the test taker work out the function. However, it will usually penalize them if they do not work it out. It also may catch people who are careless and overlook a few things. The alternate question provided below forces the test taker to look at the question; there is no easy way to guess the answer without actually blindly guessing. There are two options for the test maker. The test maker may choose to allow people to guess an answer that looks correct and be penalized for it, or he may choose to force the test takers to look at the question and work it out (which is not necessarily a guarantee for success). Alternate Question: 1b) How many errors can be found in the function above? (A) 0 (B) 1 (C) 2 (D) 3 (E) 4 Answer: (C) 2 --------------------------------------------------------------------------- Norvig Question 2) A well-defined problem has all of the following components EXCEPT: (A) Path Cost (B) Solution (C) Initial State (D) Goal Test (E) State Space Answer: (B) Solution Reasoning: A solution is not necessary to a well-defined problem. The essence of a well-defined problem is that the environment and goal are well described. Knowledge of how to get to the goal is not necessary, and perhaps even impossible to find. Analysis of Question: This is a relatively straightforward question and this whole concept was covered in Chapter 3 on page 62. If the test taker is unsure of the answer, he may be inclined to select (E) State Space because the term is probably the least familiar out of all choices. --------------------------------------------------------------------------- Other Question (Norvig) 3) What is required of an agent to be determined autonomous? (A) The agent must always make the best decision (B) The agent must rely on prior information only (C) The agent must not be given any information by the designer (D) The agent must ignore the environment (E) The agent must have the ability to function correctly if prior information is incorrect Answer: (E) Ability to function correctly if prior information is incorrect Reasoning: An autonomous agent can be given basic information prior to runtime but not after that. Key to being autonomous is the ability to learn from information gathered through its experience in the environment and make future decisions accordingly. However, an autonomous agent is not infallible and is allowed to make mistakes.. Analysis of Question: Choices (B) and (C) are partially correct and the test taker may be inclined to stop there. However, there are problems with each, invalidating them leaving (E) as the only correct answer. This information was covered in Chapter 2 on pages 37-8. Name: Keith Diggs Period: 6 Question 1 All of the following definitions of the function (defun exponent (base power) ... ) will properly evaluate the exponent EXCEPT: (B) A. (do ( (result 1) (exp power) ) ( (zerop exp) result) (setf result (* base result) ) (setf exp (- exp 1) ) ) B. (let ( (result 1) ) (dotimes (power count result) (setf result (* base result) ) ) ) C. (expt base power) D. (if (zerop power) 1 (* base (exponent base (- power 1) ) ) ) Question 2 Relative to a learning agent, the performance standard: (C) A. is part of the critic and is used to generate feedback for the learning element B. is part of the agent, but independent of the critic, which uses it to generate feedback for the learning element C. is independent of the agent and used by the critic to generate feeback for the learning element D. is evaluated directly by the performance element Question 3 The Tic-Tac-Toe problem is: (A) A. fully observable, strategic, sequential, static, discrete, and multiagent B. fully observable, stochastic, sequential, static, continuous, and multiagent C. fully observable, strategic, episodic, static, continuous, and multiagent D. fully observable, stochastic, sequential, dynamic, discrete, and multiagent Divya 1. A tail recursive procedure... (B) o A. is the least efficient type of recursive procedures o B. is in a position such that whatever is returned by the call will be immediately returned, without any further processing o C. doesn't include reductions o D. is the only kind of recursive procedure used in programs Fleming Read the following. [1]> (setf mylist '(a b c)) (A B C) [2]> (my_function 'a mylist) (A A B C) [3]> mylist (A A B C) Which of the following LISP predicates would perform in place of my-function above? Ans: B A) append B) push C) cons D) add Too many )'s. Alvin Lin Abstraction is: (B) (A) The process of codifying an agent program into an agent function (B) The process of removing detail from a representation (C) The process of extracting all relevant information from a problem (D) The process of generating actions and deciding which ones to consider Paul Porto What would the call (nthcdr 4 '(1 3 4 a b c g 16)) return? (d) o A. (1 3 4 a) o B. NIL o C. (a c g 16) o D. (b c g 16) John Livingston A proper call to dolist has the form (dolist ( ) ) If a dolist form has no result form, the dolist form will: Answer: C a) not be affected b) always return t c) always return nil d) iterate over the list again A method of uninformed search where the root node is expanded first, followed by all the successors of the root node, and their successors, and so on, is called: Answer: A a) Breadth-first search b) Uniform-cost search c) Depth-first search d) Depth-limited search Given (setf mylist '(1 2 3 4 5)) the output of (last mylist) in the LISP interpreter is: Answer: B a) 5 b) (5) c) (1 2 3 4) d) ((5)) And the latest question: The agent program is: Answer: B a) What describes the agent's behavior, mapping any given percept sequence to an action b) The implementation of the agent function c) The complete history of everything the agent has ever perceived d) A sentient program that can move in and out of any software still hardwired to its systems ~John Livingston Chris Katilie 1) Which is not an advantage of the breadth-first search? __C__ A) Almost as quick as a depth-first search with small trees. B) Will find the answer with the least cost as opposed to the depth-first search. C) Uses less memory than a depth-first search. D) Will not get caught in infinite loops when a depth first search may. 2) Which of the following is not a LISP primitive from the chapters we have read? __D__ A) cons B) cond C) or D) nor 3) Why is it important that we learn the language used regarding AI? __B__ A) Solely for the purpose of Mr. Strong quizzing us. B) So we know the standard language and will be able to understand AI when we discuss it with other people. C) So the people who wrote the LISP book can brain-wash us. D) So we can impress all our friends with our new \x{201C}Geek Language\x{201D}. Matt Fifer 1. What kind of agent attempts to increase its own "happiness?" a. Reflex Agent b. Utility Agent c. Performance Agent d. Goal-Based Agent Answer: b 2. Which LISP function can be used to find the remainder of two numbers? a. remainder b. rem c. leftover d. remp Answer: b 3. What is the correct format for a "let" function a. (let (x 13)) b. (let x 13) c. (let ((x 13))) d. (let ((13 x))) Answer: c ~Matt Fifer ;;Scott Hyndman ;;Period: 6 1. What line of this code will cause an error? 1 (defun do-expt (m n) 2 (do ((result m (* m result)) 3 (exponent n (- exponent 1)) 4 (counter (- exponent 1) 5 (- exponent 1))) 6 ((zerop counter) result))) Ans: C A. 2 B. 3 C. 4 D. 6 2. An actuator is: Ans: A A. what an agent uses to act upon its environment. B. the piece of code used to give an agent autonomy. C. what an agent is programmed to do. D. what an agent uses to percieve its environment. 3. What does the predicate "eql" check for? Ans: B A. Are two argument values the same expression? B. Are two argument values the same symbol or number? C. Are two argument values the same symbol? D. Are two argument values the same number? Jeff Chiang (defun myfunction (mylist mynum) (setf mylist2 (rest mylist)) (if ( or (endp mylist) ( < mynum (first mylist))) (setf mylist3 (append (list mynum) mylist)) (setf mylist4 (append (list (first mylist)) (myfunction mylist2 mynum))))) 1) What BEST describes what this function will do when run? (A) Sort a list in order from least to greatest. (B) Insert a number into a sorted list. (C) Search for a number in a sorted list and if it's not there, insert it. (D) Search for a number in a sorted list and if it's there, remove it. (E) Insert a number in a list immediately before the first number that's greater than it. Answer: (E) Insert a number in a list immediately before the first number that's greater than it. Susan Ditmore Period 6 What the most accurate definition of an "admissable heuristic" for an for an A* search? __c__ a. a heuristic that always overestimates the cost to reach the goal b. a heuristic that never underestimates the cost to reach the goal c. a heuristic that never overestimates the cost to reach the goal d. a heuristic that always has the exact lowest goal cost Explanation: This comes from Chapter 4 of AI: A modern approach, pg. 97. It's in italics on the bottom half of the page. "Admissible heuristics are by nature optimistic, because they think the cost of solving the problem is less than it actually is.... provided that h(n) never overestimates the goal cost..." Mike Brady Questions for AI Quarter 1 Test 1. What does (cons (append (list '(x y) '(a b)) '(c d)) 'e) display? a) (((X Y) (A B) C D) E) b) (((X Y) (A B) C D) . E) c) (X Y A B C D E) d) ((X Y A B) C D . E) e) None of these Answer: b) Alvin Li Question: What is the difference between eql, eq, and =? A) eq and = apply to symbols and eql applies to numbers and symbols only B) eq and eql apply to numbers and symbols while = applies to symbols only C) eq applies to numbers, = applies to symbols and eql applies to both D) eq applies to symbols, = applies to numbers and eql applies to both Ans: D Alvin Li, Period 6 AI Mike Szlamowicz Question 4 Given the code: (setf alphabet '(a b c d e f g h i j k l m)) And the job of finding 'f in the list, which loop is most efficient? (c) a) do b) do-times c) do-list d) They are all equally efficient. Alex Keybl lista = (a b c d) listb = (e f g h). Which of the following lines of code will combine lista and listb to be (a b c d h)? B. (Ans) * A. (setf listc (reverse (cons (first (reverse listb)) (reverse lista)))) * B. (setf listc (append (last (rest lista)) (reverse listb))) * C. (setf listc (append (reverse (first (rest listb))) (reverse (first (reverse (lista)))))) * D. (setf listc (cons lista listb)) Eric Chang Consider the function "swap" defined below: (defun swap (list) (if (or (null list) (null (cdr list))) list (cons (second list) (cons (first list) (swap (cddr list)))))) If (swap '(1 2 3 4 5)) is called, what is the result? ANSWER: C a. (2 1 3 4 5) b. (5 2 3 4 1) c. (2 1 4 3 5) d. (2 5 1 4 3) Diggs Which of the following expressions will return T? (D) A. (equal 3 3.0) B. (eql 3 3.0) C. (eq 3 3.0) D. (= 3 3.0) -Keith Matt Faria Which of the following is not a Common lisp reserved word? (C) > A. rest > B. theta > C. eleventh > D. endp Justin Solomon Evaluate: (first (rest '((a b c d) (e f g h)))) C (ans) A. E B. (E) C. (E F G H) D. (B C D) Christopher Goss What lisp code is equivalent to the code below? D (caddr mylist) A) NIL B) (rest (rest (butlast mylist))) C) (second (rest (rest mylist))) D) (third mylist)