




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This is for Ai student , in this pdf you can show the exam paper of ai subject
Typology: Exams
1 / 114
This page cannot be seen from the preview
Don't miss anything!
Artificial intelligence is the study of how to make computers do things which, at moment people do better. Artificial intelligence can be viewed from a variety of perspectives. From the perspective of intelligence, artificial intelligence is making machines "intelligent" -- acting as we would expect people to act. o The inability to distinguish computer responses from human responses is called the Turing test. o Intelligence requires knowledge. From a business perspective AI is a set of very powerful tools, and methodologies for using those tools to solve business problems. From a programming perspective, AI includes the study of symbolic programming, problem solving, and search. o Typically AI programs focus on symbols rather than numeric processing. o Problem solving i.e. to achieve a specific goal. o Search - rarely access a solution directly. Search may include a variety of techniques. It is the science and engineering of making intelligent machines, especially intelligent computer programs.
Much of the early work in the field of AI focused on formal tasks, such as game playing and theorem proving. Game playing and theorem proving share the property that people who do them well are considered to be displaying Intelligence. Initially computers could perform well at those tasks simply by being fast at exploring a large number of solution paths and then selecting the best one. Humans learn mundane (ordinary) tasks since their birth. They learn by perception, speaking, using language, and training. They learn Formal Tasks and Expert Tasks later. Another early foray into AI focused on commonsense reasoning, which includes reasoning about physical objects and their relationship to each other, as well as reasoning about actions and their consequences. As AI research progressed, techniques for handling large amount of world knowledge were developed. New tasks reasonably attempted such as perception, natural language understanding and problem solving in specialized domains. Some of the task domains of artificial intelligence are presented in table I. Earlier, all work of AI was concentrated in the mundane task domain.
Mundane tasks Formal tasks Expert tasks Perception Computer Vision Speech, Voice Games Go Chess (Deep Blue) Ckeckers Engineering Design Fault Finding Manufacturing Monitoring Natural Language Processing Understanding Language Generation Language Translation Mathematics Geometry Logic Integration and Differentiation Scientific Analysis Common Sense Reasoning Theorem Proving Financial Analysis Planning Medical Diagnosis Robot Control Table I Task Domains of AI Later, it turned out that the machine requires more knowledge, complex knowledge representation, and complicated algorithms for handling mundane tasks. This is the reason why AI work is more flourishing in the Expert Tasks domain now, as the expert task domain needs expert knowledge without common sense, which can be easier to represent and handle.
Artificial intelligence problems span a very broad spectrum. They appear to have very little in common except that they are hard. AI Research of earlier decades results into the fact that intelligence requires knowledge. Knowledge possess following properties: o It is voluminous. o It is not well-organized or well-formatted. o It is constantly changing. o It differs from data. And it is organized in a way that corresponds to its usage. AI technique is a method that exploits knowledge that should be represented in such a way that: o Knowledge captures generalization. Situations that share common properties are grouped together. Without this property, inordinate amount of memory and modifications will be required. o It can be understood by people who must provide it. Although bulk of data can be acquired automatically, in many AI domains most of the knowledge must ultimately be provided by people in terms they understand.
understands natural language spoken by humans.
Problem solving is the major area of concern in Artificial Intelligence. It is the process of generating solution from given observed data. To solve a particular problem, we need to build a system or a method which can generate required solution. Following four things are required for building such system.
A problem is described formally as:
A state is a representation of problem elements at a given moment. A State space is the set of all states reachable from the initial state.
board. State space representation seems natural for play chess problem because the set of states, which corresponds to the set of board positions, is well organized. Ex.2:- Consider Water Jug problem A Water Jug Problem: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug? Here the initial state is (0, 0). The goal state is (2, n) for any value of n. State Space Representation: we will represent a state of the problem as a tuple (x, y) where x represents the amount of water in the 4-gallon jug and y represents the amount of water in the 3 - gallon jug. Note that 0 ≤ x ≤ 4, and 0 ≤ y ≤ 3. To solve this we have to make some assumptions not mentioned in the problem. They are: o We can fill a jug from the pump. o We can pour water out of a jug to the ground. o We can pour water from one jug to another. o There is no measuring device available. Operators – we must define a set of operators that will take us from one state to another. Sr. Current state Next State Descriptions 1 (x, y) if x < 4 (4,y) Fill the 4 gallon jug 2 (x, y) if y <3 (x,3) Fill the 3 gallon jug 3 (x, y) if x > 0 (x-d, y) Pour some water out of the 4 gallon jug 4 (x, y) if y > 0 (x, y-d) Pour some water out of the 3 gallon jug 5 (x, y) if x>0 (0, y) Empty the 4 gallon jug 6 (x, y) if y >0 (x,0) Empty the 3 gallon jug on the ground 7 (x, y) if x+y >= 4 and y > 0 (4, y-(4-x)) Pour water from the 3 gallon jug into the 4 gallon jug until the 4 gallon jug is full 8 (x, y) if x+y >= 3 and x> (x-(3-y), 3) Pour water from the 4 gallon jug into the 3 - gallon jug until the 3 gallon jug is full 9 (x, y) if x+y <=4 and y> (x+y, 0) Pour all the water from the 3 gallon jug into the 4 gallon jug
10 (x, y) if x+y <= 3 and x> (0, x+y) Pour all the water from the 4 gallon jug into the 3 gallon jug 11 (0,2) (2,0) Pour the 2 gallons from 3 gallon jug into the 4 gallon jug 12 (2,y) (0,y) Empty the 2 gallons in the 4 gallon jug on the ground There are several sequences of operators that will solve the problem. One of the possible solutions is given as: Gallons in the 4- gallon jug Gallons in the 3- gallon jug Rule applied 0 0 2 0 3 9 3 0 2 3 3 7 4 2 5 or 12 0 2 9 0r 11 2 0 -- Ex.3:- Consider 8 puzzle problem The 8 puzzle consists of eight numbered, movable tiles set in a 3x3 frame. One cell of the frame is always empty thus making it possible to move an adjacent numbered tile into the empty cell. Such a puzzle is illustrated in following diagram. The program is to change the initial configuration into the goal configuration. A solution to the problem is an appropriate sequence of moves, such as “move tiles 5 to the right, move tile 7 to the left ,move tile 6 to the down” etc…
o Move empty space (blank) to the left, move blank up, move blank to the right and move blank down. o These moves are modeled by production rules that operate on the state descriptions in the appropriate manner. The goal condition forms the basis for the termination. The control strategy repeatedly applies rules to state descriptions until a description of a goal state is produced. It also keeps track of rules that have been applied so that it can compose them into sequence representing the problem solution. A solution to the 8-puzzle problem is given in fig. 1.
Search process forms the core of many intelligence processes. So, it is useful to structure AI programs in a way that facilitates describing and performing the search process. Production system provides such structures. A production system consists of:
knowledge base should be easily understandable. Production System Characteristics
Control strategies help us decide which rule to apply next during the process of searching for a solution to a problem. Good control strategy should:
This is an exhaustive search technique. The search generates all nodes at a particular level before proceeding to the next level of the tree. The search systematically proceeds testing each node that is reachable from a parent node before it expands to any child of those nodes. Search terminates when a solution is found and the test returns true. Algorithm:
_1. Create a variable called NODE-LIST and set it to initial state.
In order to choose the most appropriate problem solving method, it is necessary to analyze the problem along various key dimensions. These dimensions are referred to as problem characteristics discussed below.
1. Is the problem decomposable into a set of independent smaller or easier sub-problems? A very large and composite problem can be easily solved if it can be broken into smaller problems and recursion could be used. For example, we want to solve :- ∫ x 2 + 3x + sin2x cos2x dx This can be done by breaking it into three smaller problems and solving each by applying specific rules. Adding the results we can find the complete solution. But there are certain problems which cannot be decomposed into sub-problems. For example Blocks world problem in which, start and goal state are given as, Here, solution can be achieved be moving blocks in a sequence such that goal state can be derived. Solution steps are interdependent and cannot be decomposed in sub problems. These two examples, symbolic integration and the blocks world illustrate the difference between decomposable and non-decomposable problems. 2. Can solution steps be ignored or at least undone if they prove unwise? Problem fall under three classes, (i) ignorable, (ii) recoverable and (iii) irrecoverable. This classification is with reference to the steps of the solution to a problem. Consider theorem proving. We may later find that it is of no use. We can still proceed further, since nothing is lost by this redundant step. This is an example of ignorable solutions steps. Now consider the 8 puzzle problem tray and arranged in specified order. While moving from the start state towards goal state, we may make some stupid move
but we can backtrack and undo the unwanted move. This only involves additional steps and the solution steps are recoverable. Lastly consider the game of chess. If a wrong move is made, it can neither be ignored nor be recovered. The thing to do is to make the best use of current situation and proceed. This is an example of an irrecoverable solution steps. Knowledge of these will help in determining the control structure. o Ignorable problems can be solved using a simple control structure that never backtracks. o Recoverable problems can be solved by a slightly more complicated control strategy that allows backtracking. o Irrecoverable problems will need to be solved by a system that expends a great deal of effort making each decision since decision must be final.
3. Is the problem’s universe predictable? Problems can be classified into those with certain outcome (eight puzzle and water jug problems) and those with uncertain outcome (playing cards). In certain – outcome problems, planning could be done to generate a sequence of operators that guarantees to lead to a solution. Planning helps to avoid unwanted solution steps. For uncertain outcome problems, planning can at best generate a sequence of operators that has a good probability of leading to a solution. The uncertain outcome problems do not guarantee a solution and it is often very expensive since the number of solution paths to be explored increases exponentially with the number of points at which the outcome cannot be predicted. Thus one of the hardest types of problems to solve is the irrecoverable, uncertain – outcome problems (Ex:- Playing cards). 4. Is a good solution to the problem obvious without comparison to all other possible solutions? There are two categories of problems - Any path problem and Best path problem. In any path problem, like the water jug and 8 puzzle problems, we are satisfied with the solution, irrespective of the solution path taken. Whereas in the other category not just any solution is acceptable but we want the best path solution. Like that of traveling sales man problem, which is the shortest path problem. In any – path problems, by heuristic methods we obtain a solution and we do not explore alternatives. Any path problems can often be solved in a reasonable amount of time by using heuristics that suggest good paths to explore. For the best-path problems all possible paths are explored using an exhaustive search until the best path is obtained. Best path problems are computationally harder.
rules against states.
In order to solve many hard problems efficiently, it is often necessary to compromise the requirements of mobility and systematicity and to construct a control structure that is no longer guaranteed to find the best answer but will always find a very good answer. Usually very hard problems tend to have very large search spaces. Heuristics can be used to limit search process. There are good general purpose heuristics that are useful in a wide variety of problem domains. Special purpose heuristics exploit domain specific knowledge. For example nearest neighbor heuristics for shortest path problem. It works by selecting locally superior alternative at each step. Applying nearest neighbor heuristics to Travelling Salesman Problem:
Heuristic function maps from problem state descriptions to measures of desirability, usually represented as numbers. Which aspects of the problem state are considered, how those aspects are evaluated, and the weights given to individual aspects are chosen in such a way that the value of the heuristic function at a given node in the search process gives as good an estimate as possible of whether that node is on the desired path to a solution. Well-designed heuristic functions can play an important part in efficiently guiding a search process toward a solution. Every search process can be viewed as a traversal of a directed graph, in which the nodes represent problem states and the arcs represent relationships between states. The search process must find a path through this graph, starting at an initial state and ending in one or more final states. Domain-specific knowledge must be added to improve search efficiency. Information about the problem includes the nature of states, cost of transforming from one state to another, and characteristics of the goals. This information can often be expressed in the form of heuristic evaluation function.
In general, heuristic search improve the quality of the path that are exported. Using good heuristics we can hope to get good solutions to hard problems such as the traveling salesman problem in less than exponential time.
Generate-and-test search algorithm is a very simple algorithm that guarantees to find a solution if done systematically and there exists a solution. Algorithm:
1. Generate a possible solution. For some problems, this means generating a particular _point in the problem space. For others it means generating a path from a start stat.
Hill climbing is a variant of generate-and test in which feedback from the test procedure is used to help the generator decide which direction to move in search space. The test function is augmented with a heuristic function that provides an estimate of how close a given state is to the goal state. Hill climbing is often used when a good heuristic function is available for evaluating states but when no other useful knowledge is available. The key difference between Simple Hill climbing and Generate-and-test is the use of evaluation function as a way to inject task specific knowledge into the control process. Algorithm:
1. Evaluate the initial state. If it is also goal state, then return it and quit. Otherwise _continue with the initial state as the current state.
point at which no progress is being made. A solution is, i. Backtrack to some earlier node and try going in a different direction. ii. Make a big jump to try to get in a new section. iii. Moving in several directions at once.
DFS is good because it allows a solution to be found without expanding all competing branches. BFS is good because it does not get trapped on dead end paths. Best first search combines the advantages of both DFS and BFS into a single method. One way of combining BFS and DFS is to follow a single path at a time, but switch paths whenever some competing path looks more promising than the current one does. At each step of the Best First Search process; we select the most promising of the nodes we have generated so far. This is done by applying an appropriate heuristic function to each of them. We then expand the chosen node by using the rules to generate its successors. If one of them is a solution, we can quit. If not, all those new nodes are added to the set of nodes generated so far. OR Graphs It is sometimes important to search graphs so that duplicate paths will not be pursued. An algorithm to do this will operate by searching a directed graph in which each node represents a point in problem space. Each node will contain: o Description of problem state it represents o Indication of how promising it is o Parent link that points back to the best node from which it came o List of nodes that were generated from it Parent link will make it possible to recover the path to the goal, once the goal is found. The list of successors will make it possible, if a better path is found to an already existing node, to propagate the improvement down to its successors. This is called OR-graph, since each of its branches represents an alternative problem solving path. Implementation of OR graphs We need two lists of nodes: OPEN – nodes that have been generated and have had the heuristic function applied to them but which have not yet been examined. OPEN is actually a priority queue in which the elements with the highest priority are those with the most promising value of the heuristic function. CLOSED- nodes that have already been examined. We need to keep these nodes in
memory if we want to search a graph rather than a tree, since whenever a new node is generated; we need to check whether it has been generated before. Algorithm: Best First Search
_1. Start with OPEN containing just the initial state