CMPSCI 250: Introduction to Computation

David Mix Barrington

Fall, 2004

Question and Answers on HW#4

Due on paper in class, Friday 22 October 2004

Questions are in black, answers in blue

Question #5, 21 Oct 2004

Is there a typo in the definition of strong induction in the book, on page 4-20? Something doesn't look right.

Yes, in the second of the three bullets on that page the final "P(n)" should read "P(i)".

Question #4, 20 Oct 2004

For Problem 4.7.3, may I use other functions besides append? Do I have to use append?

Sorry, as I mentioned in lecture Wednesday, this should have said "using append and the other basic methods", by which I meant last and allButLast. You need not use append if you find that you don't need it.

Question #3, 16 Oct 2004

For 4.3.3, what is my base case, n=0, r=0, or r=2?

The variable r is constant throughout the problem, as it is an arbitrary real number that is not 1. What changes is n, so you are using induction on n and the base case is the smallest sensible value of n which is n=0. The base case says "The sum of the sequence consisting of just a0 is (a0 - a1)/(1 - r)".

Question #2, 16 Oct 2004

I think 4.10.3 (a) is wrong, because doesn't the infix expression "-a" begin with an operator?

You're right, the question should read "never begins with a binary operator".

Question #1, 16 Oct 2004

In 4.3.1, what is the first perfect cube, 0 or 1? And what is my base case?

The first perfect cube is 1. You can have either n=0 or n=1 as a base case, I prefer n=0 because "the sum of the first 0 perfect cubes" makes sense. Your main job here is to find a formula that gives the right answer for all n. For n=0 it should give 0, for n=1 it should give 1, for n=2 it should give 1 + 8 = 9, for n=3 it should give 1 + 8 + 27 = 36, and so on.

Last modified 21 October 2004