# Homework Assignment #3

#### Due on paper in lecture, Friday 24 February 2012.

There are eight questions for 60 total points plus 10 extra credit. All but two 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.

Correction in brown added 20 February.

• Problem 2.8.3 (5)

• Problem 2.10.2 (5)

• Problem 2.10.5 (10) In part (a), the relation B as defined is not a partial order because the champion is never eliminated. Replace the definition of B(x, y) with "team x did not stay in the tournament strictly longer than team y".

• Problem C-1 (10): Let Σ be the alphabet {A, B,..., Z}. Define the relation SV on strings in Σ* so that SV(x, y) is true if every vowel that occurs in x also occurs in y, and vice versa. (We consider only A, E, I, O, and U to be vowels.) For example, the pair ("AMHERST", "PELHAM") is in the relation SV. Prove that SV is an equivalence relation. Let HT be the names of the 20 towns in Hampshire County, Massachusetts. Describe the partition of the set HT corresponding to the relation SV.

• Problem 3.1.6 (10)

• Problem 3.3.3 (5)

• Problem 3.3.5 (10)

• Problem C-2 (5 + 10 extra credit): Define a positive natural to be a Kenken number if it is possible to write it as a product of one-digit numbers. (For example, 441 is a Kenken number because it is 7 times 7 times 9.)

• (a, 5) Find the largest three-digit Kenken number. Justify your answer.

• (b, 10 extra credit) Write a static boolean method in real Java that takes an `int` argument x and returns true if and only if x is a Kenken number.

Note: Your answer may assume the truth of the Fundamental Theorem of Arithmetic.