# Questions and Answers on Homework Assignment #5

#### HW#4 due on paper in class, Monday 7 March 2011

Question text is in black, answers in blue.

• Question 5.1, posted 7 March: I have a difficulty with the definition in Problem 4.6.3. If I look at C(6,6,5), it should be false because it has the same value as C(1,6,5), which is false because 1 != 6. But there is a natural r such that a = rm + b, namely r = 0. Have I got something wrong?

No, I (in the book) have something wrong. Please add the additional condition that C(a,b,m) is FALSE whenever b ≥ m.

• Question 5.2, posted 18 March: I read the correction above, but I'm still confused. If C(a,b,m) is always false when b ≥ m, how can it be true if and only if the natural r exists? For example, if m = 5, a = 11, and b = 6, the natural r satisfies a = rm + b but the new condition makes C(11,6,5) false.

You are right -- the desired condition, that C(a,b,m) is true if and only if that natural r exists such that a = rm + b, is now only true for b < m and you only need to prove it in this case.

• Question 5.3, posted 22 March: In 4.7.3, do I have to use the `append` function?

No, you may use any combination of `last`, `allButLast`, `isEmpty`, and `append`.

• Question 5.4, posted 22 March: For 4.11.5, I don't see any pattern in the lengths for n=0, n=1, and n=2.

Look further, at n=3 and n=4. (I know I didn't draw the n=4 case in the book but you should be able to draw it.) In order to make a recursive proof you are going to have to figure out what the n+1 case's path has to do with the n case's path. The new path is roughly twice as long as the old one -- can you make this precise?