Lecture #24 (11 April 2002)

Reasoning


Overall Reading
Brookshear: bottom of p. 440, Ch. 10.3

Outline:

  • Reasoning
  • Games, Puzzles, and similar Logical Challenges
  • Tic-Tac-Toe
  • Chess
  • The Eight-Puzzle
  • Production Systems
  • Production System for the Eight-Puzzle
  • State Graph
  • Search Tree
  • Heuristics

  • Reasoning

    There are time when humans solve challenges which are not immediately obvious, but require "thinking hard." The ability to solve these sorts of problems is often considered by many people, as one of the highest levels of human intelligence.

  • Can you solve Rubik's Cube?
  • How well can you play chess?
  • "Three wolves and three chickens want to cross a river..."
  • Interestingly, for computers, this is one of the more natural areas of success in "Artificial Intelligence".


    Games, Puzzles, and similar Logical Challenges

    Why are these perhaps more amenable to computers than humans?
  • Most of these are "discrete" by nature.
  • They are not open-ended, rather there is usually a well-defined goal and set of rules. (so true 'creativity' is not needed)
  • Let's consider some examples:

  • Tic-Tac-Toe (demo)

    To play a good game of Tic-Tac-Toe, a computer does not really need to know how to think. It can simply simulate all possible games in advance, and only then, commit to a given move.



  • Chess.

    Then why can't a computer play a "perfect" game of chess? Because there are way too many possible games. Way too many! We will never in our lifetime see a computer that would have the speed and memory to be able to simulate the game all the way to the end.

    So lacking the ability to map out the entire game, how is a computer to decide its next move?



  • The Eight-Puzzle

    Let's play (listed in order of 'coolness' ?):

  • www.javaonthebrain.com/java/puzz15/
  • student.lssu.edu/~gbharadw/java/puzzle.html
  • www.rideau-info.com/canal/puzzles/sliderpuz1.html
  • www.cut-the-knot.com/pythagoras/fifteen.shtml
  • There are over 181000 possible configurations. In truth, computers can solve this by brute force, but this is getting towards the size where things might get slow.

  • Production Systems

    Approaches for many of these discrete challenges can be described using the following general framework:
  • States
    Each state is a distinct configuration that might occur in the environment. For example, the "start state" is where we begin. The "goal state" (or states) is the desired setting.

  • Production Rules
    The operations which can be performed to switch directly from one state to another state. (e.g., the 'moves' in a game)

  • Control System
    What logic is used to decide the precise steps which take us from the start state to a goal state.

  • Production System for the Eight-Puzzle

  • State Graph
    The states and the productions between neighbor states can be described with what is known as a state graph:




  • Search Tree
    If we are given a specific start state, we might try to discover a path to a goal state by creating what is known as a search tree:

    For start states which are "far" away from the goal state, this search tree might become huge (even for computers). It may not be reasonable to expect to build the entire tree. Fortunately, as soon as you find a path to a goal state, you can stop the process.

    So, if you are to build up the tree from scratch, with hopes of finding the goal quickly, how should you proceed?

    How do you do this as a human?

    Possible approaches:

  • Breadth-First Search (BFS)
    Find all states that are reachable in one step.
    Then find all states that are reachable in two steps...

  • Depth-First Search (DFS)
    Find any branch from the start state, and explore that branch completely. If it ever reaches a dead-end, then backtrack and try some other possibility.

  • Heuristic Search
    In reality, we probably use a mix of these strategies as humans. We like to explore promising paths more deeply, though rather than devoting all of our efforts to one possibility, we may decide that it is worthwhile to start exploring some alternative.

    The key, however, is how to evaluate the relative "goodness" of various intermediate states. The "promising" ones are hopefully closer to the goal state.

    A heuristic is a (computable) quantitative measure which provides an estimate of the true distance from a state to the goal.

    The better the heuristic is, the better the search can progress! (this is really a key for computers playing chess).

    Let's consider the eight-puzzle.

  • Heuristic 1: Count the number of tiles out of position.

    So which of the following two states is "better" ?

    123
    4 5
    786
    Value=2

    23
    456
    781
    Value=1

  • Heuristic 2: For each tile, calculate the number of moves it is away from its proper space; sum these values for all tiles to measure the value of a configuration.

    123
    4 5
    786
    Value=2

    23
    456
    781
    Value=4



  • Control System

    The rest of the figures below demonstrate the use of this algorithm on an example, while using the second of the two heuristics developed for the eight-puzzle (summing the number of moves away for each out-of-place tile).


  • comp150 Class Page
    mhg@cs.luc.edu
    Last modified: 11 April 2002