Problem space


Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Problem space

  2. 2. <ul><li>Problem </li></ul><ul><li>Defining problem in state space </li></ul><ul><li>Production system </li></ul><ul><li>Characteristics of production system </li></ul><ul><li>Control strategy </li></ul><ul><li>Search Space algo’s </li></ul><ul><ul><li>Breadth first Search </li></ul></ul><ul><ul><li>Depth first search </li></ul></ul><ul><ul><li>Heuristic Search </li></ul></ul><ul><li>Problem Characteristics </li></ul>
  3. 3. <ul><li>Any task to be done or goal to be achieved. </li></ul><ul><li>A problem can be solved by </li></ul><ul><ul><li>Defining configuration of problem precisely. </li></ul></ul><ul><ul><li>Analyzing the problem </li></ul></ul><ul><ul><li>Defining essential features – which can have an impact on accuracy of problem solving techniques. </li></ul></ul><ul><ul><li>Defining knowledge to solve a particular problem </li></ul></ul><ul><ul><li>Applying best possible technique to solve it. </li></ul></ul>
  4. 4. <ul><li>A problem should be defined in state space, which will include </li></ul><ul><ul><li>Initial state – Starting position in chess </li></ul></ul><ul><ul><li>Legal possible Solutions – Possible moves in chess </li></ul></ul><ul><ul><li>Goal state – Not only playing but also winning </li></ul></ul><ul><ul><li>Rules applicable </li></ul></ul><ul><ul><li>But it tough to state all the rules correctly and will cause some storage problem also. </li></ul></ul>
  5. 5. <ul><li>We have 2 jugs, one of 4-gallon, second of 3-gallon. No measurement or no marking is there on jugs. We have fill 4-gallon jug with 2 gallon water. </li></ul><ul><li>Assumptions </li></ul><ul><ul><li>X  range from 0 to 4 for 4-gallon jug </li></ul></ul><ul><ul><li>Y  range from 0 to 3 for 3-gallon jug </li></ul></ul><ul><ul><li>We can fill water through pump. </li></ul></ul><ul><ul><li>We can pour waste water on ground. </li></ul></ul><ul><ul><li>We can put water from one jug to another. </li></ul></ul>
  6. 6. <ul><li>Initial state – (X, Y) = (0, 0) </li></ul><ul><li>Goal State – (X, Y) = (2, n) </li></ul><ul><li>Production system – </li></ul><ul><ul><li>(x, y) Result Description </li></ul></ul><ul><ul><li>If(x<4) (4, y) Fill X jug in full </li></ul></ul><ul><ul><li>If(y<3) (X, 3) Fill Y jug in full </li></ul></ul><ul><ul><li>If(x>0) (X-d, Y) Take some water out of X jug </li></ul></ul><ul><ul><li>If(y>0) (X, Y-d) Take some water out of Y jug </li></ul></ul>
  7. 7. <ul><ul><li>(x, y) Result Description </li></ul></ul><ul><ul><li>If(x>0) (0, Y) Empty 4 gallon jug </li></ul></ul><ul><ul><li>If(Y>0) (X, 0) Empty 3 gallon jug </li></ul></ul><ul><ul><li>If(x+y>=4, y>0) (4, y-(4-x)) Put some water in 4 from 3 gallon jug to fill it up. </li></ul></ul><ul><ul><li>If(x+y>=3, x>0) (x-(3-y), 3) Put some water in 3 from 4 gallon jug to fill it up. </li></ul></ul><ul><ul><li>If(x+y<=4, y>0) (x+y, 0) Put all water in 4 from 3 gallon jug to fill it up. </li></ul></ul><ul><ul><li>If(x+y<=3, x>0) (0, x+y) Put some water in 3 from 4 gallon jug to fill it up. </li></ul></ul>
  8. 8. <ul><ul><li>(x, y) Result Description </li></ul></ul><ul><ul><li>(0, 2) (2, 0) Put water from 3 gallon jug to 4 gallon jug </li></ul></ul><ul><ul><li>(2, Y) (0, Y) Empty 4 gallon jug by dropping water on ground. </li></ul></ul><ul><ul><li>Problems are </li></ul></ul><ul><ul><ul><li>if jugs are already filled then 1, 2 rules </li></ul></ul></ul><ul><ul><ul><li>Take some water out of jugs, but we are supposed to add water (3, 4) </li></ul></ul></ul><ul><ul><ul><li>If we are with 2 gallon jug at end then what is the need to go for 11, 12 rule </li></ul></ul></ul>
  9. 9. 4- Gallon jug 3- Gallon jug Rules 0 0 0 3 2 3 0 9 3 3 2 3+1=4 3-1=2 7 0 2 11 2 0
  10. 10. 4- Gallon jug 3- Gallon jug Rules 0 0 4 0 4-3=1 0+3=3 1 0 0 1 4 1 4-2=2 1+2=3
  11. 11. <ul><li>A structure that helps in describing and performing search in order to solve a problem is known as production system. </li></ul><ul><li>It contains </li></ul><ul><ul><li>Rules to follow </li></ul></ul><ul><ul><li>LHS shows current situation </li></ul></ul><ul><ul><li>RHS shows resulting state after applying the rule on current state. </li></ul></ul><ul><ul><li>Database describing rules, Information regarding rules can be temporary or permanent. </li></ul></ul>
  12. 12. <ul><li>Control strategy to specify order of rules which are applicable. </li></ul><ul><li>A rule applier like a chess player. </li></ul><ul><li>Example production systems are: </li></ul><ul><ul><li>Basic production system like OPS5. </li></ul></ul><ul><ul><li>Complex and Hybrid systems known as expert system shells to generate knowledge based systems. </li></ul></ul><ul><ul><li>General problem solver system like SOAR </li></ul></ul>
  13. 13. <ul><li>Control strategy specifies the order of essential rules which should be followed to solve a particular problem. </li></ul><ul><li>Control Strategies can be of 2 types </li></ul><ul><ul><li>Movable strategies: Strategies should have motion like in water jug problem, every time we have to start from first rule. But if first rule is not applicable then we will not be able to move further. </li></ul></ul>
  14. 14. <ul><ul><li>Systematized: It should have some system or order to be followed. If water jug problem can be solved by picking random rules and repeating rules then that could have motion but again no order to be followed. </li></ul></ul><ul><ul><li>Motion should be local as well as global </li></ul></ul>
  15. 15. <ul><li>Breadth first search: Representing water jug problem starting with its initial state along with its off springs i.e. various possible solutions until for reaching a goal state. </li></ul><ul><ul><li>It gives local as well as global motion. </li></ul></ul><ul><li>Depth first search: One node of tree is explored until either dead end or goal state is not found. </li></ul><ul><ul><li>In case of dead end chronological back tracking is done to explore various other ways to solve that problem. It also keeps current searching path in memory. </li></ul></ul>
  16. 16. library school hospital factory park newsagent university church Explore nodes in tree order: library, school, hospital, factory, park, newsagent, uni, church. (conventionally explore left to right at each level)
  17. 17. <ul><li>Nodes explored in order: library, school, factory, hospital, park, newsagent, university. </li></ul>library school hospital factory park newsagent university
  18. 18. Initial state One level BFS Second level BFS <ul><li>Create a variable node list and specify it with its initial state. </li></ul><ul><li>Take first node from node list, if it is empty go for quit else generate its successors. </li></ul><ul><li>For every successor: generate a new state, apply rule </li></ul><ul><ul><li>If it is a goal state return success and quit else add new state to a new list. </li></ul></ul><ul><ul><li>This is supposed to be done until or unless solution is found or node list is empty. </li></ul></ul>0, 0 4, 0 0, 3 4, 3 0, 0 1, 3 4, 3 0, 0 3, 0
  19. 19. <ul><li>It does not takes us to the blind way. </li></ul><ul><li>It will definitely give us the solution, if that exists. </li></ul><ul><li>It gives us solution with minimum value. </li></ul><ul><li>It guarantees that a solution with minimum value will be explored first, only at last all nodes with maximum values will be explored. </li></ul>
  20. 20. Initial state Subordinates <ul><li>Create a variable node list and set it to initial state, If it is a goal state then return success and quit, else chose one node n from node list. </li></ul><ul><li>Mark it as initial state, If it is empty then return failure and quit. </li></ul><ul><li>Otherwise apply an operator to generate its successor, if it is a goal state return success and quit. </li></ul><ul><li>Otherwise continue the loop until solution is not found. </li></ul>0, 0 4, 0 4, 3
  21. 21. <ul><li>Advantages: </li></ul><ul><ul><li>It takes less memory as compared to BFS as BFS requires entire tree to be stored but this requires only one path. </li></ul></ul><ul><ul><li>Sometimes solution lies in earlier stages then DFS is better. </li></ul></ul><ul><ul><li>If there are multiple solutions then DFS stops when first solution is found. Where as BFS gives all the solutions at the same time. </li></ul></ul>
  22. 22. <ul><li>Disadvantages: </li></ul><ul><ul><li>Sometimes it gives dead end after searching a lot. </li></ul></ul><ul><ul><li>It can or cannot give solution to a problem. </li></ul></ul><ul><li>Traveling Salesman Problem </li></ul><ul><li>A  B  C  D  A = 5700 </li></ul><ul><li>A  D  C  B  A = 5450 (Best path) </li></ul>CITIES A B C D A X 250 1400 900 B 650 1800 200 1100 C X 2000 3600 4000 D 1250 X 1900 600
  23. 23. <ul><li>In order to solve hard problems, we have to lack mobility or system. </li></ul><ul><li>Some techniques are good enough to choose area of some ones interest. </li></ul><ul><li>Some are bad enough to lack interest. </li></ul><ul><li>For some solutions, we have to lack completeness and accuracy. </li></ul>
  24. 24. <ul><li>Simple or General heuristic functions are applicable in every domain. </li></ul><ul><ul><li>It can be used for having optimal solution. </li></ul></ul><ul><ul><li>For having deep understanding of knowledge and problem. </li></ul></ul><ul><ul><li>Where a large problem is not decomposable into smaller parts. </li></ul></ul><ul><ul><li>If value of x and y is same then what will be the value of F(x, y). </li></ul></ul><ul><ul><ul><li>Square if f is for multiplication. </li></ul></ul></ul><ul><ul><ul><li>Identity if f is a union function. </li></ul></ul></ul><ul><ul><ul><li>Suicide if f is a killing function. </li></ul></ul></ul><ul><li>. </li></ul>
  25. 25. <ul><li>Special heuristic functions are for complex problems eg. Nearest neighbor is used to solve salesman problem. </li></ul><ul><ul><li>They can be used as a rule itself </li></ul></ul><ul><ul><li>As a heurist function, which gives description of state as well as its desirability. </li></ul></ul><ul><ul><li>Chess  High value of heuristics </li></ul></ul><ul><ul><li>Tic-Tac-Toe  High value </li></ul></ul><ul><ul><li>Salesman  Low value. </li></ul></ul>
  26. 26. <ul><li>Is problem decomposable or not? </li></ul><ul><ul><li>If problem can be solved immediately then its ok, otherwise if decomposable then decompose it into simpler one, else apply some hard technique. </li></ul></ul><ul><li>Is problem undone or not? </li></ul><ul><ul><li>Chess  cannot undone (irrecoverable) </li></ul></ul><ul><ul><li>Puzzle  can be undone (recoverable) </li></ul></ul>Initial state Goal state 2 8 3 1 6 4 7 5 1 2 3 8 4 7 6 5
  27. 27. <ul><li>Is universe predictable: solutions or moves predictable in advance or not? </li></ul><ul><ul><li>In case of card game we cannot predict what is in opponents hand and what would be his reaction after our show. We can move according to our choice. </li></ul></ul><ul><ul><li>Some problems are uncertain and undone, for them planning leads to high cost and time. </li></ul></ul><ul><ul><li>Controlling a robot arm  uncertain </li></ul></ul><ul><ul><li>8 Puzzle  certain </li></ul></ul><ul><ul><li>Depending a client against murder charge is  uncertain. </li></ul></ul>
  28. 28. <ul><li>Is good solution a solution or a way to the solution? </li></ul><ul><ul><li>Each state opted for solving a problem must have interaction with next or previous states. </li></ul></ul><ul><ul><li>Eg. A bank president ate a dish of pasta salad with fork. </li></ul></ul><ul><ul><li>Natural language understanding and numerical problems can better distinguish between a state or a solution. </li></ul></ul><ul><li>What is the role of the knowledge? </li></ul><ul><ul><li>How much knowledge is required like chess requires only knowledge of legal and possible moves </li></ul></ul><ul><ul><li>Which newspaper supports republicans or democrats requires high knowledge. </li></ul></ul>
  29. 29. <ul><li>If problem requires interaction or not? </li></ul><ul><ul><li>How much interaction between user and a system is required? </li></ul></ul><ul><ul><li>Interaction can be for taking input, giving output, taking or giving instructions, updating knowledge base. </li></ul></ul><ul><li>Is a good solution absolute or relative? </li></ul><ul><ul><li>If we know initial state, goal state to be achieved and instructions to be followed then solution would be absolute else relative. </li></ul></ul>
  30. 30. <ul><li>To which classification a problem belongs: Like Medical or Mechanical. </li></ul>
  31. 31. <ul><li>Marcus is a man </li></ul><ul><li>All men are mortal. </li></ul><ul><li>Marcus is a pompien. </li></ul><ul><li>All pompiens died in volcano in 79 AD. </li></ul><ul><li>No mortal can live more than 150 years. </li></ul><ul><li>It is now 1991. </li></ul><ul><li>Marcus born in 40 AD. </li></ul><ul><li>Q:  Is Marcus alive? </li></ul>
  32. 32. Monotonic Repetition of rules is allowed Non-Monotonic No such Repetition is allowed Partially Commutative If x gives y then permutation of x also gives y Theorem Proving Robot Navigation Non Partially Commutative It is both monotonic and partial commutative Chemical Synthesis Bridge
  33. 33. <ul><li>Forward or Backward Reasoning i.e from Initial to goal state or vice versa. </li></ul><ul><li>Rule Matching: applying rule to initial state and moving on to the goal state. </li></ul><ul><li>Representation of knowledge can be in frame, fact or Script format. </li></ul>
  34. 34. Search Tree Search Graph 0,0 is appearing 2 times and it is one of our previous state so instead of repeating it we just linked it. It requires a small book-keeping which is called a graph. 0, 0 4, 0 0, 3 4, 3 0, 0 1, 3 4, 3 0, 0 3, 0 0, 0 4, 0 0, 3 4, 3 0, 0 1, 3 4, 3 0, 0 3, 0
  35. 35. <ul><li>Check for new node, if it already exists then just point to the already existing. </li></ul><ul><li>Otherwise add it to the graph. </li></ul><ul><li>If it already exists then </li></ul><ul><ul><li>Set a pointer pointing to that previous node. </li></ul></ul><ul><ul><li>Keep track of all the paths and select the best path out of all generated paths and record them. </li></ul></ul><ul><li>Advantages:- </li></ul><ul><li>It saves our time </li></ul><ul><li>It is useful for dealing with partial commutative systems. </li></ul>
  36. 36. <ul><li>Missionaries and Cannibals problem. </li></ul><ul><li>Tower of Hanoi. </li></ul><ul><li>Monkey and Banana’s Problem </li></ul><ul><li>Crypt arithmetic problem: </li></ul><ul><ul><li>SEND + MORE=MONEY </li></ul></ul><ul><ul><li>DONALD + GERALD=ROBERT </li></ul></ul><ul><ul><li>CROSS + ROADS=DANGER. </li></ul></ul>
  37. 37. <ul><li>If problem satisfies all the above characteristics then we can best answers in less time with less cost. </li></ul><ul><li>This is the main aim of AI. </li></ul>