problem solving what is ai way of solving problem?

29
Problem Solving What is AI way of solving problem?

Post on 19-Dec-2015

250 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Problem Solving What is AI way of solving problem?

Problem Solving

What is AI way of solving problem?

Page 2: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 2

Problem Solving

Example

CAR BREAK DOWN

Page 3: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 3

Problem Solving

Steps

• Analyze the problem

• Represent it

• Observe the present state

• Infer actions

• Solve to achieve the goal

Development Phase

Implementation Phase

Page 4: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 4

Problem Solving

Analyze• Identify possible states• Identify possible actions• Identify possible goals• States, Actions, and Goals relate

through rules• Generate Rules that govern the

problem/or are helpful in searching the goal

Page 5: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 5

Problem Solving

Analyze: Car Break Down

• Possible States (that you can observe or measure): –Air fuel ratio–Temperature–Engine sound–Fuel Consumption

Page 6: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 6

Problem Solving

Analyze: Goals

• Reduction in Fuel Consumption

• High Pickup

• Low Coolant Temperature

• High Air-Conditioning Efficiency

• etc…

Page 7: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 7

Problem Solving

Analyze: Actions

• Change condenser

• Change carburetor

• Get wheel alignment

• Etc…

Page 8: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 8

Problem Solving

Analyze: RulesIf the air fuel (A/F) ratio is not correct (state observed)

THENTHENCarburetor needs adjustment (action identified)

WHICHWHICH Will achieve correct A/F ratio (Goal to be achieved)

Page 9: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 9

Problem Solving

Represent Problem

• Convert the problem into a format that is understood by the computer system for automatic processing

• Numerous Techniques are available• Propositional /Predicate Calculus (formal)• Semantic / Conceptual Graphs (Graphical)• Search Trees (Graph Theory)• Rule Based/Expert Systems (Informal)• Learning Methods (Statistical/Symbolic)

Page 10: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 10

Problem Solving

Represent: Example

IF the A/F ratio > 1.5

THEN change carburetor

IF coolant temperature > 250 c

THEN change condenser

MATLAB,

Prolog,

C++,

Lisp

As the course progresses we will study more of these representational techniques

Page 11: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 11

Problem Solving

Implementation Phase

• Observe:– Use sensors/stored information/user input to get the

information about the present state within the problem domain.

• Infer:– Use above information to select appropriate actions that

will lead to the goal.

• Achieve Goal:– Apply actions in sequence/parallel to achieve goal

Page 12: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 12

Problem Solving

Problem types

• Deterministic, fully observable

• Partial Deterministic and observable– Partial knowledge of states and actions

Page 13: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 13

Problem Solving

Problem types

• Deterministic, fully observable

single state problem– know exactly present state;– solution is a sequence of known actions.

Page 14: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 14

Problem Solving

Problem types

Partial knowledge of states and actions:• Non-observable sensorless or conformant problem

• May have no idea where one is; • solution (if any) is a sequence.• As if you are blind folded

• Nondeterministic and/or partially observable contingency problem

• Percepts provide new information about current state • solution is a tree or policy; often interleave search and execution.• States, actions and Rules of the environment are known, but current

state assessment is only possible after observation

• Unknown state space exploration problem (“online”)– When states and actions of the environment are unknown.

Page 15: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 15

Problem Solving

More Examples

• Path Finding

• 8 Puzzle

• Robot Assembly

Primary FOCUS of discussion:

How to Analyze a given problem?

Page 16: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 16

Problem Solving

Example: Romania

Page 17: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 17

Problem Solving

Example: Romania

• On holiday in Romania; currently in Arad– Flight leaves tomorrow from Bucharest

• Formulate goal– Be in Bucharest

• Formulate problem– States: various cities– Actions: drive between cities

• Find solution– Sequence of cities; e.g. Arad, Sibiu, Fagaras, Bucharest, …

Identify Current StateIdentify GoalAnalyzeSolution

Page 18: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 18

Problem Solving

Example: vacuum world

• Goal: Clean all the rooms

• Current State: 5• Single state, start in

#5. Solution??• Possible Actions

Page 19: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 19

Problem Solving

Example: vacuum world

• Single state, start in #5. Solution??

[Movement, clean action]

[Right, Vacuum]

Page 20: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 20

Problem Solving

Example: vacuum world• Single state

start in #5. Solution??[Right, Vacuum]

• Sensorless: start in {1,2,3,4,5,6,7,8} Solution??

• Contingency: start in {1,3}. Solution??

Page 21: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 21

Problem Solving

Example: vacuum world

• States??• Initial state??• Actions??• Goal test??• Path cost??

Page 22: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 22

Problem Solving

Example: vacuum world

• States?? two locations with or without dirt: 2 x 22=8 states.• Initial state?? Any state can be initial• Actions?? {Left, Right, Vacuum}• Goal test?? Check whether squares are clean.• Cost?? Number of actions to reach goal.

Page 23: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 23

Problem Solving

Example: 8-puzzle

• States??• Initial state??• Actions??• Goal test??• Path cost??

Page 24: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 24

Problem Solving

Example: 8-puzzle

• States?? Integer location of each tile • Initial state?? Any state can be initial• Actions?? {Left, Right, Up, Down}• Goal test?? Check whether goal configuration is reached• Cost?? Number of actions to reach goal

Page 25: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 25

Problem Solving

Example: 8-queens problem

• States??• Initial state??• Actions??• Goal test??• Cost??

Page 26: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 26

Problem Solving

Example: 8-queens problem

Incremental formulation vs. complete-state formulation• States?? • Initial state??• Actions??• Goal test??• Cost??

Page 27: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 27

Problem Solving

Example: robot assembly

• States?? • Initial state??• Actions??• Goal test??• Cost??

Page 28: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 28

Problem Solving

Example: robot assembly

• States?? Real-valued coordinates of robot joint angles; parts of the object to be assembled.

• Initial state?? Any arm position and object configuration.• Actions?? Continuous motion of robot joints• Goal test?? Complete assembly (without robot)• Cost?? Time to execute

Page 29: Problem Solving What is AI way of solving problem?

CS 331 Dr M M Awais 29

Problem Solving

Summary

• Analyze:– States, Actions, Goals, Rules

• Represent: – Using any appropriate technique – Estimate the Cost factors (Time and Space Complexity)

• Implement:– Do actual coding/real world implementation– Validate and Test