CMPSCI 250: Introduction to Computation

David Mix Barrington

Fall, 2004

CMPSCI 250 Practice Midterm #2

Posted 23 October 2004

Actual midterm will be 28 October 2004

There are six questions for 100 total points.

Question 5 (a) corrected 26 Oct 2004.

Question 1 (10): Prove ∃a:∀b:(b≥a)→[∃c:(b<3c)∧(3c<2b)]. This can be done without mathematical induction.

Question 2 (10): Prove by induction that for all naturals n, (n+1)/2≤n. Here the "/" is the Java integer division operator.

Question 3 (20): This problem concerns the three naturals 64, 77, and 91.

Question 4 (20): Prove ∀a:∀b:(b>0)→[∃q∃r:(a=qb+r)∧(r<b)]. (Hint: Let b be arbitrary, assume b>0, and use strong induction on a, with P(a) being the predicate in square brackets.)

Question 5 (20): Define the function f from strings in {a,b}* to strings in {0,1}* by the following rules:

Prove the following, where u is in {a,b}* and w is in {0,1}*:

Question 6:(20) Define a directed ternary tree (DTT) by the following rules:

Recall that a leaf is a node with no arcs out of it. Prove that in any DTT, the number of leaves is twice the number of non-leaves, plus one.

Last modified 26 October 2004