AI Question Bank
AI Question Bank
AI Question Bank
Students
ARTIFICIAL INTELLIGENCE
Prepared By
Table of Contents
CHAPTER 2: INTELLIGENT AGENTS ...................................................................................................................................... 1 CHAPTER 3: SOLVING PROBLEMS BY SEARCHING .......................................................................................................... 2 CHAPTER 4: INFORMED SEARCH & EXPLORATION ......................................................................................................... 3 CHAPTER 5: CONSTRAINT-SATISFACTION PROBLEMS ................................................................................................. 10 CHAPTER 7, 8 & 9: PROPOSITIONAL & FIRST-ORDER LOGICS .................................................................................... 11 CHAPTER A: GENETIC ALGORITHMS.................................................................................................................................. 14 CHAPTER B: NEURAL NETWORKS ........................................................................................................................................ 15 CHAPTER C: CLASSIFICATION & CLUSTERING (DUNHAM) ......................................................................................... 16 CHAPTER D: MISCELLANEOUS .............................................................................................................................................. 16
3.7
Consider a state space where the start state is number 1 and the successor function for state n returns two states, number 2n and 2n + 1. i. ii. Draw the portion of the state space for states 1 to 35. Suppose the goal state is 21. List the order in which nodes will be visited for breadthfirst search, depth-first search, depth-limited search with depth limit 2, and iterative deepening depth-first search where in every iteration depth will be increased by 2. [In-course. Marks: 8]
3.8
What is state-space search? Contrast state-space search and dynamic programming. Can they be combined? [2008, 2007. Marks: 3]
A Work-Through Example of Best-First Search Algorithm Goal: Find a path from Arad to Bucharest using the straight-line distance heuristic
A Work-Through Example of A* Search Algorithm Goal: Find a path from Arad to Bucharest using the straight-line distance heuristic
Since g(n) gives the path cost from the start node to node n, and h(n) is the estimated cost of the cheapest path from n to the goal, we have f (n) = estimated cost of the cheapest solution through n Thus, if we are trying to find the cheapest solution, a reasonable thing to try first is the node with the lowest value of g(n) + h(n).
Optimal? o A* using TREE-SEARCH is optimal if h(n) is admissible, that is, provided that h(n) never overestimates the cost to reach the goal. Admissible heuristics are by nature optimistic, because they think the cost of solving the problem is less than it actually is. Since g(n) is the exact cost to reach n, we have as immediate consequence that f (n) never overestimates the true cost of a solution through n. o A* using GRAPH-SEARCH is optimal if h(n) is consistent. A heuristic h(n) is consistent if, for every node n and every successor n' of n generated by any action a, the estimated cost of reaching the goal from n is no greater than the step cost of getting to n' plus the estimated cost of reaching the goal from n': h(n) c(n, a, n') + h(n') Another important consequence of consistency is the following: If h(n) is consistent, then the values of f(n) along any path are nondecreasing. From this, we can say that A* search is complete as we add bands of increasing f, we must eventually reach a band where f is equal to the cost of the path to a goal state. However, completeness requires that there be only finitely many nodes with cost less than or equal to C*, a condition that is true if all step costs exceed some finite and if b is finite.
Drawbacks: o For most problems, the number of nodes within the goal contour search space is still exponential in the length of the solution. For this reason, it is often impractical to insist on finding an optimal solution. One can use variants of A* that find suboptimal solutions quickly, or one can sometimes design heuristics that are more accurate, but not strictly admissible. In any case, the use of a good heuristic still provides enormous savings compared to the use of an uninformed search. o Because it keeps all generated nodes in memory, A* usually runs out of space long before it runs out of time. For this reason, A* is not practical for many large-scale problems. Recently developed algorithms (IDA*, RBFS, MA*, SMA*) have overcome the space problem without sacrificing optimality or completeness, at a small cost in execution time.
Memory-Bounded Heuristic Searches 1. 2. 3. 4. IDA* The simplest way to reduce memory requirements for A* is to adapt the idea of iterative deepening to the heuristic search context, resulting in the iterative-deepening A* (IDA*) algorithm.
6
Iterative-Deepening A* (IDA*) Recursive Best-First Search (RBFS) Memory-Bounded A* (MA*) Simplified MA* (SMA*)
The main difference between IDA* and standard iterative deepening is that the cutoff used is the fcost (g + h) rather than the depth; at each iteration, the cutoff value is the smallest f-cost of any node that exceeded the cutoff on the previous iteration. A simple recursive algorithm that attempts to mimic the operation of standard best-first search, but using only linear space. Its structure is similar to that of a recursive depth-first search, but rather than continuing indefinitely down the current path, it keeps track of the f-value of the best alternative path available from any ancestor of the current node. If the current node exceeds this limit, the recursion unwinds back to the alternative path. As the recursion unwinds, RBFS replaces the f-value of each node along the path with the best f-value of its children. In this way, RBFS remembers the f-value of the best leaf in the forgotten sub-tree and can therefore decide whether it's worth re-expanding the sub-tree at some later time.
Advantage: Somewhat more efficient than IDA*. Disadvantage: Still suffers from excessive node re-generation. Optimal? Yes, if the heuristic function h(n) is admissible. Space complexity is linear in the depth of the deepest optimal solution. Time complexity is rather difficult to characterize: it depends both on the accuracy of the heuristic function and on how often the best path changes as nodes are expanded. Both suffer from using too little memory. Between iterations, IDA* retains only a single number: the current f-cost limit. RBFS retains more information in memory, but it uses only linear space: even if more memory were available, RBFS has no way to make use of it. It seems sensible, therefore, to use all available memory. Two algorithms that do this are MA* (memory-bounded A*) and SMA* (simplified MA*).
What is admissible heuristic? When does admissible heuristic become consistent? [2003. Marks: 3] Describe the key dimensions that are necessary to analyze to implement any heuristic search algorithm to any problem. [2003. Marks: 3] What is A* search and what is admissibility? Why is it important? What would happen if we used an inadmissible heuristic? [2007. Marks: 3] In A* search, why does the heuristic have to always underestimate? [2008, 2007. Marks: 2] What is the condition for A* to be optimal? Give an example when A* is not practical. [2004. Marks: 4] A* is a best-first search for f(n) = g(n) + h(n) where g(n) is the cost to reach the node n and h(n) is a heuristic function from the node n to the goal. Now, given that the graph is a tree, choose special functions g(n) and h(n), as general as possible, that will make A* search become a. Breadth-first search b. Depth-first search c. Uniform-cost search [In-course 1, 2008-2009. Marks: 6]
Prove that uniform-cost search is a special case of A* search. [In-course. Marks: 4] What do you understand by iterative deepening search? How can it be combined with A* search? [2008. Marks: 3] Write whether each of the following statements is true or false: [In-course 1, 2008-2009. Marks: 3] a. Uniform-cost search is a special case of breadth-first search. b. Breadth-first search, depth-first search and uniform-cost search are special cases of bestfirst search. c. A* is a special case of uniform-cost search.
4.10
The major four criteria for evaluating search methods are: time complexity, space complexity, optimality and completeness. Using one or more of these criteria, attempt to justify the following statements: [In-course 1, 2008-2009. Marks: 3] a. Iterative deepening search is preferred over breadth-first search. b. Bidirectional search is preferred over breadth-first search.
c. The A* algorithm is preferred over the hill-climbing method. 4.11 Consider the following search space where we want to find a path from the start state S to the goal state G. The table shows three different heuristic functions h1, h2 and h3.
A 5 2 S B 2 1 D 5 5 C 2 G Node S A B C D G h1 0 0 0 0 0 0 h2 5 3 4 2 5 0 h3 6 5 2 5 3 0
a. What solution path is found by Greedy Best-first search using h2? Break ties alphabetically. b. What solution path is found by Uniform-Cost search? Break ties alphabetically. c. Give the three found by algorithm A* using each of the three heuristic function, respectively. Break ties alphabetically. [In-course 1, 2008-2009. Marks: 3 + 3 + 1 3] 4.12 For each statement about Hill Climbing below, decide whether its true or false, and give a one-sentence justification. [In-course 1, 2008-2009. Marks: 3] i. ii. iii. 4.13 4.14 2] 4.15 4.16 Explain how simple hill climbing and steepest ascent hill climbing algorithms move to the next state from the current state. [2003. Marks: 4] Give an example of an admissible heuristic for the eight puzzle problem. [2007. Marks: 3] ALSO, Consider trying to solve the 8-puzzle using hill climbing. Can you find a heuristic function that makes it work? Make sure it works on the following example: Start 1 2 3 8 5 6 4 7 4.17 4.18 End 1 2 3 4 5 6 7 8 There can be more than one global optimum. It is possible that every state is a local optimum. (A local optimum is defined to be a state that is no better than its neighbors.) Hill climbing with random restarts is guaranteed to find the global optimum if it runs long enough on a finite state space.
Discuss and compare hill climbing and best-first search techniques. [2007, 2006. Marks: 3] Discuss and compare hill climbing and simulated annealing search techniques. [2008. Marks:
Fifteen puzzle is like eight puzzle except there are fifteen tiles instead of eight. What is the branching factor of the search tree for fifteen puzzle? [2007. Marks: 3] Give an example of an admissible heuristic for the fifteen puzzle problem. [2008. Marks: 3]
10
Can statement Q be derived logically from the following knowledge base? How (use either forward or backward chaining)? [2006. Marks: 3] PQ LMP BLM APL ABL A B
7.8 7.9
What is CNF? Convert A B P R to CNF. [2006. Marks: 4] Convert the following first-order sentences into CNF: [In-course 1, 2008-2009. Marks: 3] x y z (person(x) ((likes(x, y) y z) likes(x, z)))
7.10
What is Inference Process? Distinguish between forward chaining and backward chaining reasoning with example. [2008. Marks: 5] ALSO, Explain the differences between forward and backward chaining and under what conditions each would be best to use for a given set of problems. [2005. Marks: 7]
7.11
Represent the following fact in predicate logic: For all the persons there must have parents and God gives His mercy to him who loves his
11
parents and the person who gets Gods mercy will be rewarded in the long run. Convert the predicate logic into clause form. Show the process of conversion in details with the appropriate rule. [2003. Marks: 7] 7.12 Consider the following sentences: i. ii.
iii.
John is not a good student If a student is not good then he/she hates science courses since these are hard. If a student hates a course then he doesnt like it. All the courses in the Basket Cleaning Department are easy. CS121 is a science course. BC431 is a basket cleaning course.
Convert these sentences into formulas in predicate logic. Now convert these formulas into clause form. Use resolution to answer the question What course would John like? [2005. Marks: 3 + 3 + 4]
7.13
Consider the following three sentences: There is a computer scientist who likes every operating system. Linux is an operating system. Someone likes Linux.
Write a formula in first-order logic expressing each of the given facts. Call them A, B and C. Write the set of clauses corresponding to A, B and C. Derive the empty clause from this set of clauses using resolution. [In-course 1, 20082009. Marks: 9]
Consider the problem of finding clothes to wear in the morning. To solve this problem, it is necessary to use knowledge as: Wear jeans unless either they are dirty or you have a job interview today. Wear a sweater if it is cold. It is usually cold in the winter. Wear sandals if it is warm. It is usually warm in the summer.
Show how the problem can be solved and how the solution changes as the relevant facts (such as time of year and dirtiness of jeans) change. [2003. Marks: 4] 7.15 Show the steps required to put the following axiom/logic into clause form: [2005.Marks: 3+3]
i. x : y : [Above(x, y) On(x, y)] z : [Above(x, z) Above(z, y)] ii. x : [Roman(x) Know(x, Marcus)] [hate(x, Caesar) (y : z hate(y, z) thinkcrazy(x, y))]
7.16
Are the following two formulae valid? Substantiate your answer. [2003. Marks: 6] i. ii. y x p(x, y) y x p(x, y) x y p(x, y) y x p(x, y) S = {p(X, X, g(X), h(a)), p(f(Y), f(h(Z)), g(X), Y)}
Find the most general Unifier for the following set of terms: [2003. Marks: 5] What do you understand by Herbrand Universe and Herbrand Base? What are the conditions for an interpretation to be Herbrand? [2003. Marks: 4] Consider the following logic program P: p(a) p(x), q(x) p(f(x)) p(x)
12
q(b) q(f(x)) q(x) Write down the Herbrand Universe and Herbrand Base. Give the least Herbrand model. [2003. Marks: 7] 7.20 Consider the following set S of clauses: pr r p, s sp Show that S is unsatisfiable by resolution. [2003. Marks: 3] 7.21 Consider the following set S of clauses: p q, r q, r u, v u v Is p a logical consequence of S? Is ~p a logical consequence of S? Substantiate your answer. [2003. Marks: 3] 7.22 Find a model for the set of formula {p(a), x ~p(x)}. [2003. Marks: 4]
13
14
B.9
15
Assuming three clusters, cluster the following data items using k-means clustering: {2, 4, 10, 12, 3, 20, 33, 11, 25}. [In-course 2, 2008-2009. Marks: 3]
CHAPTER D MISCELLANEOUS
D.1 D.2 What is Bayesian reasoning (aka Bayes rule / Bayes theory)? [2008, 2007, 2006. Marks: 1] How does an expert system rank potentially true hypotheses? Give an example. [2006. Marks: 4] [Out of syllabus?? Or from chapter 20??? D.3 ] Why is the certainty factors theory considered as a practical alternative to Bayesian reasoning? [2008, 2007, 2006. Marks: 3] [Probably out of syllabus??]
16