12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

50 Chap. 2 Mathematical Preliminariesalso discusses the three proof techniques presented in Section 2.6, <strong>and</strong> the roles ofinvestigation <strong>and</strong> argument in problem solving.For more about estimating techniques, see two Programming Pearls by JohnLouis Bentley entitled The Back of the Envelope <strong>and</strong> The Envelope is Back [Ben84,Ben00, Ben86, Ben88]. Genius: The Life <strong>and</strong> Science of Richard Feynman byJames Gleick [Gle92] gives insight in<strong>to</strong> how important back of the envelope calculationwas <strong>to</strong> the developers of the a<strong>to</strong>mic bomb, <strong>and</strong> <strong>to</strong> modern theoretical physicsin general.2.9 Exercises2.1 For each relation below, explain why the relation does or does not satisfyeach of the properties reflexive, symmetric, antisymmetric, <strong>and</strong> transitive.(a) “isBrotherOf” on the set of people.(b) “isFatherOf” on the set of people.(c) The relation R = {〈x, y〉 | x 2 + y 2 = 1} for real numbers x <strong>and</strong> y.(d) The relation R = {〈x, y〉 | x 2 = y 2 } for real numbers x <strong>and</strong> y.(e) The relation R = {〈x, y〉 | x mod y = 0} for x, y ∈ {1, 2, 3, 4}.(f) The empty relation ∅ (i.e., the relation with no ordered pairs for whichit is true) on the set of integers.(g) The empty relation ∅ (i.e., the relation with no ordered pairs for whichit is true) on the empty set.2.2 For each of the following relations, either prove that it is an equivalencerelation or prove that it is not an equivalence relation.(a) For integers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if a + b is even.(b) For integers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if a + b is odd.(c) For nonzero rational numbers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if a × b > 0.(d) For nonzero rational numbers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if a/b is aninteger.(e) For rational numbers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if a − b is an integer.(f) For rational numbers a <strong>and</strong> b, a ≡ b if <strong>and</strong> only if |a − b| ≤ 2.2.3 State whether each of the following relations is a partial ordering, <strong>and</strong> explainwhy or why not.(a) “isFatherOf” on the set of people.(b) “isAnces<strong>to</strong>rOf” on the set of people.(c) “isOlderThan” on the set of people.(d) “isSisterOf” on the set of people.(e) {〈a, b〉, 〈a, a〉, 〈b, a〉} on the set {a, b}.

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

Saved successfully!

Ooh no, something went wrong!