260 likes | 512 Views
Computer Simulation (1). Step 1. A (8). B (5). C (3). A (8). B (5). C (3). Step 2. 8. 4. 4. Goal State. Step 3. Initial State. Step 4. Step 5. Step 6. Step 7. Some fun (and difficult!) games. Theseus and the Minotaur: http://www.logicmazes.com/theseus.html More special mazes
E N D
Step 1 A(8) B(5) C(3) A(8) B(5) C(3) Step 2 8 4 4 Goal State Step 3 Initial State Step 4 Step 5 Step 6 Step 7
Some fun (and difficult!) games • Theseus and the Minotaur: • http://www.logicmazes.com/theseus.html • More special mazes • http://www.logicmazes.com/
Tower of Hanoi INITIAL STATE GOAL STATE ? Play the game: http://www.mazeworks.com/hanoi/
Role of Computer Simulation • Cognitive Science: • Simulate human behavior • Make vague terms concrete (e.g., ‘goals’, ‘memory’, ‘problem solving’) • Simulations help to think through the implications of a complicated theory • Artificial Intelligence: • Simulate intelligent behavior - not necessarily human behavior • Example: chess playing programs
Newell & Simon (1972) • Collected verbal protocols = a record of verbalized thought processes. • Explored computer programs for solving problems in a human way • Refined their computer programs to be closer to protocols
Problem solving as a search problem Goals are often metaphorical spatial locations: • “Searching for a way to reach the goal” • “Getting around roadblocks” • “getting lost” in the middle of a solution • “hitting a dead end” and being forced to “back-track” • “Approaching the problem from a different angle”
Representation of Problem 1) initial state 2) goal state 3) a set of legal operators 4) evaluation function: how far away is each state from goal state
Definitions • Search space (Problem space): the set of all states that potentially be reached by applying available operators. • Solution: a sequence of operators that transform initial state into goal state • A problem solving method: a procedure for finding a solution
Problem Solving is a search problem Initial state Solution Search Space (Problem space) Goal state
Search spaces can be large #DISCS #STATES 3 33 = 27 4 34 = 81 5 35 = 243 6 36 = 729
Search Strategies • Trial and Error • Hill Climbing • Means-End Analysis
Trial & ErrorReach goal after large number of random stepsmany wasted movesBut there is a role for randomness in problem solving – when getting stuck
Initial State 4 3 Hill Climbing At each state, assign a score – here, lower is better At each step, choose a next state with better score (strictly speaking, we are descending from a hill as lower scores are better in this particular example) 4 3 2 3 2 1 Goal State 2 1
Initial State 4 3 Hill Climbing Problem: getting stuck when each next move leads to worse score 4 3 2 3 2 1 Goal State 2 1
Hill climbing • Problem: depending on initial state, may get stuck in local maximum
Hill ClimbingEach state has an associated score – e.g., #discs on peg 3higher = better From current state, go to next best state (highest score) 0 0 1 1 1 0 0 2 1 1 2 1 2 1 1 2 0 0 2 3 1 1 2
Hill ClimbingProblem: ‘local high’a state from which any next step is worsesolution: make some random steps to get out of the “local high”randomness in problem-solving can be good at times 0 0 1 1 1 0 0 2 1 1 2 1 2 1 1 2 0 0 2 3 1 1 2
Most subjects choose this path initially, it seems closer to the goal-state Hill-climbing describes part of human behavior – no global planning
Means-end Analysis • No planning involved in trial & error and hillclimbing • Means-end analyses distinguishes between planning a move vs. executing moves by setting goals • Means-end analysis was first proposed as part of the General Problem Solver (GPS)(Newell and Simon (1972):
Means-end Analysis Search is guided by detection of differences between current state and goal state 1) compare current state to goal state and identify difference 2) select an operator to reduce difference 3) if the operator can be applied, do so; if not, set a new subgoal of reaching a state at which the operator could be applied. Means-ends analysis is then applied to this new subgoal. 4) return to 1
A simple example • Painting your house • Apply paint • Need paint and brush • Go to hardware store • Find car keys
Goal Stack • Painting your house (GOAL 1) • Apply paint (SUBGOAL 2) • Need paint and brush (SUBGOAL 3) • Go to hardware store (SUBGOAL 4) • Went to hardware store (SUBGOAL 4) • Got paint and brush (SUBGOAL 3) • Apply paint (SUBGOAL 2) • Paint the house (GOAL 1)
Goal Stack Solved Goal 4: Pop-offStack Push Goal 1 on Stack Push Goal 2 on Stack Push Goal 3 on Stack Push Goal 4 on Stack G4 G1 G2 G3 G4 G3 G1 G2 G3 G2 G1 G2 G1 G1
Production Systems A set of production rules (if-then rules) IF you have a paint roller And you have paint And you have a surface ready to paint on And the surface is large And your goal is to paint the surface THEN roll the paint onto the surface And expect the surface to be painted
Applying production systems 1) conditions of rules are matched against the currently active contents of working memory 2) if more than one rule is matched, apply procedures for conflict resolution 3) the selected rule is fired 4) return to 1 Anderson’s ACT* model: human cognition is based on production systems