Homework 0

Homework 0
This homework will NOT normally be graded or turned in, unless you want extra credit.
If you do want to hand in your work, you can earn 0.5% to 2% extra credit for everyone in your group.
Solid work = 0.5%
Very good work = 1%
Excellent work that I want to show in class = 2% (original or little known problem, interesting
observations, beautiful figures, references to books/websites for more info…)
Format: Create slides similar to the ones I am using to teach this class. In editable PowerPoint format.
Due: Oct 15th Hand in one paper copy AND email me the slides.
•You may work in groups of one, two or three.
• Find a problem, and discuss how you would go about making it into a search problem (as in the waterjug example, or the tangram example below).
• In particular, what is the initial state, the goal state, the operators. Does the search tree have any
special properties? What is the diameter? How would that effect your choice of search algorithm…
• Your problem could be a real world problem (like container ship loading, or GPS directions). However, if you want to
do “puzzles”, then a great source of puzzles are:
• The works of Henry Dudeney (free books in many formats at
http://www.gutenberg.org/ebooks/search/?query=Dudeney+Henry+)
•http://www.gutenberg.org/files/27635/27635-h/27635-h.htm
•http://www.gutenberg.org/files/16713/16713-h/16713-h.htm
• The works of Martin Gardner www.puzzles.com/puzzleplayground/Authors/MartinGardner.htm (Many of his puzzle
books are available in the library)
Below is a sample, I would grade
it at Solid work = 0.5%
The Tangram Problem
Informal Problem Description:
Given these 7 shapes, assemble
them into a square.
Note that the goal state here is implicit. We can describe it, but we
cannot actually draw it out.
In general, we don’t know if there is a goal state. As it happens, in
this case there is 1 (not counting rotations and reflections).
goal state
solution
At a low level, how do we know if the shapes make up the goal state?
The initial state is a “blank”
square.
We know the size of the square (we
can simply sum the areas of the
seven shapes)
What should the operators be?
How about insert(shape_number,x,y,r) ?
Bad idea, operators must be atomic…
We can use an insertion function that
requires:
• At least one edge of the shape must touch an edge
of another shape or the walls of the box.
• At least one vertex of the shape must coincide
with a vertex of another shape or of the box.
…
…
…
An idea to reduce the branching factor.
Since like the 8-queens problem, the order in which the shapes are
inserted does not matter (unlike the 8-puzzle or FWDC) we could
randomly label the shapes 1 to 7 and only attempt to insert the ith
shape at the ith level
2
3
1
5
7
4
6
An BAD idea to reduce the branching factor!
Since like the 8-queens problem, the order in which the shapes are
inserted does not matter (true for humans, but not for search with
the operators I defined) we could randomly label the shapes 1 to 7
and only attempt to insert the ith shape at the ith level
Assume this labeling
1
2
3
5
7
4
No solution!
6
An good idea to reduce the branching factor.
If both 6 and 7 (or 3 and 5) are still available to be inserted, only
consider inserting one of them.
2
1
3
5
7
4
6
…
What can we say about
the search tree?
• It is exactly depth 7
• Every node at depth 7 is a
solution.
How does this effect the
choice of search algorithm?
…
…