MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29

Description:

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29. Example ... Example 4: Jealous Wives Puzzle. Three jealous wives and three ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 12
Provided by: mathCo8
Learn more at: http://math.colgate.edu
Category:

less

Transcript and Presenter's Notes

Title: MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29


1
MATH 310, FALL 2003(Combinatorial Problem
Solving)Lecture 13, Monday, September 29
2
Example 3 Pitcher Pouring Puzzle
  • We are given three pitchers of water, of sizes 10
    quarts, 7 quarts and 4 quarts.
  • Initially, the 10-quart is full and the other two
    pitchers are empty.
  • Is there a way to pour among pitchers to obtain
    exactly 2 quarts in one of the pitchers?

3
The State Space
  • The state space contains the following
  • S set of states
  • s0 initial state
  • F final or goal states (could be only one)
  • P - set of rules
  • D Admissibility function DP ? S ?
    True,False
  • U Rule application UP ? S ? S.

4
Example 3 Pitcher Pouring Puzzle Exercise 16(a)







  • We are given three pitchers of water, of sizes 8
    quarts, 5 quarts and 3 quarts.
  • Initially, the 8-quart is full and the other two
    pitchers are empty.
  • Is there a way to pour among pitchers to obtain
    exactly 4 quarts in one of the pitchers?

5
Example 3 Pitcher Pouring Puzzle Exercise 16(a)







  • We are given three pitchers of water, of sizes 8
    quarts, 5 quarts and 3 quarts.
  • Initially, the 8-quart is full and the other two
    pitchers are empty.
  • Is there a way to pour among pitchers to obtain
    exactly 4 quarts in one of the pitchers?

6
State Space
  • Here is a part of the state space for Exercise
    16(a).
  • What is the initial state?
  • What are the final states?
  • What are the rules?
  • Are there any states missing?
  • Are there any edges missing?
  • Find DFS and BFS trees.

800
503
350
053
530
323
620
602
152
233
251
440
143
701
710
413
7
Example 4 Jealous Wives Puzzle.
  • Three jealous wives and three husbands come to a
    river.
  • The boat is for two people.
  • Find a sequence of boat trips that will get 6
    people across the river without ever letting any
    husband to be without his wife in the presence of
    another wife.

A,a,B,b,C,c
8
Example 4 Jealous Wives Puzzle.
  • Three jealous wives and three husbands come to a
    river.
  • The boat is for two people.
  • Find a sequence of boat trips that will get 6
    people across the river without ever letting any
    husband to be without his wife in the presence of
    another wife.

A,a,B,b,C,c
9
A Center of a Tree T
  • Let T be an arbitrary tree and let r be any of
    its vertices. Let Tr be the tree rooted at r.
    Vertex r is called a center if the correspondig
    rooted tree Tr has minimal height. Compare
    Exercise 18, p. 103.

7
2
3
4
8
1
6
5
root 1 2 3 4 5 6 7 8
height 3 4 3 4 4 3 4 2
10
4.1. Shortest Paths
  • Homework (MATH 3105M)
  • Read 4.2.
  • Do Exercises 4.1 1,2,4,6,8,10,12
  • Volunteers
  • ____________
  • ____________
  • Problem 1.
  • No Section of Chapter 4 will be on Test 1.

11
Dijkstras Algorithm
  • At each step of the algorithm the (green) edge e
    between a labeled vertex p and unlabeled vertex q
    is selected in such a way, that
  • d(p) k(e)
  • is minimal.
Write a Comment
User Comments (0)
About PowerShow.com