06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

“mcs” — 2017/3/3 — 11:21 — page 226 — #234<br />

226<br />

Chapter 7<br />

Recursive Data Types<br />

3. the composition f ı g.<br />

Prove by structural induction on this definition that if f .x/ is an Atrig, then so is<br />

f 0 WWD df =dx.<br />

Problem 7.13.<br />

Definition. The set RAF of rational functions of one real variable is the set of<br />

functions defined recursively as follows:<br />

Base cases:<br />

The identity function, id.r/ WWD r <strong>for</strong> r 2 R (the real numbers), is an RAF,<br />

any constant function on R is an RAF.<br />

Constructor cases: If f; g are RAF’s, then so is f ~ g, where ~ is one of the<br />

operations<br />

1. addition C,<br />

2. multiplication or<br />

3. division =.<br />

(a) Describe how to construct functions e; f; g 2 RAF such that<br />

e ı .f C g/ ¤ .e ı f / C .e ı g/: (7.32)<br />

(b) Prove that <strong>for</strong> all real-valued functions e; f; g (not just those in RAF):<br />

Hint: .e ~ f /.x/ WWD e.x/ ~ f .x/.<br />

.e ~ f / ı g D .e ı g/ ~ .f ı g/; (7.33)<br />

(c) Let predicate P.h/ be the following predicate on functions h 2 RAF:<br />

P.h/ WWD 8g 2 RAF: h ı g 2 RAF:<br />

Prove by structural induction on the definition of RAF that P.h/ holds <strong>for</strong> all h 2<br />

RAF.<br />

Make sure to indicate explicitly

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

Saved successfully!

Ooh no, something went wrong!