Вы находитесь на странице: 1из 13

CHAPTER 1 ARTIFICIAL INTELLIGENCE Q1.What is Artificial Intelligence? Ans.

Definition of AI :

Artificial is concerned with making computers behave like humans. The term was coined in 1956 by John McCarthy at the Massachusetts Institute of Technology. Artificial intelligence includes Games playing: programming computers to play games such as chess and checkers Expert systems: programming computers to make decisions in real-life situations (for example, some expert systems help doctors diagnose diseases based on symptoms) Natural language: programming computers to understand natural human languages Neural Networks: Systems that simulate intelligence by attempting to reproduce the types of physical connections that occur in animal brains Robotics: programming computers to see and hear and react to other sensory stimuli Currently, no computers exhibit full artificial intelligence (that is, are able to simulate human behavior). The greatest advances have occurred in the field of games playing. AI Problems: Mundane Tasks: Perception -Vision -Speech Natural language -Understanding -Generation -Translation Commonsense Robot Control 1 Formal Tasks: Games\ -Chess -Checkers Mathematics -Geometry -Logic -Integral Calculus -Proving programming properties Expert Tasks: Engineering -Design -Fault Finding -Manufacturing -Planning Scientific Analysis Medical Analysis Financial Analysis

To Discuss about AI let us try to answer 4 questions 1. 2. 3. 4. What is the underlying assumption about intelligence? What kinds of techniques will be useful for solving AI problems? At what level of detail, if at all are we trying to model human intelligence? How will we know when we have succeeded in building an intelligent program?

1. Underlying Assumption: The Underlying assumption is Physical Symbol System Hypothesis i.e. A Physical symbol system has the necessary and sufficient means for general intelligent action. 2. AI Technique: Knowledge can be defined as the Technique for AI, as intelligence requires knowledge. But the properties of knowledge include a. I t is voluminous. b. It is hard to characterize accurately. c. It is constantly changing. d. It differs from data by being organized in a way that corresponds to the ways it will be used. So to use knowledge as technique for AI, it should be represented in such a way that: The Knowledge should hold the property of generalization. It should be understood by people who must use it. So gather the required source at most from the people who are going to use it. It should be modified to correct errors and to reflect changes in the world and in our world view. I t should be used in a great many situations even if it is not totally accurate or complete. I t should be used to help overcome its own bulkiness by narrowing the options.

3. The level of Model: Before going to write any program we must ask ourselves What if our goal in trying to produce programs that do the intelligent things that people do? Are we trying to produce programs that do the tasks the same way people do? Or , are we attempting to produce programs that simply do the tasks in whatever the way appears easiest? So depending on the goal we have to decide the level of model we have to utilize. 4. Criteria for success: To answer this question let us consider the example of Turing Test, where the task is To determine whether a machine can think 1.To conduct this test, we need two people and the machine to be evaluated. One person plays the role of the interrogator, who is in a separate room from the computer and the other person. 2.The interrogator can ask questions of either the person or the computer by typing questions and receiving typed responses. 3.However the interrogator knows them as A and B and aims into believing that it is the person. If the machine succeeds at this, then we will conclude that the machine can think. The machine is allowed to do what ever it can to fool the interrogator. Ex: if asked the question How much is 12,324 times 73,982 It could wait several minutes and then respond with the wrong answer If our goal in writing a program is to simulate human performance at a task then the measure of success is not only doing the job efficiently and effectively but also doing the job in a poor way. So depending on the task we can define criteria for success. 2

***** Q2. What are the areas of Application? Or What are the task domains of Artificial Intelligence? Or What are the AI Problems? Ans: Mundane Tasks : Perception - Vision - Speech Natural Language - Understanding - Generation - Translation Commonsense reasoning Robot Control Formal Tasks : Games - Chess - Backgammon - Checkers-Go Mathematics - Geometry - Logic - Integral Calculus - Proving properties of programs. Expert Tasks : Engineering - Design - Fault finding - Manufacturing Planning Scientific analysis Medical diagnosis Financial analysis.

