06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

“mcs” — 2017/3/3 — 11:21 — page 239 — #247<br />

7.5. Induction in <strong>Computer</strong> <strong>Science</strong> 239<br />

Problems <strong>for</strong> Section 7.3<br />

Homework Problems<br />

Problem 7.25.<br />

One version of the the Ackermann function A W N 2 ! N is defined recursively by<br />

the following rules:<br />

A.m; n/ WWD 2n if m D 0 or n 1, (A-base)<br />

A.m; n/ WWD A.m 1; A.m; n 1// otherwise: (AA)<br />

Prove that if B W N 2 ! N is a partial function that satisfies this same definition,<br />

then B is total and B D A.<br />

Problems <strong>for</strong> Section 7.4<br />

Practice Problems<br />

Problem 7.26. (a) Write out the evaluation of<br />

eval.subst.3x; x.x 1//; 2/<br />

according to the Environment Model and the Substitution Model, indicating where<br />

the rule <strong>for</strong> each case of the recursive definitions of eval.; / and ŒWD] or substitution<br />

is first used. Compare the number of arithmetic operations and variable lookups.<br />

(b) Describe an example along the lines of part (a) where the Environment Model<br />

would per<strong>for</strong>m 6 fewer multiplications than the Substitution model. You need not<br />

carry out the evaluations.<br />

(c) Describe an example along the lines of part (a) where the Substitution Model<br />

would per<strong>for</strong>m 6 fewer multiplications than the Environment model. You need not<br />

carry out the evaluations.<br />

Class Problems<br />

Problem 7.27.<br />

In this problem we’ll need to be careful about the propositional operations on truth<br />

values and connective symbols that appear in <strong>for</strong>mulas. We’ll restrict ourselves to<br />

<strong>for</strong>mulas with connective symbols And and Not, since we know every propositional

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!