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 225 — #233<br />

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

hblacki 2 RBT.<br />

Constructor cases: A; B are RBT’s, then<br />

if A; B start with black, then hred; A; Bi is an RBT.<br />

if A; B start with red, then hblack; A; Bi is an RBT.<br />

For any RBT T , let<br />

r T be the number of red labels in T ,<br />

b T be the number of black labels in T , and<br />

n T WWD r T C b T be the total number of labels in T .<br />

Prove that<br />

If T starts with a red label; then n T<br />

3 r T 2n T C 1<br />

; (7.31)<br />

3<br />

Hint:<br />

n=3 r IFF .2=3/n n r<br />

Exam Problems<br />

Problem 7.12.<br />

The Arithmetic Trig Functions (Atrig’s) are the set of functions of one real variable<br />

defined recursively as follows:<br />

Base cases:<br />

The identity function id.x/ WWD x is an Atrig,<br />

any constant function is an Atrig,<br />

the sine function is an Atrig,<br />

Constructor cases:<br />

If f; g are Atrig’s, then so are<br />

1. f C g<br />

2. f g

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

Saved successfully!

Ooh no, something went wrong!