CMPSCI 250: Introduction to Computation
David Mix Barrington
Spring, 2011
Homework Assignment #7
Posted Tuesday 22 March 2011
Due on paper in lecture, Friday 15 April 2011.
There are seven questions for 60 total points plus 15 extra credit.
All but one are from
the textbook,
Mathematical Foundation for Computer Science. Note that the book has
both Exercises and Problems -- make sure you are doing a Problem and not the
Exercise with the same number. The number in parentheses following each problem
is its individual point value.
Students are responsible for understanding and following
the academic honesty
policies indicated on this page.
- Excursion 9.11, Writing Exercise 2 (15XC) You may be able to
find a winning Octopawn strategy for one player by hand. But you are
probably better off searching the entire game tree by computer. If
I were doing it, I would define a
Position
class whose
objects have a boolean
telling whose move it is and a
four by four array of int
values: 0 for a blank space,
1 for a White pawn, and 2 for a Black pawn. I would write an
eval
method for this class that determined who would
win from the calling position given optimal play. This would be
recursive, and the hardest thing would be to generate all the
positions that the player could move to.
- Problem 9.10.5 (10) Prove that your strategy is correct. You
may find the winning strategy from an outside source, but be sure to
cite your source in your answer.
- Problem 5.1.3 (10)
- Problem 5.1.5 (10)
- Problem 5.2.5 (10)
- Problem 5.4.2 (10) Note that this problem changed between the
green and blue books -- do the version in the blue book, which is
also in the Fall 2010 errata
page.
- Problem G-1 (10): Give a regular expression, over the
alphabet Σ = {a,b}, for the set of strings that have either
aaa or bbb as substrings (the three a's or three b's must occur
consecutively). Then give a regular expresssion for the
complement of this language -- the set of strings that do not
have an aaa or a bbb in them. Argue that this second expression is correct.
Last modified 5 April 2011