CHAPTER 2 PROBLEMS, PROBLEM SPACES AND SEARCH State Space/Search Space/Production Rules Search Techniques and their analysis DFS BFS Heuristic Search Problem Characteristics Production System and Production System Characteristics ******

Q1. Explain about State Space and production rules? Ans. To build any system to solve problem we need to do four things 1. Define the problem precisely. i.e giving formal way to the problem and also and final situations. specifications of initial

2. Analyze the problem: Analyzation of features which have deep effect on problem solving. 3. Isolate and Represent the task knowledge that is necessary to solve the problem. 4. Choose the best problem solving techniques and apply it to the specific problem. Let us explain about State Space with the example of Water Jug Problem A Water Jug Problem: You are given two jugs, a 4 gallon and a 3 gallon one. No measuring markers on them. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug? State space for this problem: A set of ordered pairs of integers(x,y) such that x = 0,1,2,3, or 4 ; represents number of gallons of water in 4 gallon jug. y= 0,1,2, or 3; represents number of gallons of water in 3 gallon jug. Start State: (0,0) Final/Goal State: (2,n) for any value of n (as there is no specification about no. of gallons of water in 3gallon jug) Production Rules for Water Jug Problem: 1. (x,y) -> (4,y) Fill the 4-gallon jug If x<4 2. (x,y) If y<3 3. (x,y) If x>0 4. (x,y) If y>0 -> -> -> (x,3) Fill the 3-gallon jug

(x-d,y) Pour some what out of 4-gallon jug (x,y-d) Pour some what out of 4-gallon jug 4

5. (x,y) If x>0 6. (x,y) If y>0 7. (x,y)

-> -> ->

(0,y) (x,0)

Empty the 4-gallon jug Empty the 4-gallon jug

(4,y-(4-x))Pour water from the 3-gallon jug into the 4-gallon jug until the 4-gallon jug is full. (x-(3-y),3)Pour water from the 4-gallon jug into the 3-gallon jug until the 3-gallon jug is full. (x+y,0) Pour all the water from 3-gallon jug into the 4-gallon jug (0,x+y)Pour all the water from 3-gallon jug into the 4-gallon jug (2,0) (0,y) Pour the 2-gallon from 3-gallon jug to 4-gallon jug Empty the 2gallons in the 4-gallon jug on the ground.

If x+y>4 and y>0 8. (x,y) ->

If x+y>3 and x>0 9. (x,y) -> If x+y<4 and y>0 10. (x,y) -> If x+y<3 and x>0 11. (0,2) 12. (2,y) -> ->

One Solution to the Water Jug Problem Gallons in the 4-gallon Jug 0 0 3 3 4 0 2 Gallons in the 3-gallon jug 0 2 3 9 0 2 3 7 2 5 OR 12 2 9 OR 11 0 Rule applied

Note: The second issue is explained by rules 3 and 4 5

The third issue is explained by rules 11 and 12 Operationalization : The process of creation of a formal and manipulable description of the problem itself is called Operationalization. In order to provide a formal description of a problem we must do the following. 1. Define a state space that contains all the possible configurations of the relevant objects 2. Specify one or more states within that space that describe possible situations from which the problem solving process may start, Initial State. 3. Specify one or more states that would be acceptable as solutions to the problem. These states are called Goal State. 4. Specify a set of rules the describe the actions available i.e. unstated assumptions, how much time required etc. ******* Q2. Explain about Problem Characteristics? Ans. There are Problem Characteristics, they are 1. 2. 3. 4. 5. 6. 7. Is the problem decomposable into a set of independent small subproblems? Can the solution steps be ignored or at least undone if they prove unwise? Is the problems universe predictable? Is a good solution to the problem obvious without comparison to all other possible solutions? Is the desired solution a state of the world or a path to a state? Is a large amount of knowledge required to solve the problem, or only to constrain the search? Can a computer that is simply given the problem return the solution, or will the solution of the problem require interaction between the computer and a person?

