Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Article intelligentie, Exams of Artificial Intelligence

This is for Ai student , in this pdf you can show the exam paper of ai subject

Typology: Exams

2020/2021

Uploaded on 05/04/2021

patel-yash-ravindrabhai
patel-yash-ravindrabhai 🇮🇳

1 document

1 / 114

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 What is AI?
1
Gopi Sanghani, CE Department
| 2180703 Artificial Intelligence
Artificial Intelligence
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.
AI Problems
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.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Article intelligentie and more Exams Artificial Intelligence in PDF only on Docsity!

1 – What is AI?

Artificial Intelligence

 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.

AI Problems

 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.

1 – What is AI?

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.

What is an AI technique?

 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.

1 – What is AI?

understands natural language spoken by humans.

  1. Expert Systems − There are some applications which integrate machine, software, and special information to impart reasoning and advising. They provide explanation and advice to the users.
  2. Computer Vision Systems − These systems understand, interpret, and comprehend visual input on the computer.
  3. Speech Recognition − Some intelligent systems are capable of hearing and comprehending the language in terms of sentences and their meanings while a human talks to it. It can handle different accents, slang words, noise in the background, change in human’s noise, etc.
  4. Handwriting Recognition − The handwriting recognition software reads the text written on paper by a pen or on screen by a stylus. It can recognize the shapes of the letters and convert it into editable text.
  5. Intelligent Robots − Robots are able to perform the tasks given by a human. They have sensors to detect physical data from the real world such as light, heat, temperature, movement, sound, bump, and pressure. They have efficient processors, multiple sensors and huge memory, to exhibit intelligence. In addition, they are capable of learning from their mistakes and they can adapt to the new environment.

Heuristic Search Techniques

Introduction

 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.

  1. Define the problem precisely.  This definition must precisely specify the initial situation (input).  What final situation (output) will constitute the acceptable solution to the problem.
  2. Analyze the problem.  To identify those important features which can have an immense impact on the appropriateness of various possible techniques for solving the problem.
  3. Isolate and represent the task knowledge that is necessary to solve the problem.
  4. Choose the best problem solving technique and apply it to the particular problem.

Defining the Problem as a State Space Search

1. Defining Problem & Search

 A problem is described formally as:

  1. Define a state space that contains all the possible configurations of relevant objects.
  2. Specify one or more states within that space that describe possible situations from which the problem solving process may start. These states are called initial states.
  3. Specify one or more states that would be acceptable as solutions to the problem. These states are called goal states.
  4. Specify a set of rules that describe the actions available.  The problem can then be solved by using the rules, in combination with an appropriate control strategy, to move through the problem space until a path from an initial state to a goal state is found.  This process is known as search.  Search is fundamental to the problem-solving process.  Search is a general mechanism that can be used when more direct method is not known.  Search also provides the framework into which more direct methods for solving subparts of a problem can be embedded.

2. Defining State & State Space

 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.

Heuristic Search Techniques

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

Heuristic Search Techniques

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…

Heuristic Search Techniques

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.

Production System

 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:

  1. A set of rules , each consisting of a left side that determines the applicability of the rule and a right side that describes the operation to be performed if that rule is applied.
  2. One or more knowledge/databases that contain whatever information is appropriate for the particular task. Some parts of the database may be permanent, while other parts of it may pertain only to the solution of the current problem.
  3. A control strategy that specifies the order in which the rules will be compared to the database and a way of resolving the conflicts that arise when several rules match at once. 4. A rule applier which is the computational system that implements the control strategy and applies the rules.  In order to solve a problem: o We must first reduce it to the form for which a precise statement can be given. This can be done by defining the problem’s state space (start and goal states) and a set of operators for moving that space. o The problem can then be solved by searching for a path through the space from an initial state to a goal state. o The process of solving the problem can usefully be modeled as a production system. Benefits of Production System
  4. Production systems provide an excellent tool for structuring AI programs. 2. Production Systems are highly modular because the individual rules can be added, removed or modified independently. 3. The production rules are expressed in a natural form, so the statements contained in the

Heuristic Search Techniques

knowledge base should be easily understandable. Production System Characteristics

  1. Monotonic Production System: the application of a rule never prevents the later application of another rule that could also have been applied at the time the first rule was selected. i.e., rules are independent.
  2. Non-Monotonic Production system is one in which this is not true.
  3. Partially commutative Production system: a production system with the property that if application of a particular sequence of rules transforms state x to state y, then allowable permutation of those rules, also transforms state x into state y.
  4. Commutative Production system: A Commutative production system is a production system that is both monotonic and partially commutative.

Control Strategies

 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:

  1. It should cause motion
  2. It should be Systematic  Control strategies are classified as:
  3. Uninformed/blind search control strategy: o Do not have additional information about states beyond problem definition. o Total search space is looked for solution. o Example: Breadth First Search (BFS), Depth First Search (DFS), Depth Limited Search (DLS).
  4. Informed/Directed Search Control Strategy: o Some information about problem space is used to compute preference among the various possibilities for exploration and expansion. o Examples: Best First Search, Problem Decomposition, A*, Mean end Analysis

Breadth-First Search Strategy (BFS)

 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.

  1. Until a goal state is found or NODE-LIST is empty do:_

Heuristic Search Techniques

Problem Characteristics

 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

Heuristic Search Techniques

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.

Heuristic Search Techniques

rules against states.

  1. How to represent each node of the search process (knowledge representation problem).

Heuristic Search Techniques

 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:

  1. Arbitrarily select a starting city
  2. To select the next city, look at all cities not yet visited and select the one closest to the current city. Go to next step.
  3. Repeat step 2 until all cities have been visited.  This procedure executes in time proportional to N 2 , where N is the number of cities to be visited.

Heuristic Function

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.

Heuristic Search Techniques

 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.

Heuristic Search Techniques

I. Generate-and-Test

 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.

  1. Test to see if this is actually a solution by comparing the chosen point or the endpoint_ of the chosen path to the set of acceptable goal states.
  2. If a solution has been found, quit, Otherwise return to step 1.  It is a depth first search procedure since complete solutions must be generated before they can be tested.  In its most systematic form, it is simply an exhaustive search of the problem space.  It operates by generating solutions randomly.

II. Simple Hill Climbing

 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.

  1. Loop until a solution is found or until there are no new operators left to be applied in_ the current state: a. Select an operator that has not yet been applied to the current state and apply it to produce a new state. b. Evaluate the new state i. If it is the goal state, then return it and quit. ii. If it is not a goal state but it is better than the current state, then make it the current state. iii. If it is not better than the current state, then continue in the loop.

Heuristic Search Techniques

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.

IV. Best First Search

 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

Heuristic Search Techniques

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

  1. Until a goal is found or there are no nodes left on OPEN do:_ a. Pick the best node on OPEN b. Generate its successors c. For each successor do: i. If it has not been generated before, evaluate it, add it to OPEN, and record its parent. ii. If it has been generated before, change the parent if this new path is better than the previous one. In that case, update the cost of getting to this node and to any successors that this node may already have. Best First Search example The A Algorithm*  Best First Search is a simplification of A* Algorithm.  This algorithm uses following functions:
  2. f’: Heuristic function that estimates the merits of each node we generate. f’ = g + h’. f’ represents an estimate of the cost of getting from the initial state to a goal state along with the path that generated the current node.
  3. g: The function g is a measure of the cost of getting from initial state to the current node.
  4. h’ : The function h’ is an estimate of the additional cost of getting from the current node to a goal state.  The algorithm also uses the lists: OPEN and CLOSED