Presentation on theme: "Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011"— Presentation transcript:
1Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011 Midterm ReviewDr. Bernard Chen Ph.D.University of Central ArkansasSpring 2011
2Outline Ch3 Structures and Strategies for State Space Search Ch4 Heuristic SearchCh5 Stochastic Search
3Introduction to Representation The representation function is to capture the critical features of a problem and make that information accessible to a problem solving procedureExpressiveness (the result of the feature abstracted) and efficiency (the computational complexity) are major dimensions for evaluating knowledge representation
4Introduction to Search Given a representation, the second component of intelligent problem solving is searchHuman generally consider a number of alternatives strategies on their way to solve a problemSuch as chessPlayer reviews alternative moves, select the “best” moveA player can also consider a short term gain
5Introduction to Search We can represent this collection of possible moves by regarding each board as a state in a graphThe link of the graph represent legal moveThe resulting structure is a state space graph
7State Space Representation State space search characterizes problem solving as the process of finding a solution path form the start state to a goalA goal may describe a state, such as winning board in tic-tac-toe
8State Space Representation A goal in configuration in the 8-puzzle
9State Space Representation The Traveling salesperson problemSuppose a salesperson has five cities to visit and then must return homeThe goal of the problem is to find the shortest path for the salesperson to travel
11BFS and DFSIn addition to specifying a search direction (data-driven or goal-driven), a search algorithm must determine the order in which states are examined in the graphTwo possibilities:Depth-first searchBreadth-first search
14Outline Ch3 Structures and Strategies for State Space Search Ch4 Heuristic SearchCh5 Stochastic Search
15Introduction IN AI, heuristics are formalized as George Polya defines heuristic as:“the study of the methods and rules of discovery and invention”This meaning can be traced to the term’s Greek root, the verb eurisco, which means “I discover”When Archimedes emerged from his famous bath clutching the golden crown, he shouted “Eureka!!”, meaning I have found itIN AI, heuristics are formalized asRules for choosing those branches in a state space that are most likely to lead to an acceptable problem solution
16Introduction Consider heuristic in the game of tic-tac-toe A simple analysis put the total number of states for 9!Symmetry reduction decrease the search spaceThus, there are not 9 but 3 initial moves:to a cornerto the center of a sideto the center of the grid
18IntroductionUse of symmetry on the second level further reduces the number of path to 3* 12 * 7!A simple heuristic, can almost eliminate search entirely: we may move to the state in which X has the most winning opportunityIn this case, X takes the center of the grid as the first step
21Hill-ClimbingThe simplest way to implement heuristic search is through a procedure called hill-climbingIt expend the current state of the search and evaluate its childrenThe Best child is selected for further expansionNeither it sibling nor its parent are retainedTic-Tac-Toe we just saw is an example
22Dynamic Programming (DP) DP keeps track of and reuses of multiple interacting and interrelated subproblemsAn example might be reuse the subseries solutions within the solution of the Fibonacci seriesThe technique of subproblem caching for reuse is sometimes called memorizing partial subgoal solutions
25Best First SearchFor the 8-puzzle game, we may add 3 different types of information into the code:The simplest heuristic counts the tiles out of space in each stateA “better” heuristic would sum all the distances by which the tiles are out of space
29Minimax Procedure on Exhaustively Search Graphs Let’s consider a variant of the game nimTo play this game, a number of tokens are placed on a table between the two playersAt each move, the player must divide a pile of tokens into two nonempty piles of different sizesThus, 6 tokens my be divided into piles of 5&1 or 4&2 but not 3&3The first player who can no longer make a move loses the game
30Minimax Procedure on Exhaustively Search Graphs State space for a variant of nim. Each state partitions the seven matches into one or more piles.
32Minimax Procedure on Exhaustively Search Graphs Minimax propagates these values up the graph through successive parent nodes according to the rule:If the parent is a MAX node, give it the maximum value among its childrenIf the parent is a MIN node, give it the minimum value among its children
36Exercises Consider 3D tic-tac-toe. How to represent state search space?Analysis the complexity of the state space?Propose a heuristic for playing this game
37Outline Ch3 Structures and Strategies for State Space Search Ch4 Heuristic SearchCh5 Stochastic Search
38Bayes’ Theorem P(A), P(B) is the prior probability P(A|B) is the conditional probability of A, given B.P(B|A) is the conditional probability of B, given A.
39ExercisesSuppose an automobile insurance company classifies a driver as good, average, or bad.Of all their insured drivers, 25% are classified good, 50% are average, and 25% are bad.Suppose for the coming year, a good driver has a 5% chance of having an accident, and average driver has 15% chance of having an accident, and a bad driver has a 25% chance.If John had an accident in the past year what is the probability that John are a good driver?
43Naïve Bayesian Classifier: An Example X = (age <= 30 , income = medium, student = yes, credit_rating = fair)P(X|Ci) :P(X|buys_computer = “yes”) = x x x = 0.044P(X|buys_computer = “no”) = 0.6 x 0.4 x 0.2 x 0.4 = 0.019P(X|Ci)*P(Ci) : P(X|buys_computer = “yes”) * P(buys_computer = “yes”) = 0.028P(X|buys_computer = “no”) * P(buys_computer = “no”) = 0.007Therefore, X belongs to class (“buys_computer = yes”)
44Naïve Bayesian Classifier: An Example Test on the following example:X = (age > 30,Income = Low,Student = yesCredit_rating = Excellent)
45So how is “Tomato” pronounced A probabilistic finite state acceptor for the pronunciation of “tomato”, adapted from Jurafsky and Martin (2000).
46Outline Expert System introduction Rule-Based Expert System Goal Driven ApproachData Driven ApproachModel-Based Expert System
47The Design of Rule-Based Expert System architecture of a typical expert system for a particular problem domain.
48Strategies for state space search In data driven search, also called forward chaining, the problem solver begins with the given facts of the problem and set of legal moves for changing stateThis process continues until (we hope!!) it generates a path that satisfies the goal condition
49Strategies for state space search An alternative approach (Goal Driven) is start with the goal that we want to solveSee what rules can generate this goal and determine what conditions must be true to use themThese conditions become the new goalsWorking backward through successive subgoals until (we hope again!) it work back to
50A unreal Expert System Example Rule 1: ifthe engine is getting gas, andthe engine will turn over,thenthe problem is spark plugs.Rule 2: ifthe engine does not turn over, andthe lights do not come onthe problem is battery or cables.Rule 3: ifthe lights do come onthe problem is the starter motor.Rule 4: ifthere is gas in the fuel tank, andthere is gas in the carburetorthe engine is getting gas.
51The production system at the start of a consultation in the car The production system at the start of a consultation in the car diagnostic example.
56The production system after evaluating the first premise of Rule 2, which then fails.
57The data-driven production system after considering Rule 4, beginning its second pass through the rules.
58Model-Based Expert System A more robust, deeply explanatory approach would begin with a detailed model of the physical structure of the circuit and equations describing the expected behavior of each component and their interactions.A knowledge based reasoner whose analysis is founded directly on the specification and functionality of a physical system is called a MODEL-BASED System