Explanation: 1. Is the problem decomposable? Example for Decomposable problems: Integration (x2 + 3x + Sin2x+Cos2x)dx X2dx+3xdx+sin2xdx+con2xdx So some problems can be solved by problem decomposition, if possible very large problems can be solved easily. At each step, a simple recursive program checks whether the problem is not easily solvable. If so then the answer is returned directly. If the problem is not easily solvable, the integrator checks to see whether it can decompose the problem, if so the recursive program will solve the problem by using the technique decomposition. Example for Non decomposable problem: Blocks World Problem Start State: Goal State:

The rules for doing this problem are if we have to move any block, it should not have any blocks over it i.e at a time only one block can be moved. So to reach the Goal state we should perform the task together. We cant break the problem and do it. So the solution for this is first move A to ground the move B onto C and A onto B. So proper interactions must be maintained in order to arrive at a solution for the entire problem. Where as for the decomposable problems we can perform the tasks independently and finally club the solutions. 2. Can the solution steps be Ignored or Undone?: Here we have three categories, they are a. Ignorable (ex. Theorem proving) , where solution steps can be ignored. b. Recoverable(ex. 8-Puzzle), where the solution steps can be undone. c. Irrecoverable(eg. Chess), where solution steps can not be undone. Theorem Proving: When we are trying to prove a mathematical theorem, suppose we first considered a lemma thinking that it will be useful for us to prove the theorem. If afterwards it proves useless then we simple can ignore it and continue with our theorem proving. So just we lost the effort we kept on lemma but nothing else. Still we can prove the theorem as usually. 8-Puzzle: Consider then 8-Puzzle problem where the Initial and Goal States are as follows Initial State 2 1 7 8 6 3 4 5 1 8 7 6 2 3 4 5 Goal State

Here the first move is to move 6 in the downward direction. Suppose by mistake we moved 5 to left side. Then what we can do is we cant ignore the wrong step but still we can recover from that wrong step. i.e the wrong move can be undone ie can be recovered. That is again move 5 to its original position and move 6 to the empty cell. So in some problems even if some thins wrong happened still we can recover from the mistakes. Chess: Consider the Chess game, where if a wrong move is made we cant ignore the wrong move and also cant undo the wrong move. Once some worst move is made, at the best what we can do is try to prevent the bad results of the wrong move. That is in chess the mistakes made can not be recovered. So while writing programs for this kind of problem more care should be taken and the efficient control structures should be implemented. We must put extra efforts in getting the knowledge data base also. 3. Is the universe predictable?: To understand let us take the examples of 8-Puzzle and Playing cards. 8-Puzzle: Every time we make a move, we know exactly what will happen. So it is possible to plan the entire series of moves and be confident that we know what the outcome state will be. So we can 7

do proper planning to overcome the problem of undo. So with the help of control structure which allows backtracking we can develop good program. Playing Cards: But unlike in 8-Puzzle problem, in playing cards we can not guess what will be the opponents move once we made a move. That is the universe of playing cards can not be predicted. Chess: But in Chess though it is difficult to predict the move, but it is not impossible. So planning process can be done effectively for the problems of certain outcome. But planning process for uncertain outcome is some what difficult. But the planning process of irrecoverable , uncertain outcome is hardest. Few examples of this are Playing Cards, Controlling a robot arm(for some variety situations like something hurdle comes to arm of robot then the gears of the arm might stick.) Helping a lawyer decide how to defend his client against a murder charge. Here can not even list all the possible outcomes. 4. Is a good solution Absolute or Relative? To Explain the concept of Absolute Solutions Consider the problem of answering questions based on a database of simple facts, as 1. 2. 3. 4. 5. 6. 7. Marcus was a man. Marcus was a American. Marcus was born in 40AD. All men are mortal. All Americans died when the volcano erupted in 79AD. No mortal lives longer than 150yrs. It is now 1991AD. Justification Axiom 1 Axiom 4 1,4 Axiom 3 Axiom 7 3,7 Axiom 6 8,6,9

Question to be answered is Is Marcus alive? 1.Marcus was a man. 4.All men are mortal. 8.Marcus is mortal. 3.Marcus was born in 40AD. 7.It is now 1991AD. 9.Marcus age is 1951years. 6.No mortal lives longer than 150years. 10.Marcus is dead.

