Artificial Intelligence (6CS6.2) Unit 1. A Introduction To Artificial Intelligence
Artificial Intelligence (6CS6.2) Unit 1. A Introduction To Artificial Intelligence
Artificial Intelligence (6CS6.2) Unit 1. A Introduction To Artificial Intelligence
What is AI?
Intelligence: Oxford Dictionary meaning : ability to learn,
understand and think
Examples: 1. Recognition (Speech, Smell, Face, Object) 2. Intuition 3. Inferencing 4. Learning New Skills 5. Decision Making 6. Abstract thinking
What is AI?
1. Thinking humanly
3. Thinking rationally
2. Acting humanly
4. Acting rationally
AI System
Obstacles:
- Informal knowledge representation. - Computational complexity and resources.
4. Acting Rationally
Acting so as to achieve ones goals, given ones beliefs. Does not necessarily involve thinking. Advantages: More general than the laws of thought approach. More amenable to scientific development than human
based approaches.
Task Domains of AI
Mundane Tasks: Perception Vision Speech Natural Languages Understanding Generation Translation Common sense reasoning Robot Control Formal Tasks Games : chess, checkers etc Mathematics: Geometry, logic, Proving properties of programs Expert Tasks: Engineering ( Design, Fault finding, Manufacturing planning) Scientific Analysis Medical Diagnosis Financial Analysis
AI Technique
Intelligence requires Knowledge Knowledge possesses less desirable properties such as: Voluminous Hard to characterize accurately Constantly changing Differs from data that can be used AI technique is a method that exploits knowledge that should be represented in such a way that: Knowledge captures generalization It can be understood by people who must provide it It can be easily modified to correct errors. It can be used in variety of situations
Application of AI
Computer beats human in a chess game. Computer-human conversation using speech recognition. Expert system controls a spacecraft. Robot can walk on stairs and hold a cup of water.
Language translation for web pages. Home appliances use fuzzy logic. And so on...
X o
Data Structures: Board: 9 element vector representing the board, with 1-9 for each square. An element contains the value 0 if it is blank, 1 if it is filled by X, or 2 if it is filled with a O Move-table: A large vector of 19,683 elements ( 3^9), each element is 9-element vector.
Tic-Tac-Toe cont..
Algorithm: 1. View the vector as a ternary number. Convert it to a decimal number. 2. Use the computed number as an index into MoveTable and access the vector stored there. 3. Set the new board to that vector. Advantage: 1. This program is very efficient in time. Limitation: 1. A lot of space to store the Move-Table. 2. A lot of work to specify all the entries in the MoveTable. 3. Difficult to extend.
State Space
To build a system for solving a problem: 1. Define the problem precisely 2. Analyze the problem 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 particular problem. Here we concentrate on first step only.
State Space
A state is representation of elements at a given moment. A problem is defined by its states and their relations. Among all possible states, there are two special states called: 1. Initial state: start point 2. Goal State: or final state Here we also need a successor function (production rules) for state change. It moves one state to another state. A successor function is description of possible actions; a set of operators. A state space is set of all states reachable from initial state. A state space forms a graph in which nodes are states and arcs between nodes are actions. In state space, A path is sequence of states connected by sequence of actions.
Examples
1. 2. 3. 4. 5. 6. 7. Playing Chess Water Jug Problem Missionaries and Cannibals Problem 8 Puzzle Problem Tower of Hanoi problem Travelling Salesman Problem Monkeys and Bananas Problem
move the pawn from Square( file e, rank 2) to Square( file e, rank 4).
However, this approach leads to large number of rules 10120 board positions. Using so many rules poses problems such as: No person could ever supply a complete set of such rules. No program could easily handle all those rules. Just storing so many rules poses serious difficulties. Here we need to write more general rules as much as possible. For example:
(0,0)
(4,0)
(0,3)
(4,3)
(0,0)
(1,3)
(4,3)
(0,0)
(3,0)
0 0 3 3 4 0 2
0 3 0 3 2 2 0
2 9 2 7 5 or 12 9 0r 11
TSP cont
Algorithm: 1. Begin generating complete paths, keeping track of the shortest path found so far. 2. Give up exploring any path as soon as its partial length becomes greater than the shortest path found so far. Using this algorithm, we are guaranteed to find the shortest path. It still requires exponential time. The time it saves depends on the order in which paths are explored.
3. 4.
Production Systems
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 knowledgebase/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
Control Strategies
How to decide which rule to apply next during the process of searching for a solution to a problem? The two characteristics of good control strategy are that 1. It should cause motion. 2. It should be systematic. Two important control strategies are discussed here. 1. BFS (Breadth First Search) 2. DFS (Depth First Search)
Problem Characteristics
In order to choose the most appropriate method for a particular problem, it is necessary to analyze the problem along several key dimensions: 1. Is the problem decomposable into a set of independent smaller or easier sub-problems? 2. Can solution steps be ignored or at least undone if they prove unwise? 3. Is the problems universe predictable? 4. Is a good solution to the problem obvious without comparison to all other possible solutions? 5. Is the desired solution a state of the world or a path to a state? 6. Is a large amount of knowledge absolutely required to solve the problem or is knowledge important only to constrain the search? 7. Amount of interaction between the computer and a person required?
C A
A B C
ON(B,C)
CLEAR(A) CLEAR(A)
ON(A,B) ON(A,B)
3. Is the universe Predictable? Important classes of problems: 1. Certain Outcome: Example: Water Jug Problem, 8-puzzle For solving certain outcome problems, open loop approach ( without feedback) will work fine. 2. Uncertain Outcome: Example: Bridge or controlling a robot arm); For uncertain-outcome problems, planning can at best generate a sequence of operators that has a good probability of leading to a solution. We need to allow for a process of plan revision to take place.
Problem Classification
There are several broad classes into which the problems fall. These classes can each be associated with generic control strategy that is appropriate for solving the problems: 1. Classification : Example - Medical diagnostics, diagnosis of faults in mechanical devices 2. Propose and Refine: Example - Design and planning
4. Partially Commutative and Monotonic: These production systems are useful for solving ignorable problems. Example: Theorem Proving They can be implemented without the ability to backtrack to previous states when it is discovered that an incorrect path has been followed. This often results in a considerable increase in efficiency, particularly because since the database will never have to be restored, It is not necessary to keep track of where in the search process every change was made. They are good for problems where things do not change; new things get created. 5. Partially Commutative and Non-Monotonic: Useful for problems in which changes occur but can be reversed and in which order of operations is not critical. Example: Robot Navigation, 8-puzzle, blocks world Suppose the robot has the following ops: go North (N), go East (E), go South (S), go West (W). To reach its goal, it does not matter whether the robot executes the N-N-E or N-E-N.
6. Non-Partially Commutative Problems in which irreversible change occurs. Example: chemical synthesis The operations can be :Add chemical x to the pot, Change the temperature to t degrees. These ops may cause irreversible changes to the potion being brewed. The order in which they are performed can be very important in determining the final output. (X + Y) + Z is not the same as (Z + Y) + X Non partially commutative production systems are less likely to produce the same node many times in search process. When dealing with ones that describe irreversible processes, it is partially important to make correct decisions the first time, although if the universe is predictable, planning can be used to make that less important.
Monotonic
Bridge
Thanks