To Explain the concept of Relative solutions consider the problem of Traveling Salesman Problem, where the object is you will be given a set of cities, start from a city and visit each city once and again come back to the starting city and the distance should be shortest. A X 25 145 170 B 25 X 120 150 C 145 120 X 160 D 170 150 160 X E 300 290 330 170 8

A B C D

300

290

330

170

One path among the cities: A- E-D-B-C-A where the distance covered is 885km Other path among the cities: A-B-C-D-E-A , where the distance covered is 775km , which is covering less distance than the previous one. So with one solution we can not say here this is the best solution. We have to find out all possible solutions and should show which is the best solution. 5. Is the solution a state or path? Consider the problem of Water Jug, where without specifying the entire path of how we reached to the state of (2,0) , simply we can not say this is the solution by mentioning (2,0) state alone. That is the solution should contain the entire path but not simply the goal state. Where as consider the problem of Interpretation for the Sentence The Bank president ate a dish of pasta salad with the fork Here the computer need not to mention the entire path of the solution it is enough to give meaning of the sentence. Where the path of solution includes : The word dish can be taken as dish was eaten or the item in the dish was eaten. Pasta salad can be taken as salad containing pasta, but in other way also because the dog food does not contain dog. So machine will think before giving its meaning. Suppose the phrase with the fork is like with the friends then the machine will have several meanings like bank president and the fork are eating together or president is eating with the help of fork. But machine need not to mention all this thinking in its solution but it is enough to provide the meaning of the sentence.

6. What is Role of Knowledge? Let us take the examples of Chess and Scanning a news paper where the program task is to give output which news paper is supporting which political party by scanning the news papers given as inputs. In chess how much knowledge is required by a perfect program is very less. Only huge memory is required. So role of knowledge is to come to the solution. But in Scanning a news paper the role of knowledge is just to control the search process to give the imperfect solution. 7. Does the task require interaction with a person? Here take the examples of Mathematical Theorem Proving and ATM. In Mathematical Theorem Proving simply given the input it does not need any interaction. It will give output. But in ATM machine right from the Entry till Exit interaction between the computer and person is needed. 9

We can classify the problems in Two types: Solitary, in which the computer is given a problem description and produces an answer with no intermediate communication and with no demand for an explanation of the reasoning process. Conversational, which there is intermediate communication between a person and the computer, either to provide additional assistance to the computer or to provide additional information to be user or both. ******* Q3. Explain about Production System and its Characteristics? Ans: A Production System provides structure of intelligent process. It contains of A set of rules, each with Left hand side explaining the applicability of the rule and the Right hand side the change after application of the rule. Knowledge Data Base(s) which contains appropriate information to solve the problem. A Control strategy that specifies the order in which the rules will be compared to the database and way of solving the conflicts that arise when several rules match at once. A rule applier.

Control Strategies: A good control strategy should have two requirements 1. The first requirement of a good control strategy is that it causes motion. 2. The Second requirement of a good control strategy is that it be systematic. Production System Characteristics: These characteristics provides us knowledge about how easily a solution can be implemented and also what are the relationships between problem types and the types of production systems best suited to solve the problem. There are four classes of Production System. They are a. b. c. d. Monotonic Production System Non Monotonic Production System Partially commutative Production System Not Partially commutative Production System

a. A Monotonic Production System is a production system in which the application of a rule never prevents the later application of another rule which could have been applied at the time of first rule was selected. b. But A Non monotonic production system is one in which this is not true. c. A Partially Commutative production system is one in which if the application of a particular series of rules changes state A into state B, then any permutation of those rules that is allowable(i.e. each rules preconditions are satisfied when it is applied) also changes state A into state B. 10

d. A commutative Production system is both monotonic and partially commutative. About the relationship between the problems and production systems, we can say any problem can be solved by any production system. In formal sense there is no relationship between the problems and production systems. But in practical sense there is such a relationship between the problems and production systems that will describe naturally those problems. To understand that consider the following table : Monotonic Non monotonic Partially Theorem Proving Robot navigation Commutativ e Not Partially Chemical synthesis Bridge Commutativ e Partially Commutative and Monotonic production system is useful to solve ignorable problems. Ex: Theorem Proving Partially Commutative and Non Monotonic Production system is useful to solve the problems where changes occur but can be reversed and in which order of operations is not critical. Ex: Robot Navigation, Suppose that the robot has the following operator: go north(N), go east(E), go south(S) and go west(W). To reach its goal the robot can perform the work either N-W-S-E-N or N-S-E-W-N. So here the order is not important to perform the task is important. Coming to Not Partially commutative and Monotonic, problems where the changes can not be irreversed are solved . Ex: Chemical Synthesis , Where suppose that to form a certain compound z first mix x with y and then w. But if you first mix x with w and then with y you can not reach your goal i.e forming z. So here the order of performing the operations is very important. Not partially commutative and Non monotonic production system is useful to solve the problems in which the outcome is uncertain, planning process is tough and also the changes are irrecoverable. Ex: Bridge, Playing Cards ******* Q4. Explain the algorithms Breadth-First Search and Depth First Search along with their analysis ie advantages and disadvantages. Ans: Algorithm :Breadth First Search 1. Create a variable called NODE-LIST and set it to the initial state. 2. Until a goal state is found or NODE-LIST is empty: a. Remove the first element from NODE-LIST and call it E. If NODE-LIST was empty,quit. b. For each way that each rule can match the state described in E do: i. apply the rule to generate a new state. ii. If the new state is a goal state, quit and return this state. iii. Otherwise, add the new state to the end of NODE-LIST. If we take the example of Water Jug Problem , the BFS will generate a tree with Initial state as the root node and then Generates all possible nodes of the root node by applying all rules which can be applied to 11

the initial state. Continue this process until some rule produces a Goal State. The tree of BFS for Water Jug Problem can be as follows:

Algorithm: Depth First Search 1. If the initial state is a goal state, quit and return success. 2. Otherwise, do the following until success or failure is signaled: a. Generate a successor, E of the initial state. If there are no more successors, signal failure. b. Call Depth-First Search with E as the initial state. c. If success is returned, signal success. Otherwise continue in this loop. If we apply DFS to Water Jug Problem , this algorithm also begins generating tree with initial state as root node. Then it applies any one of the applicable rules and generates a single offspring. So it continues till it generates either a goal state or no rule is there to apply. If finds solution it will return success otherwise failure. Analysis of BFS and DFS: Advantages of Depth-First Search: Depth First Search requires less memory since only the nodes on the current path are stored. But in BFS all the tree that was generated so far must be stored. By chance(if care is taken in generating nodes), DFS may find solution without examining much of the search space. But in BFS all parts of the tree must be examined to level n before any nodes on n+1 level can be examined.

Advantages of Breadth First Search: BFS will not get trapped by generating nodes in blind way. Where in DFS, it may generate a single path which may be useless for very long time till a node from which no further nodes can be generated. BFS is guaranteed to find a solution if there is a solution. Also if there are several solutions it will found with minimum no. of steps. How we can say this is Longer paths are never explored until a shorter paths have already been examined. But in DFS, it may find long path solution when a shorter path exists in some other unexplored part of the tree. ******* Q5. What is Heuristic Search give one example? Ans: Heuristic is a technique that improves the efficiency of a search process, possible by sacrificing the claim of completeness. Heuristics are like tour guides. Because the guides are good in general way of showing the places but they wont pay attention to personal interests. So with the help of Heuristics we can find good solution but may not be optimal to hard problems. We can develop general purpose heuristics which will be useful for wide variety of problems and special purpose heuristics which will be developed with the use of knowledge of specific domain of the problem. A good example of General purpose heuristics is Traveling Salesman Problem in which the heuristic is nearest neighbor heuristic which works by selecting the nearest city. 1. Arbitrarily select a starting city. 12

2. To select the next city, look at all cities not yet visited and select the one closest to the current city. Go to it next. 3. Repeat step 2 until all cities have been visited. A good example of Specific purpose heuristic is Chess. Here we have to develop a function which is specific to the rules of chess and can be defined as the material advantage of our side over the opponent Note: A good heuristic function plays an important role in efficiently guiding a search process to find a solution. *******

13

Вам также может понравиться