Discrete Mathematics: Proofs, Structures and Applications, Third Edition (Instructor Solution Manual, Solutions) [3 ed.] 9781439842089, 9781439812808, 1439812802


136 25 3MB

English Pages 372 Year 2009

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Discrete Mathematics: Proofs, Structures and Applications, Third Edition  (Instructor Solution Manual, Solutions) [3 ed.]
 9781439842089, 9781439812808, 1439812802

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

SOLUTIONS MANUAL FOR Discrete Mathematics: Proofs, Structures and Applications, Third Edition

by Rowan Garnier John Taylor

SOLUTIONS MANUAL FOR Discrete Mathematics: Proofs, Structures and Applications, Third Edition

by Rowan Garnier John Taylor

Boca Raton London New York

CRC Press is an imprint of the Taylor & Francis Group, an informa business

Taylor & Francis 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2010 by Taylor and Francis Group, LLC Taylor & Francis is an Informa business No claim to original U.S. Government works Printed in the United States of America on acid-free paper 10 9 8 7 6 5 4 3 2 1 International Standard Book Number: 978-1-4398-4208-9 (Paperback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com

Contents 1 Logic 1.1 Solutions 1.2 Solutions 1.3 Solutions 1.4 Solutions 1.5 Solutions 1.6 Solutions 1.7 Solutions 1.8 Solutions

. . . . . . . .

1 1 4 5 8 9 14 18 23

2 Mathematical Proof 2.1 Solutions to Exercises 2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Solutions to Exercises 2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Solutions to Exercises 2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28 28 29 29

3 Sets 3.1 Solutions 3.2 Solutions 3.3 Solutions 3.4 Solutions 3.5 Solutions 3.6 Solutions 3.7 Solutions

. . . . . . .

34 34 35 40 47 55 60 73

. . . . . . .

76 76 86 98 101 111 118 119

4 Relations 4.1 Solutions 4.2 Solutions 4.3 Solutions 4.4 Solutions 4.5 Solutions 4.6 Solutions 4.7 Solutions

to to to to to to to to

to to to to to to to to to to to to to to

Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises

Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises Exercises

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8

3.1 3.2 3.3 3.4 3.5 3.6 3.7 4.1 4.2 4.3 4.4 4.5 4.6 4.7

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . .

5 Functions 122 5.1 Solutions to Exercises 5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.2 Solutions to Exercises 5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.3 5.4 5.5 5.6

Solutions Solutions Solutions Solutions

to to to to

Exercises Exercises Exercises Exercises

6 Matrix Algebra 6.1 Solutions to Exercises 6.2 Solutions to Exercises 6.3 Solutions to Exercises 6.4 Solutions to Exercises

5.3 5.4 5.5 5.6

6.1 6.2 6.3 6.4

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

142 156 173 175

. . . .

179 179 180 184 187

7 Systems of Linear Equations 195 7.1 Solutions to Exercises 7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 7.2 Solutions to Exercises 7.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 7.3 Solutions to Exercises 7.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 8 Algebraic Structures 8.1 Solutions to Exercises 8.2 Solutions to Exercises 8.3 Solutions to Exercises 8.4 Solutions to Exercises 8.5 Solutions to Exercises 8.6 Solutions to Exercises

8.1 8.2 8.3 8.4 8.5 8.6

. . . . . .

. . . . . .

. . . . . .

9 Introduction to Number Theory 9.1 Solutions to Exercises 9.1 . . . 9.2 Solutions to Exercises 9.2 . . . 9.3 Solutions to Exercises 9.3 . . . 9.4 Solutions to Exercises 9.4 . . . 10 Boolean Algebra 10.1 Solutions to Exercises 10.2 Solutions to Exercises 10.3 Solutions to Exercises 10.4 Solutions to Exercises 10.5 Solutions to Exercises 11 Graph Theory 11.1 Solutions to 11.2 Solutions to 11.3 Solutions to 11.4 Solutions to 11.5 Solutions to 11.6 Solutions to

Exercises Exercises Exercises Exercises Exercises Exercises

10.1 10.2 10.3 10.4 10.5

11.1 11.2 11.3 11.4 11.5 11.6

. . . . .

. . . . . .

. . . . .

. . . . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

. . . .

. . . . .

. . . . . .

. . . . . .

211 211 216 223 234 239 249

. . . .

254 254 257 259 260

. . . . .

262 262 268 273 277 278

. . . . . .

284 284 293 300 303 313 315

12 Applications 12.1 Solutions 12.2 Solutions 12.3 Solutions 12.4 Solutions 12.5 Solutions 12.6 Solutions

of Graph Theory to Exercises 12.1 . . to Exercises 12.2 . . to Exercises 12.3 . . to Exercises 12.4 . . to Exercises 12.5 . . to Exercises 12.6 . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

321 321 329 342 345 348 358

Chapter 1

Logic 1.1 1.

Solutions to Exercises 1.1 (i) The basic structure of the proposition is a conjunction: p and q. However, the first proposition of the conjunct is negated so the compound proposition is: Max is not sulking and today is my birthday. (ii) Max is sulking or today is my birthday. (iii) If Max is not sulking then today is my birthday. (iv) If and only if today is my birthday then Max is sulking. An alternative is: Today is my birthday if and only if Max is sulking.

2.

(i) The basic structure of the proposition is a conditional: p → ( ). This is expressed as ‘if p then ( )’. The consequent (in parentheses) is an exclusive disjunction: ‘either Sally cries or Jo shouts (but not both)’. Piecing this together, we can express the proposition as: If Mary laughs then either Sally cries or Jo shouts (but not both). (ii) If and only if Jo shouts and Sally cries, then Mary laughs. (iii) If Mary laughs then Sally doesn’t cry and if Jo shouts then Sally cries. (iv) Mary laughs or Sally doesn’t cry or Jo doesn’t shout. (v) If and only if Mary laughs or Sally cries then Jo doesn’t shout.

3.

(i) p → q (ii) The structure of the sentence is a biconditional ‘if and only if ... then ...’. The first proposition in the biconditional is a disjunction which may be symbolised as p ∨ q. The second proposition in the biconditional is the negated statement r. Hence the whole sentence is symbolised as: (p ∨ q) ↔ r. (iii) The basic structure of the sentence is a conjunction: ‘ ... and ...’. The first conjunct is the negated statement r. The second conjunct is a conditional ‘if ... then ...’ which can be symbolised as p → q. Hence the whole sentence is symbolised as: r ∧ (p → q). (iv) (p ∨ q) ∧ (q → r) 1

Discrete Mathematics: Proofs, Structures and Applications

4. The truth table is the following. p T T F F

q p p∨q T F T F F F T T T F T T

Only in the second row of the table is p ∨ q false. Therefore p ∨ q is false when p is true and q is false. 5. (iii) We build the truth table column by column. In order to obtain the truth values for the conditional proposition (p ∨ q) → (p ∧ q), we first need the truth values of the antecedent p ∨ q and the consequent p ∧ q. These are given in columns 3 and 4 in the truth table below. When p ∨ q has truth value F then the conditional (p ∨ q) → (p ∧ q) has truth value T (regardless of the truth value of p ∧ q); this occurs in row 4 only. When p ∨ q has truth value T (rows 1 to 3) then the truth value of the conditional (p ∨ q) → (p ∧ q) ‘follows’ the truth value of p ∧ q. The final truth table is as follows. p T T F F

q p ∨ q p ∧ q (p ∨ q) → (p ∧ q) T T T T T F F F T T F F F F T F

(v) As before, we build the truth table column by column. Columns 3 and 4 give the truth values for p and p ∧ q. The biconditional p ↔ (p ∧ q) has truth value T when the two constituent propositions p and p ∧ q have the same truth value (either both T or both F). This occurs in row 2 only. When p and p ∧ q have different truth values (rows 1, 3, 4) then p ↔ (p ∧ q) has truth value F. The final truth table is as follows. p T T F F

q p p ∧ q p ↔ (p ∧ q) T F T F F F F T T T F F F T F F

6. The statement ‘if John is honest then he is not rich’ is symbolised as q → p. The truth table for this proposition is given below. p T T F F 2

q q p q→p T F F T F F T F T F T T F T T T Exercises 1.1

Solutions Manual

Therefore the statement ‘if John is honest then he is not rich’ is false only in row 2 which is when John is rich and honest. 7.

(i) We first obtain the truth values for p ∧ q; these are given in column 4 of the truth table below. When p ∧ q has truth value F then the conditional (p ∧ q) → r has truth value T regardless of the truth value of r; this occurs in rows 3 to 8. When p ∧ q has truth value T (rows 1 and 2) then the truth value of the conditional (p ∧ q) → r equals the truth value of r. This gives the following truth table. p T T T T F F F F

q T T F F T T F F

r p ∧ q (p ∧ q) → r T T T F T F T F T F T F T F T F F T T F T F F T

(iii) Similarly, we build the truth table column by column to obtain the following. p T T T T F F F F

q T T F F T T F F

r T F T F T F T F

q q ∨ r p ∧ (q ∨ r) F T T F F F T T T T T T F T F F F F T T F T T F

(v) Building the truth table column by column produces the following. For the last column, (p ∨ q) ↔ (r ∨ p) has truth table T when the two constituent propositions p ∨ q and r ∨ p are either both true (row 7) or both false (row 6). When p ∨ q and r ∨ p have different truth values (rows 1, 2, 3, 4, 5, 8) then the biconditional (p ∨ q) ↔ (r ∨ p) has truth table F. p T T T T F F F F

Exercises 1.1

q T T F F T T F F

r p ∨ q p ∨ q r ∨ p (p ∨ q) ↔ (r ∨ p) T T F T F F T F T F T T F T F F T F T F T T F T F F T F F T F T T T T F F T F F

3

Discrete Mathematics: Proofs, Structures and Applications

1.2

Solutions to Exercises 1.2

For each proposition, we need to determine its truth values. 1.

p T T F F

q p ∨ q p → (p ∨ q) T T T F T T T T T F F T

Since p → (p ∨ q) has only truth value T, it is a tautology. 2.

p T T F F

q p → q p p ∨ q (p → q) ∧ (p ∨ q) T T F T T F F F F F T T T T T F T T T T

Since (p → q) ∧ (p ∨ q) has truth values T and F, it is neither a tautology nor a contradiction. 3.

p T T F F

q p ∨ q q ∨ p (p ∨ q) ↔ (q ∨ p) T T T T T T T F T T T T F F T F

Since (p ∨ q) ↔ (q ∨ p) has only truth value T, it is a tautology. 5.

p T T F F

q p ∧ q p ∨ q p ∨ q (p ∧ q) ∧ (p ∨ q) T T T F F F F T F F T F T F F F F F T F

Since (p ∧ q) ∧ (p ∨ q) has only truth value F, it is a contradiction. 8.

4

p T T T T F F F F

q T T F F T T F F

r T F T F T F T F

q p→q F F F F T T T T F T F T T T T T

r r → p (p → q) ∨ (r → p) F T T T T T F T T T T T F T T T F T F T T T F T Exercises 1.2

Solutions Manual

Since (p → q) ∨ (r → p) has only truth value T, it is a tautology. 9. p T T T T F F F F

q T T F F T T F F

r T F T F T F T F

A B q ∧ r p → (q ∧ r) p → q p → r (p → q) ∧ (p → r) A ↔ B T T T T T T F F T F F T F F F T F T F F F F F T T T F T T T F T T T T T F T T T T T F T T T T T

Since (p → (q ∧ r)) ↔ ((p → q) ∧ (p → q)) has only truth value T, it is a tautology.

1.3

Solutions to Exercises 1.3

1. First we construct the truth table for p → q and p ∨ q. p T T F F

q p→q p p∨q T T F T F F F F T T T T F T T T

A comparison of the third and fifth columns shows that p → q and p ∨ q have the same truth values. Hence the two propositions are logically equivalent: (p → q) ≡ (p ∨ q). Alternatively, we may complete the truth table as before but including an extra column for the proposition (p → q) ↔ (p ∨ q). p T T F F

q p → q p p ∨ q (p → q) ↔ (p ∨ q) T T F T T F F F T F T T T T T F T T T T

Since (p → q) ↔ (p ∨ q) is a tautology (column 6), it follows that (p → q) ≡ (p ∨ q). 3. First we construct the truth table for p Y q and p Y q. p T T F F Exercises 1.3

q pYq pYq q pYq T F T F T T F T F F T T F F F F F T T T 5

Discrete Mathematics: Proofs, Structures and Applications

Since p Y q and p Y q have the same truth values (columns 4 and 6), they are logically equivalent: (p Y q) ≡ (p Y q). 4. The truth table for q → p is given below. p T T F F

q q→p T T F T T F F T

In all cases where p is true (rows 1 and 2), the proposition q → p is also true. Therefore p logically implies q → p: p ` (q → p). As an aside, note that q → p is also true in row 4 when p is not true. This does not matter because, to establish p ` (q → p), we only need to consider what happens when p is true. However, row 4 of the table does show that the two propositions are not logically equivalent: p 6≡ (q → p). 6. (iii) p T T F F

q p → q (p → q) ∧ p T T T F F F T T F F T F

The proposition (p → q) ∧ p is true only in row 1 and in this row q is also true. Therefore [(p → q) ∧ p] ` q. 7. We are required to prove that p Y q is logically equivalent to p ↔ q. The relevant truth table is shown below. p T T F F

q pYq p↔q p↔q T F T F F T F T T T F T F F T F

Columns 3 and 5 show that p Y q and p ↔ q have the same truth values. Therefore (p Y q) ≡ (p ↔ q). 8. We are required to prove that (p ↔ q) ≡ [(p → q ∧ (q → p)]. The following is the relevant truth table. p T T F F 6

q p ↔ q p → q q → p (p → q ∧ (q → p) T T T T T F F T F F T F T F F F T T T T Exercises 1.3

Solutions Manual

From columns 3 and 6 we see that (p ↔ q) and (p → q) ∧ (q → p) have identical truth values. Therefore (p ↔ q) ≡ (p → q) ∧ (q → p)]. 9.

(i) p T T F F

q p→q q p∧q p∧q T T F F T F F T T F T T F F T F T T F T

The truth values in columns 3 and 6 are identical, so (p → q) ≡ (p ∧ q). (ii) p T T F F

q p ↔ q q p ∧ q p ∧ q p q ∧ p q ∧ p (p ∧ q) ∧ (q ∧ p) T T F F T F F T T F F T T F F F T F T F F F T T T F F F T T F T T F T T

The truth values in columns 3 and 10 are identical, so (p ↔ q) ≡ (p ∧ q) ∧ (q ∧ p). (iii) p T T F F

q p∨q p q p∧q p∧q T T F F F T F T F T F T T T T F F T F F T T T F

The truth values in columns 3 and 7 are identical, so (p ∨ q) ≡ (p ∧ q). (iv) p T T F F

q p Y q q p ∧ q p ∧ q p q ∧ p q ∧ p (p ∧ q) ∧ (q ∧ p) (p ∧ q) ∧ (q ∧ p) T F F F T F F T T F F T T T F F F T F T T F F T T T F F T T F F T F T T F T T F

The truth values in columns 3 and 11 are identical, so (p Y q) ≡ (p ∧ q) ∧ (q ∧ p). 10.

(i) The following truth table shows that p and p|p have the same truth values so that p ≡ (p|p). p p p|p T F F F T T (ii) p T T F F

Exercises 1.3

q p ∧ q p|q (p|q)|(p|q) T T F T F T F F T F T F F F T F 7

Discrete Mathematics: Proofs, Structures and Applications

Columns 3 and 5 show that p ∧ q and (p|q)|(p|q) have the same truth values. Therefore (p ∧ q) ≡ (p|q)|(p|q). These results show that negation, p, and conjunction, p ∧ q, can be expressed using the connective ‘ | ’. Exercise 9 above shows that the remaining four connectives (conditional p → q, biconditional p ↔ q, disjunction p ∨ q and exclusive disjunction p Y q) can be expressed using only conjunction and negation. Therefore any proposition expressed using negation and the five familiar logical connectives may be expressed using | only. For example, p → q ≡ p ∧ q ≡ (p|q)|(p|q) ≡ ([p|(q|q)] | [p|(q|q)]) | ([p|(q|q)] | [p|(q|q)]) . 11. The given statement can be symbolised as a conditional p → q where p is ‘it is Sunday’ and q is ‘the supermarket is open until midnight’. Converse Symbolically the converse is q → p. In English: ‘if the supermarket is open until midnight then it’s not Sunday.’ Inverse Symbolically the inverse is (p → q) ≡ (p → q). In English: ‘if it’s Sunday then the supermarket is not open until midnight.’ Contrapositive Symbolically the contrapositive is (q → p) ≡ (q → p). In English: ‘if the supermarket is not open until midnight then it’s Sunday.’ Note that we could have chosen to symbolise the original statement as p → q where p is ‘it is not Sunday’. Were we to have done this the symbolic representations of the converse, inverse and contrapositive would have been different – we would need to replace p with p in the corresponding expressions above. However the English language expressions for the converse, inverse and contrapositive would remain the same.

1.4 1.

8

Solutions to Exercises 1.4 (i)

(p ∧ p) ∨ (p ∧ p)

≡ ≡

p∨p t

(Idem) (Comp).

(p ∧ p) ∨ (p ∧ p)

≡ ≡

p∨p t

(Idem) (Comp).

(ii)

(p ∧ q) ∧ q

≡ ≡

(iii)

p→q

p ∨ q) p∨q p∧q

≡ ≡ ≡

p ∧ (q ∧ q) p∧q

(Assoc) (Idem).

(Imp) (Inv) (De M) Exercises 1.4

Solutions Manual

(iv)

(p ∧ q) → r]

≡ ≡ ≡ ≡

p → (q → r) p ∨ (q → r) p ∨ (q ∨ r) (p ∨ q) ∨ r

(v)

q ∧ [(p ∨ q) ∧ (q ∧ p)]

≡ ≡ ≡ ≡

(Exp) (Imp) (Imp) (Assoc)

q ∧ [(p ∨ q) ∧ (q ∨ p)] q ∧ [(p ∨ q) ∧ (q ∨ p)] q ∧ [(q ∨ p) ∧ (q ∨ p)] q ∧ (q ∨ p)

(De M) (Inv) (Comm) (Idem)

2. We are required to prove (p ∧ (q ∨ p)) ≡ (p ∧ q). Proof

(p ∧ (q ∨ p))

≡ ≡ ≡

(p ∧ q) ∨ (p ∧ p) (p ∧ q) ∨ f p∧q

(Assoc) (Comp) (Ident).

The dual of p ∧ (q ∨ p) is p ∨ (q ∧ p). The dual of p ∧ q is p ∨ q. We are now required to show that the dual statements are logically equivalent: (p ∨ (q ∧ p)) ≡ (p ∨ q). Proof

1.5

(p ∨ (q ∧ p))

≡ ≡ ≡

(p ∨ q) ∧ (p ∨ p) (p ∨ q) ∧ t p∨q

(Assoc) (Comp) (Ident).

Solutions to Exercises 1.5

1. We begin by defining the following propositions: p: q:

you gamble you are stupid.

The premises are: p → q, q. The conclusion is: p. We need to determine whether [(p → q) ∧ q] → p is a tautology. To this end, we construct its truth table. p T T F F

q p → q q (p → q) ∧ q p [(p → q) ∧ q] → p T T F F F T F F T F F T T F F T T T F T T T T T

Since [(p → q) ∧ q] → p is a tautology (column 7), the argument is valid. 2. Define the following propositions: p: q: Exercises 1.5

I leave college I get a job in a bank. 9

Discrete Mathematics: Proofs, Structures and Applications

The premises are: p → q, p. The conclusion is: q. We need to determine whether [(p → q) ∧ p] → q is a tautology. We construct its truth table. p T T F F

q p → q p (p → q) ∧ p T T F F F F F F T T T T F T T T

q [(p → q) ∧ p] → q F T T T F F T T

Since [(p → q) ∧ p] → q is a not a tautology (column 7 contains a truth value F), the argument is not valid. 3. Define the following propositions: p: q: r:

James is a policeman James is a footballer James has big feet.

The premises are: p ∨ q, p → r, r. The conclusion is: q. We need to determine whether [(p ∨ q) ∧ (p → r) ∧ r] → q is a tautology or, equivalently, whether [(p ∨ q) ∧ (p → r) ∧ r] ` q. We first construct an appropriate truth table. Note that the truth values in column 7 are obtained from the previous three columns: (p ∨ q) ∧ (p → r) ∧ r has truth value T only when each of the conjuncts p ∨ q, p → r and r has truth value T; this occurs in row 6 only. The alternative to this would be to have a column for (p ∨ q) ∧ (p → r) and then a further column giving the truth values for [(p ∨ q) ∧ (p → r)] ∧ r. p T T T T F F F F

q T T F F T T F F

r p∨q p→r T T T T F F T T T F T F T T T F T T T F T F F T

r (p ∨ q) ∧ (p → r) ∧ r F F T F F F T F F F T T F F T F

The conjunction of the premises (p ∨ q) ∧ (p → r) ∧ r only has truth value T in row 6; in this row, the conclusion q also has truth value T. Therefore [(p ∨ q) ∧ (p → r) ∧ r] ` q so the argument is valid. The alternative to the approach taken here would be to follow our approach in questions 1 and 2 above and complete an extra column of the truth table giving the truth values of [(p ∨ q) ∧ (p → r) ∧ r] → q. This is shown below. 10

Exercises 1.5

Solutions Manual

p T T T T F F F F

q T T F F T T F F

r p∨q p→r T T T F T F T T T F T F T T T F T T T F T F F T

r (p ∨ q) ∧ (p → r) ∧ r [(p ∨ q) ∧ (p → r) ∧ r] → q F F T T F T F F T T F T F F T T T T F F T T F T

This final column of this truth table shows that [(p ∨ q) ∧ (p → r) ∧ r] → q is a tautology and therefore the argument is valid. 4. Define the following propositions: p: q:

I can swim I’ll come sailing with you.

The premises are: p → q, p. The conclusion is: q. The argument has precisely the same form as that in question 2 above. Since we showed that the argument in question 2 was not valid, it follows that this argument is also not valid. 5. Define the following propositions: p: q: r:

you find this difficult you’re stupid you have done your homework.

The premises are: p → (q ∨ r), r ∧ q. The conclusion is: p. We shall follow the first approach taken in question 3 above and determine whether [(p → (q ∨ r)) ∧ (r ∧ q)] ` p. The following truth table gives truth values of the appropriate propositions. p T T T T F F F F Exercises 1.5

q T T F F T T F F

r T F T F T F T F

r q ∨ r p → (q ∨ r) F T T T T T F F F T T T F T T T T T F F T T T T

q r ∧ q (p → (q ∨ r)) ∧ (r ∧ q) F F F F F F T T F T F F F F F F F F T T T T F F

p F F F F T T T T 11

Discrete Mathematics: Proofs, Structures and Applications

The conjunction of the premises (p → (q ∨ r)) ∧ (r ∧ q) has truth value T only in row 7; in this row, the conclusion p also has truth value T. Therefore [(p → (q ∨ r)) ∧ (r ∧ q)] ` p so the argument is valid. 6. Define the following propositions: p: q: r:

you can go out you do the washing up you watch television.

The premises are: p ↔ q, p → r. The conclusion is: r Y q. This time we shall follow the second approach taken in question 3 above and determine whether [(p ↔ q) ∧ (p → r)] → (r Y q) is a tautology. The following truth table gives truth values of [(p ↔ q) ∧ (p → r)] → (r Y q).

p T T T T F F F F

q T T F F T T F F

r p↔q T T F T F T F F T F F F T T T F

r p → r (p ↔ q) ∧ (p → r) r Y q [(p ↔ q) ∧ (p → r)] → (r Y q) F F F F T T T T T T F F F T T T T F F T F T F F T T T F T T F T F T T T T T F F

The proposition [(p ↔ q) ∧ (p → r)] → (r Y q) is not a tautology since it has truth value F in row 8. Therefore the argument is not valid. 7. Define the following propositions: p: q: r:

I graduate in June I go on holiday in the summer I get a job in the summer.

The premises are: p → q, r ∨ q, q. The conclusion is: p. This time we shall follow the ‘tautology’ approach and determine whether or not the proposition [(p → q) ∧ (r ∨ q) ∧ q] → p is a tautology. The following truth table gives truth values of [(p → q) ∧ (r ∨ q) ∧ q] → p. Note that, column 7 is a ‘triple’ conjunction (p → q) ∧ (r ∨ q) ∧ q. This has truth value T only when each of the three conjuncts p → q, r ∨ q and q has truth value T; in this case this only occurs in row 7. (See the comments in question 3 above.) 12

Exercises 1.5

Solutions Manual

p T T T T F F F F

q T T F F T T F F

r p→q r∨q T T T F T T T F T F F F T T T F T T T T T F T F

q (p → q) ∧ (r ∨ q) ∧ q F F F F T F T F F F F F T T T F

p [(p → q) ∧ (r ∨ q) ∧ q] → p F T F T F T F T T T T T T T T T

The proposition [(p → q) ∧ (r ∨ q) ∧ q] → p is a tautology since it has only truth values T. Therefore the argument is valid. 8. Define the following propositions: p: q: r:

there are clouds in the sky the sun shines the temperature falls.

The premises are: (p → q) ∧ (q → r), r. The conclusion is: p. This time we shall follow the ‘logical implication’ approach and determine whether or not [((p → q) ∧ (q → r)) ∧ r] ` p. The following truth table gives the relevant truth values.

p T T T T F F F F

q T T F F T T F F

r T F T F T F T F

q p → q q → r (p → q) ∧ (q → r) F F T F F F T F T T T T T T F F F T T T F T T T T T T T T T F F

r ((p → q) ∧ (q → r)) ∧ r F F T F F F T F F F T T F F T F

p F F F F T T T T

In all cases where ((p → q) ∧ (q → r)) ∧ r is true (row 6 only), p is also true. Therefore [((p → q) ∧ (q → r)) ∧ r] ` p, so the argument is valid. 9. Define the following propositions: p: q: r:

I shall be a lawyer I shall be a banker I shall be rich.

The premises are: p Y q, p → r. The conclusion is: r → q. Exercises 1.5

13

Discrete Mathematics: Proofs, Structures and Applications

This time we shall follow the ‘tautology’ approach and determine whether or not the proposition [(p Y q) ∧ (p → r)] → (r → q) is a tautology. The following truth table gives truth values of [(p Y q) ∧ (p → r)] → (r → q). p T T T T F F F F

q T T F F T T F F

r pYq T F F F T T F T T T F T T F F F

r p → r (p Y q) ∧ (p → r) r → q [(p Y q) ∧ (p → r)] → (r → q) F F F T T T T F T T F F F F T T T T T T F T T T T T T T T T F T F F T T T F T T

The proposition [(p Y q) ∧ (p → r)] → (r → q) is a tautology since it has only truth values T. Therefore the argument is valid. 10. Define the following propositions: p: q: r:

you are eligible for admission you are under 25 you qualify for a scholarship.

The premise is: (p → q) ∧ (q → r). The conclusion is: r → p. This time we shall follow the ‘logical implication’ approach and determine whether or not [(p → q) ∧ (q → r)] ` (r → p). The following truth table gives the relevant truth values. p T T T T F F F F

q T T F F T T F F

r p→q T T F T T F F F T T F T T T F T

q F F T T F F T T

r q → r (p → q) ∧ (q → r) r → p F T T T T T T T F F F T T T F T F T T F T T T T F F F F T T T T

In row 5, (p → q) ∧ (q → r) is true but r → p is false. Hence (p → q) ∧ (q → r) does not logically imply r → p: [(p → q) ∧ (q → r)] 6` (r → p). Therefore the argument is not valid.

1.6

Solutions to Exercises 1.6

We give an example of a formal proof for each argument but note that,in each case, there may be one or more alternative proofs 14

Exercises 1.6

Solutions Manual

1.

(i)

1. 2. 3. 4. 5. 6. 7.

(p ∧ q) → (r ∧ s) p q p∧q r∧s s∧r s

(ii)

1. 2. 3. 4. 5.

p → q¯ q∨r q¯ ∨ r q¯ → r p→r

(premise) (premise) (2. Invol) (3. Impl) (1, 4. HS)

(iii)

1. 2. 3. 4. 5. 6.

p → q¯ p∧r q∨r p q¯ r

(premise) (premise) (premise) (2. Simp) (1, 4. MP) (3, 5. DS)

(iv)

1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

(v)

1. 2. 3. 4. 5. 6.

(p → q) ∧ (¯ p → r¯) s∧p p∧s p p→q q

(premise) (premise) (2. Comm) (3. Simp) (1. Simp) (4, 5. MP)

(vi)

1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

(p ∨ q) → (r ∧ s) r→t t¯ (r ∧ s) → (p ∨ q) (¯ r ∨ s¯) → (p ∨ q) r¯ r¯ ∨ s¯ p∨q p¯ ∧ q¯ p¯

(premise) (premise) (premise) (1. Trans) (4. De M) (2, 3. MT) (6. Add) (5, 7. MP) (8. De M) (9. Simp)

Exercises 1.6

p∨q r → q¯ p¯ (¯ r ∧ q) → s q q¯ → r¯ q → r¯ r¯ r¯ ∧ q s

(premise) (premise) (premise) (3, 4. Conj) (1, 4. MP) (5. Comm) (6. Simp)

(premise) (premise) (premise) (Premise) (1, 3. DS) (2. Trans) (6. Invol) (5, 7. MP) (5, 8. Conj) (4, 9. MP)

15

Discrete Mathematics: Proofs, Structures and Applications

(vii)

2.

1. 2. 3. 4. 5. 6. 7. 8. 9.

(p ∨ q) ∧ (q ∨ r) q¯ p∨q q∨p p (q ∨ r) ∧ (p ∨ q) q∨r r p∧r

(i) Let p: q: r:

The murder was committed by A. The murder was committed by B. The murder was committed by C.

Argument: Premises : Conclusion :

p ∨ (q ∧ r) p∨r

Proof: 1. p ∨ (q ∧ r) 2. (p ∨ q) ∧ (p ∨ r) 3. (p ∨ r) ∧ (p ∨ q) 4. p∨r (ii) Let p: q:

(premise) (1. Dist) (2. Comm) (3. Simp)

I’ll play golf. I’ll go swimming.

Argument: Premises : Conclusion : Proof: 1. p¯ → q 2. q¯ 3. p¯ 4. p (iii) Let p: q: r: s:

(premise) (premise) (1. Simp) (3. Comm) (2, 4. DS) (1. Comm) (6. Simp) (2, 7. DS) (5, 8. Conj)

p¯ → q, q¯ p (premise) (premise) (1, 2. MT) (3. Invol)

Ed goes to the party. I go to the party. I stay at home. I watch TV.

Argument: Premises : Conclusion :

p → q¯, q ∨ (r ∧ s) p → (r ∧ s)

Proof: 16

Exercises 1.6

Solutions Manual

1. 2. 3. 4. 5.

p → q¯ q ∨ (r ∧ s) q¯ ∨ (r ∧ s) q¯ → (r ∧ s) p → (r ∧ s)

(iv) Let p: q: r: s:

The summer is hot. The summer is wet. My garden flourishes. The summer is windy.

Argument: Premises : Conclusion : Proof: 1. (p ∨ q) → r 2. q∧s 3. q 4. q∨p 5. p∨q 6. r (v) Let p: q:

(premise) (premise) (2. Invol) (3. Impl) (1, 4. HS)

(p ∨ q) → r, q ∧ s r (premise) (premise) (2. Simp) (3. Add) (4. Comm) (1, 5 MP)

People are happy. People are truthful.

Argument: Premises : Conclusion :

p ↔ q, p ∧ q p¯ ∧ q¯

Proof: 1. p↔q p∧q 2. 3. (p ∧ q) ∨ (¯ p ∧ q¯) 4. (¯ p ∧ q¯) ∨ (p ∧ q) 5. p¯ ∧ q¯ (vi) Let p: q: r: s:

You You You You

go to college. get a good job. will be successful. will be respected.

Argument: Premises : Conclusion :

(p ∨ q) → (r ∧ s), p r

Proof: 1. (p ∨ q) → (r ∧ s) 2. p 3. p∨q 4. r∧s 5. r Exercises 1.6

(premise) (premise) (1. Equiv) (3. Comm) (4. Simp)

(premise) (premise) (2. Add) (1, 3. MP) (4. Simp) 17

Discrete Mathematics: Proofs, Structures and Applications

(vii) Let p: q: r: s:

I I I I

eat cheese. get sick. drink wine. go to Ira’s.

Argument: Premises : Conclusion :

(p → q) ∧ (r → q), s → (p ∨ r), s q

Proof: 1. (p → q) ∧ (r → q) 2. s → (p ∨ r) 3. s 4. p→q 5. (r → q) ∧ (p → q) 6. r→q 7. p∨r 8. q∨q 9. q

1.7 1.

(premise) (premise) (premise) (1. Simp) (1. Comm) (5. Simp) (2, 3. MP) (4, 6, 7. CD) (8. Idem)

Solutions to Exercises 1.7 (i) C(m) ∧ F (s). (ii) B(m) → C(s). (iii) Since ‘but’ represents conjunction, the statement is a ‘triple’ conjunction. By the associative law, [(p ∧ q) ∧ r] ≡ [p ∧ (q ∧ r)], we can omit the brackets and write the triple conjunction as p ∧ q ∧ r. Hence the sentence symbolises as: C(m) ∧ B(m) ∧ ¬F (s). (iv) We could first rephrase this as follows: ‘for all x, if x works in the city then x is a chicken farmer.’ Hence we can symbolise the sentence as: ∀x [C(x) → F (x)]. (v) This is similar to part (iv) above. First rephrase as ‘for all x, if x works in the city and doesn’t ride a bicycle then x is a chicken farmer.’ Then we can symbolise as ∀x [(C(x) ∧ ¬B(x)) → F (x)]. (vi) This time we first rephrase as follows: ‘for some x, x works in the city and doesn’t ride a bicycle and is not a chicken farmer.’ The phrase ‘x works in the city and doesn’t ride a bicycle and is not a chicken farmer ’ represents a triple conjunction which, as in part (iii) above, we represent without brackets: C(x) ∧ B(x) ∧ ¬F (x). Therefore the sentence may be symbolised as: ∃x [C(x) ∧ B(x) ∧ ¬F (x)]. (vii) The overall structure of the sentence is a conditional: ‘if p then q’. The antecedent p is the negation of an existentially quantified statement: ‘there does not exist an x such that x works in the city and rides a bicycle.’ We can symbolise this as: ¬∃x [C(x) ∧ B(x)].

18

Exercises 1.7

Solutions Manual

The consequent q is easier to symbolise as it does not involve any quantification: ¬C(m) ∨ ¬F (s). Piecing this together gives the following symbolic representation of the sentence: ¬∃x [C(x) ∧ B(x)] → (¬C(m) ∨ ¬F (s)). (viii) This is the negation of an existentially quantified statement: ‘there does not exist an x such that x is a chicken farmer and works in the city and rides a bicycle.’ We can symbolise this as: ¬∃x [F (x) ∧ C(x) ∧ B(x)]. 2. In several of the solutions below, we give two versions of the solution, one where no universe of discourse is defined and one where a universe is defined. The symbolisation is generally simpler when a universe of discourse has been defined. (i) ‘No universe’ version Define: B(x) : x is a baby C(x) : x cries a lot. We may rephrase the sentence as: ‘for all x, if x is a baby then x cries a lot.’ Hence it may be symbolised as: ∀x [B(x) → C(x)]. Universe version Define: universe : babies C(x) : x cries a lot. Then the sentence may be symbolised as: ∀x C(x). (ii) ‘No universe’ version Define: P (x) : x is a person I(x) : x can ignore him. We may rephrase the sentence as the negation of an existentially quantified proposition: ‘there does not exist an x such that x is a person and x can ignore him.’ Hence it may be symbolised as: ¬∃x [P (x) ∧ I(x)]. Note that the original sentence is logically equivalent to the universally quantified statement: ‘everyone cannot ignore him’. This may be symbolised as: ∀x [P (x) → ¬I(x)]. Universe version Define: universe : people I(x) : x can ignore him. Then the sentence may be symbolised as: ¬∃x I(x). The logically equivalent universally quantified statement is: ∀x ¬I(x). (iii) ‘No universe’ version Define: Exercises 1.7

19

Discrete Mathematics: Proofs, Structures and Applications

S(x) : x is a student G(x) : x can write a good essay. We may rephrase the sentence as: ‘for some x, x is a student and x cannot write a good essay.’ Hence it may be symbolised as: ∃x [S(x) ∧ ¬G(x)]. Universe version Define: universe : students G(x) : x can write a good essay. Then the sentence may be symbolised as: ∃x ¬G(x). (iv) Universe version Define: universe : people C(x) : x approves of capital punishment. The sentence is the negation of a universally quantified proposition ‘it is not the case that everyone approves of capital punishment’. Hence the sentence may be symbolised as: ¬∀x C(x). (v) Universe version Define: universe : people U (x) : x has had a university education P (x) : x lives in poverty. We may rephrase the sentence as: ‘for some person x, x has had a university education and x lives in poverty.’ Hence it may be symbolised as: ∃x [U (x) ∧ P (x)]. (vi) ‘No universe’ version Define: R(x) : x is when it rains U (x) : x is when I forget my umbrella. We may rephrase the sentence as : ‘for all x, if x is when it rains then x is when I forget my umbrella.’ Hence it may be symbolised as: ∀x [R(x) → U (x)]. (vii) ‘No universe’ version Define: F (x) : x is my friend N (x) : x believes in nuclear disarmament. We may rephrase the sentence as : ‘for all x, if x is my friend then x believes in nuclear disarmament.’ Hence it may be symbolised as: ∀x [F (x) → N (x)]. (viii) ‘No universe’ version Define: 20

Exercises 1.7

Solutions Manual

F (x) : x is Fred’s child R(x) : x is rude S(x) : x is stupid. We may rephrase the sentence as: ‘for all x, if x is Fred’s child then x is rude or x is stupid.’ Hence it may be symbolised as: ∀x [F (x) → (R(x) ∨ S(x)]. Universe version Define: universe : Fred’s children R(x) : x is rude S(x) : x is stupid. Then the sentence may be symbolised as: ∀x [(R(x) ∨ S(x)]. (ix) Universe version Define: universe : people in the building F (x) : x set off the fire alarm B(x) : x left the building. Then the sentence is a conjunction of two statements, one existentially quantified and one universally quantified: ’there exists x such that x set off the fire alarm and for all x, x left the building.’ Therefore the sentence may be symbolised as: ∃x F (x) ∧ ∀x B(x). (x) ‘No universe’ version Define: R(x) : x is a rat D(x) : x is dirty C(x) : x carries disease. We may phrase the sentence as the negation of a universally quantified statement: ‘it is not the case that for all x, if x is a rat then x is dirty and x carries disease.’ Hence it may be symbolised as: ¬∀x [R(x) → (D(x) ∧ C(x))]. (xi) Universe version Define: universe : people S(x) : x likes snails T (x) : x has taste. Then the sentence may be expressed as: ’for all x, if x does not like snails then x does not have taste.’ Therefore the sentence may be symbolised as: ∀x [¬S(x) → ¬T (x)]. (xii) ‘No universe’ version Define: T (x) : x is a toy D(x) : x is dangerous C(x) : x is a child G(x, y) : x should be given to y. Exercises 1.7

21

Discrete Mathematics: Proofs, Structures and Applications

Note that we require a two-place predicate: ‘x should be given to y’. The sentence is a conjunction of two statements. The first statement is existentially quantified: ‘there exists x such that x is a toy and x is dangerous’. This may be symbolised as : ∃x (T (x) ∧ D(x). The second statement is harder to understand but may be paraphrased as ‘any child should not be given any dangerous toy’. This contains two separate universal quantifications ‘any child ’ and ‘any dangerous toy’. Hence the whole of this second statement may be rephrased as: ‘for all x and for all y if x is a child and y is a dangerous toy then y should not be given to x.’ This may be symbolised as: ∀x ∀y [(C(x) ∧ (T (y) ∧ D(y))) → ¬G(y, x)]. Therefore the whole sentence may be symbolised as: [∃x (T (x) ∧ D(x)] ∧ [∀x ∀y [(C(x) ∧ (T (y) ∧ D(y))) → ¬G(y, x)]]. 3. First define the two-place predicate L(x, y) : ‘x loves y’. (i) The sentence may be phrased as: ‘for all x there exists y such that x loves y.’ This may be symbolised as: ∀x ∃y L(x, y). (ii) The sentence may be phrased as: ‘there exists x such that for all y, x loves y.’ This may be symbolised as: ∃x ∀y L(x, y). (iii) Define the two-place predicate T (x, y) : ‘x is taller than y’. Also define s to denote ‘Sam’. The sentence may be phrased as: ‘for all x, x is taller than Sam.’ This may be symbolised as: ∀x T (x, s). (iv) Define: E(x) : x is an elephant B(x) : x is a bun. Then the sentence may be phrased: ‘for all x, for all y, if x is an elephant and y is a bun, then x loves y.’ This may be symbolised as: ∀x ∀y [(E(x) ∧ B(y)) → L(x, y)]. 4.

(i) Define: universe : people L(x, y) : x likes y s : strawberry jam. The proposition may be symbolised as: ∀x L(x, s). The negation is: ¬∀x L(x, s) ≡ ∃x ¬L(x, s). In English: Somebody does not like strawberry jam. (ii) Define: universe : birds F (x) : x can fly. The proposition may be symbolised as: ∃x ¬F (x). The negation is: ¬∃x ¬F (x) ≡ ∀x ¬¬F (x) ≡ ∀x F (x). In English: All birds can fly.

22

Exercises 1.7

Solutions Manual

(iii) Define L(x) : x is a time when I think you are lazy. The proposition may be symbolised as: ∃x L(x). The negation is: ¬∃x L(x) ≡ ∀x ¬L(x). In English: I never think you are lazy. (iv) Define: universe : people L(x) : x leaves without my permission. The proposition may be symbolised as: ¬∃x L(x). The negation is: ¬¬∃x L(x) ≡ ∃x L(x). In English: Somebody leaves without my permission. 5.

(i) True: R(9) is true so ∃x R(x) is true. (ii) False: ¬S(10) is false (since S(10) is true), so ∀y ¬S(y) is false. (iii) True: for any x we may take y = x − 1 so that P (x, y) is true. (iv) False: there is no real number that is less than or equal to every real number. (v) True: given any real numbers x and y one of x > y and x ≤ y must be true. (vi) True: ∃x S(x) is true since, for example, S(10) is true and ¬∀x R(x) is also true because, for example, R(1) is false. (vii) False: given any y, Q(y + 1, y) is false, for example. (viii) True: the statement R(x) ∧ S(y) is is only true when x = 9 and y > 9 and, in this case, Q(x, y) is also true.

1.8

Solutions to Exercises 1.8

1. First define: M (x) : x is a monkey B(x) : x eats bananas P (x) : x is a primate. Then the premises are: ∃x (M (x) ∧ B(x)), ∀x (M (x) → P (x)). The conclusion is: ∃x P (x) ∧ B(x). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Exercises 1.8

∃x (M (x) ∧ B(x)) M (a) ∧ B(a) ∀x (M (x) → P (x)) M (a) → P (a) M (a) P (a) B(a) ∧ M (a) B(a) P (a) ∧ B(a) ∃x P (x) ∧ B(x)

(premise) (from 1: ES) (premise) (from 3: US) (from 2: Simp) (from 4, 5: MP) (from 2: Comm) (from 7: Simp) (from 6, 8: Conj) (from 9: EG) 23

Discrete Mathematics: Proofs, Structures and Applications

2. We define: C(x) : x is a car D(x) : x is a dangerous weapon G(x) : x should be given to children. Then the premises are: ∀x (C(x) → D(x)), ∀x (D(x) → ¬G(x)). The conclusion is: ∀x (C(x) → ¬G(x)). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6.

∀x (C(x) → D(x)) ∀x (D(x) → ¬G(x)) C(a) → D(a) D(a) → ¬G(a) C(a) → ¬G(a) ∀x (C(x) → ¬G(x))

3. Define: universe R(x) A(x) j

: : : :

(premise) (premise) (from 1: US) (from 2: US) (from 3, 4: HS) (from 5: UG)

people x is reasonable x approves of wars Jack.

Then the premises are: ¬∃x (R(x) ∧ A(x)), A(j). The conclusion is: ¬R(j). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7. 8.

¬∃x (R(x) ∧ A(x)) ∀x ¬(R(x) ∧ A(x)) ¬(R(j) ∧ A(j)) ¬R(j) ∨ ¬A(j) ¬A(j) ∨ ¬R(j) A(j) ¬(¬A(j)) ¬R(j)

4. We define: universe : G(x) : R(x) : H(x) :

(premise) (from 1: QD) (from 2: US) (from 3: De M) (from 4: Comm) (premise) (from 6: Invol) (from 5, 7: DS)

people x is a gambler x is bound for ruin x is happy.

Then the premises are: ∀x (G(x) → R(x)), ∀x (R(x) → ¬H(x)). The conclusion is: ∀x (G(x) → ¬H(x)). The argument has precisely the same form as in question 2 above. Therefore a validity proof with the same structure as given in question 2 establishes the validity of the argument. 5. Define: 24

Exercises 1.8

Solutions Manual

universe C(x) W (x) T (x)

: : : :

computer scientists x is clever x is wealthy x is witty.

Then the premises are: ∀x (C(x) ∨ W (x)), ¬∃x W (x). The conclusion is: ∀x (C(x) ∨ T (x)). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7. 8. 9.

∀x (C(x) ∨ W (x)) ¬∃x W (x) ∀x ¬W (x) C(a) ∨ W (a) ¬W (a) W (a) ∨ C(a) C(a) C(a) ∨ T (a) ∀x (C(x) ∨ T (x))

6. Define: universe A(x) U (x) S(x) b

: : : : :

(premise) (premise) (from 2: QD) (from 1: US) (from 3: US) (from 4: Comm) (from 5, 6: DS) (from 7: Add) (from 8: UG)

people x eats apples x is unhealthy x has strong teeth Betty.

Then the premises are: ∀x (A(x) → S(x)), ∀x (¬A(x) → U (x)), ¬S(b). The conclusion is: U (b). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7.

∀x (A(x) → S(x)) ∀x (¬A(x) → U (x)) ¬S(b) A(b) → S(b) ¬A(b) → U (b) ¬A(b) U (b)

7. Define: universe F (x) S(x) Z(x)

: : : :

(premise) (premise) (premise) (from 1: US) (from 2: US) (from 3, 4: MT) (from 5, 6: MP)

alligators x is friendly x is sociable x lives in a zoo.

Then the premises are: ∃x (F (x) ∧ S(x)), ∀x (F (x) → Z(x)). The conclusion is: ∃x (Z(x) ∧ S(x)). The following is a proof of the validity of the argument. Exercises 1.8

25

Discrete Mathematics: Proofs, Structures and Applications

1. 2. 3. 4. 5. 6. 7. 8. 9.

∃x (F (x) ∧ S(x)) ∀x (F (x) → Z(x)) F (a) ∧ S(a) F (a) → Z(a) F (a) S(a) Z(a) Z(a) ∧ S(a) ∃x (Z(x) ∧ S(x))

8. Define: universe D(x) F (x) C(x)

: : : :

(premise) (premise) (from 1: US) (from 2: US) (from 3: Simp) (from 3: Simp) (from 4, 5: MP) (from 6, 7: Conj) (from 8: EG)

problems x is difficult x is frustrating x is challenging.

Then the premises are: ∀x (D(x) ∧ F (x)), ∃x C(x). The conclusion is: ∃x (F (x) ∧ C(x)). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7.

∀x (D(x) ∧ F (x)) ∃x C(x) C(a) D(a) ∧ F (a) F (a) F (a) ∧ C(a) ∃x (F (x) ∧ C(x))

9. Define: universe S(x) D(x) C(x)

: : : :

(premise) (premise) (from 2: ES) (from 1: US) (from 4: Simp) (from 3, 5: Conj) (from 6: EG)

animals x has scales x is a dragon x has sharp claws.

Then the premises are: ∀x (S(x) → D(x)), ∃x (¬D(x) ∧ C(x)). The conclusion is: ∃x (¬S(x) ∧ C(x)). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7. 8. 9.

∀x (S(x) → D(x)) ∃x (¬D(x) ∧ C(x)) ¬D(a) ∧ C(a) S(a) → D(a)) ¬D(a) ¬S(a) C(a) ¬S(a) ∧ C(a) ∃x (¬S(x) ∧ C(x))

(premise) (premise) (from 2: ES) (from 1: US) (from 3: Simp) (from 4, 5: MT) (from 3: Simp) (from 6, 7: Conj) (from 8: EG)

10. Define: 26

Exercises 1.8

Solutions Manual

universe F (x) T (x) L(x)

: : : :

people x is fat x is forty x is foolish.

Then the premises are: ∀x [T (x) → (F (x) ∨ L(x))], ¬∃x L(x), ¬∃x F (x). The conclusion is: ¬∃x T (x). The following is a proof of the validity of the argument. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.

Exercises 1.8

∀x [T (x) → (F (x) ∨ L(x))] ¬∃x L(x) ¬∃x F (x) ∀x ¬L(x) ∀x ¬F (x) T (a) → (F (a) ∨ L(a)) ¬L(a) ¬F (a) ¬F (a) ∧ ¬L(a) ¬(F (a) ∨ L(a)) ¬T (a) ∀x ¬T (x)

(premise) (premise) (premise) (from 2: QD) (from 3: QD) (from 1: US) (from 4: US) (from 1: US) (from 7, 8: Conj) (from 9: De M) (from 6, 10: MT) (from 11: UG)

27

Chapter 2

Mathematical Proof 2.1

Solutions to Exercises 2.1

1. From the theorem in example 2.1, there exist (at least) three glugs. Let G1 , G2 and G3 be three distinct glugs. From axiom A2, each of these glugs has two blubs that lie on it. Suppose: blubs B1,1 and B1,2 lie on glug G1 ; blubs B2,1 and B2,2 lie on glug G2 ; blubs B3,1 and B3,2 lie on glug G3 . This identifies six blubs: B1,1 , B1,2 , B2,1 , B2,2 , B3,1 , B3,2 . However, from axiom A3 there exist exactly 5 blubs. Therefore the six blubs are not all different so at least two of them are equal. This defines a single blub which must lie on two different glugs. 2. The following is a model with 11 glugs.

B1 B2

B5

B4

B3

Let A4 be the following axiom. A4. Given any two distinct blubs, there exists at most one glug on which they both lie. Theorem In the axiom system with axioms A1 – A4, there exists at most 10 glugs. Proof By axiom A4, for each pair of blubs there is at most one glug on which they both lie. Therefore the number of glugs is no greater than the number of pairs of blubs. 28

Solutions Manual

By axiom A3, there are exactly five blubs. Hence the number of ‘blub pairs’ is 10. This can be verified either by direct counting of the blub pairs or from the binomial coefficient C25 =

5! 5×4 = = 10. 3! 2! 2

Therefore there are at most 10 glugs.

2.2

Solutions to Exercises 2.2

4. Suppose that both solutions of x2 + ax + b = 0 are even integers. Then the solutions may be denoted by 2n and 2m for some integers n and m. The equation may be written

⇒ Equating the x terms: Equating the constant terms: √ 7. Let r = 1 + 2.

x2

(x − 2n)(x − 2m) = 0 − 2(n + m)x + 4nm = 0. a = 2(n + m) which is an even integer. b = 4nm = 2 × 2nm which is also an even integer.

Suppose that r is rational. Then r − √1 is also rational (since the difference of two rational numbers is rational). But r − 1 = 2 is irrational, which is a contradiction. √ Therefore r = 1 + 2 is irrational. 8. This is false. For example, let a = 2, b = 3 and c = 5. Then a = 2 is a factor of b + c = 8 but 2 is not a factor of 3 and 2 is not a factor of 5. 10. Let n be any integer and let a be the smallest factor of n that is greater than 1. Suppose that a is not prime. Then a = bc where 1 < b < a and 1 < c < a. Since a is a factor of n, n = ak for some integer k. Therefore n = bck so b is a factor of n (as is c). Hence b is a factor of n such that 1 < b < a which contradicts the fact that a is the smallest factor of n that is greater than 1. Therefore the assumption that a is not prime is false. Hence a is prime.

2.3

Solutions to Exercises 2.3

1. Base Case When n = 1, left-hand side = 1 and right-hand side = holds when n = 1.

1 2

× 1 × 2 = 1. Hence the result

Inductive Step Exercises 2.3

29

Discrete Mathematics: Proofs, Structures and Applications

Suppose that the result holds when n = k: 1 + 2 + . . . + k = 12 k(k + 1). Then 1 2 k(k

1 + 2 + . . . + k + (k + 1) =

+ 1) + (k + 1)

= (k + 1)[ 12 k + 1] 1 2 (k 1 2 (k

= =

+ 1)[k + 2] + 1)[(k + 1) + 1].

Hence the result holds for n = k + 1. Therefore if the result holds for n = k then it also holds for n = k + 1. This completes the inductive step. Therefore 1 + 2 + . . . + n = 12 n(n + 1), for all positive integers n, by induction. 3. Base Case When n = 1, 5n − 1 = 51 − 1 = 4 which is certainly divisible by 4. Hence the result holds when n = 1. Inductive Step Suppose that the result holds when n = k: 5k − 1 is divisible by 4. In other words, 5k − 1 = 4a for some positive integer a. Therefore 5k = 4a + 1.

(∗)

Now 5k+1 − 1 = 5 × 5k − 1 = 5(4a + 1) − 1

from (∗)

= 5 × 4a + 5 − 1 = 5 × 4a + 4 = 4(5a + 1). Hence 5k+1 − 1 is divisible by 4. Therefore if the result holds for n = k then it also holds for n = k + 1. This completes the inductive step. Therefore 5n − 1 is divisible by 4, for all positive integers n, by induction. 6. The result to be proved is: for all positive integers n, ·

n(n + 1) 1 + 2 + ... + n = 2 3

30

3

3

¸2 . Exercises 2.3

Solutions Manual

Base Case

·

1×2 When n = 1, LHS = = 1 and RHS = 2 Hence the result holds when n = 1.

¸2

13

= 12 = 1.

Inductive Step Suppose that

·

k(k + 1) 1 + 2 + ... + k = 2 3

3

3

¸2 .

Then ¸ k(k + 1) 2 + (k + 1)3 2 1 2 2 + 1 (k + 1)2 4(k + 1) 4 k (k + 1) 4 ¡ ¢ 1 2 k 2 + 4(k + 1) (k + 1) 4

· 3

3

3

3

1 + 2 + . . . + k + (k + 1)

= = = =

1 4 (k 1 4 (k

+ 1)2 (k 2 + 4k + 4)

+ 1)2 (k + 2)2 ¸ · (k + 1)(k + 2) 2 = 2 · ¸ (k + 1) ((k + 1) + 1) 2 = . 2 =

Hence the result holds for n = k + 1. Therefore if the result holds for n = k then it also holds for n = k + 1. This completes the inductive step. · ¸ n(n + 1) 2 3 3 3 Therefore 1 + 2 + . . . + n = , for all positive integers n, by induction. 2 9. The result to be proved is: for all positive integers n, 2 + 4 + . . . + 2n = n(n + 1). Base Case When n = 1, LHS = 2 and RHS = 1 × 2 = 2. Hence the result holds when n = 1. Inductive Step Suppose that the result holds when n = k: 2 + 4 + . . . + 2k = k(k + 1). Then 2 + 4 + . . . + 2k + 2(k + 1) = k(k + 1) + 2(k + 1) Exercises 2.3

31

Discrete Mathematics: Proofs, Structures and Applications

= (k + 1)(k + 2) = (k + 1) ((k + 1) + 1) . Hence the result holds for n = k + 1. Therefore if the result holds for n = k then it also holds for n = k + 1. This completes the inductive step. Therefore 2 + 4 + . . . + 2n = n(n + 1), for all positive integers n, by induction. 10. Base Case1 When n = 1, 42n+1 + 3n+2 = 43 + 33 = 64 + 27 = 91 = 7 × 13 is divisible by 13. Hence the result holds when n = 1. Inductive Step Suppose that the result holds when n = k: that is, suppose Then

42k+1 + 3k+2 42k+1

= =

13a for some integer a. 13a − 3k+2 . (∗)

Now 42(k+1)+1 + 3(k+1)+2 = 42k+3 + 3k+3 = 42 × 42k+1 + 3 × 3k+2 = 16(13a − 3k+2 ) + 3 × 3k+2 k+2

= 13 × 16a − 16 × 3

from (∗) k+2

+3×3

k+2

= 13 × 16a − 13 × 3 = 13(16a − 3k+2 ).

Since 16a − 3k+2 is an integer, we have shown that 42(k+1)+1 + 3(k+1)+2 is divisible by 13. Therefore if the result holds for n = k then it also holds for n = k + 1. This completes the inductive step. Therefore 5n − 1 is divisible by 4, for all positive integers n, by induction. 12. [This is not a proof by induction but the inductive definition of the Fibonacci sequence is used in the proof.] First note that, from the definition of the Fibonacci sequence: fk+3 = fk+2 + fk+1

(2.1)

and fk+2 = fk+1 + fk 1

In fact, it is easier to begin with n = 0. When n = 0, 42n+1 + 3n+2 = 41 + 32 = 4 + 9 = 13 which is clearly divisible by 13. With this as the base case, the proof will establish the result for all integers n ≥ 0 which is more than was required.

32

Exercises 2.3

Solutions Manual

so fk = fk+2 − fk+1 .

(2.2)

Now 2 2 fk+2 − fk+1 = (fk+2 − fk+1 )(fk+2 + fk+1 ) = (fk+2 − fk+1 )fk+3 = fk fk+3

Exercises 2.3

from (2.1) from (2.2).

33

Chapter 3

Sets 3.1 1.

Solutions to Exercises 3.1 (i) {−2, −1, 0, 1, 2, 3} (ii) {3, 6, 9, 12, . . .} (iii) {0, 1, 4, 9, 16, 25, 36, 49, 64, . . .} (iv) {−2, 13 } (v) { 13 } (vi) {−2} (vii) { }, the empty set ∅. (viii) { 12 , 1, 23 , 2, 52 , 3, . . .}

2.

(i) {0, 2, 4} (ii) {0, 1, 2, 3, 4} (iii) {−2, −1, 0, 1, 2} (iv) {−2, −1, 0, 1, 2} √ √ (v) {− 2, −1, 0, 1, 2} (vi) {−1, 0, 1}

3.

(i) The set is A = {1, 2, 3, . . . , 8} so |A| = 8. (ii) The set is A = {0, 1, 4, 9, 16, 25, . . .} so |A| = ∞. √ √ ª © (iii) The set is A = −1, 1, −1/ 2, 1/ 2 so |A| = 4. (iv) The set contains four elements which are a, b, c and the set {a, b, c}; hence its cardinality is 4. (v) The set contains three elements which are a, the set {b, c} and the set {a, b, c}; hence its cardinality is 3. (vi) The set contains a single element, namely the set {a, b, c}, even though this is listed twice. (Recall that we ignore repeats in the listing of elements.) Therefore the cardinality is 1. (vii) The set contains four elements which are: 34

Solutions Manual

• • • •

a the set containing a, namely {a} the set whose only element is {a}, namely {{a}} the set whose only element is the set {{a}}, namely {{{a}}}.

Therefore the cardinality is 4. (viii) The set contains three elements which are: • the empty set ∅ • the set which contains ∅ as its only element, namely {∅} • the set whose only element is the set containing the empty set, namely {{∅}}. Therefore the cardinality is 3. 4. Note that there are frequently several ways of describing a suitable propositional function P (x). (i) {x : x is an integer and 1 ≤ x ≤ 5} (ii) {x : x = 3n where n is an integer and 1 ≤ n ≤ 10} (iii) {x : x is a positive odd integer} An alternative is {x : x = 2n − 1 for some positive integer n} (iv) {x : x is a prime number} (v) {x : x is a vowel in English} (vi) {x : x = n2 + m2 for some integers n and m} (vii) {x : x is an integer, x < 1000 and x = n2 for some integer n}. Note that ‘x is an integer’ is redundant since it follows from ‘x = n2 for some integer n’. Hence a slightly neater description of the set is {x : x < 1000 and x = n2 for some integer n}. (viii) {x : x = 13n for some integer n} (ix) {x : x is a country} (x) {x : x is a play by William Shakespeare}

3.2 1.

Solutions to Exercises 3.2 (i) True. The element 2 does indeed belong to the set {1, 2, 3, 4, 5}. (ii) False. The set {2} is not an element of {1, 2, 3, 4, 5}; the elements of {1, 2, 3, 4, 5} are integers not sets. (iii) False. There is a ‘syntax error’ in the statement. Since 2 is a number and not a set, any statement of the form 2 ⊆ A (where A is a set) is false. (iv) True. Every element of the set {2} (there is, of course, only one such element) is also an element of the set {1, 2, 3, 4, 5}. (v) True. The empty set ∅ is a subset of every set so any statement of the form ∅ ⊆ A (where A is a set) is true.

Exercises 3.2

35

Discrete Mathematics: Proofs, Structures and Applications

(vi) True. The set {∅} contains a single element, namely the set ∅. This element is also an element of {∅, {∅}}, so {∅} ⊆ {∅, {∅}}. (vii) False. Since ∅ contains no elements, any statement of the form ‘a ∈ ∅’ is false. (viii) True. The order in which the elements of a set are listed is not significant. 2.

(i) (a) The subsets of {a, b} are: ∅, {a}, {b}, {a, b}. (b) The subsets of {a, b, c} are: ∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}. (c) The subsets of {a} are ∅, {a}. The conjecture is that if A has n elements then it has 2n subsets. (ii) The empty set ∅ has a single subset, namely ∅. This is because ∅ is a subset of any set. This is consistent with the conjecture in part (i) because |∅| = 0 and ∅ has 20 = 1 subset.

3.

(i) Only x ⊆ A. {1} ⊆ {1, 2, 3} since every element of {1} (namely, 1 itself) is also an element of {1, 2, 3}. {1} 6∈ {1, 2, 3} since the single element set {1} is not one of the elements of {1, 2, 3}. (ii) Only x ∈ A, {1} 6⊆ {{1}, {2}, {3}} since 1, the only element of {1}, is not an element of {{1}, {2}, {3}}; the elements of {{1}, {2}, {3}} are single-element sets not numbers. {1} ∈ {{1}, {2}, {3}} since {1} is one of the elements of {{1}, {2}, {3}}. (iii) Only x ⊆ A. {1} ⊆ {1, 2, {1, 2}} since every element of {1} (namely, 1) is also an element of {1, 2, {1, 2}}. {1} 6∈ {1, 2, {1, 2}} since the single element set {1} is not one of the elements of {1, 2, {1, 2}}; the elements of {1, 2, {1, 2}} are the numbers 1 and 2 and the set {1, 2}. (iv) Both x ⊆ A and x ∈ A. {1, 2} ⊆ {1, 2, {1, 2}} since both elements of {1, 2} (that is, 1 and 2) are also elements of {1, 2, {1, 2}}; they are the first two elements listed {1, 2} ∈ {1, 2, {1, 2}} since the set {1, 2} is one of the elements of {1, 2, {1, 2}}; it is the third and last element listed. (v) Neither x ⊆ A nor x ∈ A. Note that the set {{1, 2, 3}} contains a single element, namely the set {1, 2, 3}. {1} 6⊆ {{1, 2, 3}} since 1 (the only element of {1}) is not an element of {{1, 2, 3}}. {1} 6∈ {{1, 2, 3}} since the set {1} is not an element of {{1, 2, 3}}. (vi) Neither x ⊆ A nor x ∈ A. 1 6⊆ {{1}, {2}, {3}} since 1 is not a set and the subset relation is a relation between sets. 1 6∈ {{1}, {2}, {3}} since the number 1 is not one of the elements of {{1}, {2}, {3}}; the elements of {{1}, {2}, {3}} are single element sets not numbers.

36

Exercises 3.2

Solutions Manual

4.

(i) {A : A ⊆ X and |A| = 2} is the set of all subsets of X that have cardinality 2. Hence {A : A ⊆ X and |A| = 2} = {{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}}. (ii) Similarly, {A : A ⊆ X and |A| = 1} is the set of all single-element subsets of X. Hence {A : A ⊆ X and |A| = 1} = {{1}, {2}, {3}, {4}}. (iii) The proper subsets of X are all subsets except X itself. Therefore {A : A is a proper subset of X} = {∅, {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}}. (iv) {A : A ⊆ X and 1 ∈ A} comprises all those subsets of X that contain the element 1. Hence {A : A ⊆ X and 1 ∈ A} = {{1}, {1, 2}, {1, 3}, {1, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {1, 2, 3, 4}}.

5. Note that U = {2, 3, . . . , 10}. (i) Neither. A = {3, 5, 7, 9} and B = {3, 6, 9} so A 6⊆ B and B 6⊆ A. (ii) Both. A = B = {2, 4, 6, 8, 10}. Note that, Examples 2.2.1 and 2.3.1, we proved that, for every integer n, n is even if and only if n2 is even. (iii) B ⊆ A only. A = {2, 4, 6, 8, 10} and B = {2, 4, 8} so B ⊆ A (since each element of B is also an element of A) but A 6⊆ B (since, for example, 6 ∈ A but 6 6∈ B). (iv) B ⊆ A only. Since 2x + 1 > 7 ⇔ x > 3, we have A = {4, 5, 6, 7, 8, 9, 10}. Also, for x ∈ X, x2 > 20 ⇔ x > 4, so B = {5, 6, 7, 8, 9, 10}. Therefore B ⊆ A, since each element of B is also an element of A, but A 6⊆ B since 4 ∈ A but 4 6∈ B. (v) A ⊆ B only. √ Note that x ∈ Z ⇔ x = n2 for some n ∈ Z, so A = {4, 9}. The powers of 2 in X are 2, 4 and 8 and the powers of 3 in X are 3 and 9, so B = {2, 3, 4, 8, 9}. Therefore A ⊆ B, since each element of A is also an element of B, but B 6⊆ A since, for example, 2 ∈ B but 2 6∈ A. (vi) Neither. √ The elements of X for which x ≤ 2 are x = 2, 3 and 4, so A = {2, 3, 4}. The perfect squares in X are 4 and 9, so B = {4, 9}. A 6⊆ B since, for example, 2 ∈ A but 2 6∈ B. Similarly, B 6⊆ A since 9 ∈ B but 9 6∈ A. Exercises 3.2

37

Discrete Mathematics: Proofs, Structures and Applications

(vii) Neither. Note that x2 − 3x + 2 = 0 ⇔ (x − 1)(x − 2) = 0 ⇔ x = 1 or x = 2, so A = {1, 2}. The elements of X for which x + 7 is a perfect square are 2 (2 + 7 = 9 is a perfect square) and 9 (9 + 7 = 16 is a perfect square) so B = {2, 9}. A 6⊆ B since 1 ∈ A but 1 6∈ B and B 6⊆ A since 9 ∈ B but 9 6∈ A. 6.

(i) Note that 2x2 + 5x = 3 ⇔ 2x2 + 5x − 3 = 0 ⇔ (2x − 1)(x + 3) = 0 ⇔ x =

1 or x = −3. 2

Therefore A = { 12 , −3}. To show that A ⊆ B we do not need to list all the elements of B (so we don’t need to solve the equation 2x2 + 17x + 27 = 18/x). Instead, we only need to show that each element of A belongs to B. Thus we need to show that x = 12 satisfies 2x2 + 17x + 27 = 18/x and hence is an element of B and similarly for x = −3. Let x = 12 . Then 2x2 + 17x + 27 = 2 × 14 + 17 2 + 27 = 36 and 2 2x + 17x + 27 = 18/x and hence 12 ∈ B.

18 1/2

= 36. Therefore x =

Now let x = −3. Then 2x2 + 17x + 27 = 2 × 9 + 17 × (−3) + 27 = −6 and satisfies 2x2 + 17x + 27 = 18/x and hence −3 ∈ B.

18 −3

1 2

satisfies

= −6. Therefore x = −3

Since x ∈ A ⇒ x ∈ B, we have A ⊆ B. (ii) In Example 2.3.1, we proved that, for all positive integers n, x is even ⇒ x2 is even. Suppose that x ∈ A. Then x is a positive integer and x is even. Therefore x2 is even. Hence x ∈ B. We have shown that x ∈ A ⇒ x ∈ B. Hence A ⊆ B. (iii) On this occasion, we give a largely symbolic answer. x∈A ⇒ ⇒ ⇒ ⇒ ⇒

x ∈ Z and x ∈ Z and x ∈ Z and x ∈ Z and x ∈ B.

x is a multiple of 6 x = 6n for some n ∈ Z x = 3 × (2n) where 2n ∈ Z x is a multiple of 3

Hence A ⊆ B. 7.

38

(i) Let x ∈ B. Then both x ∈ A and P (x) are true so, certainly, x ∈ A. This shows that x ∈ B ⇒ x ∈ A; therefore B ⊆ A. Exercises 3.2

Solutions Manual

Suppose B ⊂ A. Then there is an element of A, a say, that does not belong to B. In other words a ∈ A is true but (a ∈ A) ∧ P (a) is false (since a 6∈ B). Therefore P (a) is false. Thus B ⊂ A implies that P (a) is false for some a ∈ A. Suppose A = B. Then A ⊆ B so x ∈ A ⇒ x ∈ B. In other words, x ∈ A ⇒ (x ∈ A) ∧ P (x). This means that x ∈ A ⇒ P (x). Thus A = B implies that P (x) is true for all x ∈ A. (ii) Let x ∈ A. Then (x ∈ A) ∨ P (x) is true so x ∈ C. Therefore A ⊆ C. Suppose A ⊂ C. Then there exists c ∈ C such that c 6∈ A. Now c ∈ C means that (c ∈ A) ∨ P (c) is true but, since c 6∈ A, this implies P (c) is true. Hence A ⊂ C implies that P (c) is true for some c 6∈ A. Suppose A = C. Then C ⊆ A so that x ∈ C ⇒ x ∈ A. This means that the contrapositive x 6∈ A ⇒ x 6∈ C is true. Let x 6∈ A. Then x 6∈ C which means that (x ∈ A) ∨ P (x) is false. Hence both x ∈ A and P (x) are false. Thus A = C implies that P (x) is false for all x 6∈ A. 9. Suppose that A and B have no element in common (ie A ∩ B = ∅) and let C = {x : x ∈ A ∧ x ∈ B}. We prove C = ∅ by contradiction. So suppose that C 6= ∅. Then there exists c ∈ C. Hence, by the definition of the set C, c ∈ A ∧ c ∈ B. This contradicts the assertion that A and B have no elements in common. Hence C = ∅. 10.

(i) Suppose that A ⊆ B and B ⊆ C. Now x∈A ⇒ x∈B ⇒ x∈C

(since A ⊆ B) (since B ⊆ C).

We have shown that x ∈ A ⇒ x ∈ C. Therefore A ⊆ C. (ii) Suppose that A ⊆ B, B ⊆ C and C ⊆ A. From part (i) we have A ⊆ C which, together with C ⊆ A, implies A = C. Since A = C and B ⊆ C we have B ⊆ A. But we also know A ⊆ B, so A = B. Therefore A = B = C, as required. 11. (iii) Let X = {B : B ⊆ A and {1, 2} ⊆ B}. Then X comprises all those subsets of A that contain both 1 and 2. Hence X = {{1, 2}, {1, 2, 3}, {1, 2, 4}, {1, 2, 3, 4}} so |X| = 4. (iv) Let Y = {B : B ⊆ A and {1, 2} ⊆ C}. Then Y comprises all those subsets of A that contains {1, 2} as a proper subset. Hence Y = {{1, 2, 3}, {1, 2, 4}, {1, 2, 3, 4}} so |Y | = 3. Exercises 3.2

39

Discrete Mathematics: Proofs, Structures and Applications

3.3 1.

Solutions to Exercises 3.3 (i) A ∩ B

A

B

U

A

B

U

A

B

U

A

B

U

B

U

(ii) A ∪ B

(iii) (A ∩ B) ∪ (A ∪ B)

(iv) A ∩ (B ∪ C)

C (v) A ∪ (B ∩ C)

A

C

40

Exercises 3.3

Solutions Manual

(vi) (A ∩ B) − C

A

B

U

B

U

B

U

B

U

C

(vii) A − (B ∩ C)

A

C

(viii) (A ∪ B) − C

A

C

(ix) A − (B ∪ C)

A

C

Exercises 3.3

41

Discrete Mathematics: Proofs, Structures and Applications

(x) (A − B) ∩ (A − C)

A

B

U

C

2. Note that U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. (i) A ∩ B = {2} (ii) A ∪ B = {2, 3, 4, 5, 6, 7, 8} (iii) A − B = {4, 6, 8} (iv) B ∩ C = ∅ (v) A ∩ B = {0, 1, 3, 5, 7, 9} ∩ {2, 3, 5, 7} = {3, 5, 7} (vi) A ∩ (B ∪ C) = {2, 4, 6, 8} ∩ {1, 2, 3, 4, 5, 7, 9} = {2, 4} (vii) B ∪ B = U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} (viii) B ∩ B = ∅ (ix) A ∪ C = {1, 2, 4, 6, 8, 9} = {0, 3, 5, 7} (x) (A − C) − B = {2, 6, 8} − {2, 3, 5, 7} = {6, 8} 3.

(i) Y ⊆ X (ii) X ∩ Y = ∅ (iii) None. (iv) X ⊆ Y (v) X ⊆ Y (vi) X ⊆ Y (vii) None. (viii) X ∩ Y = ∅ (ix) Y ⊆ X and X ∩ Y = ∅ (since Y = ∅). (x) Y ⊆ X

4.

(i) A ∪ B = {2, 3, 4, 5, 6, 8, 10} (ii) A ∩ D = ∅ = { } (iii) B ∪ C = {1, 2} (iv) A ∩ (B ∪ D) = {4, 6} (v) B ∪ (A ∩ D) = {3, 4, 5, 6} (since A ∩ D = ∅).

42

Exercises 3.3

Solutions Manual

(vi) (vii) (viii) (ix) (x) (xi) (xii) 5.

(C ∩ D) ∪ B = {1, 2, 3, 4, 5, 6, 8, 10} B ∩ C = {1, 2} A − (B ∩ C) = {2, 8, 10} (A − B) ∪ (D − C) = {1, 2, 3, 5, 8, 10} D − C = {2, 4, 6, 7, 8, 9, 10} (A ∪ B) − (A ∪ B) = {2, 3, 5, 8, 10} (C − A) ∩ (A − C) = {1, 3, 5, 8, 10}

(i) (a) A ∩ B = {n : n is a prime divisor of 12} (b) A ∩ B ∩ C = {n : n is an odd prime divisor of 12} (c) B ∩ C = {n : n is an even prime number} (d) A − C = {n : n is an even divisor of 12} (ii) Note that A = {1, 2, 3, 4, 6, 12}, B = {2, 3, 5, 7, 11} and C = {1, 3, 5, 7, 9, 11}. (a) (b) (c) (d) (e)

6.

7.

(i) (ii) (iii) (iv) (v) (vi)

A ∪ B = {1, 2, 3, 4, 5, 6, 7, 11, 12} B ∩ C = {3, 5, 7, 11} A ∪ C = {1, 2, 3, 4, 5, 6, 7, 9, 11, 12} = {8, 10} C − A = {5, 7, 9, 11} A ∩ B = {2, 3} = {1, 4, 5, 6, 7, 8, 9, 10, 11, 12}

A ∩ B = {x : P (x) ∧ ¬Q(x)} A ∪ B = {x : ¬(P (x) ∨ Q(x))} A ∩ (B ∪ C) = {x : P (x) ∧ (Q(x) ∨ ¬R(x))} A − B = {x : ¬(P (x) ∧ ¬Q(x))} = {x : ¬P (x) ∨ Q(x)} A − (B ∪ C) = {x : P (x) ∧ ¬(Q(x) ∨ R(x))} = {x : P (x) ∧ ¬Q(x) ∧ ¬R(x)} A − B = {x : ¬P (x) ∧ ¬(¬Q(x))} = {x : ¬P (x) ∧ Q(x)}

(i) A − B = A − (A ∩ B) See figure 3.1. Proof x ∈ A − B ⇒ x ∈ A and x 6∈ B ⇒ x ∈ A and x 6∈ A ∩ B ⇒ x ∈ A − (A ∩ B). Therefore A − B ⊆ A − (A ∩ B). x ∈ A − (A ∩ B) ⇒ ⇒ ⇒ ⇒ ⇒

x ∈ A and x 6∈ A ∩ B x ∈ A and (x 6∈ A or x 6∈ B) (x ∈ A or x 6∈ A) and (x ∈ A or x 6∈ B) (x ∈ A or x 6∈ B) x ∈ A − B.

Therefore A − (A ∩ B) ⊆ A − B. Hence A − B = A − (A ∩ B).

Exercises 3.3

43

Discrete Mathematics: Proofs, Structures and Applications

A

U

B

A

A

B

B

A

U

AÇ B

A - ( A Ç B)

A- B Figure 3.1: A − B = A − (A ∩ B) (ii) A ∩ (B − C) = (A ∩ B) − C See figure 3.2. Proof x ∈ A ∩ (B − C) ⇔ ⇔ ⇔ ⇔ ⇔

x ∈ A and x ∈ B − C x ∈ A and (x ∈ B and x 6∈ C) (x ∈ A and x ∈ B) and x ∈ 6 C x ∈ A ∩ B and x 6∈ C x ∈ (A ∩ B) − C.

Therefore A ∩ (B − C) = (A ∩ B) − C.

A

B

U

A

B

C A

U

C B -C

A Ç (B - C)

AÇ B

C

( A Ç B) - C

Figure 3.2: A ∩ (B − C) = (A ∩ B) − C (iii) (A ∪ B) − C = (A − C) ∪ (B − C) 44

Exercises 3.3

Solutions Manual

See figure 3.3. Proof x ∈ (A ∪ B) − C ⇔ ⇔ ⇔ ⇔ ⇔

x ∈ A ∪ B and x 6∈ C (x ∈ A or x ∈ B) and x 6∈ C (x ∈ A and x 6∈ C) or (x ∈ B and x 6∈ C) x ∈ A − C or x ∈ B − C x ∈ (A − C) ∪ (B − C).

Therefore (A ∪ B) − C = (A − C) ∪ (B − C).

A

B

U

A

B

C AÈ B

U

C C

A-C

( A È B) - C

B -C

( A - B) È ( B - C )

Figure 3.3: (A ∪ B) − C = (A − C) ∪ (B − C) (iv) A ∪ (B − C) = (A ∪ B) − (A ∩ C) See figure 3.4. Proof x ∈ A ∪ (B − C) ⇔ ⇔ ⇔ ⇔ ⇔ ⇔ ⇔

x ∈ A or x ∈ B − C x ∈ A or (x ∈ B and x 6∈ C (x ∈ A or x ∈ B) and (x ∈ A or x 6∈ C) x ∈ A ∪ B and (x ∈ A or x 6∈ C) x ∈ A ∪ B and (x 6∈ A or x 6∈ C) x ∈ A ∪ B and x 6∈ A ∩ C x ∈ (A ∪ B) − (A ∩ C).

Therefore A ∪ (B − C) = (A ∪ B) − (A ∩ C).

Exercises 3.3

45

Discrete Mathematics: Proofs, Structures and Applications

A

B

U

A

B

C A

U

C B -C

AÈ B

A È (B - C)

AÇC

( A È B) - ( A Ç C )

Figure 3.4: A ∪ (B − C) = (A ∪ B) − (A ∩ C) (v) (A − B) − C = A − (B ∪ C) See figure 3.5. Proof x ∈ (A − B) − C ⇔ ⇔ ⇔ ⇔ ⇔

x ∈ A − B and x 6∈ C (x ∈ A and x 6∈ B) and x 6∈ C x ∈ A and (x 6∈ B and x 6∈ C) x ∈ A and x 6∈ B ∪ C x ∈ A − (B ∪ C).

Therefore (A − B) − C = A − (B ∪ C).

A

B

U

A

B

C A- B

U

C C

( A - B) - C

A

B ÈC

A - (B È C)

Figure 3.5: (A − B) − C = A − (B ∪ C)

46

Exercises 3.3

Solutions Manual

3.4

Solutions to Exercises 3.4

1.

(i) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).

A

B

U

A

B

C

C

B ÈC

A

U

AÇC

AÇ B

( A Ç B) È ( A Ç C )

A Ç (B È C) (ii) A − B = B ∪ A.

A

B

A- B

U

A

B

B

A

A- B

U

AÈ B (iii) A ∩ B = A ∪ B.

A

B

AÇ B

AÇ B

U

A

B

A

B AÈ B

Exercises 3.4

U

2

47

Discrete Mathematics: Proofs, Structures and Applications

(iv) (A − B) ∩ C = (A ∩ C) − B. A

U

B

A

B

C

C C

A- B

U

B

AÇC

( A Ç C) - B

A Ç (B È C )

(v) (A − B) ∪ (B − A) = (A ∪ B) − (A ∩ B). A

U

B

A- B

A

B

AÇ B

AÈ B

B- A

U

( A È B) - ( A Ç B)

( A - B ) È ( B - A)

2. The sets are shown in the figure. A

B

U

A

AÈ B

A

B

A

U

A

B

U

A

B

U

B

U

B

U

AÈ B

B

U

A

AÇ B

( A - B) È ( B - A)

48

U

A- B

A - ( A Ç B)

A

B

BÈ A

B

( A È B ) - ( A Ç B)

U

A

AÇ B

Exercises 3.4

Solutions Manual

From the figure, we can identify the following identities: A − (A ∩ B) = A ∩ B A−B = B∪A (A − B) ∪ (B − A) = (A ∪ B) − (A ∩ B). 3. The sets are shown in the figure. A

B

U

A

C

U

B

U

C

( A Ç B) È ( A Ç C )

A

B

B

( A - B) Ç C

U

A

C

C

( A Ç C) - B

A Ç (B È C)

From the figure, we can identify the following identities: (A ∩ B) ∪ (A ∩ C) = A ∩ (B ∪ C) (A − B) ∩ C = (A ∩ C) − B. 4.

(i) A − B = A − (A ∩ B) Proof In this case it is easier to begin by considering A − (A ∩ B). A − (A ∩ B) = = = = = =

A ∩ (A ∩ B) A ∩ (A ∪ B) (A ∩ A) ∪ (A ∩ B) ∅ ∪ (A ∩ B) A∩B A−B

(ii) A ∩ (B − C) = (A ∩ B) − C Proof A ∩ (B − C) = A ∩ (B ∩ C) = (A ∩ B) ∩ C = (A ∩ B) − C Exercises 3.4

(definition of difference) (De Morgan’s law) (distributive law) (complement law) (identity law) (definition of difference).

(definition of difference) (associative law) (definition of difference). 49

Discrete Mathematics: Proofs, Structures and Applications

(iii) (A ∪ B) − C = (A − C) ∪ (B − C) Proof (A ∪ B) − C = (A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C) = (A − C) ∪ (B − C)

(∗)

(definition of difference) (distributive law (∗) ) (definition of difference – twice).

Note that, strictly, we are using a distributive law ‘on the right’: (X ∪ Y ) ∩ Z = (X ∩ Z) ∪ (Y ∩ Z). However, this follows from the distributive law ‘on the left’, given in section 3.5, together with the commutative law, as follows. (X ∪ Y ) ∩ Z = Z ∩ (X ∪ Y ) = (Z ∩ X) ∪ (Z ∩ Y ) = (X ∩ Z) ∪ (Y ∩ Z)

(commutative law) (distributive law ‘on the left’) (commutative law – twice).

(iv) A ∪ (B − C) = (A ∪ B) − (A ∩ C) Proof A ∪ (B − C) = = = = =

A ∪ (B ∩ C) (A ∪ B) ∩ (A ∪ C) (A ∪ B) ∩ (A ∪ C) (A ∪ B) ∩ (A ∩ C) (A ∪ B) − (A ∩ C)

(definition of difference) (distributive law) (involution law) (De Morgan’s law) (definition of difference)

(v) (A − B) − C = A − (B ∪ C) Proof (A − B) − C = = = =

5.

(A ∩ B) ∩ C A ∩ (B ∩ C) A ∩ (B ∪ C) A − (B ∪ C)

(i) For every set A, A ∗ ∅ = A. Proof A ∗ ∅ = (A − ∅) ∪ (∅ − A) = A∪∅ = A

50

(definition of difference – twice) (associative law) (De Morgan’s law) (definition of difference)

(definition of ∗) (since A − ∅ = A and ∅ − A = ∅) (identity law)

Exercises 3.4

Solutions Manual

For every set A, A ∗ A = ∅. Proof A ∗ A = (A − A) ∪ (A − A) = ∅∪∅ = ∅

(definition of ∗) (since A − A = A ∩ A = ∅) (identity law)

(ii)

U

B

C A

U

A

A

B *C

A Ç (B * C )

B

C AÇ B

AÇC

( A Ç B) * ( A Ç C )

(iii) There are many possible counter-examples. The following is a simple one. Let A = {1}, B = {2} and C = {3}. Then A ∪ (B ∗ C) = {1} ∪ {2, 3} = {1, 2, 3}. But (A ∪ B) ∗ (A ∪ C) = {1, 2} ∗ {1, 3} = {2, 3}. Therefore A ∪ (B ∗ C) 6= (A ∪ B) ∗ (A ∪ C). 7. (iii) A ∪ B = U . 8. Theorem 3.3.

If A, B and C are finite sets then

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |B ∩ C| − |C ∩ A| + |A ∩ B ∩ C|. Proof Let A, B and C be finite sets. First, we write A ∪ B ∪ C as A ∪ (B ∪ C) and apply Theorem 3.2 to A and B ∪ C. This gives: |A ∪ B ∪ C| = |A| + |B ∪ C| − |A ∩ (B ∪ C)|. (3.1) Then we can apply Theorem 3.2 to B and C: |B ∪ C| = |B| + |C| − |B ∩ C|.

(3.2)

Combining equations 3.1 and 3.2 gives: |A ∪ B ∪ C| = |A| + |B| + |C| − |B ∩ C| − |A ∩ (B ∪ C)|. Exercises 3.4

(3.3) 51

Discrete Mathematics: Proofs, Structures and Applications

We now need to consider the term |A ∩ (B ∪ C). Since A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)| (by the distributive law), equation 3.3 becomes |A ∪ B ∪ C| = |A| + |B| + |C| − |B ∩ C| − |(A ∩ B) ∪ (A ∩ C)|.

(3.4)

We may apply Theorem 3.2 to A ∩ B and A ∩ C to obtain: |(A ∩ B) ∪ (A ∩ C)| = |A ∩ B| + |A ∩ C| − |(A ∩ B) ∩ (A ∩ C)|.

(3.5)

Now (A ∩ B) ∩ (A ∩ C) = A ∩ (B ∩ C),

1

so equation 3.5 gives |(A ∩ B) ∪ (A ∩ C)| = |A ∩ B| + |A ∩ C| − |A ∩ B ∩ C|.

(3.6)

Finally, combining equations 3.4 and 3.6 gives: |A ∪ B ∪ C| = |A| + |B| + |C| − |B ∩ C| − |(A ∩ B) ∪ (A ∩ C)| = |A| + |B| + |C| − |B ∩ C| − (|A ∩ B| + |A ∩ C| − |A ∩ B ∩ C|) = |A| + |B| + |C| − |A ∩ B| − |B ∩ C| − |C ∩ A| + |A ∩ B ∩ C|.

9. It is helpful to refer to figure 3.6 to follow the reasoning below. Since |A ∩ B| = 20 and |A ∩ B ∩ C| = 17 we have |A ∩ B ∩ C| = 3. Similarly |B ∩ C| = 24 and |A ∩ B ∩ C| = 17 we have |A ∩ B ∩ C| = 7. Since |B| = 40 we can now deduce |A ∩ B ∩ C| = 40 − (3 + 17 + 7) = 13. Now |A ∩ C| = |A| + |C| − |A ∪ C| = 55 + 80 − 100 = 35. Hence |A ∩ B ∩ C| = |A ∩ C| − |A ∩ B ∩ C| = 35 − 17 = 18. Since |A| = 55 we can now deduce |A ∩ B ∩ C| = 55 − (18 + 17 + 3) = 17. Similarly |C| = 80 gives |A ∩ B ∩ C| = 80 − (18 + 17 + 7) = 38. The cardinalities are represented in figure 3.6 1

Although this seems rather obvious, a proof from our rules is a little involved: (A ∩ B) ∩ (A ∩ C)

52

= = = = = =

A ∩ (B ∩ (A ∩ C)) A ∩ ((B ∩ A) ∩ C) A ∩ ((A ∩ B) ∩ C) A ∩ (A ∩ (B ∩ C)) (A ∩ A) ∩ (B ∩ C) A ∩ (B ∩ C)

(associative law) (associative law) (commutative law) (associative law) (associative law) (idempotent law).

Exercises 3.4

Solutions Manual

U A

B 3

17

13

17 18

7 38 C

Figure 3.6: Showing the cardinalities for Exercise 3.4.9 (i) |A ∩ C| = 35 (ii) |C − B| = 38 + 18 = 56 (iii) |(B ∩ C) − (A ∩ B ∩ C)| = 7. We have |A ∪ B ∪ C| = 17 + 3 + 18 + 17 + 13 + 7 + 38 = 113. Hence, if |U | = 150 then |A ∪ B ∪ C| = 150 − 113 = 37. 10. Let

U C T V

be be be be

the the the the

set set set set

of of of of

1000 households; households that own a home computer; households that own two cars; households that own a video.

Then we have |U | = 1000, |C| = 275, |T | = 405, |V | = 455, |C ∪ T ∪ V | = 265, |C ∩ V | = 145, |T ∩ V | = 195 and |C ∩ T | = 110. Let x = |C ∩ T ∩ V |. Then figure 3.7 shows the cardinalities of the various disjoint subsets of U , which are calculated as follows. |C ∩ T ∩ V | = |C ∩ T | − |C ∩ T ∩ V | = 110 − x |C ∩ T ∩ V | = |C ∩ V | − |C ∩ T ∩ V | = 145 − x |C ∩ T ∩ V | = |T ∩ V | − |C ∩ T ∩ V | = 195 − x |C ∩ T ∩ V | = |C| − (|C ∩ T | + |C ∩ T ∩ V |) = 275 − (110 + 145 − x) = 20 + x |C ∩ T ∩ V | = |T | − (|T ∩ V | + |C ∩ T ∩ V |) = 405 − (195 + 110 − x) = 100 + x |C ∩ T ∩ V | = |V | − (|V ∩ C| + |C ∩ T ∩ V |) = 455 − (145 + 195 − x) = 115 + x. Now |C ∪ T ∪ V | = |U | − |C ∪ T ∪ V | = 1000 − 265 = 735 ⇒ ⇒

735 = (20 + x) + (100 + x) + (115 + x) + (110 − x) + (145 − x) +(195 − x) + x x = 50.

We can now read off any of the required cardinalities. Exercises 3.4

53

Discrete Mathematics: Proofs, Structures and Applications

U C

T 20 + x

110 - x 100 + x

x 145 - x

195 - x

115 + x

V

Figure 3.7: Showing the cardinalities for Exercise 3.4.10 (i) |C ∩ T ∩ V | = x = 50 (ii) |V ∩ C ∩ T | = 115 + x = 165 (iii) |T ∩ V ∩ C| = 195 − x = 145 (iv) |V ∩ C ∩ T | = 145 − x = 95. 11. Let

U S R C

be be be be

the the the the

set set set set

people in the village; of members of the soccer club; of members of the rugby club; of members of the cricket club.

U S

R 24 + x

7-x

10 + x

x 28 - x

11 - x 0

C

Figure 3.8: Showing the cardinalities for Exercise 3.4.11 We are given the following information. |S| |R| |S ∩ R| |S ∩ C| |R ∩ C| |S ∩ R ∩ C| |C ∩ S ∩ R| 54

= = = = = = =

42 45 7 11 28 2 × |R ∩ S ∩ C| 0. Exercises 3.4

Solutions Manual

Let x = |S ∩ R ∩ C|. Reasoning as in exercise 3.4.10 above, we obtain the cardinalities of the various disjoint subsets of S ∪ R ∪ C shown in figure 3.8. Now |S ∩ R ∩ C| = 2 × |R ∩ S ∩ C| 24 + x = 2(10 + x)

⇒ ⇒

x = 4.

Therefore: (i) |S ∩ R ∩ C| = x = 4 (ii) |C| = 4 + 7 + 24 = 35 (iii) |S ∩ R ∩ C| = 24 + x = 28.

3.5 1.

Solutions to Exercises 3.5 (i) A has 4 elements so P(A) has 24 = 16 elements, as follows. P(A) = {∅, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {a, d}, {b, c}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}}. (ii) A has two elements x = {1} and y = {1, 2} so P(A) is of the form {∅, {x}, {y}, {x, y}}. Therefore P(A) = {∅, {{1}}, {{1, 2}}, {{1}, {1, 2}}}. (iii) A has three elements x = {1}, y = {1, 2} and z = {1, 2, 3} so P(A) is of the form {∅, {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}}. Therefore P(A) = {∅, {{1}}, {{1, 2}}, {{1, 2, 3}}, {{1}, {1, 2}}, {{1}, {1, 2, 3}}, {{1, 2}, {1, 2, 3}}, {{1}, {1, 2}, {1, 2, 3}}}. (iv) First note that A = P{1, 2} = {∅, {1}, {2}, {1, 2}} so A itself has four elements. Therefore P(A) = P(P{1, 2}) has 16 elements and can be obtained from the solution to part i) by replacing a with ∅, replacing b with {1}, replacing c with {2} and replacing d with {1, 2}. This gives the following P(A) = {∅, {∅}, {{1}}, {{2}}, {{1, 2}}, {∅, {1}}, {∅, {2}}, {∅, {1, 2}}, {{1}, {2}}, {{1}, {1, 2}}, {{2}, {1, 2}}, {∅, {1}, {2}}, {∅, {1}, {1, 2}}, {∅, {2}, {1, 2}}, {{1}, {2}, {1, 2}}, {∅, {1}, {2}, {1, 2}}}.

Exercises 3.5

55

Discrete Mathematics: Proofs, Structures and Applications

(v) A = P(∅) = {∅, {∅}} so P(A) = {∅, {∅}, {{∅}}, {∅, {∅}}}. 2.

(i) This is not a partition because it is not a family of sets – 1 and 2 are not sets. (ii) This is a partition of A; the sets in the family are pairwise disjoint and their union is A. (iii) This is not a partition of A since 6 ∈ A but 6 does not belong to the union of the sets in the family, 6 6∈ {1, 3, 5, 7, 9} ∪ {2, 4, 8} ∪ {10}. (iv) This is a partition of A; the sets in the family are pairwise disjoint and their union is A. (v) This is not a partition of A since the sets in the family are not pairwise disjoint: 8 ∈ {2, 8, 10} ∩ {7, 8, 9} so {2, 8, 10} ∩ {7, 8, 9} 6= ∅.

3.

(i) This is not a partition since {2, 3} ∩ {3, 7, 9} 6= ∅. (ii) This is a partition: the sets in the family are pairwise disjoint and their union is {2, 3, 7, 9, 10}. (iii) This is not a partition since {2, 3, 4} is not a subset of {2, 3, 7, 9, 10} (so the family is not a family of subsets of {2, 3, 7, 9, 10}). (iv) This is a partition: the sets in the family are pairwise disjoint and their union is {2, 3, 7, 9, 10}. (v) This is not a partition since it is not a family of sets. (vi) This is a partition: there is only one set in the family, namely {2, 3, 7, 9, 10}. Hence, the sets in the family are (trivially) pairwise disjoint (trivially, since there are no pairs of sets) and their union is {2, 3, 7, 9, 10}. Note that, in general, if A is any non-empty set, then {A} is a partition – a jigsaw puzzle with a single piece. (vii) This is not a partition since 9 6∈ {10, 3} ∪ {7, 2} so {10, 3} ∪ {7, 2} 6= {2, 3, 7, 9, 10}. (viii) This is not a partition since it is not a family of non-empty subsets of {2, 3, 7, 9, 10}.

4.

(i) To count the partitions of {a, b, c, d}, we consider the different patterns or types of partitions that can occur. For example, we use {{∗, ∗}, {∗}, {∗}} to represent a partition that has two single element sets and one set containing two elements. • {{∗}, {∗}, {∗}, {∗}} There is 1 partition of this type. • {{∗, ∗}, {∗}, {∗}} There are 4 C2 = 6 ways of choosing the two elements to form the two-element subset. Hence there are 6 partitions of this type.

56

Exercises 3.5

Solutions Manual

• {{∗, ∗}, {∗, ∗}} Again, there are 4 C2 = 6 ways of choosing two elements to form the ‘first’ of the two-element subsets. However, two different choices may give rise to the same partition. For example, choosing {1, 3} as the ‘first’ set and choosing {2, 4} as the ‘first’ set each give rise to the partition {{1, 3}, {2, 4}}. Hence there are 6/2 = 3 partitions of this type. • {{∗, ∗, ∗}, {∗}} There are 4 ways to select the single-element subset. Hence there are 4 partitions of this type. • {{∗, ∗, ∗, ∗}} There is 1 partition of this type. Therefore there are 1 + 6 + 3 + 4 + 1 = 15 different partitions in total. (ii) The empty set does not have any partitions since it does not have any non-empty subsets. 5. {Am : m ∈ R} is not a partition of the plane R2 . In fact, it fails both conditions. Firstly,

[

Am 6= R2

m∈R

since any point (0, b) on the y-axis (except the origin (0, 0)) does not belong to In other words, if b 6= 0 then (0, b) does not lie on any of the lines Am .

[

Am .

m∈R

More obviously perhaps, the sets are not pairwise disjoint since each line passes through the origin so for all p, m ∈ R, where p 6= m, we have Am ∩ Ap = {(0, 0)} 6= ∅. 6.

(i) The family of sets {{n, n + 1} : n ∈ Z} is not a partition of Z as it fails the ‘pairwise disjoint’ condition. For example, {0, 1}, {1, 2} ∈ {{n, n + 1} : n ∈ Z} but {0, 1} ∩ {1, 2} = {1} 6= ∅. (ii) The family of sets {{−n, n} : n ∈ Z+ } = {{1, −1}, {2, −2}, {3, −3}, . . .} is not a partition of Z since [ 0 6∈ {−n, n}. n∈Z+

Therefore

[

{−n, n} 6= Z.

n∈Z+

(iii) The family of sets {{n, n2 , n3 } : n ∈ Z} = {{1}, {2, 4, 8}, {3, 9, 27}, . . .} is not a partition of Z since 4 ∈ {2, 4, 8} ∩ {4, 16, 64} so {2, 4, 8} ∩ {4, 16, 64} 6= ∅. Exercises 3.5

57

Discrete Mathematics: Proofs, Structures and Applications

(iv) The family of sets {{2n : n ∈ Z}, {2n + 1 : n ∈ Z}} is a partition of Z. Let E = {2n : n ∈ Z}, the set of even integers, and let O = {2n + 1 : n ∈ Z}, the set of odd integers. Then E ∪ O = Z and E ∩ O = ∅, so {E, O} is a partition of Z. 7.

(i) {In : n ∈ Z} is not a partition of R since the sets are not pairwise disjoint. For example, I1 = [1, 2] = {x ∈ R : 1 ≤ x ≤ 2} and I2 = [2, 3] = {x ∈ R : 2 ≤ x ≤ 3} so 2 ∈ I1 ∩ I2 . (ii) {Jn : n ∈ Z} is a partition of R. Every real number x satisfies n ≤ x < n + 1, and hence x ∈ Jn , for some n ∈ Z. Therefore [ Jn = R. n∈Z

Also, if n 6= m then Jn ∩ Jm = ∅. Therefore {Jn : n ∈ Z} is a partition of R. (iii) {Kn : n ∈ Z} is not a partition of R since, for example, 1 6∈ Kn for any n ∈ Z so [ Kn 6= R. n∈Z

In fact, it is easy to see that [ Kn = R − Z = {x ∈ R : x 6∈ Z}, n∈Z

the set of real numbers without the integers 9. Theorem 3.4 (ii)

For all sets A and B, P(A) ∩ P(B) = P(A ∩ B).

Proof Let A and B be sets. We shall establish the two subset relations P(A) ∩ P(B) ⊆ P(A ∩ B) and P(A) ∩ P(B) ⊇ P(A ∩ B) separately. (⊆) Let X ∈ P(A) ∩ P(B). Then X ∈ P(A) so X ⊆ A and X ∈ P(B) so X ⊆ B. We need to show that X ⊆ A ∩ B. Let x ∈ X. Then x ∈ A (since X ⊆ A) and x ∈ B (since X ⊆ B). Therefore x ∈ A ∩ B. We have shown that x ∈ X ⇒ x ∈ A ∩ B. 58

Exercises 3.5

Solutions Manual

Therefore X ⊆ A ∩ B, so X ∈ P(A ∩ B). Since we have shown that X ∈ P(A) ∩ P(B) ⇒ X ∈ P(A ∩ B), it follows that P(A) ∩ P(B) ⊆ P(A ∩ B). (⊇) Let X ∈ P(A ∩ B). Then X ⊆ A ∩ B. Since A ∩ B ⊆ A, it follows from Exercise 3.2.10 that X ⊆ A. Hence X ∈ P(A). Similarly, since A ∩ B ⊆ B, it again follows from Exercise 3.2.10 that X ⊆ B. Hence X ∈ P(B). Since X ∈ P(A) and X ∈ P(B), we have X ∈ P(A) ∩ P(B). We have shown that X ∈ P(A ∩ B) ⇒ X ∈ P(A) ∩ P(B). Therefore P(A ∩ B) ⊆ P(A) ∩ P(B). Since P(A) ∩ P(B) ⊆ P(A ∩ B) and P(A ∩ B) ⊆ P(A) ∩ P(B), we have P(A) ∩ P(B) = P(A ∩ B).

Theorem 3.4 (iii)

For all sets A and B, P(A) ∪ P(B) ⊆ P(A ∪ B).

Proof Let A and B be sets. Let X ∈ P(A) ∪ P(B); then X ∈ P(A) or X ∈ P(B). If X ∈ P(A) then X ⊆ A. Since A ⊆ A ∪ B, it follows from Exercise 3.2.10 that X ⊆ A ∪ B. If X ∈ P(B) then X ⊆ B. Since B ⊆ A ∪ B, it again follows from Exercise 3.2.10 that X ⊆ A ∪ B. In both cases X ⊆ A ∪ B; therefore X ∈ P(A ∪ B). We have shown X ∈ P(A) ∪ P(B) ⇒ X ∈ P(A ∪ B). Therefore P(A) ∪ P(B) ⊆ P(A ∪ B). We have P(A) ∪ P(B) ⊂ P(A ∪ B) if there is a set X such that X ⊆ A ∪ B but X 6⊆ A and X 6⊆ B. Such a set X is illustrated in figure 3.9. Thus a simple example is A = {1, 2}, B = {2, 3}. Let X = {1, 2, 3} = A ∪ B. Then X ∈ P(A ∪ B) but X 6∈ P(A) and X 6∈ P(B), so X 6∈ P(A) ∪ P(B). Exercises 3.5

59

Discrete Mathematics: Proofs, Structures and Applications

A

B

U

X

Figure 3.9: Illustrating P(A) ∪ P(B) ⊂ P(A ∪ B) 10. Theorem 3.5

If |A| = n then |P(A)| = 2n .

Proof The proof is by induction on n. If |A| = 0 then A = ∅ so P(A) = {∅}. Hence |P(A)| = 1 = 20 . Therefore the result holds when n = 0. Suppose the result is true for n = k; ie if A is any set with |A| = k then |P(A)| = 2k . Let B be a set such that |B| = k + 1. We need to count the subsets of B. Choose some element b∗ ∈ B. Let A = B − {b∗ }. Then |A| = k so, by the inductive hypothesis, |P(A)| = 2k . Let X ⊆ B. There are two possibilities: b∗ ∈ X or b∗ 6∈ X. If b∗ 6∈ X then X ⊆ A. There are 2k such sets X. If b∗ ∈ X then X = Y ∪ {b∗ } where Y ⊆ A. There are 2k such sets Y so there are also 2k such sets X. Since there are 2k subsets of B that contain b∗ and there are 2k subsets of B that do not contain b∗ , there are, in total, 2k + 2k = 2k+1 subsets of B. Hence, for any set with k + 1 elements, its power set has 2k+1 elements. This completes the inductive step. Therefore, for all sets A, if |A| = n then |P(A)| = 2n .

3.6 2.

Solutions to Exercises 3.6 (i) X = {1, 2, 3, 4}, Y = {a, b} X × Y = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b), (4, a), (4, b)} See figure 3.10. (ii) X = {1, 2}, Y = {a, b, c, d, e} X × Y = {(1, a), (1, b), (1, c), (1, d), (1, e), (2, a), (2, b), (2, c), (2, d), (2, e)} See figure 3.11. (iii) X = {(1, 2)}, Y = {a, b, c, d, e} X × Y = {((1, 2), a), ((1, 2), b), ((1, 2), c), ((1, 2), d), ((1, 2), e)} See figure 3.12.

60

Exercises 3.6

Solutions Manual

X ´Y

b

(1, b)

a

(1, a ) (2, a) (3, a ) (4, a )

(2, b) (3, b) (4, b)

Y

1

2

3

4

X

Figure 3.10: {1, 2, 3, 4} × {a, b} X ´Y

Y

e

(1, e)

d

(1, d ) (2, d )

c

(1, c)

(2, c)

b

(1, b)

(2, b)

a

(1, a) (2, a )

(2, e)

1

2 X

Figure 3.11: {1, 2} × {a, b, c, d, e} X ´Y

Y

e

((1, 2), e)

d

((1, 2), d )

c

((1, 2), c)

b

((1, 2), b)

a

((1, 2), a )

(1, 2)

X

Figure 3.12: {(1, 2)} × {a, b, c, d, e}

Exercises 3.6

61

Discrete Mathematics: Proofs, Structures and Applications

3.

(i) A ∩ B = {3, 4} and X ∩ Y = {b} so (A ∩ B) × (X ∩ Y ) = {(3, b), (4, b)}. (ii) A × X = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b), (4, a), (4, b)} and B × Y = {(3, b), (3, c), (3, d), (4, b), (4, c), (4, d), (5, b), (5, c), (5, d)} so (A × X) ∩ (B × Y ) = {(3, b), (4, b)}. (iii) A × Y = {(1, b), (1, c), (1, d), (2, b), (2, c), (2, d), (3, b), (3, c), (3, d), (4, b), (4, c), (4, d)} and B × X = {(3, a), (3, b), (4, a), (4, b), (5, a), (5, b)} so (A × Y ) ∩ (B × X) = {(3, b), (4, b)}. (iv) A ∩ X = ∅ so (A ∩ X) × Y = ∅. (v) A ∩ B = {3, 4} and X ∪ Y = {a, b, c, d} so (A ∩ B) × (X ∪ Y ) = {(3, a), (3, b), (3, c), (3, d), (4, a), (4, b), (4, c), (4, d)}. (vi) (A × X) ∪ (B × Y ) = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b), (3, c), (3, d), (4, a), (4, b), (4, c), (4, d), (5, b), (5, c), (5, d)}

4.

(i) Not every quadruple in T ×A×R+ ×Z corresponds to an actual book. For example, class numbers have a finite number of decimal places so any quadruple of the form (t, a, π, n) does not correspond to an actual book (since π has an infinite decimal expansion). Similarly, any quadruple of the form (t, a, x, 2500) does not correspond to an actual book since there is no book with year of publication 2500. (ii) The set D contains those years corresponding to the publication dates of the books in the library’s collection. The smallest element of D is the year of publication of the oldest book in the collection. (iii) S represents the collection of books in the library’s collection authored by (someone called) Shakespeare. (Technically, since the physical books are not the same things as the quadruples, S is the set of quadruples corresponding those books in the library’s collection authored by (someone called) Shakespeare.) (iv) {(t, a, x, n) ∈ C : a = Garnier} (v) It says that there is no book in the library’s collection with class number 514.3. (vi) It says that the library does not hold a copy of Dostoyevsky’s Crime and Punishment.

7.

(i) There are two parts to the proof because we need to prove the implication in each direction. (⇒) Suppose that (x, y, z) = (a, b, c). Then, by definition, ((x, y), z) = ((a, b), c). Each side of this equation is an ordered pair so, by the properties of ordered pairs, this implies (x, y) = (a, b) and z = c. Now, again by the properties of ordered pairs, (x, y) = (a, b) ⇒ x = a and y = b. Hence we have shown x = a, y = b and z = c, as required.

62

Exercises 3.6

Solutions Manual

(⇐) This is straightforward: if x = a, y = b and z = c then (x, y) = (a, b) so ((x, y), z) = ((a, b), c). (ii) The proof is by induction. The starting case is n = 2 which is covered by the definition of ordered pair given in §3.7. (or the proof of exercise 3.6.1). Suppose the result is true for n = k. That is, suppose that (x1 , x2 , . . . , xk ) = (y1 , y2 , . . . , yk ) if and only if xi = yi for each i = 1, 2, . . . , k. As in part (i), the proof for n = k + 1 has two parts. (⇒) Suppose that (x1 , x2 , . . . , xk , xk+1 ) = (y1 , y2 , . . . , yk , yk+1 ). Then, by definition, ((x1 , x2 , . . . , xk ), xk+1 ) = ((y1 , y2 , . . . , yk ), yk+1 ). Each side of this equation is an ordered pair so, by the properties of ordered pairs, this implies (x1 , x2 , . . . , xk ) = (y1 , y2 , . . . , yk ) and xk+1 = yk+1 . Now, by the inductive hypothesis (x1 , x2 , . . . , xk ) = (y1 , y2 , . . . , yk ) implies xi = yi for each i = 1, 2, . . . , k. This shows xi = yi for each i = 1, 2, . . . , k, k + 1, as required. (⇐) Again, this is more straightforward. Suppose that xi = yi for each i = 1, 2, . . . , k, k + 1. Then (x1 , x2 , . . . , xk ) = (y1 , y2 , . . . , yk ), by the inductive hypothesis, so ((x1 , x2 , . . . , xk ), xk+1 ) = ((y1 , y2 , . . . , yk ), yk+1 ). Therefore, by definition, (x1 , x2 , . . . , xk , xk+1 ) = (y1 , y2 , . . . , yk , yk+1 ). We have shown that (x1 , x2 , . . . , xk+1 ) = (y1 , y2 , . . . , yk+1 ) if and only if xi = yi for each i = 1, 2, . . . , k + 1, which completes the inductive step. Therefore, for all ordered n-tuples, (x1 , x2 , . . . , xn ) = (y1 , y2 , . . . , yn ) if and only if xi = yi for each i = 1, 2, . . . , n, by induction. 8.

(i) The non empty subsets of A are: {a}, {b} and {a, b}. The non-empty subsets of X are: {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}.

Exercises 3.6

63

Discrete Mathematics: Proofs, Structures and Applications

(ii) B = {a},

Y = {1}

: B × Y = {(a, 1)}

B = {a},

Y = {2}

: B × Y = {(a, 2)}

B = {a},

Y = {3}

: B × Y = {(a, 3)}

B = {a},

Y = {1, 2}

: B × Y = {(a, 1), (a, 2)}

B = {a},

Y = {1, 3}

: B × Y = {(a, 1), (a, 3)}

B = {a},

Y = {2, 3}

: B × Y = {(a, 2), (a, 3)}

B = {a},

Y = {1, 2, 3} : B × Y = {(a, 1), (a, 2), (a, 3)}

B = {b},

Y = {1}

: B × Y = {(b, 1)}

B = {b},

Y = {2}

: B × Y = {(b, 2)}

B = {b},

Y = {3}

: B × Y = {(b, 3)}

B = {b},

Y = {1, 2}

: B × Y = {(b, 1), (b, 2)}

B = {b},

Y = {1, 3}

: B × Y = {(b, 1), (b, 3)}

B = {b},

Y = {2, 3}

: B × Y = {(b, 2), (b, 3)}

B = {b},

Y = {1, 2, 3} : B × Y = {(b, 1), (b, 2), (b, 3)}

B = {a, b}, Y = {1}

: B × Y = {(a, 1), (b, 1)}

B = {a, b}, Y = {2}

: B × Y = {(a, 2), (b, 2)}

B = {a, b}, Y = {3}

: B × Y = {(a, 3), (b, 3)}

B = {a, b}, Y = {1, 2}

: B × Y = {(a, 1), (a, 2), (b, 1), (b, 2)}

B = {a, b}, Y = {1, 3}

: B × Y = {(a, 1), (a, 3), (b, 1), (b, 3)}

B = {a, b}, Y = {2, 3}

: B × Y = {(a, 2), (a, 3), (b, 2), (b, 3)}

B = {a, b}, Y = {1, 2, 3} : B × Y = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)} (iii) {(a, 1), (b, 2)} ⊆ A × X = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)} is not of the form B × Y where B ⊆ A and Y ⊆ X since {(a, 1), (b, 2)} does not appear in the list in part (ii) above. 9.

(i) For all sets A, X and Y , (X ∩ Y ) × A = (X × A) ∩ ((Y × A). Proof Let (x, a) ∈ (X ∩ Y ) × A. Then x ∈ X ∩ Y and a ∈ A. Since x ∈ X ∩ Y , we have x ∈ X and x ∈ Y . Therefore (x, a) ∈ X × A and (x, a) ∈ Y × A, so (x, a) ∈ (X × A) ∩ (Y × A). We have shown that (x, a) ∈ (X ∩ Y ) × A ⇒ (x, a) ∈ (X × A) ∩ (Y × A), so (X ∩ Y ) × A ⊆ (X × A) ∩ ((Y × A). Now let (x, a) ∈ (X × A) ∩ (Y × A). Then (x, a) ∈ X × A and (x, a) ∈ Y × A. Now (x, a) ∈ X × A implies x ∈ X and a ∈ A and (x, a) ∈ Y × A implies x ∈ Y and a ∈ A. Since x ∈ X and x ∈ Y , we have x ∈ X ∩ Y . Therefore (x, a) ∈ (X ∩ Y ) × A.

64

Exercises 3.6

Solutions Manual

We have shown that (x, a) ∈ (X × A) ∩ (Y × A) ⇒ x, a) ∈ (X ∩ Y ) × A, so (X × A) ∩ ((Y × A) ⊆ (X ∩ Y ) × A. Since we have both (X ∩ Y ) × A ⊆ (X × A) ∩ ((Y × A) and (X × A) ∩ ((Y × A) ⊆ (X ∩ Y ) × A, it follows that (X ∩ Y ) × A = (X × A) ∩ ((Y × A).

(iii) For all sets A, X and Y , (X ∪ Y ) × A = (X × A) ∪ ((Y × A). Proof By way of contrast, we shall give a more symbolic proof that the one given in part (i) above. (x, a) ∈ (X ∪ Y ) × A ⇒ x ∈ X ∪ Y and a ∈ A ⇒ (x ∈ X or x ∈ Y ) and a ∈ A ⇒ (x ∈ X and a ∈ A) or (x ∈ Y and a ∈ A) ⇒ (x, a) ∈ X × A or (x, a) ∈ Y × A ⇒ (x, a) ∈ (X × A) ∪ (Y × A). Therefore (X ∪ Y ) × A ⊆ (X × A) ∪ ((Y × A). Now (x, a) ∈ (X × A) ∪ (Y × A) ⇒ (x, a) ∈ X × A or (x, a) ∈ Y × A ⇒ (x ∈ X and a ∈ A) or (x ∈ Y and a ∈ A) ⇒ (x ∈ X or x ∈ Y ) and a ∈ A ⇒ x ∈ X ∪ Y and a ∈ A ⇒ (x, a) ∈ (X ∪ Y ) × A. Therefore (X × A) ∪ ((Y × A) ⊆ (X ∪ Y ) × A. Hence (X ∪ Y ) × A = (X × A) ∪ ((Y × A).

10.

(i) For all sets A, B, X and Y , (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (A × Y ) ∩ (B × X) ∩ (B × Y ). Proof The result is a generalisation of Theorem 3.7 (i) and we will use that theorem in the proof.

Exercises 3.6

65

Discrete Mathematics: Proofs, Structures and Applications

Using the first part of Theorem 3.7 (i) with A replaced by A ∩ B, we have (A ∩ B) × (X ∩ Y ) = ((A ∩ B) × X) ∩ ((A ∩ B) × Y ).

(3.7)

Now we use the second part of Theorem 3.7 (i) twice, as follows: (A ∩ B) × X = (A × X) ∩ (B × X)

(3.8)

(A ∩ B) × Y = (A × Y ) ∩ (B × Y ).

(3.9)

and Substituting for (A ∩ B) × X from equation 3.8 and (A ∩ B) × Y from equation 3.9 into equation 3.7 and using commutativity of intersection gives the required result: (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (B × X) ∩ (A × Y ) ∩ (B × Y ) = (A × X) ∩ (A × Y ) ∩ (B × X) ∩ (B × Y ).

The identity is illustrated in figure 3.13. The shaded region can either be viewed as (A ∩ B) × (X ∩ Y ) or as the quadruple intersection (A × X) ∩ (A × Y ) ∩ (B × X) ∩ (B × Y ).

A´Y

B ´Y

Y

A´ X

X ÇY

A´Y B´ X B ´Y

X A´ X

B´ X

A AÇ B

B

Figure 3.13: (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (A × Y ) ∩ (B × X) ∩ (B × Y ) (ii) For all sets A, B, X and Y , (A ∪ B) × (X ∪ Y ) = (A × X) ∪ (A × Y ) ∪ (B × X) ∪ (B × Y ). 66

Exercises 3.6

Solutions Manual

Proof The result follows from Theorem 3.7 (ii) in much the same way that the previous result followed from Theorem 3.7 (i). We write the proof more compactly as follows. Let A, B, X and Y be sets. Then (A ∪ B) × (X ∪ Y ) = ((A ∪ B) × X) ∪ ((A ∪ B) × Y ) (by theorem 3.7(ii)) = (A × X) ∪ (B × X) ∪ (A × Y ) ∪ (B × Y ) (using theorem 3.7(ii) twice) = (A × X) ∪ (A × Y ) ∪ (B × X) ∪ (B × Y ) (using commutativity of union).

The identity is illustrated in figure 3.14. The shaded region can either be viewed as (A ∪ B) × (X ∪ Y ) or as the quadruple union (A × X) ∪ (A × Y ) ∪ (B × X) ∪ (B × Y ).

A´Y

B ´Y

A´ X

B´ X

Y

X ÈY

X A B AÈ B

Figure 3.14: (A ∪ B) × (X ∪ Y ) = (A × X) ∪ (A × Y ) ∪ (B × X) ∪ (B × Y ) 11.

(i) For all sets A, B, X and Y , (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (B × Y ). Proof As usual, we give separate proofs for the two subset relations (A ∩ B) × (X ∩ Y ) ⊆ (A × X) ∩ (B × Y ) and

Exercises 3.6

(A ∩ B) × (X ∩ Y ) ⊇ (A × X) ∩ (B × Y ). 67

Discrete Mathematics: Proofs, Structures and Applications

(⊆) Let (a, x) ∈ (A ∩ B) × (X ∩ Y ). Then a ∈ A ∩ B and x ∈ X ∩ Y . Now a ∈ A ∩ B and x ∈ X ∩ Y implies a ∈ A and x ∈ X so (a, x) ∈ A × X. Similarly, a ∈ A ∩ B and x ∈ X ∩ Y implies a ∈ B and x ∈ Y so (a, x) ∈ B × Y . Therefore (a, x) ∈ (A × X) ∩ (B × Y ). Hence (A ∩ B) × (X ∩ Y ) ⊆ (A × X) ∩ (B × Y ). (⊇) Let (a, x) ∈ (A × X) ∩ (B × Y ). Then (a, x) ∈ A × X and (a, x) ∈ B × Y . Now (a, x) ∈ A × X implies a ∈ A and x ∈ X. Similarly (a, x) ∈ B × Y implies a ∈ B and x ∈ Y . Therefore a ∈ A ∩ B and x ∈ X ∩ Y , so (a, x) ∈ (A ∩ B) × (X ∩ Y ). Hence (A × X) ∩ (B × Y ) ⊆ A ∩ B) × (X ∩ Y ). Therefore, since we have proved the subset relation both ways round, (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (B × Y ).

The identity is illustrated in figure 3.15. The shaded region can either be viewed as the Cartesian product (A ∩ B) × (X ∩ Y ) or as the intersection (A × X) ∩ (B × Y ). Y

B ´Y

X ÇY

X

A´ X

A AÇ B

B

Figure 3.15: (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (B × Y ) For all sets A, B, X and Y , (A ∩ B) × (X ∩ Y ) = (A × Y ) ∩ (B × X). Proof The proof is very similar to the previous proof. 68

Exercises 3.6

Solutions Manual

(⊆) Let (a, x) ∈ (A ∩ B) × (X ∩ Y ). Then a ∈ A ∩ B and x ∈ X ∩ Y . Now a ∈ A ∩ B and x ∈ X ∩ Y implies a ∈ A and x ∈ Y so (a, x) ∈ A × Y . Similarly, a ∈ A ∩ B and x ∈ X ∩ Y implies a ∈ B and x ∈ X so (a, x) ∈ B × X. Therefore (a, x) ∈ (A × Y ) ∩ (B × X). Hence (A ∩ B) × (X ∩ Y ) ⊆ (A × Y ) ∩ (B × X). (⊇) Let (a, x) ∈ (A × Y ) ∩ (B × X). Then (a, x) ∈ A × Y and (a, x) ∈ B × Xx. Now (a, x) ∈ A × Y implies a ∈ A and x ∈ Y . Similarly (a, x) ∈ B × X implies a ∈ B and x ∈ X. Therefore a ∈ A ∩ B and x ∈ X ∩ Y , so (a, x) ∈ (A ∩ B) × (X ∩ Y ). Hence (A × Y ) ∩ (B × X) ⊆ A ∩ B) × (X ∩ Y ). Therefore, since we have proved the subset relation both ways round, (A ∩ B) × (X ∩ Y ) = (A × Y ) ∩ (B × X).

The identity is illustrated in figure 3.16. The shaded region can either be viewed as the Cartesian product (A ∩ B) × (X ∩ Y ) or as the intersection (A × Y ) ∩ (B × X). Y

A´Y

X ÇY

X

B´ X

A AÇ B

B

Figure 3.16: (A ∩ B) × (X ∩ Y ) = (A × X) ∩ (B × Y ) (ii) There are many possible examples. A simple example is A = {a}, B = {b}, X = {x} and Y = {y}. Then b ∈ A ∪ B and x ∈ X ∪ Y so (b, x) ∈ (A ∪ B) × (X ∪ Y ). However (b, x) 6∈ (A × X) ∪ (B × Y ) = {(a, x), (b, y)}. Therefore (A ∪ B) × (X ∪ Y ) 6= (A × X) ∪ (B × Y ). Exercises 3.6

69

Discrete Mathematics: Proofs, Structures and Applications

12. Theorem 3.8 For all sets A, B and X: (i) A ⊆ B implies (A × X) ⊆ (B × X). (ii) If X 6= ∅ then (A × X) ⊆ (B × X) implies A ⊆ B. Proof (i) Suppose that A ⊆ B. Then a ∈ A ⇒ a ∈ B. Therefore (a, x) ∈ A × X ⇒ a ∈ A and x ∈ X ⇒ a ∈ B and x ∈ X ⇒ (a, x) ∈ B × X. Hence (A × X) ⊆ (B × X). (ii) Suppose X 6= ∅. Then we may choose an element x∗ ∈ X. Now suppose that (A × X) ⊆ (B × X). Let a ∈ A. Then (a, x∗ ) ∈ A × X. Since (A × X) ⊆ (B × X), this implies that (a, x∗ ) ∈ B × X so a ∈ B. We have shown that a ∈ A ⇒ a ∈ B, so A ⊆ B.

13. For all non-empty sets A, B, X and Y , (A × B) ⊆ (X × Y ) ⇔ A ⊆ X and B ⊆ Y . Proof (⇒) Suppose that (A × B) ⊆ (X × Y ). Let a ∈ A and b ∈ B. Then (a, b) ∈ A × B. Since (A × B) ⊆ (X × Y ), this implies (a, b) ∈ X × Y . Therefore a ∈ X and b ∈ Y . We have shown both a ∈ A ⇒ a ∈ X and b ∈ B ⇒ b ∈ Y . Hence A ⊆ X and B ⊆ Y , as required. (⇐) Suppose that A ⊆ X and B ⊆ Y . Let (a, b) ∈ A × B. Then a ∈ A and b ∈ B. Therefore a ∈ X (since A ⊆ X) and b ∈ Y (since B ⊆ Y ). Hence (a, b) ∈ X × Y . We have shown (a, b) ∈ A × B ⇒ (a, b) ∈ X × Y . Therefore (A × B) ⊆ (X × Y ).

14.

(i) For all sets A, B and X, (A − B) × X = (A × X) − (B × X).

70

Exercises 3.6

Solutions Manual

Proof (⊆) Let (a, x) ∈ (A − B) × X. Then a ∈ A − B, so a ∈ A and a 6∈ B, and x ∈ X. Now (a, x) ∈ A × X since a ∈ A and x ∈ X. Also (a, x) 6∈ B × X since a 6∈ B. Therefore (a, x) ∈ (A × X) − (B × X). Therefore (A − B) × X ⊆ (A × X) − (B × X). (⊇) Let (a, x) ∈ (A × X) − (B × X). Then (a, x) ∈ A × X and (a, x) 6∈ B × X. Now (a, x) ∈ A × X implies a ∈ A and x ∈ X. Also (a, x) 6∈ B × X implies a 6∈ B or x 6∈ X. But since we know that x ∈ X this implies a 6∈ B. Hence a ∈ A − B and x ∈ X so that (a, x) ∈ (A − B) × X. Therefore (A × X) − (B × X) ⊆ (A − B) × X. Hence (A − B) × X = (A × X) − (B × X). A´ X

B´ X A´ X

B´ X

X A A- B

B

Figure 3.17: (A − B) × X = (A × X) − (B × X) The identity is illustrated in figure 3.17. The shaded region can either be viewed as the Cartesian product (A − B) × X or as the difference (A × X) − (B × X). (ii) For all sets A, B, X and Y , (A − B) × (X − Y ) = (A × X) − [(A × Y ) ∪ (B × X)]. Proof (⊆) Let (a, x) ∈ (A − B) × (X − Y ). Then a ∈ A − B, so a ∈ A and a 6∈ B, and x ∈ X − Y , so x ∈ X and x 6∈ Y . Now (a, x) ∈ A × X since a ∈ A and x ∈ X. Also (a, x) 6∈ A × Y since x 6∈ Y and (a, x) 6∈ B × X since a 6∈ B. Therefore (a, x) 6∈ ((A × Y ) ∪ (B × X). Exercises 3.6

71

Discrete Mathematics: Proofs, Structures and Applications

Hence (a, x) ∈ (A × X) − [(A × Y ) ∪ (B × X)]. Therefore (A − B) × (X − Y ) ⊆ (A × X) − [(A × Y ) ∪ (B × X)]. (⊇) Let (a, x) ∈ (A × X) − [(A × Y ) ∪ (B × X)]. Then (a, x) ∈ A × X and (a, x) 6∈ (A × Y ) ∪ (B × X). Now (a, x) ∈ A × X implies a ∈ A and x ∈ X. Also (a, x) 6∈ (A × Y ) ∪ (B × X) implies (a, x) 6∈ A × Y and (a, x) 6∈ B × X. Now (a, x) 6∈ A × Y implies a 6∈ A or x 6∈ Y . But we know that a ∈ A so this implies that x 6∈ Y . Similarly, (a, x) 6∈ B × X implies a 6∈ B or x 6∈ X. But we know that x ∈ X so this implies that a 6∈ B. Hence a ∈ A − B (since a ∈ A and a 6∈ B) and x ∈ X − Y (since x ∈ X and x 6∈ Y ) so that (a, x) ∈ (A − B) × (X − Y ). Therefore (A × X) − [(A × Y ) ∪ (B × X)] ⊆ (A − B) × (X − Y ). Hence (A − B) × (X − Y ) = (A × X) − [(A × Y ) ∪ (B × X)]. The identity is illustrated in figure 3.18. The (unhatched) shaded region can either be viewed as the Cartesian product (A − B) × (X − Y ) or as the difference (A × X) − [(A × Y ) ∪ (B × X)]; that is, A × X with both A × Y and B × X removed. A´Y Y B´ X

X

A´Y

B´ X X -Y A´ X A´ X

A A- B

B

Figure 3.18: (A − B) × (X − Y ) = (A × X) − [(A × Y ) ∪ (B × X)]

72

Exercises 3.6

Solutions Manual

3.7

Solutions to Exercises 3.7

1. (a) (i) (ii) (iii) (iv) (v) (vi) (b) (i) (ii) (iii) (iv) (v) (vi)

Integer Boolean Boolean Boolean Boolean Real Type checks. Type checks. Does not type check. Type checks. Type checks. Does not type check.

2. Height( ) : Person → Real DateOfBirth( ) : Person → Date YearOfBirth( ) : Person → Integer Age( ) : Person → Integer Mother ( ) : Person → Person IsOlderThan( , ) : Person , Person → Boolean CitizenOf ( ) : Person → Nation If dual or multiple nationality is permitted, CitizenOf ( ) : Person → Set [Nation ] Children( ) : Person → Set [Person ] IsTallerThan( , ) : Person , Person → Boolean Qualifications( ) : Person → Set [Qualification ], assuming that a type Qualification exists which is the type of qualifications. Siblings( ) : Person → Set [Person ] 3.

(i) False. There is no integer n such that n2 = 2. √ (ii) True. The real number x = 2 satisfies x2 = 2. (iii) True. For every integer n, n − 1 < n. (iv) True. For every real number x there is an integer n that is larger than x. (v) This depends on how IsOlderThan is interpreted. If IsOlderThan is interpreted as ‘was born before’ then this is true because every person’s mother was born before the person. If IsOlderThan is interpreted as ‘age now (for the living) or age at death (for the deceased) is greater than’ then this is false as there are people who have lived to be older than their mothers lived to. (vi) False. There is no real number x for which x2 < 0. (vii) True. There is a person who is queen.

Exercises 3.7

73

Discrete Mathematics: Proofs, Structures and Applications

(viii) True. There exist two people who have the same age (in years). (ix) True. For every integer n there is an integer m that is larger than n. (x) True. For every integer n either n < 0 or n ≥ 0. 4.

(i) True. Every integer n is less than the ‘next’ integer n + 1. (ii) False. The statement does not type check. (iii) False. For example, if n = −2 then n + 1 = −1 < 0. (iv) True. For example, if n = 1 then n + 1 = 2 > 0. (v) True. For every real number x, x2 ≥ 0. √ (vi) True. If x = 3 then x ∈ R and x2 = 3. (vii) True. Every person is some age in years. (viii) False. There is no integer n with the property that everyone is n years old. (ix) True. For example, if n = −3 and m = −2 then n < m and n2 = 9 > 4 = m2 . (x) The truth table for (P ↔ Q) ∨ (P ↔ ¬Q) is given below. P Q P ↔ Q ¬Q P ↔ ¬Q (P ↔ Q) ∨ (P ↔ ¬Q) T T T F F T T F F T T T F T F F T T T T F T F F The table shows that (P ↔ Q) ∨ (P ↔ ¬Q) is a tautology. Therefore ∀P ∀Q : Boolean , (P ↔ Q) ∨ (P ↔ ¬Q) is true. (xi) True. For every real number x there is an integer n such that n ≥ x. Note that we are assuming, here, that Integer is a subtype of Real . (xii) True. For every real number x the statement ‘x2 < 0’ is false so the conditional ‘(x2 < 0) → (x < 0)’ is therefore true.

6.

(i) IsM arried( ) : Person → Boolean IsF emale( ) : Person → Boolean IsChildOf ( , ) : Person , Person → Boolean IsM arriedT o( , ) : Person , Person → Boolean (ii) signature Informally: precondition postcondition

Formally: precondition postcondition 74

W if eOf ( ) : p : Person → q : Person

p must be male and married. q is the wife of p if q is female and p and q are married to one another.

¬IsM ale(p) ∧ IsM arried(p) IsF emale(q) ∧ IsM arriedT o(p, q) Exercises 3.7

Solutions Manual

(iii) signature

Sons( ) : p : Person → A : Set [Person ]

Informally: precondition postcondition

Sons(p) is defined for any p so there is no precondition. Sons(p) comprises all male children of p.

Formally: precondition postcondition

none A = {q : Person : ¬IsF emale(q) ∧ IsChildOf (q, p)}

(iv) f (p) is p’s father (since f (p) is male and p is a child of f (p)). (v) signature precondition postcondition 7.

F atherInLaw( ) : p : Person → q : Person IsM arried(p) ¬IsF emale(q) ∧ ∃r : Person , IsM arriedT o(p, r) ∧ IsChildOf (r, q)

(i) (a) OwnerOf ( ) : Pet → Person (b) Owns( ) : Person → Set [Pet ] (ii) a ∈ Owns(OwnerOf (a)) (iii) signature precondition postcondition

hasPet : p : Person → Boolean none Owns(p) 6= ∅

(iv) f (a, b) is true if the pets a and b have the same owner.

Exercises 3.7

75

Chapter 4

Relations 4.1 1.

Solutions to Exercises 4.1 (i) A = {1, 2, 3, 4, 5, 6, 7, 8}; a R b ⇔ a < b. (a)

A´ A

8 7 6 5 A

4 3 2 1

1

2

3

4

5

6

7

8

A (b)

6

5

7

4

8

3 1

2

76

Solutions Manual

 0 0  0  0  0  0  0 0

(c)

1 0 0 0 0 0 0 0

1 1 0 0 0 0 0 0

1 1 1 0 0 0 0 0

1 1 1 1 0 0 0 0

1 1 1 1 1 0 0 0

1 1 1 1 1 1 0 0

 1 1  1  1  1  1  1 0

(ii) A = {1, 2, 3, 4, 5, 6, 7, 8}; a R b ⇔ a = b. (a)

A´ A

8 7 6 5 A

4 3 2 1

1

2

3

4

5

6

7

8

A (b)

6

7

4

8

3

1

Exercises 4.1

5

2

77

Discrete Mathematics: Proofs, Structures and Applications



1 0  0  0  0  0  0 0

(c)

0 1 0 0 0 0 0 0

0 0 1 0 0 0 0 0

0 0 0 1 0 0 0 0

0 0 0 0 1 0 0 0

0 0 0 0 0 1 0 0

0 0 0 0 0 0 1 0

 0 0  0  0  = I8 0  0  0 1

(iv) A = {1, 2, 3, 4, 5, 6, 7, 8}; a R b ⇔ a/b ∈ Z. (a)

A´ A

8 7 6 5 A

4 3 2 1

1

2

3

4

5

6

7

8

A (b)

6

7

4

8

3

1

78

5

2

Exercises 4.1

Solutions Manual

 1 1  1  1  1  1  1 1

(c)

0 1 0 1 0 1 0 1

0 0 1 0 0 1 0 0

0 0 0 1 0 0 0 1

0 0 0 0 1 0 0 0

0 0 0 0 0 1 0 0

0 0 0 0 0 0 1 0

 0 0  0  0  0  0  0 1

(v) A = {a, b, c, d, e}; R = {(a, b), (a, c), (a, e), (b, c), (c, a), (c, d), (d, e), (e, c), (e, d)}. (a)

e d A c b a

a

(b)

b

c d A

e

a

e

b

d (c)

Exercises 4.1

c  0 0  1  0 0

1 0 0 0 0

1 1 0 0 1

0 0 1 0 1

 1 0  0  1 0

79

Discrete Mathematics: Proofs, Structures and Applications

(vi) A = {a, b, c, d, e, f }; x R y ⇔ x and y are both vowels or x and y are both consonants. (a)

f e A

d c b a

a

b

c

d

e

f

A (b)

a

b

c

e

f

d

(c)  1 0  0  0  1 0

80

0 1 1 1 0 1

0 1 1 1 0 1

0 1 1 1 0 1

1 0 0 0 1 0

 0 1  1  1  0 1

Exercises 4.1

Solutions Manual

(vii) A = {1, 2, 3, 4, 5, 6, 7, 8}; a R b ⇔ a = 2b. Then R = {(2, 1), (4, 2), (6, 3), (8, 4)}. (a)

A´ A

8 7 6 5 A

4 3 2 1

1

2

3

4

5

6

7

8

A (b)

1

5

7

3

6

2

4

8

(c)  0 1  0  0  0  0  0 0

Exercises 4.1

0 0 0 1 0 0 0 0

0 0 0 0 0 1 0 0

0 0 0 0 0 0 0 1

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

 0 0  0  0  0  0  0 0

81

Discrete Mathematics: Proofs, Structures and Applications

(viii) A = {1, 2, 3, 4, 5, 6, 7, 8}; a R b ⇔ a = 2n b for some n ∈ Z+ . Then R = {(2, 1), (4, 1), (4, 2), (6, 3), (8, 1), (8, 2), (8, 4)}. (a)

A´ A

8 7 6 5 A

4 3 2 1

1

2

3

4

5

6

7

8

A (b)

8

4

6

7

1

2

3

5

(c)  0 1  0  1  0  0  0 1

0 0 0 1 0 0 0 0

0 0 0 0 0 1 0 1

0 0 0 0 0 0 0 1

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

 0 0  0  0  0  0  0 0

(ix) A = P{1, 2, 3} = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}; a R b ⇔ a ⊆ b. 82

Exercises 4.1

Solutions Manual

(a)

P A ´P A

{1,2,3} {2,3} {1,3} {1,2} {3} P A {2} {1}

Æ {1} {2}

Æ

{1,3} {1,2,3}

{3}

{1,2} {2,3}

PA (b)

{1,2}

{1,3}

{2,3}

{3}

{1,2,3}

{2}

{1}

Æ

(c)

2.

 1 0  0  0  0  0  0 0

1 1 0 0 0 0 0 0

1 0 1 0 0 0 0 0

1 0 0 1 0 0 0 0

1 1 1 0 1 0 0 0

1 1 0 1 0 1 0 0

1 0 1 1 0 0 1 0

 1 1  1  1  1  1  1 1

(i) R = {(2, 1), (2, 3), (2, 5), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3), (4, 5), (5, 1), (5, 4)}, S = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (3, 1), (3, 2), (3, 3), (4, 1), (4, 4), (4, 5)}.

Exercises 4.1

83

Discrete Mathematics: Proofs, Structures and Applications

(ii)

1

1

5

2

4

5

3

2

4

3

R

6.

S

(i) R = {(a, b), (a, c), (a, d), (a, e), (b, c), (b, d), (b, e), (c, d), (c, e), (d, e)}.

a

e

b

d

c

(ii) R = {(a, a), (b, a), (b, b), (c, a), (c, b), (c, c), (d, a), (d, b), (d, c), (d, d), (e, a), (e, b), (e, c), (e, d), (e, e)}.

a

e

b

d

c

(iii) R = {(a, a), (a, c), (a, e), (b, b), (b, d), (c, a), (c, c), (c, e), (d, b), (d, d), (e, a), (e, c), (e, e)}. 84

Exercises 4.1

Solutions Manual

a

b

e

9.

c

d

(i) Let A = {a, b, c} and B = {1, 2, 3, 4}. A relation R from A to B is a subset of the Cartesian product A × B. Since |A × B| = 12 (Theorem 3.6) it follows that there are 212 subsets of A × B (Theorem 3.5). Therefore there are 212 relations from A to B. (ii) The argument in part (i) clearly generalises. If |A| = n and |B| = m then |A × B| = nm so A × B has 2nm subsets. Therefore there are 2nm relations from A to B.

10. (a) (i) R−1 = {(2, 1), (4, 1), (2, 2), (3, 2), (4, 3), (3, 4), (4, 4)}. (ii)

1

2

1

4

3

4

R

2

3 R

–1

(iii) Let MR and MR−1 denote the binary matrices of R and R−1 respectively. Then 

0 0 MR =  0 0

1 1 0 0

0 1 0 1

 1 0  1 1



and

MR−1

0 1 = 0 1

0 1 1 0

0 0 0 1

 0 0 . 1 1

(b) (i) Let a, b ∈ A. There is an arrow from a to b in the directed graph of R ⇔ (a, b) ∈ R ⇔ (b, a) ∈ R−1 ⇔ there is an arrow from b to a in the directed graph of R−1 . Therefore the directed graph of R−1 is obtained from the directed graph of R by reversing the direction of the arrows. Exercises 4.1

85

Discrete Mathematics: Proofs, Structures and Applications

(ii) Let MR and MR−1 denote the binary matrices of R and R−1 respectively. Also, let ai , aj ∈ A correspond to the ith and jth row/column of MR respectively. There is a 1 in the (i, j)-position of MR ⇔ (ai , aj ) ∈ R ⇔ (aj , ai ) ∈ R−1 ⇔ there is a 1 in the (j, i)-position MR−1 . Therefore MR−1 , the binary matrix of R−1 , is obtained from MR , the binary matrix of R, by interchanging the rows and columns. Note: this says that MR−1 is the transpose of MR , MR−1 = MRT . See chapter 6 for the definition of transpose.

4.2

Solutions to Exercises 4.2

1. Question 4.1.1 (i) R is: ◦ not reflexive since, for example, 1 6< 1; ◦ not symmetric since, for example, 1 < 2 but 2 6< 1; ◦ anti-symmetric since it is not possible to have both a < b and b < a (when a 6= b); ◦ transitive since a < b and b < c implies a < c. (ii) R is: ◦ reflexive since a = a for all a ∈ A; ◦ symmetric since a = b implies b = a; ◦ anti-symmetric since a R b and b R a implies a = b; ◦ transitive since a = b and b = c implies a = c. (iii) R is: ◦ reflexive since a ≤ a for all a ∈ A; ◦ not symmetric since, for example, 1 ≤ 2 but 2 6≤ 1; ◦ anti-symmetric since a ≤ b and b ≤ a implies a = b; ◦ transitive since a ≤ b and b ≤ c implies a ≤ c. (iv) R is: ◦ reflexive since a/a = 1 ∈ Z for all a ∈ A; ◦ not symmetric since, for example, 4 R 2 (as 4/2 ∈ Z) but 26 R 4 (since 2/4 6∈ Z); 1 ◦ anti-symmetric since a R b and b R a implies a/b ∈ Z and b/a = a/b ∈ Z which implies a/b = 1 so a = b; ◦ transitive since a R b and b R c implies a/b ∈ Z and b/c ∈ Z; hence a/c = a/b × b/c ∈ Z so a R c. (v) R is: ◦ not reflexive since, for example, (a, a) 6∈ R; ◦ not symmetric since, for example (a, b) ∈ R but (b, a) 6∈ R; 86

Exercises 4.2

Solutions Manual

(vi)

(vii)

(viii)

(ix)

(x)

◦ not anti-symmetric since, for example, (a, c) ∈ R and (c, a) ∈ R but a 6= c; ◦ not transitive since, for example, (a, c) ∈ R and (c, d) ∈ R but (a, d) 6∈ R. R is: ◦ reflexive since x R x for all x ∈ A; ◦ symmetric since x R y implies x and y are either both vowels or both consonants so y R x; ◦ not anti-symmetric since, for example, a R e and e R a but a 6= e; ◦ transitive since x R y and y R z implies x, y and z are either all vowels or are all consonants, so x R z. R is: ◦ not reflexive since, for example, 16 R 1; ◦ not symmetric since, for example, 6 R 3 (as 6 = 2 × 3) but 36 R 6 (as 3 6= 2 × 6); ◦ anti-symmetric since a R b implies a < b which implies b6 R a; hence it is not possible to have both a R b and b R a; ◦ not transitive since, for example, 8 R 4 (as 8 = 2 × 4) and 4 R 2 (as 4 = 2 × 2) but 86 R 2 (as 8 6= 2 × 2). Note that a R b implies a > b since a = 2n b where n ≥ 1. R is: ◦ not reflexive since, for example, 16 R 1; ◦ not symmetric since, for example, 8 R 2 (as 8 = 22 ×2) but 26 R 8 (since 2 < 8); ◦ anti-symmetric since a R b implies a > b which implies b6 R a; hence it is not possible to have both a R b and b R a; ◦ transitive since a R b and b R c implies a = 2n b and b = 2m c (where n, m ∈ Z) so a = 2n × 2m c = 2n+m c (where n + m ∈ Z) so a R c. R is: ◦ reflexive since a ⊆ a for all sets a; ◦ not symmetric since, for example, {1} ⊆ {1, 2} but {1, 2} 6⊆ {1}; ◦ anti-symmetric since a ⊆ b and b ⊆ a implies a = b (by Theorem 3.1); ◦ transitive since a ⊆ b and b ⊆ c implies a ⊆ c (see Exercise 3.2.10 (i)). R is: ◦ not reflexive since, for example, {1} 6⊂ {1}; ◦ not symmetric since, for example, {1} ⊂ {1, 2} but {1, 2} 6⊂ {1}; ◦ anti-symmetric since a ⊂ b implies b 6⊂ a hence it is not possible to have both a ⊂ b and b ⊂ a; ◦ transitive since a ⊂ b and b ⊂ c implies a ⊂ c.

Question 4.1.2 R is: ◦ ◦ ◦ ◦ Exercises 4.2

not not not not

reflexive since, for example, 16 R 1; symmetric since, for example, 2 R 1 but 16 R 2; anti-symmetric since, for example, 2 R 3 and 3 R 2 but 2 6= 3; transitive since, for example, 2 R 3 and 3 R 2 but 26 R 2. 87

Discrete Mathematics: Proofs, Structures and Applications

S is: ◦ ◦ ◦ ◦

not not not not

reflexive since, for example, 26 S 2; symmetric since, for example, 1 S 2 but 26 S 1; anti-symmetric since, for example, 1 S 3 and 3 S 1 but 1 6= 3; transitive since, for example, 3 S 1 and 1 S 4 but 36 S 4.

Question 4.1.3 R is: ◦ ◦ ◦ ◦

not not not not

reflexive since, for example, a6 R a; symmetric since, for example, c R b but b6 R c; anti-symmetric since, for example, a R c and c R a but a 6= c; transitive since, for example, b R e and e R a but b6 R a.

Question 4.1.5 R is: ◦ ◦ ◦ ◦

not not not not

reflexive since, for example, A6 R A; symmetric since, for example, C R A but A6 R C; anti-symmetric since, for example, A R B and B R A but A 6= B; transitive since, for example, C R B and B R D but C6 R D.

Question 4.1.6 See the listing of the elements and the directed graphs on pages 84-85. (i) R is: ◦ not reflexive since, for example, a6 R a; ◦ not symmetric since, for example, a R b but b6 R a; ◦ anti-symmetric since we never have both x R y and y R x when x 6= y – see the directed graph on page 84; ◦ transitive since whenever x R y and y R z we also have x R z – again, see the directed graph on page 84. (ii) R is: ◦ reflexive since x6 R x for all x ∈ A; ◦ not symmetric since, for example, b R a but a6 R b; ◦ anti-symmetric since we never have both x R y and y R x when x 6= y – see the directed graph on page 84; ◦ transitive since whenever x R y and y R z we also have x R z – again, see the directed graph on page 84. (iii) R is: ◦ reflexive since x6 R x for all x ∈ A; ◦ symmetric since whenever x R y we also have y R x – this is most clearly seen in the directed graph on page 85 where all of the arrows connecting different vertices are bidirectional; ◦ not anti-symmetric since, for example, a R c and c R a but a 6= c; 88

Exercises 4.2

Solutions Manual

◦ transitive since whenever x R y and y R z we also have x R z – again, this is most easily seen from the directed graph on page 85. Question 4.1.8 (i) IA is: ◦ reflexive since, for all a ∈ A, a = a so a IA a; ◦ symmetric since whenever a IA b implies a = b which implies b IA a; ◦ anti-symmetric since a IA b and b IA a implies a = b; ◦ transitive since a IA b and b IA c implies a = b and b = c; hence a = c so a IA c. (ii) UA is: ◦ reflexive since a UA a for all a ∈ A; ◦ symmetric since a UA b implies a, b ∈ A which implies b UA a; ◦ not anti-symmetric if there exist distinct elements a, b ∈ A for then a UA b and b UA a but a 6= b; however, if |A| = 1 then UA is anti-symmetric; ◦ transitive since a UA b and b UA c implies a UA c (since a UA c for all a, c ∈ A). 2. In each case, let the relation be denoted R. Also, in each case, we assume that the set A contains more than one person. Note that the empty relation R = ∅ is symmetric, anti-symmetric and transitive – see question 5 below. (i) Reflexive R is not reflexive since no-one is their own mother. Symmetric If A contains both a mother m and her child c then R is not symmetric because, in this case, m R c but clearly c6 R m. However, if A does not contain a mother and child then R is symmetric because, in this case, R = ∅. Anti-symmetric R is anti-symmetric since, if m is the mother of c then c is not the mother of m. Therefore, for all a, b ∈ A, it is not possible to have both a R b and b R a. Transitive R is not transitive if the set A contains a grandmother g, her daughter m and m’s child c. In this case g R m and m R c but g6 R c. However, if A does not contain any example of a grandmother, her daughter and her daughter’s child, then R is transitive because, in this case, for all a, b, c ∈ A we do not have both a R b and b R c. (ii) Reflexive R is not reflexive since no-one is their own brother. Symmetric If A contains a brother b and his sister s then R is not symmetric because, in this case, b R s but clearly s6 R b. If A does not contain a brother and his sister then R is symmetric because, in this case, if a R b then a and b must be brothers so b R a. Exercises 4.2

89

Discrete Mathematics: Proofs, Structures and Applications

Anti-symmetric If A contains a pair of brothers b1 and b2 then R is not anti-symmetric since, in this case, b1 R b2 and b2 R b1 but b1 6= b2 . If A does not contain any pair of brothers then R is anti-symmetric since, in this case, for all a, b ∈ A, we do not have both a R b and b R a. Transitive If A contains a pair of brothers b1 and b2 then R is not transitive since, in this case, b1 R b2 and b2 R b1 but b1 6 R b1 (since no-one is their own brother). If A does not contain a pair of brothers b1 and b2 then R is transitive since R = ∅. (iii) Reflexive R is not reflexive since no-one is their own sibling. Symmetric R is symmetric because, if a is a sibling of b then b is a sibling of a. Anti-symmetric If A contains a pair of siblings a and b then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A does not contain any pair of siblings then R is anti-symmetric since, in this case, R = ∅. Transitive If A contains a pair of siblings a and b then R is not transitive since, in this case, a R b and b R a but a6 R a (since no-one is their own sibling). If A does not contain a pair of siblings then R is transitive since R = ∅. (iv) Reflexive R is reflexive since everyone is as tall as themselves. Symmetric If A contains a pair of people a and b of different heights then R is not symmetric. Suppose a is taller than b; then a R b but b6 R a. If, however, all of the people in A are the same height then R is symmetric because, in this case, R is the universal relation UA . (See the solution to question 4.1.8 (ii) in question 1 above.) Anti-symmetric If A contains a pair of people a and b of the same height then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A does not contain any pair of people who are the same height then R is antisymmetric. In this case, if a R b then a is strictly taller than b so b6 R a. Transitive R is transitive because, if a is at least as tall as b and b is at least as tall as c then a is at least as tall as c. (v) Reflexive R is not reflexive since no-one is taller than themselves. Symmetric If A contains a pair of people a and b of different heights then R is not symmetric. Suppose a is taller than b; then a R b but b6 R a. 90

Exercises 4.2

Solutions Manual

If, however, all of the people in A are the same height then R is symmetric because, in this case, R = ∅. Anti-symmetric R is anti-symmetric since, if a R b then a is taller than b so b6 R a. Transitive R is transitive because, if a is taller than b and b is taller than c then a is taller than c. (vi) Reflexive R is reflexive since everyone is the same age as themselves. Symmetric R is symmetric since, if a is the same age as b then b is the same age as a. Anti-symmetric If A contains a pair of people a and b of the same age then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A does not contain any pair of people who are the same age then R is antisymmetric since, in this case, R is the identity relation on A, IA . (See the solution to question 4.1.8 (i) in question 1 above.) Transitive R is transitive because, if a is the same age as b and b is the same age as c then a is the same age as c. (vii) Reflexive R is reflexive since everyone is the same gender as themselves. Symmetric R is symmetric since, if a is the same gender as b then b is the same gender as a. Anti-symmetric If A contains a pair of people a and b of the same gender then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A = {a, b} where a is male and b is female then R is anti-symmetric since, in this case, R is the identity relation on A, R = IA = {(a, a), (b, b)}. (See the solution to question 4.1.8 (i) in question 1 above.) Transitive R is transitive because, if a is the same gender as b and b is the same gender as c then a is the same gender as c. (viii) Reflexive R is not reflexive since no-one is an ancestor of themselves. Symmetric If A contains person a and one of their descendants b then R is not symmetric since a R b but b6 R a. If, however, no-one in A is an ancestor of anyone else in A then R is symmetric because R = ∅. Anti-symmetric R is anti-symmetric since, if a R b then a is an ancestor of b so b is not an ancestor Exercises 4.2

91

Discrete Mathematics: Proofs, Structures and Applications

of a, b6 R a. Transitive R is transitive because, if a is an ancestor of b and b is an ancestor of c then a is an ancestor of c. (ix) Reflexive R is not reflexive since no-one is married to themselves. Symmetric R is symmetric because if a is married to b then b is married to a. Anti-symmetric If A contains a married couple, a and b, then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A does not contain any married couples then R is anti-symmetric since R = ∅. Transitive If A contains a married couple, a and b, then R is not transitive since, in this case, a R b and b R a but a6 R a (since no-one is married to themselves). If A does not contain any married couples then R is transitive since R = ∅. None of the properties of R are affected by whether the society os monogamous or polygamous. (x) Reflexive R is not reflexive since no-one is an acquaintance of themselves. Symmetric R is symmetric because (we assume) if a is an acquaintance of b then b is an acquaintance of a. Anti-symmetric If A contains a pair of acquaintances, a and b, then R is not anti-symmetric since, in this case, a R b and b R a but a 6= b. If A does not contain any pairs of acquaintances then R is anti-symmetric since R = ∅. Transitive If A contains a pair of acquaintances, a and b, then R is not transitive since, in this case, a R b and b R a but a6 R a. Note that it may also be the case that there are three individuals a, b and c in A such that a is an acquaintance of b, b is an acquaintance of c but a is not an acquaintance of c. This would also ensure (in a more obvious way) that R is not transitive. However, even if there do not exist three such individuals in A then R is still not transitive, as the previous argument demonstrates. If A does not contain any pairs of acquaintances then R is transitive since R = ∅. 3.

(i) R is: ◦ ◦ ◦ ◦

92

not reflexive since (d, d) 6∈ R; symmetric since, for all x, y ∈ A, (x, y) ∈ R ⇒ (y, x) ∈ R; not anti-symmetric since, for example (a, b), (b, a) ∈ R but a 6= b; transitive since, for all x, y, z ∈ A, (x, y), (y, z) ∈ R ⇒ (x, z) ∈ R. Exercises 4.2

Solutions Manual

(ii) R is: ◦ ◦ ◦ ◦

reflexive since, (x, x) ∈ R for all x ∈ A; not symmetric since, for example, (a, b) ∈ R but (b, a) 6∈ R; anti-symmetric since we do not have both (x, y) ∈ R and (y, x) ∈ R for x 6= y; not transitive since, for example, (a, b) ∈ R and (b, c) ∈ R but (a, c) 6∈ R.

(iii) R is: ◦ ◦ ◦ ◦

reflexive since, (x, x) ∈ R for all x ∈ A; not symmetric since, for example, (a, d) ∈ R but (d, a) 6∈ R; anti-symmetric since we do not have both (x, y) ∈ R and (y, x) ∈ R for x 6= y; not transitive since, for example, (a, d) ∈ R and (d, e) ∈ R but (a, e) 6∈ R.

(iv) R is: ◦ ◦ ◦ ◦

not reflexive since, for example, (a, a) 6∈ R; not symmetric since, for example, (a, b) ∈ R but (b, a) 6∈ R; anti-symmetric since we do not have both (x, y) ∈ R and (y, x) ∈ R for x 6= y; not transitive since, for example, (a, b) ∈ R and (b, c) ∈ R but (a, c) 6∈ R.

(v) R is: ◦ ◦ ◦ ◦ 4.

not not not not

reflexive since, for example, (a, a) 6∈ R; symmetric since, for example, (b, d) ∈ R but (d, b) 6∈ R; anti-symmetric since, for example (a, b), (b, a) ∈ R but a 6= b; transitive since, for example, (a, b) ∈ R and (b, d) ∈ R but (a, d) 6∈ R.

(i) Reflexive R is reflexive since, for all n ∈ A, n = 20 n so n R n; Symmetric R is symmetric since, for n, m ∈ A, n R m ⇒ n = 2k m ⇒ m = 2−k n ⇒ m R n.

for some k ∈ Z where − k ∈ Z

Anti-symmetric R is not anti-symmetric since, for example, 6 R 6 (since 6 = 21 × 3) and 3 R 6 (since 3 = 2−1 × 6) but 6 6= 3. Transitive R is transitive since, for n, m, p ∈ A, n R m and m R p ⇒ n = 2k m and m = 2` p ⇒ n = 2k 2` p = 2k+` p ⇒ n R p.

for some k, ` ∈ Z where k + ` ∈ Z

(ii) Reflexive R is reflexive since, for all n ∈ A, n ≤ n so n R n. Symmetric R is not symmetric since, for example, 2 ≤ 5 but 5 6≤ 2. Exercises 4.2

93

Discrete Mathematics: Proofs, Structures and Applications

Anti-symmetric R is anti-symmetric since, for all n, m ∈ A, n ≤ m and m ≤ n implies n = m. Transitive R is transitive since, for all n, m, p ∈ A, n ≤ m and m ≤ p implies n ≤ p. (iii) Reflexive R is not reflexive since, for example, 16 R 1 (since 1 = 1). Symmetric R is symmetric since, for all n, m ∈ A, n 6= m ⇒ m 6= n. Anti-symmetric R is not anti-symmetric since, for example, 1 R 2 (since 1 6= 2) and 2 R 1 (since 2 6= 1) but 1 6= 2. Transitive R is not transitive since, for example, 1 R 2 (since 1 6= 2) and 2 R 1 (since 2 6= 1) but 16 R 1 (since 1 = 1). (iv) Reflexive R is reflexive since, for all sets X, X ⊆ X. Symmetric R is not symmetric since, for example {1} ⊆ {1, 3} but {1, 3} 6⊆ {1}. Anti-symmetric R is anti-symmetric since, for all X, Y ∈ P({1, 2, 3}), X ⊆ Y and Y ⊆ X ⇒ X = Y . Transitive R is transitive since, for for all X, Y ∈ P({1, 2, 3}), X ⊆ Y and Y ⊆ Z ⇒ X ⊆ Z. (v) Reflexive R is reflexive since, for all sets X, |X| = |X|. Symmetric R is symmetric since, for all X, Y ∈ P({1, 2, 3}), |X| = |Y | ⇒ |Y | = |X|. Anti-symmetric R is not anti-symmetric since, for example, |{1, 2}| = |{2, 3}| but {1, 2} 6= {2, 3}. Transitive R is transitive since, for for all X, Y ∈ P({1, 2, 3}), |X| = |Y | and |Y | = |Z| ⇒ |X| = |Z|. 5. Let A 6= ∅ and R = ∅. Recall that a conditional statement P ⇒ Q is true when the antecedent P is false. Choose a ∈ A. Then a6 R a, since R = ∅. Therefore R = ∅ is not reflexive. For all a, b ∈ A, a R b is false, since R = ∅. Hence the conditional ‘a R b ⇒ b R a’ is true. Therefore R = ∅ is symmetric. 94

Exercises 4.2

Solutions Manual

Similarly, for all a, b ∈ A, (a R b) ∧ (b R a) is false, since R = ∅. Hence the conditional ‘(a R b) ∧ (b R a) ⇒ a = b’ is true. Therefore R is anti-symmetric. Finally, for all a, b, c ∈ A, (a R b)∧(b R c) is false. Hence the conditional ‘(a R b)∧(b R c) ⇒ a R c’ is true. Therefore R is transitive. If A = ∅ then R = ∅ is also reflexive. This is because there are no elements a of A such that a6 R a. 6. It is possible for a relation R on a set A to be both symmetric and anti-symmetric. Suppose that R satisfies a R b ⇒ a = b. for all a, b ∈ A. In other words, we never have a R b when a 6= b. This means that R is a subset of the identity relation, R ⊆ IA . R is symmetric since, for all a, b ∈ A, a R b ⇒ a = b ⇒ b R a. R is anti-symmetric since we never have a R b and b R a when a 6= b. 7. Let A = {a, b, c, d}. (i) Two elements – we need to add both (c, c) and (d, d) to make R reflexive. (ii) Since (a, b) ∈ R we need to add (b, a). Similarly, we need to add both (c, a) and (c, b). Thus we need to add three elements to make R symmetric. (iii) No elements need adding since R is anti-symmetric. (iv) No elements need adding since R is transitive. 9.

(i) Reflexive R is reflexive since, for all n ∈ Z+ , n − n = 3 × 0 so n R n. Symmetric R is symmetric since, for all n, m ∈ Z+ , n R m ⇒ n − m = 3k for some k ∈ Z ⇒ m − n = 3(−k) where − k ∈ Z ⇒ m R n. Anti-symmetric R is not anti-symmetric since, for example, 4 R 1 and 1 R 4 but 4 6= 1. Transitive R is transitive since, for for all n, m, p ∈ Z+ , n R m and m R p ⇒ n − m = 3k and m − p = 3` for some k, ` ∈ Z ⇒ m − p = (n − m) + (m − p) = 3k + 3` = 3(k + `) where k + ` ∈ Z ⇒ n R p. (ii) Reflexive R is not reflexive since, for example, 1 6= 3k × 1 where k is a positive integer, so 16 R 1.

Exercises 4.2

95

Discrete Mathematics: Proofs, Structures and Applications

Symmetric R is not symmetric since, for example, 18 R 2 because 18 = 32 × 2 but 26 R 18 because 2 6= 3k × 18 for any positive integer k. Anti-symmetric For all n, m ∈ Z+ , if n R m then n = 3k m for some k ∈ Z+ so n > m. Hence we cannot have both n R m and m R n so R is anti-symmetric. Transitive R is transitive since, for for all n, m, p ∈ Z+ , n R m and m R p ⇒ n = 3k m and m = 3` p for some k, ` ∈ Z+ ⇒ n = 3k 3` p = 3k+` p where k + ` ∈ Z+ ⇒ n R p. (iii) See the solution to Exercise 4.2.4 (iii) on page 94 above. (iv) Reflexive R is reflexive since, for all n ∈ Z+ , n/n = 1 ∈ Z, so n R n. Symmetric R is not symmetric since, for example, 6 R 2 because 6/2 = 3 ∈ Z but 26 R 6 because 2/6 = 13 6∈ Z. Anti-symmetric The only positive integer k with the property that 1/k ∈ Z is k = 1. Suppose that n, m ∈ Z+ are such that n R m and m R n. Then n/m ∈ Z and 1 m/n = ∈ Z, so n/m = 1 which implies n = m. n/m Therefore R is anti-symmetric. Transitive R is transitive since, for for all n, m, p ∈ Z+ , n n R m and m R p ⇒ m ∈ Z and m p ∈Z n n m ⇒ p = m× p ∈Z ⇒ n R p.

10.

(i) Reflexive R is reflexive since, for all l1 ∈ A, l1 is parallel to itself so l1 R l1 . Symmetric R is symmetric since, for all l1 , l2 ∈ A, l1 is parallel to l2 implies l2 is parallel to l1 . Anti-symmetric R is not anti-symmetric. For example, if l1 has equation y = x and l2 has equation y = x + 1 then l1 R l2 (l1 is parallel to l2 ), l2 R l1 but l1 6= l2 . Transitive R is transitive since, for all l1 , l2 , l3 ∈ A, if l1 is parallel to l2 and l2 is parallel to l3 then l1 is parallel to l3 . (ii) Reflexive R is not reflexive since, for any l1 ∈ A, l1 is not perpendicular to itself so l1 6 R l1 .

96

Exercises 4.2

Solutions Manual

Symmetric R is symmetric since, for all l1 , l2 ∈ A, l1 is perpendicular to l2 implies l2 is perpendicular to l1 . Anti-symmetric R is not anti-symmetric. For example, if l1 has equation y = x and l2 has equation y = −x then l1 R l2 (l1 is perpendicular to l2 ), l2 R l1 but l1 6= l2 . Transitive R is not transitive. Let l1 have equation y = x, l2 have equation y = −x and l3 have equation y = x + 1. Then l1 is perpendicular to l2 and l2 is perpendicular to l3 but l1 is not perpendicular to l3 (in fact, l1 is parallel to l3 ). (iii) Reflexive R is not reflexive since, for example, the line l1 ∈ A with equation y = 2x is not related to itself since the square of its gradient is 4. Symmetric R is symmetric since, for all l1 , l2 ∈ A, if the product of the gradient of l1 and l2 is equal to 1 then the product of the gradient of l2 and l1 is also (trivially) equal to 1. Anti-symmetric R is not anti-symmetric. For example, let l1 have equation y = 2x and l2 has equation y = 12 x. Then l1 R l2 and l2 R l1 (since the product of their gradients is 2 × 21 = 1) but l1 6= l2 . Transitive R is not transitive. Let l1 have equation y = 2x, l2 have equation y = 12 x and l3 have equation y = 2x + 1. Then l1 R l2 since the product of their gradients is 2 × 21 = 1 and l2 R l3 since the product of their gradients is 12 × 2 = 1. However l3 6 R l1 since the product of their gradients is 2 × 2 6= 1. 13. R−1 inherits each of the four properties from R. Recall that, for all x, y ∈ A, x R−1 y if and only if y R x. Reflexive Suppose that R is reflexive. Then, for all x ∈ A, x R x so x R−1 x. Hence R−1 is reflexive. Symmetric Suppose that R is symmetric. Then, for all x, y ∈ A, x R−1 y ⇒ y R x (definition of R−1 ) ⇒ xRy (since R is symmetric) −1 ⇒ y R x (definition of R−1 ). Hence R−1 is symmetric. Anti-symmetric Suppose that R is anti-symmetric. Then, for all x, y ∈ A, x R−1 y and y R−1 x ⇒ y R x and x R y (definition of R−1 ) ⇒ y=x (since R is anti-symmetric) ⇒ x = y. Exercises 4.2

97

Discrete Mathematics: Proofs, Structures and Applications

Hence R−1 is anti-symmetric. Transitive Suppose that R is transitive. Then, for all x, y, z ∈ A, x R−1 y and y R−1 z ⇒ y R x and z R y (definition of R−1 ) ⇒ zRx (since R is transitive) ⇒ x R−1 z (definition of R−1 ). Hence R−1 is transitive.

4.3 1.

Solutions to Exercises 4.3 (i) R ∩ S = {(a, b), (a, c), (c, d)} and R ∪ S = {(a, b), (a, c), (a, d), (b, b), (b, c), (c, a), (c, b), (c, d), (d, a)}. (ii) a

d

b

a

c

d

R

a

d

R ÇS

(iii)

MR

MR∩S

98

 0 0 =  1 0 0 0 =  0 0

1 1 0 0 1 0 0 0

1 1 0 0 1 0 0 0

b

c S

b

a

c

d

b

c

R ÈS

  0 1 0 0  MS =  0 1 0 1 0 0 0 0  and MR∪S =  1 1 1 0

1 0 1 0 1 1 1 0

1 0 0 0 1 1 0 0

 0 0  1 0 1 0 . 1 0 Exercises 4.3

Solutions Manual

4. (ii) Suppose that R and S are both transitive. Let a, b, c ∈ A. Then x (R ∩ S) y and y (R ∩ S) z ⇒ x R y, x S y, y R z and y S z (definition of R ∩ S) ⇒ x R z and x S z

(since R and S are transitive)

⇒ x (R ∩ S) z

(definition of R ∩ S).

Therefore R ∩ S is transitive. 5.

(i) S ◦ R = {(a, c) ∈ A × A : (a, b) ∈ R and (b, c) ∈ S for some b ∈ A}. Thus, whenever (a, b) ∈ R and (b, c) ∈ S we have (a, c) ∈ S ◦ R. We consider each element (a, b) ∈ R in turn and find elements of S of the form (b, c). Consider (1, 3) ∈ R. Since (3, 4) ∈ S it follows that (1, 4) ∈ S ◦ R. Next consider (2, 2) ∈ R. Since (2, 3) ∈ S it follows that (2, 3) ∈ S ◦ R. Continuing in the same way: (3, 1) ∈ R and (1, 2) ∈ S so (3, 2) ∈ S ◦ R; (3, 4) ∈ R and (4, 1) ∈ S so (3, 1) ∈ S ◦ R; (4, 2) ∈ R and (2, 3) ∈ S so (4, 3) ∈ S ◦ R. Therefore S ◦ R = {(1, 4), (2, 3), (3, 2), (3, 1), (4, 3)}. To find the elements of R ◦ S we interchange the roles of R and S: (1, 2) ∈ S (2, 3) ∈ S (3, 4) ∈ S (4, 1) ∈ S

and and and and

(2, 2) ∈ R (3, 1), (3, 4) ∈ R (4, 2) ∈ R (1, 3) ∈ R

so so so so

(1, 2) ∈ R ◦ S; (2, 1), (2, 4) ∈ R ◦ S; (3, 2) ∈ R ◦ S; (4, 3) ∈ R ◦ S.

Therefore R ◦ S = {(1, 2), (2, 1), (2, 4), (3, 2), (4, 3)}. (ii) Recall that (x, y) ∈ R−1 ⇔ (y, x) ∈ R. Therefore R−1 = {(1, 3), (2, 2), (2, 4), (3, 1), (4, 3)} S−1 = {(1, 4), (2, 1), (3, 2), (4, 3)} (R ◦ S)−1 = {(1, 2), (2, 1), (2, 3), (3, 4), (4, 2)} (S ◦ R)−1 = {(1, 3), (2, 3), (3, 2), (3, 4), (4, 1)}. (iii) We proceed in a similar way to part (i). (1, 4) ∈ S−1 (2, 1) ∈ S−1 (3, 2) ∈ S−1 (4, 3) ∈ S−1

and and and and

(4, 3) ∈ R−1 (1, 3) ∈ R−1 (2, 2), (2, 4) ∈ R−1 (3, 1) ∈ R−1

so so so so

(1, 3) ∈ R−1 ◦ S−1 ; (2, 3) ∈ R−1 ◦ S−1 ; (3, 2), (3, 4) ∈ R−1 ◦ S−1 ; (4, 1) ∈ R−1 ◦ S−1 .

Therefore R−1 ◦ S−1 = {(1, 3), (2, 3), (3, 2), (3, 4), (4, 1)}. Exercises 4.3

99

Discrete Mathematics: Proofs, Structures and Applications

Similarly: (1, 3) ∈ R−1 (2, 2) ∈ R−1 (2, 4) ∈ R−1 (3, 1) ∈ R−1 (4, 3) ∈ R−1

and and and and and

(3, 2) ∈ S−1 (2, 1) ∈ S−1 (4, 3) ∈ S−1 (1, 4) ∈ S−1 (3, 2) ∈ S−1

so so so so so

(1, 2) ∈ S−1 ◦ R−1 ; (2, 1) ∈ S−1 ◦ R−1 ; (2, 3) ∈ S−1 ◦ R−1 ; (3, 4) ∈ S−1 ◦ R−1 . (4, 2) ∈ S−1 ◦ R−1 .

Therefore S−1 ◦ R−1 = {(1, 2), (2, 1), (2, 3), (3, 4), (4, 2)}. (iv) In this example, R−1 ◦ S−1 = (S ◦ R)−1 and S−1 ◦ R−1 = (R ◦ S)−1 . We now prove that the results indicated in part (iv) for this example hold more generally. Result 1: For all relations R and S on a set A, R−1 ◦ S−1 = (S ◦ R)−1 . Proof Let R and S be relations on A and let a, b ∈ A. Then (a, b) ∈ R−1 ◦ S−1 ⇔ ⇔ ⇔ ⇔ ⇔

(a, x) ∈ S−1 and (x, b) ∈ R−1 for some x ∈ A (x, a) ∈ S and (b, x) ∈ R for some x ∈ A (b, x) ∈ R and (x, a) ∈ S for some x ∈ A (b, a) ∈ S ◦ R (a, b) ∈ (S ◦ R)−1 .

Therefore R−1 ◦ S−1 = (S ◦ R)−1 . Result 2: For all relations R and S on a set A, S−1 ◦ R−1 = (R ◦ S)−1 . Proof Just interchange R and S in the proof of result 1.

8. Let n, m ∈ Z+ . Then n R2 m ⇔ n R p and p R m for some p ∈ Z+ ⇔ p = n2 and m = p2 for some p ∈ Z+ ⇔ m = n4 . 9. Let R be a relation from A to B. Recall that a1 IA a2 ⇔ a1 = a2 . 100

Exercises 4.3

Solutions Manual

(i) R ◦ IA = R. Proof Let a ∈ A and b ∈ B. Then a (R ◦ IA ) b ⇔ a IA a0 and a0 R b for some a0 ∈ A ⇔ a = a0 and a0 R b for some a0 ∈ A ⇔ a R b. Since a (R ◦ IA ) b ⇔ a R b, it follows that R ◦ IA = R. (ii) IA ◦ R = R. Proof The proof is similar to that in part (i).

4.4 2.

Solutions to Exercises 4.4 (i) (a) Recall that, for x ∈ R, bxc is the largest integer which is less than or equal to x. We need to show that R is reflexive, symmetric and transitive. For all x ∈ R, b2xc = b2xc so R is reflexive. Let x, y ∈ R. Then x R y ⇒ b2xc = b2yc ⇒ b2yc = b2xc ⇒ y R x, so R is symmetric. Let x, y, z ∈ R. Then x R y and yRz ⇒ b2xc = b2yc and b2yc = b2zc ⇒ b2xc = b2zc ⇒ x R z, so R is transitive. Therefore R is an equivalence relation. (b)

£1¤ 4

Similarly,

£1¤ 2

Exercises 4.4

= = = = =

{x ∈ R : x R 41 } {x ∈ R : b2xc = b 21 c = 0} {x ∈ R : 0 ≤ 2x < 1} {x ∈ R : 0 ≤ x < 12 } £ 1¢ 0, 2 .

= = = = =

{x ∈ R : x R 12 } {x ∈ R : b2xc = b1c = 1} {x ∈ R : 1 ≤ 2x < 2} {x ∈ R : 12 ≤ x < 1} £1 ¢ 2, 1 . 101

Discrete Mathematics: Proofs, Structures and Applications

(c) Let a ∈ R and suppose that b2ac = n ∈ Z. Then [a] = = = = =

{x ∈ R : x R a} {x ∈ R : b2ac = n} {x ∈ R : n ≤ 2a < n + 1} {x ∈ R : n2 ≤ a < n+1 2 } £ n n+1 ¢ . 2, 2

Therefore the partition of R by equivalence classes is: ©£ n n+1 ¢ ª © £ ¢ £ ¢ £ ¢£ ¢ £ ¢ ª : n ∈ Z = . . . , − 12 , 0 , 0, 21 , 21 , 1 1, 23 , 32 , 2 , . . . . 2, 2 (ii) Let a ∈ R and suppose that b3ac = n ∈ Z. Then [a] = = = = =

{x ∈ R : x R a} {x ∈ R : b3ac = n} {x ∈ R : n ≤ 3a < n + 1} {x ∈ R : n3 ≤ a < n+1 3 } £ n n+1 ¢ . 3, 3

Therefore the partition of R by equivalence classes is: ©£ n n+1 ¢ ª © £ ¢ £ ¢£ ¢ £ ¢£ ¢ £ ¢ £ ¢ ª : n ∈ Z = . . . , − 13 , 0 , 0, 13 , 13 , 32 23 , 1 , 1, 43 , 34 , 35 53 , 2 . . . . 3, 3 3.

(i) Let P R Q if and only if P is the same age (in years) as Q. We need to show that R is reflexive, symmetric and transitive. For all people P ∈ A, P is the same age as P , so P R P . Therefore R is reflexive. For all P , Q ∈ A, if P R Q then P and Q are the same age so Q R P . Therefore R is symmetric. For all P , Q, S ∈ A, if P R Q and Q R S then P and Q are the same age and Q and S are the same age. Hence P and S are the same age, so P R S. Therefore R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on A. Let P ∈ A. The equivalence class of P is [P ] = {Q ∈ A : Q R P } = {Q ∈ A : Q and P are the same age}. In other words, the equivalence classes are the sets of those people in A who are the same age (in years). (ii) We are given that S is an equivalence relation on A. Let P ∈ A. The equivalence class of P is [P ] = {Q ∈ A : Q R P } = {Q ∈ A : Q and P were born in the same country}. In other words, the equivalence classes are the sets of those people in A who were born in the same country.

102

Exercises 4.4

Solutions Manual

4. Identity relation The identity relation on A, IA , is an equivalence relation on A. Proof For all a ∈ A, a = a so a IA a. Hence IA is reflexive. For all a, b ∈ A if a IA b then a = b so b IA a. Hence IA is symmetric. For all a, b, c ∈ A if a IA b and b IA c then a = b and b = c. Hence a = c so a IA c. Therefore IA is transitive. Since IA is reflexive, symmetric and transitive, it is an equivalence relation on A. Let a ∈ A. The equivalence class of a is [a] = {b ∈ A : b IA a} = {b ∈ A : b = a} = {a}. In other words, the equivalence classes are singleton sets. Universal relation The universal relation on A, UA , is an equivalence relation on A. Proof For all a ∈ A, a UA a. Hence UA is reflexive. For all a, b ∈ A, a UA b and b UA a. Hence UA is symmetric. For all a, b, c ∈ A, a UA b and b UA c and a UA c. Hence UA is transitive. Since UA is reflexive, symmetric and transitive, it is an equivalence relation on A. Let a ∈ A. Since b UA a for all b ∈ A, the equivalence class of a is [a] = {b ∈ A : b UA a} = A. In other words, the (only) equivalence class is the whole set A. 5.

(i) Let R be the relation defined on R2 by (x1 , y1 ) R (x2 , y2 ) if and only if x1 = x2 . R is an equivalence relation on R2 . Proof For all (x, y) ∈ R2 , x = x so (x, y) R (x, y). Hence R is reflexive. For all (x1 , y1 ), (x2 , y2 ) ∈ R2 , (x1 , y1 ) R (x2 , y2 ) ⇒ x1 = x2 ⇒ x2 = x1 ⇒ (x2 , y2 ) R (x1 , y1 ), so R is symmetric. For all (x1 , y1 ), (x2 , y2 ), (x3 , y3 ) ∈ R2 ,

Exercises 4.4

103

Discrete Mathematics: Proofs, Structures and Applications

(x1 , y1 ) R (x2 , y2 ) and (x2 , y2 ) R (x3 , y3 ) ⇒ x1 = x2 and x2 = x3 ⇒ x1 = x3 ⇒ (x1 , y1 ) R (x3 , y3 ), so R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on R2 . Let (a, b) ∈ R2 . The equivalence class of (a, b) is [(a, b)] = {(x, y) ∈ R2 : (x, y) R (a, b)} = {(x, y) ∈ R2 : x = a)} = {(a, y) : y ∈ R}. In other words, the equivalence class of (a, b) is (the set of points lying on) the vertical line in R2 through (a, b). (ii) Let R be the relation defined on R2 by (x1 , y1 ) R (x2 , y2 ) if and only if x1 + y1 = x2 + y2 . R is an equivalence relation on R2 . Proof For all (x, y) ∈ R2 , x + y = x + y so (x, y) R (x, y). Hence R is reflexive. For all (x1 , y1 ), (x2 , y2 ) ∈ R2 , (x1 , y1 ) R (x2 , y2 ) ⇒ x1 + y1 = x2 + y2 ⇒ x2 + y2 = x1 + y1 ⇒ (x2 , y2 ) R (x1 , y1 ), so R is symmetric. For all (x1 , y1 ), (x2 , y2 ), (x3 , y3 ) ∈ R2 , ⇒ ⇒ ⇒

(x1 , y1 ) R (x2 , y2 ) and (x2 , y2 ) R (x3 , y3 ) x1 + y1 = x2 + y2 and x2 + y2 = x3 + y3 x1 + y1 = x3 + y3 (x1 , y1 ) R (x3 , y3 ),

so R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on R2 . Let (a, b) ∈ R2 . The equivalence class of (a, b) is [(a, b)] = {(x, y) ∈ R2 : (x, y) R (a, b)} = {(x, y) ∈ R2 : x + y = a + b)}. In other words, the equivalence class of (a, b) is (the set of points lying on) the line in R2 through (a, b) with gradient −1. (iii) Let R be the relation defined on R2 by (x1 , y1 ) R (x2 , y2 ) if and only if x21 + y12 = x22 + y22 . R is an equivalence relation on R2 . Proof For all (x, y) ∈ R2 , x2 + y 2 = x2 + y 2 so (x, y) R (x, y). Hence R is reflexive. 104

Exercises 4.4

Solutions Manual

For all (x1 , y1 ), (x2 , y2 ) ∈ R2 , (x1 , y1 ) R (x2 , y2 ) ⇒ x21 + y12 = x22 + y22 ⇒ x22 + y22 = x21 + y12 ⇒ (x2 , y2 ) R (x1 , y1 ), so R is symmetric. For all (x1 , y1 ), (x2 , y2 ), (x3 , y3 ) ∈ R2 , (x1 , y1 ) R (x2 , y2 ) and (x2 , y2 ) R (x3 , y3 ) ⇒

x21 + y12 = x22 + y22 and x22 + y22 = x23 + y32



x21 + y12 = x23 + y32



(x1 , y1 ) R (x3 , y3 ),

so R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on R2 . Let (a, b) ∈ R2 . The equivalence class of (a, b) is [(a, b)] = {(x, y) ∈ R2 : (x, y) R (a, b)} = {(x, y) ∈ R2 : x2 + y 2 = a2 + b2 )}. In other words, the equivalence class of (a, b) is (the √ set of points lying on) the circle in R2 centered at the origin (0, 0) with radius a2 + b2 . (If a = b = 0 then this gives just the origin itself: [(0, 0)] = {(0, 0)}.) 7. Let R be the relation defined on Q by x R y if and only if x − y ∈ Z. R is an equivalence relation on Q. Proof For all x ∈ Q, x − x = 0 ∈ Z so x R x. Hence R is reflexive. For all x, y ∈ Q, x R y ⇒ x − y ∈ Z ⇒ y − x = −(x − y) ∈ Z ⇒ y R x, so R is symmetric. For all x, y, z ∈ Q, ⇒ ⇒ ⇒

x R y and y R z x − y ∈ Z and y − z ∈ Z x − z = (x − y) + (y − z) ∈ Z x R z,

so R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on Q.

Exercises 4.4

105

Discrete Mathematics: Proofs, Structures and Applications

[2] £1¤ 4

£

8.

− 41

¤

= {x ∈ Q : x R 2} = {x ∈ Q : x − 2 ∈ Z} = {x ∈ Q : x ∈ Z} = Z, = {x ∈ Q : x R 41 } = {x ∈ Q : x − ¤ £ = . . . , − 74 , − 34 , 14 , 54 , 94 , . . . ,

1 4

∈ Z} = {n +

= {x ∈ Q : x R − 41 } = {x ∈ Q : x + £ ¤ = . . . , − 94 , − 54 , − 41 , 34 , 74 , . . . .

1 4

1 4

: n ∈ Z}

∈ Z} = {n −

1 4

: n ∈ Z}

(i) Let A = {a, b, c}. To count the number of equivalence relations on A, it is probably simplest to consider the number of partitions of the set. There are three types of partition of A. Type 1 All the sets in the partition are singleton sets: {{a}, {b}, {c}}. This corresponds to the identity relation on A, IA = {(a, a), (b, b), (c, c)}. Type 2 The partition is of the form {{∗}, {∗, ∗}} where ∗ denotes an element of A; in other words, the partition comprises a singleton set and a two-element set. There are three partitions of this type since there are three choices for the singleton set. One such partition is {{a}, {b, c}} which corresponds to the relation R = {(a, a), (b, b), (b, c), (c, b), (c, c)}. Type 3 The partition comprises a single set {A} = {{a, b, c}}. This corresponds to the universal relation on A, UA = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c)}. Therefore, in total there are 5 = 1 + 3 + 1 partitions of A so there are 5 equivalence relations on A. (ii) Let A = {a, b, c, d}. Again we consider the number of partitions of A. There are five types of partition of A. Type 1 All the sets in the partition are singleton sets: {{a}, {b}, {c}, {d}}. This corresponds to the identity relation on A, IA = {(a, a), (b, b), (c, c), (d, d)}. Type 2 The partition is of the form {{∗}, {∗}, {∗, ∗}}; in other words, the partition comprises two singleton sets and a two-element set. There are six partitions of this type since there are six choices for the two-element set. (These choices are: {a, b}, {a, c}, {a, d}, {b, c}, {b, d} and {c, d}.) One such partition is {{a}, {b}, {c, d}} which corresponds to the relation R = {(a, a), (b, b), (c, c), (c, d), (d, c), (d, d)}. Type 3 The partition is of the form {{∗, ∗}, {∗, ∗}}; in other words, the partition comprises a pair of two-element sets. There are three partitions of this type since there are three choices for the two element set containing a, {a, ∗}. One such partition is {{a, b}, {c, d}} which corresponds to the relation R = {(a, a), (a, b), (b, a), (b, b), (c, c), (c, d), (d, c), (d, d)}.

106

Exercises 4.4

Solutions Manual

Type 4 The partition is of the form {{∗}, {∗, ∗, ∗}}; in other words, the partition comprises a singleton set and a three-element set. There are four partitions of this type since there are four choices for the singleton set. One such partition is {{a}, {b, c, d}} which corresponds to the relation R = {(a, a), (b, b), (b, c), (b, d), (c, b), (c, c), (c, d), (d, b), (d, c), (d, d)}. Type 5 The partition comprises a single set {A} = {{a, b, c, d}}. This corresponds to the universal relation on A, UA

= P(A) = {(a, a), (a, b), (a, c), (a, d), (b, a), (b, b), (b, c), (b, d), (c, a), (c, b), (c, c), (c, d), (d, a), (d, b), (d, c), (d, d)}.

Therefore, in total there are 15 = 1 + 6 + 3 + 4 + 1 partitions of A so there are 15 equivalence relations on A. 9. Let A = Z(≥2) = {n ∈ Z : n ≥ 2}. For n ∈ A let P (n) and Q(n) denote the smallest and largest primes respectively that divide n. (i) Let R be the relation on A defined by n R m if and only if P (n) = P (m). R is an equivalence relation on A. Proof For all n ∈ A, P (n) = P (n) so n R n. Hence R is reflexive. For all n, m ∈ A, n R m ⇒ P (n) = P (m) ⇒ P (m) = P (n) ⇒ m R n, so R is symmetric. For all `, m, n ∈ A, ` R m and m R n ⇒ P (`) = P (m) and P (m) = P (n) ⇒ P (`) = P (n) ⇒ ` R n, so R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on A. [2] = {n ∈ A : n R 2} = {n ∈ A : P (n) = P (2) = 2} = {2, 4, 6, 8, 10, . . .} = {2k : k ∈ Z+ } [3] = {n ∈ A : n R 3} = {n ∈ A : P (n) = P (3) = 3} = {3, 9, 15, 21, 27, 33, . . .} = {3(2k − 1) : k ∈ Z+ } [5] = {n ∈ A : n R 5} = {n ∈ A : P (n) = P (5) = 5} = {5, 25, 35, 55, 65, 85, 95, . . .} = {5(6k + 1) : k ∈ N} ∪ {5(6k − 1) : k ∈ Z+ }. Exercises 4.4

107

Discrete Mathematics: Proofs, Structures and Applications

(ii) It is give that the relation S defined by n m if and only if Q(n) = Q(m). is an equivalence relation on A. [2] = = = =

{n ∈ A : n S 2} {n ∈ A : Q(n) = Q(2) = 2} {2, 4, 8, 16, 32, . . .} {2k : k ∈ Z+ },

[3] = = = =

{n ∈ A : n S 3} {n ∈ A : Q(n) = Q(3) = 3} {3, 6, 9, 12, 18, 24, 27, 36, 48, 54, . . .} {2k 3` : k ∈ N, ` ∈ Z+ },

[5] = = = =

{n ∈ A : n S 5} {n ∈ A : Q(n) = Q(5) = 5} {5, 10, 15, 20, 25, 30, 40, 45, 60, 75 . . .} {2k 3` 5m : k, ` ∈ N, m ∈ Z+ }.

10. Let n be a fixed positive integer. The relation a ≡n b ⇔ a − b = kn for some k ∈ Z is an equivalence relation on Z. Proof For all a ∈ Z, a − a = 0 = 0 × n so a ≡n a. Hence ≡n is reflexive. For all a, b ∈ Z, a ≡n b ⇒ a − b = kn ⇒ b − a = (−k)n ⇒ b ≡n a,

for some k ∈ Z where − k ∈ Z

so ≡n is symmetric. For all a, b, c ∈ Z,

⇒ ⇒ ⇒

a ≡n b and b ≡n c a − b = kn and b − c = k 0 n a − c = (a − b) + (b − c) = (k + k 0 )n a ≡n c,

for some k, k 0 ∈ Z where k + k 0 ∈ Z

so ≡n is transitive. Since ≡n is reflexive, symmetric and transitive, it is an equivalence relation on A.

108

Exercises 4.4

Solutions Manual

For all a, b ∈ Z, a ≡n b if and only if a and b have the same remainder after division by n. Proof Note that ‘a gives a remainder of r after division by n’ means a = qn + r where q, r ∈ Z and 0 ≤ r < n. Let a ∈ Z and b ∈ Z have remainders r and r0 respectively after division by n. Then there exist q, q 0 ∈ Z such that a = qn + r b=

q0n

+

r0

where 0 ≤ r < n where 0 ≤

r0

0. Therefore +2 2 x +2 ¡ ¤ © ª im(f ) ⊆ 0, 21 = x ∈ R : 0 < x ≤ 12 .

For all x ∈ R, x2 + 2 ≥ 2 so

Conversely, if 0 < x ≤ µq f

1 x

Exercises 5.1

then

1 x

¶ − 2 = ³q

so x ∈ im(f ). Hence

Therefore

1 2

x2

≥ 2 so 1 1 x

−2

´2

1 x

q − 2 ≥ 0 in which case

+2

= ¡1

x

1 x

− 2 ∈ R. Now

1 1 ¢ = = x, 1/x −2 +2

© ª x ∈ R : 0 < x ≤ 12 ⊆ im(f ). ¤ © ª ¡ im(f ) = 0, 21 = x ∈ R : 0 < x ≤ 12 . 125

Discrete Mathematics: Proofs, Structures and Applications

(iv) By definition,

© ª im(f ) = {f (x) : x ∈ R} = x4 : x ∈ R .

For all x ∈ R, x4 ≥ 0 so im(f ) ⊆ {x ∈ R : x ≥ 0}. √ Conversely, if x ≥ 0 then 4 x ∈ R and ¡ √ ¢ ¡ √ ¢4 f 4 x = 4 x = x, so x ∈ im(f ). Hence {x ∈ R : x ≥ 0} ⊆ im(f ). Therefore im(f ) = {x ∈ R : x ≥ 0}. (v) By definition, © ª im(f ) = {f (x) : x ∈ R} = (x + 2)/(x2 + 5) : x ∈ R . Let y ∈ R. Then y ∈ im(f ) ⇔ y = f (x) x+2 ⇔ y= 2 x +5 ⇔ x2 y + 5y = x + 2

for some x ∈ R for some x ∈ R for some x ∈ R

⇔ yx2 − x + (5y − 2) = 0 for some x ∈ R. Note that a quadratic equation ax2 + bx + c = 0 has a solution x ∈ R if and only if b2 − 4ac ≥ 0. Therefore yx2 − x + (5y − 2) = 0 for some x ∈ R ⇔

(−1)2 − 4y(5y − 2) ≥ 0



1 − 20y 2 + 8y ≥ 0



20y 2 − 8y − 1 ≤ 0



(10y + 1)(2y − 1) ≤ 0



1 − 10 ≤ y ≤ 21 .

1 We have shown that y ∈ im(f ) if and only if − 10 ≤ y ≤ 12 . Therefore £ 1 1¤ © ª 1 im(f ) = − 10 , 2 = x ∈ R : − 10 ≤ x ≤ 12 .

(vi) By definition, im(f ) = {f (x) : x ∈ R} = For all x ∈ R, x2 + 1 ≥ 1 so

np o x2 + 1 : x ∈ R .

√ x2 + 1 ≥ 1; hence im(f ) ⊆ {x ∈ R : x ≥ 1}.

126

Exercises 5.1

Solutions Manual

Conversely, if x ≥ 1 then x2 − 1 ≥ 0 so

√ x2 − 1 ∈ R and

³p ´ r³p ´2 √ p f x2 − 1 = x2 − 1 + 1 = (x2 − 1) + 1 = x2 = x, since x ≥ 0. Thus x ∈ im(f ). Hence {x ∈ R : x ≥ 1} ⊆ im(f ). Therefore im(f ) = {x ∈ R : x ≥ 1}. 8.

(i) For C ∈ P{a, b, c, d} the possible values of |C| are 0, 1, 2, 3 and 4. For example, |∅| = 0, |{a}| = 1, |{a, b}| = 2, |{a, b, c}| = 3 and |{a, b, c, d}| = 4. Therefore im(f ) = {0, 1, 2, 3, 4}. (ii) im(f ) = {n2 : n ∈ Z} = {0, 1, 4, 9, 16, 25, 36, 49, . . .}. (iii) A city Y belongs to im(f ) if and only if Y = f (X) for some country X. In other words, Y ∈ im(f ) if and only if Y is the capital city of some country X. Therefore im(f ) = {capital cities of the world}. (iv) For X ∈ P{a, b, c, d}, there are two possibilities for f (X). If a 6∈ X then f (X) = X ∩ {a} = ∅. If a ∈ X then f (X) = X ∩ {a} = {a}. Therefore im(f ) = {∅, {a}}. (v) For X ∈ P{a, b, c, d}, there are two possibilities for f (X). If a 6∈ X then f (X) = X ∪ {a} which gives X with the ‘new’ element a added; for example, f (∅) = ∅ ∪ {a} = {a}, f ({b, c}) = {b, c} ∪ {a} = {a, b, c} etc. If a ∈ X then f (X) = X ∪ {a} = X. Therefore im(f ) = {{a}, {a, b}, {a, c}, {a, d}, {a, b, c}, {a, b, d}, {a, c, d}, {a, b, c, d}} = {X ∈ P{a, b, c, d} : a ∈ X}.

9.

Question 1

As a set the function f : R → R is f ⊆ R × R. Therefore f has type Set [Real × Real ]. Similarly, g ⊆ Z × R so g has type Set [Integer × Real ]. Finally, h ⊆ R × Z so h : Set [Real × Integer ].

Exercises 5.1

127

Discrete Mathematics: Proofs, Structures and Applications

Question 2

Since the elements of A have type Integer , it follows that the elements of P(A) have type Set [Integer ]. Therefore, since f and g are both subsets of P(A) × P(A) it follows that f and g have type Set [Set [Integer ] × Set [Integer ]].

Question 6

Since the elements of A have type Integer , it follows that each of the functions f : A → A has type Set [Integer ] × Set [Integer ].

Question 8 (i)

10.

Since a, b, c, d have type Character , it follows that the elements of A = P({a, b, c, d}) have type Set [Character ]. Now f ⊆ P(A) × Z so f has type Set [Set [Character ] × Integer ].

(ii)

f : Z → Z has type Set [Integer × Integer ].

(iii)

Suppose that the elements of A have type Country and the elements of B have type City . Then f : A → B has type Set [Country × City ].

(iv), (v)

Since a, b, c, d have type Character , it follows that the elements of A = P({a, b, c, d}) have type Set [Character ]. Therefore f : A → A has type Set [Set [Character ] × Set [Character ]].

(i) By definition, f ([−3, 2]) = {f (x) : x ∈ [−3, 2]} = {x2 : −3 ≤ x ≤ 2}. If −3 ≤ x ≤ 2 then 0 ≤ x2 ≤ 9. Hence f ([−3, 2]) ⊆ [0, 9]. Let 0 ≤ y ≤ 9. Then 0 ≤ and

√ √ √ y ≤ 3 so −3 ≤ − y ≤ 0. Let x = − y; then x ∈ [−3, 2] √ √ f (x) = f (− y) = (− y)2 = y,

so y ∈ f ([−3, 2]). Hence [0, 9] ⊆ f ([−3, 2]) . Therefore f ([−3, 2]) = [0, 9]. (ii) By definition, f ((0, 8]) = {f (x) : x ∈ (0, 8]} = {2/x : 0 < x ≤ 8}. If 0 < x ≤ 8 then

2 1 2 ≥ = . Hence x 8 4 © ª f ((0, 8]) ⊆ x ∈ R : x ≥ 41

Let y ≥ 14 . Then 0
1.

Then, for all x ∈ R and all n ∈ Z+ , f [n] (x) = 2n x + (2n − 1). Proof (An outline proof is given in Hints and Solutions. The proof given here is just a fuller version of that proof.) The proof is by induction on n. Let n = 1. Then f [1] (x) = f (x) = 2x + 1 = 21 x + (21 − 1), so the result holds when n = 1. Suppose that, for some k ≥ 1, f [k] (x) = 2k x + (2k − 1)

for all x ∈ R.

Then, for all x ∈ R, f [k+1] (x) = = = = = =

(f [k] ◦ f )(x) f [k] (f (x)) f [k] (2x + 1) 2k (2x + 1) + (2k − 1) (from the inductive assumption) 2k+1 x + 2 × 2k − 1 2k+1 x + (2k+1 − 1).

This is the required result for n = k + 1. Therefore, by the principal of mathematical induction, for all x ∈ R and all n ∈ Z+ , f [n] (x) = 2n x + (2n − 1).

12.

(i) The function g : Z+ → Z+ must satisfy g(f (x)) = g(x + 2) = x

(∗)

for all x ∈ Z+ . Now x ≥ 1 implies x + 2 ≥ 3 so we must have g(y) = y − 2 for y ≥ 3 in order that (∗) is satisfied. However g(1) ∈ Z+ and g(2) ∈ Z+ may be chosen arbitrarily. Since there are infinitely many choices for g(1) and g(2), there are infinitely many different functions g : Z+ → Z+ such that g ◦ f = idZ+ . (ii) Since 1 6∈ im(f ) we have (f ◦ h)(1) = f (h(1)) 6= 1 regardless of the value of h(1). Therefore f ◦ h = 6 idZ+ . 138

Exercises 5.2

Solutions Manual

(iii) We have, for all x ∈ Z+ , f [2] (x) f [3] (x) f [4] (x) f [5] (x)

= (f ◦ f )(x) = (f [2] ◦ f )(x) = (f [3] ◦ f )(x) = (f [4] ◦ f )(x)

= f (x + 2) = f [2] (x + 2) = f [3] (x + 2) = f [4] (x + 2)

= = = =

(x + 2) + 2 (x + 2) + 4 (x + 2) + 6 (x + 2) + 8

= = = =

x + 4, x + 6, x + 8, x + 10,

etc.

Hence an obvious conjecture is that, for all n ∈ Z+ and for all x ∈ R, f [n] (x) = x + 2n. A simple proof by induction, along the lines of the proof given in question 11 above, proves the conjecture. 13.

(i) Note that, if x ≥ 0 then f (x) ≥ 0 and if x < 0 then f (x) < 0. Hence there are two cases to consider. √ If x ≥ 0 then f (x) = x2 + x and g(x) = x + 1 so ¡ ¢ p (g ◦ f )(x) = g(f (x)) = g x2 + x = x2 + x. If x < 0 then f (x) = 1/x and g(x) = 1/x so (g ◦ f )(x) = g(f (x)) = g (1/x) = Therefore g ◦ f : R → R,

1 = x. 1/x

½ √ x2 + x if x ≥ 0 (g ◦ f )(x) = x if x < 0

(ii) There are four cases to consider. Case 1: x ≥ 2. If x ≥ 2 then f (x) ≥ 0 so g(f (x)) = (f (x) + 4)/3. This gives (g ◦ f )(x) = g(f (x)) = g(x − 2) =

(x − 2) + 4 x+2 = . 3 3

Case 2: 1 ≤ x < 2. If 1 ≤ x < 2 then f (x) < 0 so g(f (x)) = |f (x) + 1|. This gives (g ◦ f )(x) = g(f (x)) = g(x − 2) = |(x − 2) + 1| = |x − 1|. Case 3: 0 ≤ x < 1. If 0 ≤ x < 1 then f (x) ≥ 0 so g(f (x)) = (f (x) + 4)/3. This gives ¡ ¢ x3 + 4 . (g ◦ f )(x) = g(f (x)) = g x3 = 3 Case 4: x < 0. Exercises 5.2

139

Discrete Mathematics: Proofs, Structures and Applications

If x < 0 then f (x) < 0 so g(f (x)) = |f (x) + 1|. This gives ¯ ¡ ¢ ¯ (g ◦ f )(x) = g(f (x)) = g x3 = ¯x3 + 1¯ . Therefore

g ◦ f : R → R,

  (x + 2)/3     |x − 1| (g ◦ f )(x) =  (x3 + 4)/3     |x3 + 1|

if if if if

x≥2 1≤x 0 and if n is odd then f (n) = ≤ 0. 2 2 Let m = f (n). n If m > 0 then m = so n = 2m. 2 1−n If m ≤ 0 then m = so n = 1 − 2m. 2 ½ 2m if m > 0 + So let g : Z → Z be defined by g(m) = 1 − 2m if m ≤ 0. For all n ∈ Z+ , we have (g ◦ f )(n) = g(f (n)) ( g(n/2) = g((1 − n)/2) ( 2 × (n/2) = 1 − 2 × (1 − n)/2 ( n = n

if n is even if n is odd if n is even if n is odd if n is even if n is odd.

Therefore g ◦ f is the identity function Z+ → Z+ . 162

Exercises 5.4

Solutions Manual

Similarly, for all m ∈ Z, we have (f ◦ g)(m) = f (g(m)) ( f (2m) = f (1 − 2m) ( (2m)/2 = (1 − (1 − 2m))/2 ( m = m

if m > 0 if m ≤ 0 if m > 0 if m ≤ 0 if m > 0 if m ≤ 0.

Therefore f ◦ g is the identity function Z → Z. Hence f is a bijection and g is its inverse, g = f −1 . (x) Note that, f (n, 0) = n − 1 ≥ 0 and g(n, 1) = −n < 0. To find the inverse function we use the relationship p = f (n, m) if and only if (n, m) = f −1 (p). We consider two cases: m = 0:

p = f (n, 0) = n − 1 ⇒ n = p + 1;

m = 1:

p = f (n, 1) = −n ⇒ n = −p. ½

So let g : Z →

Z+

× {0, 1} be defined by g(p) =

(p + 1, 0) if p ≥ 0 (−p, 1) if p < 0.

For all (n, m) ∈ Z+ × {0, 1}, we have (g ◦ f )(n, m) = g(f (n, m)) ( g(n − 1) = g(−n) ( ((n − 1) + 1, 0) = (−(−n), 1) ( (n, 0) = (n, 1) ( (n, m) = (n, m)

if m = 0 if m = 1 if m = 0 if m = 1 if m = 0 if m = 1 if m = 0 if m = 1

Therefore g ◦ f is the identity function Z+ × {0, 1} → Z+ × {0, 1}. Exercises 5.4

163

Discrete Mathematics: Proofs, Structures and Applications

Similarly, for all m ∈ Z, we have (f ◦ g)(p) = f (g(p)) ( f (p + 1, 0) = f (−p, 1) ( (p + 1) − 1 = −(−p) ( p = p

if p ≥ 0 if p < 0 if p ≥ 0 if p < 0 if p ≥ 0 if p < 0.

Therefore f ◦ g is the identity function Z → Z. Hence f is a bijection and g is its inverse, g = f −1 . 4.

δC (a) = 0, since a 6∈ C; δC (b) = 1, since c ∈ C; δC (c) = 0, since c 6∈ C; δC (d) = 1, since c ∈ C ; δC (e) = 1, since e ∈ C. (b) For δC to be injective we cannot have two distinct elements a and a0 in A − C for then δC (a) = 0 = δC (a0 ); similarly we cannot have two distinct elements c and c0 in C for then δC (c) = 1 = δC (c0 ). Therefore there are three possibilities: • A = {a, c} and C = {c}; then δC : a 7→ 0, c 7→ 1. • A = {a} and C = ∅; then δC : a 7→ 0. • A = {c} = C; then δC : c 7→ 1. (c) δC is surjective provided there is an element a ∈ A − C (so that δC (a) = 0) and there is an element c ∈ C (so that δC (c) = 1). In other words, δC is surjective if and only if both A − C 6= ∅ and C 6= ∅.

(i) (a)

(iii) Let X = {x1 , x2 , . . . , xn } and suppose f : P(X) → {0, 1}n be defined by f (C) = (δC (x1 ), δC (x2 ), . . . , δC (xn )) where C ⊆ X. Then f is a bijection. Proof Let C, D ∈ P(X) be such that f (C) = f (D). Then (δC (x1 ), δC (x2 ), . . . , δC (xn )) = (δD (x1 ), δD (x2 ), . . . , δD (xn )) . Then δC (x1 ) = δD (x1 ), δC (x2 ) = δD (x2 ), . . . , δC (xn ) = δD (xn ).

(∗)

Note that, for each xi ∈ X, δC (xi ) = δD (xi ) if and only if either we have both xi 6∈ C and xi 6∈ D or we have both xi ∈ C and xi ∈ D. Therefore, if the equations (∗) are all satisfied then, for all x ∈ X, x ∈ C ⇔ x ∈ D. This implies that C = D. Hence we have established if f (C) = f (D) then C = D. 164

Exercises 5.4

Solutions Manual

Therefore f is injective. Now let (δ1 , δ2 , . . . , δn ) ∈ {0, 1}n . Then each δi ∈ {0, 1}. Now define a subset C of X by xi ∈ C if and only if δi = 1 for i = 1, 2, . . . , n. (For example, (1, 0, 0, 1, 1, 1, 0) ∈ {0, 1}7 gives rise to C = {x1 , x4 , x5 , x6 } ⊆ X = {x1 , x2 , x3 , x4 , x5 , x6 , x7 }.) Then f (C) = (δC (x1 ), δC (x2 ), . . . , δC (xn )) = (δ1 , δ2 , . . . , δn ), so f is surjective. 5.

(i) Let f : [0, 1] → [1, 3] be defined by f (x) = 2x + 1. It is straightforward to verify that f is a bijection. Note that the length of the codomain interval [1, 3] is twice that of the domain interval [0, 1]; the term 2x provides a ‘stretch factor’ of 2 that will map an interval of length 1 onto an interval of length 2. Then the term ‘+1’ ensures that f (0) = 1 so that the leftmost point of the domain interval maps to the leftmost point of the codomain interval. With these considerations in mind, we can generalize to arbitrary closed intervals and show that the function µ ¶ d−c f : [a, b] → [c, d] defined by f (x) = (x − a) + c a−b is a bijection. (ii) Let f : (0, 1) → R+ be defined by f (x) =

x . See figure 5.13 for a sketch of the 1−x

graph of the function. From the sketch, it is clear that each horizontal line through a point b ∈ R+ meets the graph exactly once which indicates that f is bijective. A more formal proof is given below.

y

y=

x 1- x

0

1

x

Figure 5.13: A sketch of the graph of f (x) =

x 1−x

x . 1+x (Of course, we discovered g by letting y = f (x) and then rearranging to obtain x = g(y).) Note that: x > 0 since x > 0 and 1+x Let g : R+ → (0, 1) be defined by g(x) =

Exercises 5.4

165

Discrete Mathematics: Proofs, Structures and Applications

x < 1 since 1 + x > x > 0. 1+x Therefore, for all x ∈ R+ , we have g(x) ∈ (0, 1), so g is a well defined function. For all x ∈ (0, 1), (g ◦ f )(x) = g(f (x)) µ ¶ x = g 1−x = =

x/(1 − x) 1 + x/(1 − x) x (1 − x) + x

= x, so g ◦ f = id(0,1) , the identity function (0, 1) → (0, 1). Similarly, for all x ∈ R+ , (f ◦ g)(x) = f (g(x)) µ ¶ x = f 1+x = =

x/(1 + x) 1 − x/(1 + x) x (1 + x) − x

= x, so f ◦ g = idR+ , the identity function R+ → R+ . Therefore f is a bijection ( and g is its inverse function). (iii) Probably the most obvious bijection f : R+ → R is a logarithmic function. For example, f (x) = log2 (x) which has inverse f −1 : R → R+ , f −1 (x) = 2x . However, we will restrict our attention here to rational functions. Let f : R+ → R 1 be defined by f (x) = x − . See figure 5.14 for a sketch of the graph of the function. x From the sketch, it is clear that each horizontal line through a point b ∈ R meets the graph exactly once which indicates that f is bijective. A more formal proof that f is a bijection is rather complicated. We first find an expression for the inverse function. For all x ∈ R+ , x2 − 1 1 y = f (x) ⇒ y = x − = x x 2 ⇒ xy = x − 1 ⇒ x2 − yx − 1 = 0. From the quadratic formula we have, since x > 0, r³ ´ p y + y2 + 4 y y 2 x= = + + 1. 2 2 2 166

Exercises 5.4

Solutions Manual

Therefore, we define g : R →

x by g(x) = + 2

R+

y

y = x-

0

1

r³ ´ x 2 2

+ 1.

1 x

x

Figure 5.14: A sketch of the graph of f (x) = x −

1 x

As usual, we need to show that (g ◦ f )(x) = x for all x ∈ R+ and (f ◦ g)(x) = x for all x ∈ R. Firstly, for all x ∈ R+ ,

(g ◦ f )(x) = g(f (x)) µ 2 ¶ x −1 = g x sµ ¶2 x2 − 1 x2 − 1 = + +1 2x 2x sµ ¶ x2 − 1 x4 − 2x2 + 1 + 4x2 = + 2x 4x2 sµ ¶ x4 + 2x2 + 1 x2 − 1 = + 2x 4x2 sµ ¶ x2 − 1 (x2 + 1)2 + = 2x (2x)2 =

x2 − 1 (x2 + 1) + 2x (2x)

=

2x2 2x

= x. Exercises 5.4

167

Discrete Mathematics: Proofs, Structures and Applications

Secondly, for all x ∈ R, (f ◦ g)(x) = f (g(x)) ! Ã r³ ´ x x 2 + +1 = f 2 2 Ã =

=

=

=

!2 r³ ´ x 2 +1 −1 2 r³ ´ x x 2 +1 + 2 2 µ³ ´ ¶ ³ x ´2 2x r³ x ´2 x 2 + +1+ +1 −1 2 2 2 2 r³ ´ x x 2 + +1 2 2 r³ ´ x 2 x2 +x +1 2 2 r³ ´ x x 2 + +1 2 2 Ã ! r³ ´ x x 2 + x +1 2 2 r³ ´ x x 2 + +1 2 2 x + 2

= x. Since (g ◦ f )(x) = x for all x ∈ R+ and (f ◦ g)(x) = x for all x ∈ R, it follows that f is a bijection (and g = f −1 ). x and let f2 : R+ → R be defined (iv) Let f1 : (0, 1) → R+ be defined by f1 (x) = 1−x x2 − 1 by f2 (x) = . x By parts (ii) and (iii), f1 and f2 are bijections. Therefore, by Theorem 5.7(i), their composite f = f2 ◦ f1 : (0, 1) → R is also a bijection. Now (f2 ◦ f1 )(x) = f2 (f µ1 (x)) ¶ x = f2 1−x = = = 168

(x/(1 − x))2 − 1 x/(1 − x) x2 − (1 − x)2 x(1 − x) 2x − 1 . x(1 − x) Exercises 5.4

Solutions Manual

½

2n if n > 0 1 − 2n if n ≤ 0. Then f is a bijection since it is the inverse of the bijection defined in question 5.4.3 (ix) on page 162 above.

(v) Let f : Z →

6.

Z+

be defined by f (n) =

(i) Let f be a function R → R and let k ∈ R, k 6= 0. Then kf : R → R defined by (kf )(x) = kf (x) is a bijection if and only if f is a bijection. Proof Firstly, suppose that f is a bijection. Let x, y ∈ R. Then (kf )(x) = (kf )(y) ⇒ kf (x) = kf (y) ⇒ f (x) = f (y) (since k = 6 0) ⇒ x=y (since f is injective.) Therefore kf is injective. Now let y ∈ R. Then y/k ∈ R, since k 6= 0. Now, f is surjective so there exists x ∈ R such that f (x) = y/k. Hence (kf )(x) = kf (x) = k ×

y = y. k

Therefore kf is surjective. Since kf is both injective and surjective, it is a bijection. Conversely, suppose that kf is a bijection. By the first part of the proof with k replaced by k1 and f replaced by kf , it follows that f=

1 (kf ) k

is a bijection. (ii) Let f : R → R be defined by f (x) = x and g : R → R be defined by g(x) = −x. Is is straightforward to verify that f and g are bijections. Now f + g : R → R is given by (f + g)(x) = x + (−x) = 0, so clearly f + g is not a bijection. Similarly (f ∗ g) : R → R is given by (f ∗ g)(x) = x(−x) = −x2 which is also not a bijection (see Example 5.7.1). 7.

(i) Let A be a set with n elements. There are n! = n(n − 1)(n − 2) . . . 2.1 different bijections A → A. Proof Let A = {a1 , a2 , . . . , an }. We can construct a bijection f : A → A by selecting, in turn, f (a1 ) ∈ A, then f (a2 ) ∈ A, then f (a3 ) ∈ A, and so on, until finally we select f (an ) ∈ A.

Exercises 5.4

169

Discrete Mathematics: Proofs, Structures and Applications

For f (a1 ) there are n choices that are possible – we can select any of the elements a1 , a2 , . . . , an of A. Once f (a1 ) has been selected, there are n − 1 possible choices for f (a2 ). This is because we cannot choose f (a2 ) to be the same element as f (a1 ) for then f would then not be injective; however, any of n − 1 elements of A − {f (a1 )} can be selected for f (a2 ). Once both f (a1 ) and f (a2 ) have been selected, there are n − 2 possible choices for f (a3 ). This is because we cannot choose f (a3 ) to be equal to either f (a1 ) or f (a2 ) as f would then not be injective. But any of n − 2 elements of A − {f (a1 ), f (a2 )} can be selected for f (a3 ). Continuing in this way, there are n − 3 choices for f (a4 ), n − 4 choices for f (a5 ) etc. At the last step, there is only one element in A − {f (a1 ), f (a2 ), . . . , f (an−1 )} and this must be chosen as f (an ). In total there are n × (n − 1) × (n − 2) × . . . × 2 × 1 choices. Each of these choices defines a different bijection A → A and every such bijection arises in this way. Therefore there are n! = n(n − 1)(n − 2) . . . 2.1 different bijections A → A. (ii) Let A be a set with n elements and B be a set with m elements where n ≤ m. There are m! = m(m − 1)(m − 2) . . . (m − n + 1) (m − n)! different injections A → B. Proof The proof is very similar to the proof in part (i). To define an injection A → B, we need to ensure that f (a1 ), f (a2 ), . . . , f (an−1 ) are all different elements of B. Again we choose the elements f (a1 ), f (a2 ), . . . , f (an−1 ) of B in turn. • There are m choices for f (a1 ) since we may chose any element of B. • There are m − 1 choices for f (a2 ); we cannot choose f (a1 ) but any of the m − 1 elements of B − {f (a1 )} is a valid choice. • There are m − 2 choices for f (a3 ); we cannot choose either f (a1 ) or f (a2 ) but any of the m − 2 elements of B − {f (a1 ), f (a2 )} is a valid choice. .. . • There are m − n + 1 choices for f (an ). We cannot choose any of the n − 1 elements f (a1 ), f (a2 ), . . . , f (an−1 ) but any of the m − (n − 1) elements of B − {f (a1 ), f (a2 ), . . . , f (an−1 )} is a valid choice. There are m(m − 1)(m − 2) . . . (m − n + 1) choices in total. Each of these choices defines a different injection A → B and every such injection arises in this way. Therefore there are m! = m(m − 1)(m − 2) . . . (m − n + 1) (m − n)! different injections A → B. 170

Exercises 5.4

Solutions Manual

9. Let f : A → B be a function. Then f is a bijection if and only if f (A − C) = B − f (C) for every C ⊆ A. Proof The result is a biconditional statement so there are two parts to the proof. (⇒) Suppose that f is a bijection. Let C ⊆ A. We need to show that f (A − C) = B − f (C). Let y ∈ f (A − C). Then y = f (a) for some a ∈ A − C. We show that y 6∈ f (C). Suppose that y ∈ f (C). Then y = f (c) for some c ∈ C. Then we have f (a) = y = f (c) where a 6= c (since a ∈ A − C and c ∈ C). This contradicts the supposition that f is injective. Hence y 6∈ f (C). Therefore y ∈ B − f (C). We have shown that, if y ∈ f (A − C) then y ∈ B − f (C). Therefore f (A − C) ⊆ B − f (C). Now suppose that y ∈ B − f (C). Since f is surjective there exists x ∈ A such that y = f (x). Now x 6∈ C because x ∈ C implies f (x) ∈ f (C) but we have y = f (x) 6∈ f (C). Therefore x ∈ A − C. Since y = f (x) where x ∈ A − C, it follows that y ∈ f (A − C). We have shown that, if y ∈ B − f (C) then y ∈ f (A − C). Therefore B − f (C) ⊆ f (A − C). Since f (A−C) ⊆ B −f (C) and B −f (C) ⊆ f (A−C), we have f (A−C) = B −f (C), as required. (⇐) Suppose that f (A − C) = B − f (C) for every C ⊆ A. We need to show that f is a bijection. We first prove that f is injective. Let x1 , x2 ∈ A be such that x1 6= x2 . We need to show that the images are different: f (x1 ) 6= f (x2 ). Let C = {x1 }. Then f (C) = {f (x1 )}. Now x2 ∈ A − C = A − {x1 } so f (x2 ) ∈ f (A − C). But f (A − C) = B − f (C) = B − {f (x1 )}. Therefore f (x2 ) ∈ B − {f (x1 )} so f (x2 ) 6= f (x1 ). We have shown that, if x1 6= x2 then f (x2 ) 6= f (x1 ). Therefore f is injective. Let C = ∅. Then f (C) = ∅ so f (A − C) = B − f (C) becomes f (A) = B which is precisely the condition for f to be surjective. Therefore f is a bijection, as required.

10. Let X = {x : x is a 2 × 1 column matrix} = R2 . Let A be a 2 × 2 matrix and let f : X → X be defined by f (x) = Ax. Exercises 5.4

171

Discrete Mathematics: Proofs, Structures and Applications

Then f is bijective if and only if A is non-singular. Proof The statement is a biconditional so there are two parts to the proof. We tackle the easier implication first. (⇐) Suppose that A is non-singular. Then A has an inverse A−1 such that AA−1 = I2 = A−1 A. We need to show that f is a bijection. Let x, y ∈ X be such that f (x) = f (y). Then Ax = Ay so A−1 Ax = A−1 Ay. This gives I2 x = I2 y which implies x = y. Hence f (x) = f (y) implies x = y so f is injective. Let y ∈ X. Then x = A−1 y ∈ X satisfies f (x) = Ax = AA−1 y = I2 y = y. Therefore f is surjective. Hence f is a bijection, as required. (⇒) We will prove the contrapositive: if A is singular then f is not a bijection. Suppose that A is singular. Then, by Theorem 6.5, A is not row-equivalent to I2 . This implies that one row of A is a multiple of the other row. Hence we can write A as µ ¶ a b A= λa λb where a, b, λ ∈ R. Suppose that a and b are not both zero. Then µ f and

¶ µ ¶µ ¶ µ ¶ b a b b 0 = = −a λa λb −a 0

µ ¶ µ ¶µ ¶ µ ¶ 0 a b 0 0 f = = . 0 λa λb 0 0

Therefore f is not injective and so is not a bijection. If a and b are both zero then A = O2×2 the 2 × 2 zero matrix. In this case, for all x ∈ X, f (x) = Ax = 0 so, again f is not a bijection. This completes the proof of the contrapositive.

172

Exercises 5.4

Solutions Manual

11. (ii) We have: f : 1 7→ 0, 2 7→ 1, 3 7→ 2, 4 7→ 3, 5 7→ 4. (x − 1)(x + 1) x2 − 1 = = x − 1. x+1 x+1 Therefore f is a bijection so the inverse function f −1 is a total function: In fact, for x 6= −1,

f −1 : {0, 1, 2, 3, 4} → {1, 2, 3, 4, 5}, x 7→ x + 1. (iv) f is injective but not surjective; im(f ) = {2x + 1 : x ∈ Z} = {odd integers}. Therefore the inverse function is a partial function f −1 : Z 9 Z, f −1 (x) =

x−1 . 2

The domain of f −1 is {2x + 1 : x ∈ Z} = {odd integers}.

5.5

Solutions to Exercises 5.5

3. For any set A, |P(A)| = 2|A| . Proof Let X denote the set of functions A → {0, 1}, X = {f : f is a function A → {0, 1}}. By definition 5.9 (iii), |X| = 2|A| and we need to find a bijection between X and P(A). To this end, define F : P(A) → X by F : B 7→ δB where, for B ⊆ A, the function δB is ½ 1 if a ∈ B δB : A → {0, 1}, δB (a) = 0 if a 6∈ B. (The function δB was defined in Exercise 5.4.4.) We first show that F is injective. So let B, C ∈ P(A) be such that F (B) = F (C). In other words, the two functions δB and δC are equal. This means that, for all a ∈ A, δB (a) = δC (a). Thus: if a ∈ B then δB (a) = 1 so δC (a) = 1 which means that a ∈ C; if a 6∈ B then δB (a) = 0 so δC (a) = 0 which means that a 6∈ C. Therefore a ∈ B if and only if a ∈ C; hence B = C. We have shown that, for all B, C ∈ P(A), F (B) = F (C) ⇒ B = C. Hence F is injective. We now show that F is surjective. Let f ∈ X. Then f is a function A → {0, 1}. Let B be the subset of A defined by B = f −1 (1) = {a ∈ A : f (a) = 1}. Exercises 5.5

173

Discrete Mathematics: Proofs, Structures and Applications

This means that, if a ∈ B then f (a) = 1 (by definition of B) and if a 6∈ B then f (a) 6= 1 so f (a) = 0. In other words, f is just the function δB for this choice of B ⊆ A. Hence B ∈ P(A) is such that F (B) = δB = f . Therefore F is surjective. Hence F is a bijection so |P(A)| = |X| = 2|A| . 4. (ii) (ℵ0 )2 = ℵ0 . Proof Let X be the set of functions {0, 1} → Z+ , X = {f : f is a function {0, 1} → Z+ }. Then, by definition 5.9 (iii), |X| = |Z+ ||{0,1}| = (ℵ0 )2 . We also know that the set Z+ × Z+ has cardinality ℵ0 – see example 5.13.2. So, to prove the result, we find a bijection F : X → Z+ × Z+ . Define F : X → Z+ × Z+ by F : f 7→ (f (0), f (1)) where f is a function {0, 1} → Z+ . We first show that F is injective. Let f , g ∈ X be such that F (f ) = F (g). In other words, f and g are functions {0, 1} → Z+ such that (f (0), f (1)) = (g(0), g(1)). Therefore f (0) = g(0) and f (1) = g(1). Since f (x) = g(x) for all elements x in their domain, the functions are equal, f = g. We have shown that, for all f , g ∈ X, F (f ) = F (g) ⇒ f = g. Hence F is injective. We now show that F is surjective. Let (n, m) ∈ Z+ × Z+ . Define a function f : {0, 1} → Z+ by f (0) = n and f (1) = m. Then f ∈ X is such that F (f ) = (f (0), f (1)) = (n, m), so F is surjective. Therefore F is a bijection X → Z+ × Z+ so (ℵ0 )2 = |X| = |Z+ × Z+ | = ℵ0 .

5. For any cardinality α, α2 = α × α. Proof Let A be a set with cardinality α and let X = {f : f is a function {0, 1} → A}. Then X has cardinality α2 . 174

Exercises 5.5

Solutions Manual

Now define F : X → A × A by f 7→ (f (0), f (1)). The proof given in the previous example, with tiny modifications, shows that F is a bijection. Therefore α2 = |X| = |A × A| = α × α, as required.

5.6 1.

Solutions to Exercises 5.6 (i) In example 5.15 we saw that A1 functionally determines A3 but A1 does not functionally determine A2 . We now consider each of the pairs of attributes in turn. In each case we will denote the appropriate projected relation by S. • A1 and A2 . Projecting R onto{A1 , A2 } gives the relation S = {(α1 , β1 ), (α1 , β2 ), (α1 , β3 ), (α2 , β4 ), (α3 , β3 ), (α3 , β1 ), (α3 , β2 )}. In example 5.15 we saw that S is not a function so A1 does not functionally determine A2 . Also S−1 is not a function either since, for example, β1 S−1 α1 and β1 S−1 α3 . Therefore A2 does not functionally determine A1 . • A1 and A3 . Projecting R onto{A1 , A3 } gives the relation2 S = {(α1 , γ2 ), (α2 , γ1 ), (α3 , γ2 )}. In example 5.15 we saw that S is a function so A1 functionally determines A3 . However S−1 is not a function since, for example, γ2 S−1 α1 and γ2 S−1 α3 . Therefore A3 does not functionally determine A1 . • A1 and A4 . Projecting R onto{A1 , A4 } gives the relation S = {(α1 , δ1 ), (α1 , δ3 ), (α1 , δ5 ), (α2 , δ1 ), (α3 , δ2 ), (α3 , δ4 )}. S is not a function since, for example, α1 S δ1 and α1 S δ3 . Therefore A1 does not functionally determine A4 . Also S−1 is not a function either since, for example, δ1 S−1 α1 and δ1 S−1 α2 . Therefore A4 does not functionally determine A1 . • A2 and A3 . Projecting R onto{A2 , A3 } gives the relation S = {(β1 , γ2 ), (β2 , γ2 ), (β3 , γ2 ), (β4 , γ1 )}. S is a function which in the usual functional notation is β1 7→ γ2 , β2 7→ γ2 , β3 7→ γ2 , β4 7→ γ1 . Therefore A2 functionally determines A3 . However S−1 is not a function either since, for example, γ2 S−1 β1 and γ2 S−1 β2 . Therefore A3 does not functionally determine A2 .

2

We denoted this relation T in example 5.15.

Exercises 5.6

175

Discrete Mathematics: Proofs, Structures and Applications

• A2 and A4 . Projecting R onto{A2 , A4 } gives the relation S = {(β1 , δ1 ), (β2 , δ3 ), (β3 , δ5 ), (β4 , δ1 ), (β3 , δ2 ), (β1 , δ4 ), (β2 , δ4 )}. S is not a function since, for example, β1 S δ1 and β1 S δ4 . Therefore A1 does not functionally determine A4 . Also S−1 is not a function either since, for example, δ1 S−1 β1 and δ1 S−1 β4 . Therefore A4 does not functionally determine A1 . • A3 and A4 . Projecting R onto{A3 , A4 } gives the relation S = {(γ2 , δ1 ), (γ2 , δ3 ), (γ2 , δ5 ), (γ1 , δ1 ), (γ2 , δ2 ), (γ2 , δ4 )}. S is not a function since, for example, γ2 S δ1 and γ2 S δ2 . Therefore A3 does not functionally determine A4 . Also S−1 is not a function either since, for example, δ1 S−1 γ1 and δ1 S−1 γ2 . Therefore A4 does not functionally determine A3 . In summary, the only functional dependencies are: A1 functionally determines A3 ; A2 functionally determines A3 . (ii) Recall that a candidate key is a set of attributes that functionally determines the remaining attributes but no subset has this property. From part (i) there is no single attribute that functionally determines each remaining attribute so a candidate key must contain at least two attributes. We begin by considering each of the sets of two attributes to determine whether any such set is a candidate key. Where needed we will adopt the notation introduced in example 5.16 and let pij denote the projection of R onto {Ai , Aj }. • {A1 , A2 }. The relation R defines a function from p12 (R) = {(α1 , β1 ), (α1 , β2 ), (α1 , β3 ), (α2 , β4 ), (α3 , β1 ), (α3 , β2 ), (α3 , β3 )} to p34 (R) = {(γ1 , δ1 ), (γ2 , δ1 ), (γ2 , δ2 ), (γ2 , δ3 ), (γ2 , δ4 ), (γ2 , δ5 )} given by (α1 , β1 ) 7→ (γ2 , δ1 ), (α2 , β4 ) 7→ (γ1 , δ1 ), (α3 , β3 ) 7→ (γ2 , δ2 ).

(α1 , β2 ) 7→ (γ2 , δ3 ), (α3 , β1 ) 7→ (γ2 , δ4 ),

(α1 , β3 ) 7→ (γ2 , δ5 ), (α3 , β2 ) 7→ (γ2 , δ4 ),

Therefore {A1 , A2 } is a candidate key. • {A1 , A3 }. The relation R does not define a function from p13 (R) = {(α1 , γ2 ), (α2 , γ1 ), (α3 , γ2 )} to p24 (R) = {(β1 , δ1 ), (β1 , δ4 ), (β2 , δ3 ), (β2 , δ4 ), (β3 , δ2 ), (β3 , δ5 ), (β4 , δ1 )} 176

Exercises 5.6

Solutions Manual

because, for example, (α1 , γ2 ) R (β1 , δ1 ) and (α1 , γ2 ) R (β2 , δ3 ). Note that we are using a slight abuse of notation to write (α, γ) R (β, δ) instead of (α, β, γ, δ) ∈ R. Therefore {A1 , A3 } is a not a candidate key. • {A1 , A4 }. The relation R does not define a function from p14 (R) = {(α1 , δ1 ), (α1 , δ3 ), (α1 , δ5 ), (α2 , δ1 ), (α3 , δ2 ), (α3 , δ4 )} to p23 (R) = {(β1 , γ2 ), (β2 , γ2 ), (β3 , γ2 ), (β4 , γ1 )} because, for example, (α3 , δ4 ) R (β1 , γ2 ) and (α3 , δ4 ) R (β2 , γ2 ). Note that we are again using a slight abuse of notation to write (α, δ) R (β, γ) where (α, β, γ, δ) ∈ R. We will continue to modify notation in this way without further comment. Therefore {A1 , A4 } is a not a candidate key. • {A2 , A3 }. The relation R does not define a function from p23 (R) = {(β1 , γ2 ), (β2 , γ2 ), (β3 , γ2 ), (β4 , γ1 )} to p14 (R) = {(α1 , δ1 ), (α1 , δ3 ), (α1 , δ5 ), (α2 , δ1 ), (α3 , δ2 ), (α3 , δ4 )} because, for example, (β1 , γ2 ) R (α1 , δ1 ) and (β1 , γ2 ) R (α3 , δ4 ). Therefore {A2 , A3 } is a not a candidate key. • {A2 , A4 }. The relation R defines a function from p24 (R) = {(β1 , δ1 ), (β1 , δ4 ), (β2 , δ3 ), (β2 , δ4 ), (β3 , δ2 ), (β3 , δ5 ), (β4 , δ1 )} to p13 (R) = {(α1 , γ2 ), (α2 , γ1 ), (α3 , γ2 )} given by (β1 , δ1 ) 7→ (α1 , γ2 ), (β2 , δ4 ) 7→ (α3 , γ2 ), (β4 , δ1 ) 7→ (α2 , γ1 ).

((β1 , δ4 ) 7→ (α3 , γ2 ), (β3 , δ2 ) 7→ (α3 , γ2 ),

(β2 , δ3 ) 7→ (α1 , γ2 ), (β3 , δ5 ) 7→ (α1 , γ2 ),

Therefore {A2 , A4 } is a candidate key. Exercises 5.6

177

Discrete Mathematics: Proofs, Structures and Applications

• {A3 , A4 }. The relation R does not define a function from p34 (R) = {(γ1 , δ1 ), (γ2 , δ1 ), (γ2 , δ2 ), (γ2 , δ3 ), (γ2 , δ4 ), (γ2 , δ5 )} to p12 (R) = {(α1 , β1 ), (α1 , β2 ), (α1 , β3 ), (α2 , β4 ), (α3 , β1 ), (α3 , β2 ), (α3 , β3 )} because, for example, (γ2 , δ4 ) R (α3 , β1 ) and (γ2 , δ4 ) R (α3 , β2 ). Therefore {A3 , A4 } is a not a candidate key. So far we have found two candidate keys: {A1 , A2 } and {A2 , A4 }. Clearly no superset of these can be a candidate key which rules out each of the three element sets of attributes except the set {A1 , A3 , A4 }. We must now consider this case. • {A1 , A3 , A4 }. The relation R does not define a function from p134 (R) = {(α1 , γ2 , δ1 ), (α1 , γ2 , δ3 ), (α1 , γ2 , δ5 ), (α2 , γ1 , δ1 ), (α3 , γ2 , δ2 ), (α3 , γ2 , δ4 )} to p2 (R) = {β1 , β2 , β3 , β4 } because, for example, (α3 , γ2 , δ4 ) R β1 and (α3 , γ2 , δ4 ) R β2 . Therefore {A1 , A3 , A4 } is a not a candidate key. Therefore there are only two candidate keys: {A1 , A2 } and {A2 , A4 }.

178

Exercises 5.6

Chapter 6

Matrix Algebra 6.1 1.

Solutions to Exercises 6.1 (i) True: every identity matrix is symmetric and there are symmetric matrices that are not an identity matrix. Ã ! 1 2 (ii) False. For example is symmetric but is not diagonal. 2 3 Ã ! 1 1 (iii) False: is not an identity matrix. 1 1 Ã ! 1 2 (iv) False. For example is square but is not diagonal. 3 4 (v) True: every identity matrix is diagonal and there are diagonal matrices that are not an identity matrix. 

1  5 3. A =  0  3

5 4 5 0

 0 3  5 0  9 2  2 16

4. If A is a row matrix and a column matrix then A has only one column and only one row, so A is a 1 × 1 matrix. 5.

a11 = a22 a12 =

1 2 a21

⇒ x+y = 4 ⇒

10 =

1 2 (2x

(i) − y)

(ii)

From (i) x = 4 − y. Substituting into (ii) gives 179

Discrete Mathematics: Proofs, Structures and Applications

⇒ ⇒ ⇒ ⇒

10 20 12 y x

= = = = =

1 2 (2(4

− y) − y) 8 − 3y −3y −4 4 − (−4) = 8.

 T −1 ¡ ¢  2 = −1 2 3 6. (i) (a) 3   µ ¶T 4 3 4 0 −1 (b) =  0 1 3 1 3 −1 3   −1 0 µ ¶T  6 −1 6 3 4 7  (c) =  0 7 −1 3 3 −1 4 3 (ii) Let A = [aij ] be an n × n matrix. Then A is symmetric ⇔ aij = aji for all 1 ≤ i ≤ n, 1 ≤ j ≤ n ⇔ [aij ] = [aji ] ⇔

6.2

A = AT .

Solutions to Exercises 6.2 Ã

1. (ii) (iv) (vi) (viii) (x)

! −18 −3 3A − 6B = −12 3 Ã ! 4 −3 A2 = 0 1 Ã ! 4 −7 A(BA) = −4 5 Ã ! 2 −4 A(A − B) = 2 0 Ã ! 2 −2 (AB)T = 1 1

2. (ii) BA does not exist since B has two columns but A has only one row. (iv) CA does not exist since C has three columns but A has only one row. Ã ! 14 17 (vi) CB = 12 19 Ã ! p q . Then 3. Let B = r s 180

Exercises 6.2

Solutions Manual

à !à 0 1 p ⇒ 2 0à r r ⇒ 2p ⇒

AB ! = BA Ã q p = s! Ãr s 2q = 2q 2s

!Ã ! q 0 1 s ! 2 0 p r

r = 2q, s = p, 2p = 2s, 2q = r. Ã

Therefore B is any matrix of the form

! Ã ! p q 1 2 ; for example B = . 2q p 4 1

! a11 a12 . 4. Let A = a21 a22 ! Ã !Ã ! Ã a11 a12 1 0 a11 a12 = =A Then AI2 = a21 a22 0 1 a21 a22 !Ã ! Ã ! Ã 1 0 a11 a12 a11 a12 and I2 A = = = A. 0 1 a21 a22 a21 a22 Ã

5. Let A = [aij ] be an n × n matrix and let In be the n × n identity matrix. Thus In = [bij ] where ( 1 if i = j bij = 0 if i 6= j. We know that AIn is an n × n matrix. Suppose AIn = [cij ]. Then cij

= ai1 b1j + ai2 b2j + . . . + ain bnj = aij bjj = aij

(definition of matrix multiplication) (since bij = 0 if i 6= j) (since bjj = 1).

Therefore AIn = [aij ] = A. Similarly, suppose In A = [dij ]. Then dij

= bi1 a1j + bi2 a2j + . . . + bin anj = bii aij = aij

(definition of matrix multiplication) (since bij = 0 if i 6= j) (since bii = 1).

Therefore In A = [aij ] = A. 6. Let A = [aij ] be an m × n matrix and let In be the n × n identity matrix. Thus In = [bij ] where ( 1 if i = j bij = 0 if i 6= j. Exercises 6.2

181

Discrete Mathematics: Proofs, Structures and Applications

We know that AIn is an m × n matrix. Suppose AIn = [cij ] where 1 ≤ i ≤ m and 1 ≤ j ≤ n. Then cij

= ai1 b1j + ai2 b2j + . . . + ain bnj = aij bjj = aij

(definition of matrix multiplication) (since bij = 0 if i 6= j) (since bjj = 1).

Therefore AIn = [aij ] = A. Let Im be the m × m identity matrix. Thus Im = [bij ] where ( bij =

1 if i = j 0 if i 6= j.

We know that Im A is an m × n matrix. Again, suppose Im A = [dij ] where 1 ≤ i ≤ m and 1 ≤ j ≤ n. Then dij

= bi1 a1j + bi2 a2j + . . . + bim amj = bii aij = aij

(definition of matrix multiplication) (since bij = 0 if i 6= j) (since bii = 1).

Therefore Im A = [aij ] = A. 

1  7. AB = 2 4  1  AC = 2 4

    −3 2 1 4 1 3 −3 0     1 −3 2 1 1 =  1 15 0 and −3 −1 1 −2 1 −3 15 0     −3 2 2 1 −1 3 −3 0     1 −3 3 −2 −1 =  1 15 0 so −3 −1 2 −5 −1 −3 15 0

AB = AC. Ã ! Ã ! 1 1 1 1 9. Let A = and B = . 1 1 −1 −1 Then AB = O2×2 , the 2 × 2 zero matrix, but A 6= O2×2 and B 6= O2×2 . 10. Let A = [aij ] and B = [bij ] be two n × n diagonal matrices, so that, if i 6= j, then aij = 0 and bij = 0. Let AB = [cij ]. Then AB is an n × n matrix where ( cij = ai1 b1j + ai2 b2j + . . . + ain bnj = 182

aii bii if i = j 0 if i 6= j. Exercises 6.2

Solutions Manual

Therefore AB is an n × n matrix where the diagonal entries are aii bii , the product of the corresponding diagonal entries of A and B. Reversing the roles of A and B shows that BA is also an n × n diagonal matrix with diagonal entries bii aii ; in other words BA = AB in this case.     2 0 0 −4 0 0     For A = 0 3 0 and B =  0 −1 0, we have: 0 0 −3

0

0 5

  −8 0 0   AB = BA =  0 −3 0 0 0 −15 and

Claim

  4 0 0   A2 = 0 9 0 . 0 0 9   2n 0 0   For n ∈ Z+ , An =  0 3n 0 . 0 0 (−3)n

Proof The result clearly holds for n = 1.   2k 0 0   Suppose that Ak =  0 3k 0 . 0 0 (−3)k Then, using the result above about products of diagonal matrices, we have,

Ak+1

     2 0 0 2k 0 0 2k+1 0 0      = 0 3 0  0 3k 0 = 0 3k+1 0 . k k+1 0 0 −3 0 0 (−3) 0 0 (−3)

Hence, if the result holds for n = k it also holds for n = k + 1. Therefore   2n 0 0   An =  0 3n 0  0 0 (−3)n for all n ∈ Z+ , by the principle of mathematical induction.

Exercises 6.2

183

Discrete Mathematics: Proofs, Structures and Applications

11.

(i) Let A = [aij ] be an m × n matrix. Then, by Exercise 6.1.6, AT is the n × m matrix AT = [aji ]. Therefore, applying the same result to AT , we see that (AT )T is the m × n matrix (AT )T = [aij ]. Therefore (AT )T = A. (ii) Let A = [aij ] and B = [bij ] be m × n matrices. Then A + B is the m × n matrix A + B = [aij ] + [bij ] = [aij + bij ]. Now AT , B T and (A + B)T are n × m matrices where (A + B)T = [aij + bij ]T = [aji + bji ] = [aji ] + [bji ] = AT + B T . (iii) Let A = [aij ] be an m × n matrix and B = [bij ] be an n × r matrix. Let AB = C = [cij ]. Then C is an m × r matrix where cij = ai1 b1j + ai2 b2j + . . . + ain bnj . Now AT = [aji ] has dimension n×m, B T = [bji ] has dimension r ×n and (AB)T has dimension r × m. Thus B T AT is defined and is an r × m matrix. Let B T AT = [dji ]. Then dji = b1i aj1 + b2i aj2 + . . . + bni ajn = aj1 b1i + aj2 b2i + . . . + ajn bni = cji . Therefore B T AT = [cji ] = [cij ]T = C T = (AB)T .

6.3

Solutions to Exercises 6.3

1. (ii) No: (at least) two elementary operations are required to obtain the given matrix from the 4 × 4 identity matrix I4 . (iv) Yes: the given matrix can be obtained from I2 either by multiplying row 2 by 4 or by multiplying column 2 by 4. (vi) No: there is no sequence of elementary operations that, when applied to I3 , will produce the given matrix. 3.

(i) A can be obtained from B by subtracting twice the first row from the second. Thus 

 1 0 0   E1 = −2 1 0 . 0 0 1 184

Exercises 6.3

Solutions Manual

(ii) B can be obtained from A by adding twice the first row to the second. Thus   1 0 0   E2 = 2 1 0 . 0 0 1 (iii)

    1 0 0 1 0 0 1 0 0      E1 E2 = −2 1 0 2 1 0 = 0 1 0 = I3 . 0 0 1 0 0 1 0 0 1 

Similarly

     1 0 0 1 0 0 1 0 0      E2 E1 = 2 1 0 −2 1 0 = 0 1 0 = I3 . 0 0 1 0 0 1 0 0 1

4. B can be obtained from A by interchanging the first and second rows so 

 0 1 0   E1 = 1 0 0 . 0 0 1 C can be obtained from B by multiplying the first row by 21 . Hence  0 0 2   E2 =  0 1 0 . 0 0 1 1

We have: E2 B = C ⇒ E2 (E1 A) = C ⇒ (E2 E1 )A = C

1

    0 0 0 1 0 0 21 0      Q = E2 E1 =  0 1 0 1 0 0 = 1 0 0 . 0 0 1 0 0 1 0 0 1 2



5. We need to find three elementary row operations which, when applied to A, produce the identity matrix I2 . These operations correspond to the elementary matrices E1 , E2 and E3 respectively. Exercises 6.3

185

Discrete Mathematics: Proofs, Structures and Applications

We may achieve this as follows1 . µ µ ¶ 1 2 4 −→ A= 1 4 1 µ 1 −→ 0 µ 1 −→ 0

¶ 0 [R1 → R1 − R2 ] 4 ¶ 0 [R2 → R2 − R1 ] 4 ¶ 0 [R2 → R2 × 14 ] 1

Therefore the three operations are: • subtract row 2 from row 1, so E1 • subtract row 1 from row 2, so E2 • multiply row 2 by

1 4,

µ 1 so E3 = 0

µ ¶ 1 −1 = ; 0 1 µ ¶ 1 0 = ; −1 1 ¶ 0 1 . 4

6. Let R be defined on the set Mm×n (R) of all m × n real matrices by A R B ⇔ A is row-equivalent to B. Then

R is an equivalence relation on Mm×n (R).

Proof Any m × n matrix A is row-equivalent to itself (for example, multiply row 1 by 1) so A R A. Therefore R is reflexive. For any elementary row operation ρ, there is an elementary row operation ρ that undoes its effect in the sense that applying ρ followed by ρ to any matrix A leaves A unchanged. (See the proof of Theorem 6.3.) Now suppose A R B. Then there is a sequence of elementary row operations ρ1 , ρ2 , . . . ρk which, when applied to A produces the matrix B: ρ1

ρ2

ρ

k A −→ A1 −→ A2 . . . −→ Ak = B.

Now applying the ‘undoing’ operations in the order ρk , ρk−1 , . . . , ρ1 to the matrix B produces A: ρ

ρ

ρ

k k 1 B −→ Ak−1 −→ Ak−2 . . . −→ A.

Therefore B R A. Hence R is symmetric. Now suppose A R B and B R C. Then there is a sequence of elementary row operations ρ1 , ρ2 , . . . ρk which, when applied to A produces the matrix B ρ1

ρ2

ρ

k A −→ A1 −→ A2 . . . −→ B 1

186

There are other choices for elementary row operations that will achieve the same result.

Exercises 6.3

Solutions Manual

and there is a sequence of elementary row operations ρ01 , ρ02 , . . . ρ0` which, when applied to B produces the matrix C ρ0

ρ0

ρ0

2 ` 1 B −→ B1 −→ B2 . . . −→ C.

Therefore applying the entire sequence of operations ρ1 , . . . ρk , ρ01 , . . . ρ0` to A produces C: ρ1

ρ

ρ0

ρ0

k 1 ` A −→ A1 . . . −→ B −→ B1 . . . −→ C.

Therefore A R C. Hence R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on Mm×n (R).

6.4

Solutions to Exercises 6.4

1. Let A1 , A2 , . . . , An be non-singular m × m matrices. Then −1 −1 −1 (A1 A2 . . . An )−1 = A−1 n An−1 . . . A2 A1 .

Proof The proof is by induction on n. The case n = 1 is trivial. Assume that the result holds for n = k so that −1 −1 −1 (A1 A2 . . . Ak )−1 = A−1 k Ak−1 . . . A2 A1

for all non-singular m × m matrices A1 , A2 , . . . , Ak . Let A1 , A2 , . . . , Ak+1 be non-singular m × m matrices. Then (A1 A2 . . . Ak+1 )−1 = ((A1 A2 . . . Ak )Ak+1 )−1 −1 = A−1 k+1 (A1 A2 . . . Ak )

(by Theorem 6.4)

−1 −1 −1 = A−1 k+1 (Ak . . . A2 A1 ) (by the inductive hypothesis) −1 −1 −1 = A−1 k+1 Ak . . . A2 A1 .

Therefore, if the result holds for n = k it also holds for n = k + 1. Therefore, by the principal of mathematical induction, for all positive integers n, if A1 , A2 , . . . , An are non-singular m × m matrices then −1 −1 (A1 A2 . . . An )−1 = An−1 A−1 n−1 . . . A2 A1 .

Exercises 6.4

187

Discrete Mathematics: Proofs, Structures and Applications

à 2.

(i)

(A | I2 ) = Ã ∼ Ã ∼ Ã ∼ Ã ∼

5 −3 1 0 −3 2 0 1

! 0 [R1 0 1 ! − 35 15 0 1 3 [R2 5 5 1 ! 0 2 3 [R1 1 3 5 5 1 ! 0 2 3 1 3 5 [R2

1 − 35 −3 2 1 0 1 0 1 0

!

1 5

→ R1 ÷ 5]

→ R2 + 3R1 ] → R1 + 3R2 ]

→ R2 × 5]

= (I2 | A−1 ) ! Ã 2 3 Therefore A−1 = . 3 5 Ã (ii)

(A | I2 ) =

−4 8 1 0 −1 3 0 1

!

! [R1 → R1 ÷ (−4)] 1 −2 − 14 0 ∼ −1 3 0 1 Ã ! 1 −2 − 14 0 ∼ 0 1 − 14 1 [R2 → R2 + R1 ] Ã ! 1 0 − 34 2 [R1 → R1 + 2R2 ] ∼ 1 0 1 −4 1 Ã

= (I2 | A−1 ) Ã ! 3 − 2 4 Therefore A−1 = . − 14 1 Ã (iii)

(A | I2 ) = Ã ∼ Ã ∼

4 2 1 0 6 3 0 1 1 12 6 3

1 4

0 0 1

1 12 0 0

− 41 − 23

! !

0 1

[R1 → R1 ÷ 4]

! [R2 → R2 − 6R1 ]

There are no elementary row operations that will convert the row (0 0) into (0 1). Hence we cannot obtain I2 from A using elementary row operations. Therefore A has no inverse. 188

Exercises 6.4

Solutions Manual



1 1 0 1 0 0  (A | I3 ) =  1 0 0 0 1 0 1 1 1 0 0 1  1 1 0 1 0  ∼  0 −1 0 −1 1 0 0 1 −1 0  1 0 0 0 1  ∼  0 −1 0 −1 1 0 0 1 −1 0  1 0 0 0 1  ∼  0 1 0 1 −1 0 0 1 −1 0

(iv)

    0  0  [R2 → R2 − R1 ] 1 [R3 → R3 − R1 ]  0 [R1 → R1 + R2 ]  0  1  0  0  [R2 → R2 × (−1)] 1

= (I3 | A−1 )   0 1 0   Therefore A−1 =  1 −1 0. −1 0 1 

1 2 3 1  (A | I3 ) =  4 5 6 0 7 8 9 0  1 2 3  ∼  0 −3 −6 0 −6 −12  1 2 3  ∼  0 1 2 0 −6 −12  1 2 3 1  ∼  0 1 2 43 0 0 0 1

(v)

 0 0  1 0  0 1

 1 0 0  −4 1 0  −7 0 1

[R2 → R2 − 4R1 ] [R3 → R3 − 7R1 ]

 0 0  4 1 3 − 3 0  [R2 → R2 ÷ (−3)] −7 0 1  0 0  − 13 0  −2 1 [R3 → R3 + 6R2 ] 1

The row of 0’s shows that there is no sequence of elementary row operations that will convert A into I3 . Therefore A has no inverse.  2 3  (vi) (A | I3 ) =  1 2 −2 1  1 32  ∼  1 2 −2 1 Exercises 6.4

 −2 1 0 0  −1 0 1 0  0 0 0 1  −1 12 0 0 [R1 → R1 ÷ 2]  −1 0 1 0  0 0 0 1 189

Discrete Mathematics: Proofs, Structures and Applications



1 32  ∼  0 12 0 4  1 32  ∼  0 1 0 4  1 0  ∼  0 1 0 0  1 0  ∼  0 1 0 0  1 0  ∼  0 1 0 0

 1 −1 0 0 2  0 − 12 1 0  −2 1 0 1  1 −1 2 0 0  0 −1 2 0  −2 1 0 1  −1 2 −3 0  0 −1 2 0  −2 5 −8 1

[R2 → R2 − R1 ] [R3 → R3 + 2R1 ] [R2 → R2 × 2] [R1 → R1 − 32 R2 ] 

[R3 → R3 − 4R2 ]

−1 2 −3 0  0 −1 2 0  1 − 52 4 − 21 [R3 → R3 ÷ (−2)]  1 1 0 −2 1 −2 [R1 → R1 + R3 ]  0  0 −1 2 5 1 − 2 4 − 12

= (I3 | A−1 )  1  − 2 1 − 12   Therefore A−1 =  −1 2 0 . − 52 4 − 12  4 2 1 1 0 0   (A | I3 ) =  3 −1 0 0 1 0  2 −4 2 0 0 1   1 1 1 1 2 4 4 0 0   ∼  3 −1 0 0 1 0  2 −4 2 0 0 1   1 1 1 1 0 0 2 4 4   ∼  0 − 52 − 34 − 34 1 0  1 3 0 −5 2 −2 0 1   1 1 1 1 0 0 2 4 4   3 3 2 ∼  0 1 10 10 − 5 0  0 −5 32 − 12 0 1   1 1 1 1 0 10 0 10 5   3 3 2 ∼  0 1 10 − 10 5 0  0 0 3 1 −2 1   1 1 1 1 0 10 10 5 0   3 3 2 ∼  0 1 10 10 − 5 0  1 0 0 1 − 23 13 3 

(vii)

190

[R1 → R1 ÷ 4]

[R2 → R2 − 3R1 ] [R3 → R3 − 2R1 ] [R2 → R2 × − 25 ] [R1 → R1 − 12 R2 ] [R3 → R3 + 5R2 ]

[R3 → R3 ÷ 3] Exercises 6.4

Solutions Manual



1 0 0  ∼  0 1 0 0 0 1 = (I3 | A−1 ) 1 4 Therefore A−1 =

15 1 5 1 3

15 − 15 − 23

1 15 1 5 1 3

4 15 − 51 − 32

 1 [R1 → R1 − − 30 1  − 10  [R2 → R2 − 1 3

1 10 R3 ] 3 10 R3 ]

 1 − 30 1 . − 10  1 3



 0 2 2 1 0 0   (A | I3 ) =  2 2 0 0 1 0  1 4 3 0 0 1

(viii)



 1 4 3 0 0 1   ∼  2 2 0 0 1 0  0 2 2 1 0 0

[R1 ↔ R3 ]

 1 1 4 3 0 0   ∼  0 −6 −6 0 1 −2  [R2 → R2 − 2R1 ] 0 2 2 1 0 0 

 0 1 1 4 3 0   ∼  0 1 1 0 − 16 13  0 2 2 1 0 0 

 0 1 1 4 3 0  1  ∼  0 1 1 0 − 16 3  1 2 0 0 0 1 3 −3

[R2 → R2 × − 16 ]



[R3 → R3 − 2R2 ]

The row of 0’s shows that there is no sequence of elementary row operations that will convert A into I3 . Therefore A has no inverse. 3. Let A, B and C be m × m matrices such that A is non-singular. Then

⇒ ⇒ ⇒ ⇒

Exercises 6.4

AB = = −1 (A A)B = Im B = B =

A−1 (AB)

AC A−1 (AC) (A is non-singular) (A−1 A)C (associativity of matrix multiplication) Im C (since A−1 A = Im ) C.

191

Discrete Mathematics: Proofs, Structures and Applications



 1 −3 2 1 0 0 1 −3 0 1 0  (A | I3 ) =  2 4 −3 −1 0 0 1   1 −3 2 1 0 0 7 −7 −2 1 0  [R2 → R2 − 2R1 ] ∼  0 0 9 −9 −4 0 1 [R3 → R3 − 4R1 ]   1 −3 2 1 0 0 7 −7 −2 1 0  ∼  0 10 0 0 0 − 7 − 97 1 [R3 → R3 − 97 R2 ] The row of 0’s shows that there is no sequence of elementary row operations that will convert A into I3 . Therefore A has no inverse. 4.

(i) Let A and B be m × m matrices such that A is non-singular. Then (A−1 BA)2 = = = = = =

(A−1 BA)(A−1 BA) (A−1 B)(AA−1 )(BA) (A−1 B)Im (BA) (A−1 B)(BA) A−1 (BB)A A−1 B 2 A.

(associativity of matrix multiplication) (since AA−1 = Im ) (property of Im ) (associativity of matrix multiplication)

(ii) Using the result of Exercise 6.4.5 below, µ ¶ µ ¶ 1 1 −1 −1 1 −1 = . A = 2 3 −2 2 − 3 −3 Now A−1 BA

µ ¶−1 µµ 2 1 4 = µ3 1 ¶µ 3 −1 1 2 = 3 −2 3 µ ¶ 1 0 = . 0 2

Hence −1

A

2

−1

B A = (A

using the result of Exercise 6.2.10. Similarly −1

A

4

−1

B A = (A

¶µ ¶¶ −2 2 1 −1 3 1 ¶ 2 2

µ ¶2 µ ¶ 1 0 1 0 BA) = = , 0 2 0 4 2

µ ¶4 µ ¶ 1 0 1 0 BA) = = , 0 2 0 16 4

again using the result of Exercise 6.2.10. 192

Exercises 6.4

Solutions Manual

5. Since

¶ µ µ ¶ µ ¶ µ ¶ 1 1 a b d −b ad − bc 0 1 0 × = = c d 0 ad − bc 0 1 ad − bc −c a ad − bc

and

µ

¶ µ ¶ µ ¶ µ ¶ 1 d −b a b ad − bc 0 1 0 × = = , −c a c d 0 ad − bc 0 1 ad − bc

1 ad − bc it follows that

−1

A

1 = ad − bc

µ

¶ d −b . −c a

!−1 ! Ã Ã Ã 1 2 −3 1 3 1 14 (i) = = 2 − (−12) −4 2 4 1 − 27 Ã !−1 Ã ! Ã ! 7 3 7 1 −7 − 14 1 4 . (ii) = = 1 3 −4 −1 − 3 1 1 4 4

3 14 1 7

! .

6. Using the result of Exercise 6.2.10 it follows that, if A = [aij ] is a non-singular diagonal matrix then A−1 = [bij ] where ½ 1/aii if i = j bij = 0 if i 6= j. 4 7

0

Hence  0 − 53 0 0

−1  7 0 0 4 0  =  0 − 35 4 0 0 9

8.

 0 0 . 9 4

 µ AB =

4 2 2 1 3 1 −3 0 −2 3

¶    

 4 2 −1 ¶ µ 0 3 −1   16 2 15  3 −2 0 = 7 −18 14 −1 4 −2  1 0 1

µ ¶ µ ¶ 4 2 2 1 3 , A2 = , 1 −3 0 −2 3     µ ¶ µ ¶ 3 −2 0 2 −1 4 4 and B4 = −2. B1 = , B2 = , B3 = −1 0 3 −1 1 0 1 Let A1 =

Now

µ ¶µ ¶ µ ¶ 4 2 2 −1 8 2 A1 B1 = = 1 −3 0 3 2 −10

and

  µ ¶ µ ¶ 3 −2 8 0 2 1 3  −1 4 = A2 B3 = 5 −8 0 −2 3 1 0

Exercises 6.4

193

Discrete Mathematics: Proofs, Structures and Applications

so

µ ¶ µ ¶ µ ¶ 8 2 8 0 16 2 A1 B1 + A2 B3 = + = . 2 −10 5 −8 7 −18

Similarly

and

µ ¶µ ¶ µ ¶ 4 2 4 14 A1 B2 = = 1 −3 −1 7   µ ¶ µ ¶ 0 2 1 3   1 −2 = A2 B4 = 0 −2 3 7 1

so A1 B2 + A2 B4 =

µ ¶ µ ¶ µ ¶ 14 1 15 + = . 7 7 14

Therefore

µ (A1 B1 + A2 B3 | A1 B1 + A2 B3 ) =

16 2 15 7 −18 14

¶ = A.



 Ã ! 2 0 3 −1 1 T BT B   1 3 B T =  −1 . 4 0 = 3 −2 B2T B4T 4 −1 0 −2 1

194

Exercises 6.4

Chapter 7

Systems of Linear Equations 7.1

Solutions to Exercises 7.1

1. Using the result of Exercise 6.4.5, −1

A

1 = 5

Ã

! 2 1 . −1 2

The system of equations may be written in matrix form as à !à ! à ! 2 −1 x 6 = . 1 2 y 8 Therefore the solution is given by à ! à !à ! à ! à ! x 6 4 1 2 1 1 20 = = = , 5 −1 2 5 10 y 8 2 so x = 4, y = 2. 2. We first find A−1 . 

 2 2 1 1 0 0   (A I3 ) =  1 −1 −1 0 1 0  1 3 3 0 0 1   1 −1 −1 0 1 0 R1 ↔ R2   ∼  2 2 1 1 0 0  1 3 3 0 0 1   1 −1 −1 0 1 0   ∼  0 4 3 1 −2 0  R2 → R2 − 2R1 0 4 4 0 −1 1 R3 → R3 − R1 195

Discrete Mathematics: Proofs, Structures and Applications



1 −1 −1 0 1 0  3 1 1 ∼  0 1 4 4 −2 0 0 4 4 0 −1 1  1 1 0 1 0 − 14 4 2  1 1 ∼  0 1 34 −2 0 4 0 0 1 −1 1 1  3 1 1 0 0 0 4 4  ∼  0 1 0 1 − 54 − 34 0 0 1 −1 1 1

   R2 → R2 ÷ 4   

R1 → R1 + R2 R3 → R3 − 4R2



R1 → R1 + 14 R3   R2 → R2 − 34 R3

= (I3 A−1 ) 

Therefore A−1

3 0 4  =  1 − 45 −1 1

1 4



 − 34 . 1

The system of equations 2x + 2y + z = 4 x − y − z = 1 x + 3y + 3z = 1 can be written in matrix form as     x 4     A y  = 1 . z 1 Hence the solution is      3 x 4 0 4    −1   = A = y  1  1 − 54 z 1 −1 1

    4 1  3   =  − 4  1  2  . 1 1 −2 1 4

Therefore x = 1, y = 2, z = −2. Since A is non-singular, the solution of the homogeneous system of equations is x = y = z = 0. 3. The system of equations may be written as     x 4     A y  =  8  z −4 196

Exercises 7.1

Solutions Manual

where

  3 2 1   A = 1 −1 2  . 6 −3 −1

Now 

 3 2 1 1 0 0   (A I3 ) =  1 −1 2 0 1 0  6 −3 −1 0 0 1   1 −1 2 0 1 0 R1 ↔ R2   ∼  3 2 1 1 0 0  6 −3 −1 0 0 1   1 −1 2 0 1 0   ∼  0 5 −5 1 −3 0  R2 → R2 − 3R1 0 3 −13 0 −6 1 R3 → R3 − 6R1   0 1 0 1 −1 2   ∼  0 1 −1 15 − 35 0  R2 → R2 ÷ 5 0 3 −13 0 −6 1   2 1 0 1 0 1 R1 → R1 + R2 5 5   1 3 ∼  0 1 −1 −5 0  5 3 0 0 −10 − 5 − 21 1 R3 → R3 − 3R2 5   1 2 0 1 0 1 5 5   ∼  0 1 −1 15 − 35 0  3 21 1 0 0 1 50 − 10 R3 → R3 ÷ (−10) 50   7 1 1 1 0 0 50 − 50 R1 → R1 − R3 10   13 9 1 ∼  0 1 0 50 − 50 − 10  R2 → R2 + R3 3 21 1 0 0 1 50 − 10 50 = (I3 A−1 )  Therefore A−1 =

7 50  13  50 3 50

1 − 50 9 − 50 21 50



1 10 1 . − 10  1 − 10

The solution of the system of equations is Exercises 7.1

197

Discrete Mathematics: Proofs, Structures and Applications

  7 x 50    13 y  =  50 3 z 50

1 − 50 9 − 50 21 50





1 4 10  1  − 10   8  1 − 10 −4

  0   = 0 . 4

Therefore x = 0, y = 0, z = 4.

7.2

Solutions to Exercises 7.2

1. The augmented matrix is    1 −1 −2 1 2    7  ∼  0  2 1 −1 1 −3 2 −12 0  1  ∼  0 0  1  ∼  0 0  1  ∼  0 0  1  ∼  0 0

 −1 −2 2  3 3 3  R2 → R2 − 2R1 −2 4 −14 R3 → R3 − R1  −1 −2 2  1 1 1  R2 → R2 ÷ 3 −2 4 −14  0 −1 3 R1 → R1 + R2  1  1 1 0 6 −12 R3 → R3 + 2R2  0 −1 3  1 1 1  R3 → R3 ÷ 6 0 1 −2  0 0 1 R1 → R1 + R3  1 0 3  R2 → R2 − R3 0 1 −2

Therefore the solution is x = 1, y = 3, z = −2. Since the matrix of coefficients is non-singular, the solution of the homogenous system of equations is x = y = z = 0. 2. The augmented matrix  2 7 3   1 5 3 1 4 2

198

is   14 1 4 2 8   13  ∼  1 5 3 13 8 2 7 3 14  1 4 2  ∼  0 1 1 0 −1 −1

   R1 ↔ R3  8  5  R2 → R2 − R1 −2 R3 → R3 − 2R1 Exercises 7.2

Solutions Manual

 1 0 −2 −12 R1 → R1 + 4R2   ∼  0 1 1 5  0 0 0 3 R3 → R3 + R2 

The last row of the matrix gives 0x + 0y + 0z = 3 which clearly has no solution. Therefore the system is inconsistent. 3. The augmented matrix is    2 1 −1 2 1 12 − 21 1     4 −1 −1 −2  ∼  4 −1 −1 −2 3 3 −2 6 3 3 −2 6  1 12 − 21 1  ∼  0 −3 1 −6 0 32 − 21 3   1 12 − 12 1   ∼  0 1 − 13 2  0 32 − 12 3   1 0 − 13 0   ∼  0 1 − 13 2  0 0 0 0

  

R1 → R1 ÷ 2

   R2 → R2 − 4R1 R3 → R3 − 3R1

R2 → R2 ÷ (−3) R1 → R1 − 12 R2 R3 → R3 − 32 R2

This represents the system x1 − 31 x3 = 0 x2 − 13 x3 = 2. Let x3 = 3t where t ∈ R. Then x1 = t and x2 = 2 + t. 4. The augmented matrix is à ! à ! 1 −1 2 0 1 −1 2 0 ∼ R2 → R2 − 2R1 2 3 −1 0 0 5 −5 0 à ! 1 −1 2 0 ∼ 0 1 −1 0 R2 → R2 ÷ 5 Exercises 7.2

199

Discrete Mathematics: Proofs, Structures and Applications

à ∼

1 0 1 0 0 1 −1 0

!

R1 → R1 + R2

The matrix is now in reduced row echelon form and represents the system x1 + x3 = 0 x2 − x3 = 0. Let x3 = t where t ∈ R. Then x2 = t and x1 = −t. 5. The augmented matrix is  1 3 1 0 1   1 2 1 1 5   0 −1 0 1 4  1 1 1 2 9





     ∼      

1 3 1 0 0 −1 0 1 0 −1 0 1 0 −2 0 2

1   0 ∼   0  0  1   0 ∼   0  0

1 4 4 8



  R2 → R2 − R1    R4 → R4 − R1  1 3 1 0  1 0 −1 −4   R2 → R2 × (−1) −1 0 1 4   8 −2 0 2  R1 → R1 − 3R2 0 1 3 13  1 0 −1 −4   0 0 0 0   R3 → R3 + R2 0 R4 → R4 + 2R2 0 0 0

The matrix is now in reduced row echelon form and represents the system x1 x2

+ x3 + 3x4 = 13 − x4 = −4.

We can assign arbitrary values to two variables. Let x4 = t and x3 = s where s, t ∈ R. Then x2 = t − 4 and x1 = 13 − 3x4 − x3 = 13 − 3t − s. 6. The augmented matrix is     1 −1 1 0 1 −1 1 0     −2 0  R2 → R2 − 2R1  2 −1 0 0  ∼  0 1 3 2 −7 0 0 5 −10 0 R3 → R3 − 3R1 200

Exercises 7.2

Solutions Manual

 1 0 −1 0 R1 → R1 + R2   ∼  0 1 −2 0  0 0 0 0 R3 → R3 − 5R2 

The matrix is now in reduced row echelon form and represents the system x−z = 0 y − 2z = 0. Let z = t where t ∈ R. Then y = 2t and x = t. 7. The augmented matrix is



 2 4 −1 1 2   2 3 .  3 −1 0 1 2 3 −1 5

The ‘normal’ first step in the row reduction would be to divide row 1 by 2. We have chosen instead a first step that interchanges row 1 and row 3 as this delays (by one step) the introduction of fractions and makes the calculations (marginally) simpler. 

   2 4 −1 1 2 1 2 3 −1 5     2 3  ∼  3 −1 0 2 3  R1 ↔ R3  3 −1 0 1 2 3 −1 5 2 4 −1 1 2   5 1 2 3 −1   ∼  0 −7 −9 5 −12  R2 → R2 − 3R1 0 0 −7 3 −8 R3 → R3 − 2R1   1 2 3 −1 5   ∼  0 1 97 − 57 12 7  R2 → R2 ÷ (−7) 0 0 −7 3 −8   11 3 1 0 37 R1 → R1 − 2R2 7 7   5 12 9 ∼  0 1 7 −7 7  0 0 1 − 37 87 R3 → R3 ÷ (−7)   53 R1 → R1 − 37 R3 1 0 0 30 49 49   8 12 9 ∼  0 1 0 − 49 49  R2 → R2 − 7 R3 8 0 0 1 − 73 7 Exercises 7.2

201

Discrete Mathematics: Proofs, Structures and Applications

The matrix is now in reduced row echelon form and represents the system x1 + 30 49 x4 = 8 x2 − 49 x4 = 3 x3 − 7 x4 =

53 49 12 49 8 7

Let x4 = t where t ∈ R. Then x3 =

7.3 1.

8 3 12 8 53 30 + t, x2 = + t, x1 = − t. 7 7 49 49 49 49

Solutions to Exercises 7.3 (i) The augmented matrix is 

   3 −1 1 10 1 1 −1 −2 R1 ↔ R2     1 −1 −2  ∼  3 −1 1 10   1 −1 2 2 −1 2 2 0 0   1 1 −1 −2   ∼  0 −4 4 16  R2 → R2 − 3R1 R3 → R3 + R1 0 3 1 −2   1 1 −1 −2   ∼  0 1 −1 −4  R2 → R2 ÷ (−4) 0 3 1 −2   1 0 0 2 R1 → R1 − R1   ∼  0 1 −1 −4  0 0 4 10 R3 → R3 − 3R2   2 1 0 0   ∼  0 1 −1 −4  5 0 0 1 R3 → R3 ÷ 4 2   1 0 0 2   ∼  0 1 0 − 32  R2 → R2 + R3 0 0 1 52 The matrix is now in reduced row echelon form. The unique solution is 3 5 x = 2, y = − , z = . 2 2 202

Exercises 7.3

Solutions Manual

(ii) The augmented matrix is 

   2 1 8 14 1 3 5 10      0 1 2 6  ∼  0 1 2 6  R1 ↔ R3 1 3 5 10 2 1 8 14   1 3 5 10   ∼  0 1 2 6  0 −5 −2 −6 R3 → R3 − 2R1   1 0 −1 −8 R1 → R1 − 3R2   ∼  0 1 2 6  0 0 8 24 R3 → R3 + 5R2   1 0 −1 −8   ∼  0 1 2 6  0 0 1 3 R3 → R3 ÷ 8   1 0 0 −5 R1 → R1 + R3   ∼  0 1 0 0  R2 → R2 − 2R3 0 0 1 3 The matrix is now in reduced row echelon form. The unique solution is x1 = −5, x2 = 0, x3 = 3. (iii) The augmented matrix is 

   1 2 −4 4 1 2 −4 4      1 3 −6 7  ∼  0 1 −2 3  R2 → R2 − R1 2 3 −5 9 0 −1 3 1 R3 → R3 − 2R1   R1 → R1 − 2R2 1 0 0 −2   ∼  0 1 −2 3  4 R3 → R3 + R2 0 0 1   1 0 0 −2   ∼  0 1 0 11  R2 → R2 + 2R3 0 0 1 4 Hence the unique solution is x = −2, y = 11, z = 4. Exercises 7.3

203

Discrete Mathematics: Proofs, Structures and Applications

(iv) The augmented matrix is 

   3 2 −1 4 1 4 −2 3      4 −2 7 3  ∼  4 −2 7 3  R1 ↔ R3 1 4 −2 3 3 2 −1 4   1 4 −2 3   ∼  0 −18 1 −9  R2 → R2 − 4R1 0 −10 5 −5 R3 → R3 − 3R1   1 4 −2 3  1 1  ∼  0 1 − 18 2  R2 → R2 ÷ (−18) 0 −10 5 −5   1 0 − 16 1 R1 → R1 − 4R2 9   1 1 ∼  0 1 − 18 2  R3 → R3 + 10R2 0 0 40 0 9   1 0 − 16 1 9   1 ∼  0 1 − 18 12  9 0 0 1 0 R3 → R3 × 40   R1 → R1 + 16 1 0 0 1 9 R3   1 1 ∼  0 1 0 2  R2 → R2 + 18 R3 0 0 1 0 The matrix is now in reduced row echelon form. The solution is 1 x = 1, y = , z = 0. 2 (v) The augmented matrix is 

   1 1 1 0 1 1 1 0     3 0  R2 → R2 + 2R1  −2 −1 1 0  ∼  0 1 3 2 2 0 0 −1 −1 0 R3 → R3 − 3R1   R1 → R1 − R2 1 0 −2 0   ∼  0 1 3 0  R3 → R3 + R2 0 0 2 0   1 0 −2 0   ∼  0 1 3 0  0 0 1 0 R3 → R3 ÷ 2 204

Exercises 7.3

Solutions Manual

 1 0 0 0 R1 → R1 + 2R1   ∼  0 1 0 0  R3 → R2 − 3R3 0 0 1 0 

The matrix is now in reduced row echelon form. The solution is x = y = z = 0. 2.

(i) The augmented matrix is    1 1 4 1 1 4 2     4 3 15 0  ∼  0 −1 −1 2 1 7 −4 0 −1 −1  1 1 4  ∼  0 1 1 0 −1 −1  1 1 4 2  ∼  0 1 1 8 0 0 0 0

 2  −8  R2 → R2 − 4R1 −8 R3 → R3 − 2R1  2  8  R2 → R2 × (−1) −8    R3 → R3 + R2

This is equivalent to the system x1 + x2 + 4x3 = 2 x2 + x3 = 8. Let x3 = t where t ∈ R. Then x2 = 8 − t and x1 = 2 − 4x3 − x2 = 2 − 4t − (8 − t) = −6 − 3t. (ii) The augmented matrix  1 1 −1  2  2 1 1 −2 1

Exercises 7.3

is    0 1 1 −1 0    4  ∼  0 −1 4 4  R2 → R2 − 2R1 8 R3 → R3 − R1 0 −3 2 8   1 1 −1 0   ∼  0 1 −4 −4  R2 → R2 × (−1) 0 −3 2 8 205

Discrete Mathematics: Proofs, Structures and Applications



1 1 −1  ∼  0 1 −4 0 0 −10  1 1 −1  ∼  0 1 −4 0 0 1

 0  −4  −4 R3 → R3 + 3R2  0  −4  2 R3 → R3 ÷ (−10) 5

This is equivalent to the system x+y−z = 0 y − 4z = −4 z = 25 Since z =

2 5

we have y = 4z − 4 =

so x=z−y =

8 12 −4=− 5 5

2 12 14 − (− ) = . 5 5 5

(iii) The augmented matrix is 

  1 1 −1 8 1     0 1 −3 2  ∼  0 2 1 1 14 0  1  ∼  0 0

 1 −1 8  1 −3 2  −1 3 −2 R3 → R3 − 2R1  1 −1 8  1 −3 2  0 0 0 R3 → R3 + R2

This is equivalent to the system x+y−z = 8 y − 3z = 2. Let z = t where t ∈ R. Then

and

206

y = 2 + 3t x = 8−y+z = 8 − (2 + 3t) + t = 6 − 2t. Exercises 7.3

Solutions Manual

(iv) The augmented matrix  1 2 1   3 −1 −1 2 −3 2

is    0 1 2 1 0    0  ∼  0 −7 −4 0  R2 → R2 − 3R1 0 0 −7 0 0 R3 → R3 − 2R1   1 2 1 0   ∼  0 1 47 0  R2 → R2 × − 17 0 −7 0 0   1 2 1 0   ∼  0 1 47 0  0 0 4 0 R3 → R3 + 7R2   1 2 1 0   ∼  0 1 47 0  0 0 1 0 R3 → R3 × 14

This is equivalent to the system x + 2y + z = 0 y + 47 z = 0 z = 0. Hence x = y = z = 0. 3.

(i) The augmented matrix is à ! à ! 1 1 −3 3 1 1 −3 3 ∼ 2 −3 −1 −9 0 −5 5 −15 R2 → R2 − 2R1 à ∼

1 1 −3 3 0 1 −1 3

! R2 → R2 × − 15

This is equivalent to the system x1 + x2 − 3x3 = 3 x2 − x3 = 3. Let x3 = t where t ∈ R. Then and

Exercises 7.3

x2 = 3 + t x1 = 3 − x2 + 3x3 = 3 − (3 + t) + 3t = 2t. 207

Discrete Mathematics: Proofs, Structures and Applications

(ii) The augmented matrix  1 1   2 1 1 −2

is    0 1 1 0    1  ∼  0 −1 1  R2 → R2 − 2R1 8 0 −3 8 R3 → R3 − R1   0 1 1   ∼  0 1 −1  R2 → R2 × −1 0 −3 8   1 1 0   ∼  0 1 −1  0 0 5 R3 → R3 + 3R2

The third row of the matrix represents the equation 0x + 0y = 5 which has no solution. Hence the system of equations is inconsistent. (iii) The augmented matrix is     1 −2 3 7 R1 ↔ R2 2 −1 −1 1      1 −2 3 7  ∼  2 −1 −1 1  −1 1 −1 2 −1 1 −1 2   1 −2 3 7   ∼  0 3 −7 −13  R2 → R2 − 2R1 0 −1 2 9 R3 → R3 + R1   1 −2 3 7   1 ∼  0 1 − 73 − 13 3  R2 → R2 × 3 0 −1 2 9   1 −2 3 7   ∼  0 1 − 73 − 13 3  14 0 0 − 31 R3 → R3 + R2 3   1 −2 3 7   7 ∼  0 1 − 3 − 13 3  0 0 1 −14 R3 → R3 × −3 This is equivalent to the system x − 2y + 3z = 7 y − 73 z = − 13 3 z = −14 208

Exercises 7.3

Solutions Manual

Since z = −14 we have 7 13 7 13 y= z− = × (−14) − = −37 3 3 3 3 so x = 7 + 2y − 3z = 7 − 74 + 42 = −25. (iv) The augmented matrix  1 1 1   2 −1 −1   −1 3 −2  0 1 −2

is 3 0 0 −1





     ∼         ∼       ∼       ∼       ∼   

 1 1 1 3  0 −3 −3 −6   R2 → R2 − 2R1 0 4 −1 3   R3 → R3 + R1 0 1 −2 −1  1 1 1 3  0 1 1 2   R2 → R2 ÷ (−3) 0 4 −1 3   0 1 −2 −1  3 1 1 1  0 1 1 2   0 0 −5 −5   R3 → R3 − 4R2 0 0 −3 −3 R4 → R4 − R2  3 1 1 1  0 1 1 2   0 0 1 1   R3 → R3 ÷ (−5) 0 0 −3 −3  1 1 1 3  0 1 1 2   0 0 1 1   0 0 0 0 R4 → R4 + 3R3

The last row of the matrix corresponds to the equation 0x1 + 0x2 + 0x3 + 0x4 = 0 which is satisfied for all values of x1 , x2 , x3 and x4 . Hence this equation provides no information and may be discarded. Therefore the matrix is equivalent to the system x+y+z = 3 y+z = 2 z = 1. Hence z=1 Exercises 7.3

so

y =2−z =1

so

x = 3 − y − z = 1. 209

Discrete Mathematics: Proofs, Structures and Applications

(v) The augmented matrix  1 1 −1   3 −2 2 2 −1 1

is    0 1 1 −1 0    0  ∼  0 −5 5 0  R2 → R2 − 3R1 0 0 −3 3 0 R3 → R3 − 2R1   1 1 −1 0   ∼  0 1 −1 0  R2 → R2 × − 15 0 −3 3 0   1 1 −1 0   ∼  0 1 −1 0  0 0 0 0 R3 → R3 + 3R1

This is equivalent to the system x+y−z = 0 y − z = 0. Let z = t where t ∈ R. Then y=z=t

so

x = z − y = 0.

(vi) The augmented matrix is     7 3 −2 1 7 1 − 32 13 R1 → R1 × 13 3      2 −2 3 −1  ∼  2 −2 3 −1  −2 0 4 −1 −2 0 4 −1   7 1 − 23 13 3   ∼  0 − 23 73 − 17 3  R2 → R2 − 2R1 11 0 − 43 14 R3 → R3 + 2R1 3 3   1 7 1 − 23 3 3   3 ∼  0 1 − 27 17 2  R2 → R2 × − 2 11 0 − 43 14 3 3   1 7 1 − 23 3 3   ∼  0 1 − 27 17 2  0 0 0 15 R3 → R3 + 43 R2 The third row of the matrix represents the equation 0x1 + 0x2 + 0x3 = 15 which has no solution. Hence the system of equations is inconsistent.

210

Exercises 7.3

Chapter 8

Algebraic Structures 8.1 1.

Solutions to Exercises 8.1 (i) No: R+ is not closed under subtraction. For example, 1, 2 ∈ R+ but 1 − 2 = −1 6∈ R+ . (ii) No: the element z is not uniquely specified by x and y. (iii) Yes: if x, y are positive real numbers then xy is defined and xy ∈ R+ . (iv) Yes: if x, y ∈ S then x ∗ y ∈ S. The best way of seeing this is to draw up the Cayley table showing all the possible combinations. ∗ 1 2 1 1 2 2 2 2 3 3 6 4 4 4 6 6 6 8 8 8 12 12 12 24 24 24

3 3 6 3 12 6 24 12 24

4 4 4 12 4 12 8 12 24

6 6 6 6 12 6 24 12 24

8 8 8 24 8 24 8 24 24

12 12 12 12 12 12 24 12 24

24 24 24 24 24 24 24 24 24

Since only numbers belonging to the set S appear in the Cayley table, we see that x ∗ y ∈ S for all x, y ∈ S. (v) Yes. The Cayley table for ∗ in this case is given below. ∗ 1 2 3 4 6 8 12 24

1 1 1 1 1 1 1 1 1

2 1 2 1 2 2 2 2 2

3 1 1 3 1 3 1 3 3

211

4 1 2 1 4 2 4 4 4

6 1 2 3 2 6 2 6 6

8 12 24 1 1 1 2 2 2 1 3 3 4 4 4 2 6 6 8 4 8 4 12 12 8 12 24

Discrete Mathematics: Proofs, Structures and Applications

Again, since only numbers belonging to the set S appear in the Cayley table, we see that x ∗ y ∈ S for all x, y ∈ S. (vi) No. µOnly¶matrices of the dimension may be added. Thus, for example, µ same ¶ 1 3 4 A= ∈ S and B = ∈ S but A + B is not defined. 2 5 6 2.

(i) No. For example, (2 − 3) − 4 = (−1) − 4 = −5 but 2 − (3 − 4) = 2 − (−1) = 3. (ii) No. For example, 2−3 = −1 but 3−2 = 1. (In fact, subtraction is anti-commutative: x − y = −(y − x) for all x, y ∈ R.) (iii) There is no identity element. Since x − y = x implies y = 0, the only possible candidate for an identity element is 0. However 0 − y = −y 6= y (except when y is itself 0) so 0 is not an an identity element.

3.

(i) The binary operation is commutative if about the leading diagonal (which runs the binary operation is commutative if table equals the (j, i)-entry for all i and

and only if the Cayley table is symmetric top-left to bottom right). In other words, and only if the (i, j)-entry of the Cayley j.

(ii) The binary operation has an identity element if and only if the Cayley table has an element x with the property that the row corresponding to x is the same as the column headings and the column corresponding to x is the transpose of that row. If such an x exists, it is an identity element for the binary operation. 4.

(i) Yes, ∩ is commutative. For all X and Y , subsets of A, we have X ∩ Y = Y ∩ X. (ii) The set A itself is the identity element since X ∩ A = X = A ∩ X for all X ⊆ A. (iii) Since A is the identity element, an element X ∈ P(A) had an inverse Y ∈ P(A) if and only if X ∩ Y = A. This equation is satisfied only when X = Y = A. Hence the only element that has an inverse is A and A is self-inverse.

5. Let e denote the identity element and suppose that ∗ satisfies the given condition. We first show that ∗ is commutative. For all x, y ∈ S, x ∗ y = e ∗ (x ∗ y) = (e ∗ y) ∗ x

(using the given condition)

= y ∗ x. Therefore ∗ is commutative. Now that we have shown that ∗ is commutative, we can show it is also associative. For all x, y, z ∈ S, x ∗ (y ∗ z) = x ∗ (z ∗ y) = (x ∗ y) ∗ z

(since ∗ is commutative) (using the given condition).

Therefore ∗ is associative. 212

Exercises 8.1

Solutions Manual

6.

(i) 24 (ii) 39 (iii) 416 2

(iv) nn . To see this, consider the Cayley table for the binary operation. The Cayley table has n rows and n columns. For each of the n2 positions in the Cayley table, 2 there are n possible elements that may be entered. Hence there are nn possible n × n Cayley tables that may be constructed. 7. Since a is the identity element, the row and column corresponding to a are given. Also, since b ∗ c = c ∗ b, the Cayley table must take the following form where x, y, z ∈ S. ∗ a b c

a a b c

b b x y

c c y z

Since b has a unique inverse, there are two possibilities: b−1 = b or b−1 = c. Case 1: b−1 = b. Then b ∗ b = a so the entry x in the table above is a. Since b−1 is unique, y 6= a so y = b or y = c. There are two possible Cayley tables in this case. (a)

∗ a b c

a a b c

b b a b

c c b a

(b)

∗ a b c

a a b c

b b a c

c c c a

Case 2: b−1 = c. Then b ∗ c = a so the entry y in the table above is a. Since b−1 is unique, x 6= a and z 6= a. There are two possibilities (b or c) for each of x and z. Therefore there are four possible Cayley tables in this case. (c)

∗ a b c

a a b c

b b b a

c c a b

(d)

∗ a b c

a a b c

b b c a

c c a c

(e)

∗ a b c

a a b c

b b b a

c c a c

(f )

∗ a b c

a a b c

b b c a

c c a b

Only (f ) defines an associative binary operation. 8.

(i) Let X, Y ∈ P(A). Then X ⊆ A and Y ⊆ A so X − Y ⊆ A and Y − X ⊆ A. Hence (X − Y ) ∪ (Y − X) ⊆ A so X ∗ Y ∈ P(A). Therefore ∗ is a binary operation on P(A).

Exercises 8.1

213

Discrete Mathematics: Proofs, Structures and Applications

(ii) For all X, Y ∈ P(A), X ∗Y

= (X − Y ) ∪ (Y − X) = (Y − X) ∪ (X − Y )

since ∪ is commutative

= Y ∗ X. Therefore ∗ is commutative. (iii) First note that, for all X, Y ∈ P(A), X − Y = X ∩ Y so that X ∗ Y = (X ∩ Y ) ∪ (Y ∩ X) = (X ∩ Y ) ∪ (X ∩ Y ).

(8.1)

Let X, Y , Z ∈ P(A). Then (X ∗ Y ) ∗ Z £ ¤ £¡ ¢ ¤ = (X ∗ Y ) ∩ Z ∪ X ∗ Y ∩ Z (from (8.1) above) ´ i £¡ ¢ ¤ h³ = (X ∩ Y ) ∪ (X ∩ Y ) ∩ Z ∪ (X ∩ Y ) ∪ (X ∩ Y ) ∩ Z (from (8.1) above) h³ ´ i £¡ ¢ ¡ ¢¤ = (X ∩ Y ) ∩ Z ∪ (X ∩ Y ) ∩ Z ∪ (X ∩ Y ) ∩ (X ∩ Y ) ∩ Z (distributive and De Morgan’s laws) ´ i £¡ ¢ ¡ ¢¤ h³ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ (X ∪ Y ) ∩ (X ∪ Y ) ∩ Z (De Morgan’s law) ¡ ¢ ¡ ¢ £¡ ¢ ¤ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ (X ∪ Y ) ∩ (X ∪ Y ) ∩ Z (involution law) ¡ ¢ ¡ ¢ £¡ ¢ ¤ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ (X ∩ X) ∪ (X ∩ Y ) ∪ (Y ∩ X) ∪ (Y ∩ Y ) ∩ Z (distributive law) ¡ ¢ ¡ ¢ £¡ ¢ ¤ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ ∅ ∪ (X ∩ Y ) ∪ (X ∩ Y ) ∪ ∅ ∩ Z (commutative and complement laws) ¡ ¢ ¡ ¢ £¡ ¢ ¤ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ (X ∩ Y ) ∪ (X ∩ Y ) ∩ Z (identity law) ¡ ¢ ¡ ¢ ¡ ¢ = X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z ∪ (X ∩ Y ∩ Z) (distributive law) Now X ∗ (Y ∗ Z) £ ¤ £ ¤ = X ∩ (Y ∗ Z) ∪ X ∩ (Y ∗ Z) (from (8.1) above) h ³ ´i £ ¡ ¢¤ = X ∩ (Y ∩ Z) ∪ (Y ∩ Z) ∪ X ∩ (Y ∩ Z) ∪ (Y ∩ Z) (from (8.1) above) h ³ ´i £¡ ¢ ¡ ¢¤ = X ∩ (Y ∩ Z) ∩ (Y ∩ Z) ∪ X ∩ (Y ∩ Z) ∪ X ∩ (Y ∩ Z) (distributive and De Morgan’s laws) h ³ ´i £¡ ¢ ¡ ¢¤ = X ∩ (Y ∪ Z) ∩ (Y ∪ Z) ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z £ ¡ ¢¤ ¡ ¢ ¡ ¢ = X ∩ (Y ∪ Z) ∩ (Y ∪ Z) ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z 214

(De Morgan’s laws) (involution law) Exercises 8.1

Solutions Manual

£ ¡ ¢¤ ¡ ¢ ¡ ¢ = X ∩ (Y ∩ Y ) ∪ (Y ∩ Z) ∪ (Z ∩ Y ) ∪ (Z ∩ Z) ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z (distributive law) £ ¡ ¢¤ ¡ ¢ ¡ ¢ = X ∩ ∅ ∪ (Y ∩ Z) ∪ (Y ∩ Z) ∪ ∅ ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z (commutative and complement laws) £ ¡ ¢¤ ¡ ¢ ¡ ¢ = X ∩ (Y ∩ Z) ∪ (Y ∩ Z) ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z (identity law) ¡ ¢ ¡ ¢ ¡ ¢ = X ∩ Y ∩ Z ∪ (X ∩ Y ∩ Z) ∪ X ∩ Y ∩ Z ∪ X ∩ Y ∩ Z (distributive law) Therefore (X ∗ Y ) ∗ Z = X ∗ (Y ∗ Z) so ∗ is associative. An alternative approach is to use logical connectives. The symmetric difference corresponds to the exclusive disjunction connective: X ∗ Y = {x : x ∈ X Y x ∈ Y }. Since (X ∗ Y ) ∗ Z = {x : (x ∈ X Y x ∈ Y ) Y x ∈ Z} and X ∗ (Y ∗ Z) = {x : x ∈ X Y (x ∈ Y Y x ∈ Z)}, the identity (X ∗ Y ) ∗ Z = X ∗ (Y ∗ Z) follows from the associative law for Y given in §1.5 : (p Y q) Y r ≡ p Y (q Y r). (iv) The identity element is the empty set. Proof Let X ∈ P(A). Then X − ∅ = X and ∅ − X = ∅. Therefore X ∗ ∅ = (X − ∅) ∪ (∅ − X) = X ∪ ∅ = X. Since ∗ is commutative, ∅ ∗ X = X also. Therefore ∅ is the identity element for ∗. (v) For all X ∈ P(A), X −1 = X; ie every element is self-inverse. Proof Let X ∈ P(A). Then X − X = ∅ so X ∗ X = ∅ ∪ ∅ = ∅. Therefore X −1 = X. 9. A counter-example is given by (b ∗ d) ∗ c = a ∗ c = c but b ∗ (d ∗ c) = b ∗ b = d.

Exercises 8.1

215

Discrete Mathematics: Proofs, Structures and Applications

8.2

Solutions to Exercises 8.2

1. Let M2×2 (R) denote the set of all 2 × 2 matrices with real entries. The sum of two 2 × 2 real matrices is another 2 × 2 real matrix, so addition is a binary operation on M2×2 (R). The associativity of matrix addition follows from the associativity of addition of real numbers. µ ¶ 0 0 The identity element is the 2 × 2 zero matrix, 02×2 = . This is because, for all 0 0 µ ¶ a b ∈ M2×2 (R), c d µ ¶ µ ¶ µ ¶ a b 0 0 a b + = . c d 0 0 c d µ ¶ µ ¶ µ ¶ a b −a −b a b The inverse of is . This is because, for all ∈ M2×2 (R), c d −c −d c d µ ¶ µ ¶ µ ¶ a b −a −b 0 0 + = . c d −c −d 0 0 Therefore (M2×2 (R), +) is a group. The set M2×2 (R) is a not group µ under ¶ matrix multiplication because not every matrix a b has an inverse. In fact any ∈ M2×2 (R) where ad − bc = 0 does not have an c d inverse. Let GL2 (R) = {A ∈ M2×2 (R) : A is non-singular}1 . Let A, B ∈ GL2 (R). Then, from Theorem 6.4, AB is non-singular (and (AB)−1 = B −1 A−1 ) so AB ∈ GL2 (R). Therefore matrix multiplication is a binary operation on GL2 (R). We know that matrix µ ¶multiplication is associative (section 6.3) and the multiplicative 1 0 identity is I2 = ∈ GL2 (R). 0 1 µ ¶ µ ¶−1 µ ¶ 1 a b a b d −b If ∈ GL2 (R) then its inverse is = ∈ GL2 (R) (see c d c d ad − bc −c a exercise 6.4.5). Therefore (GL2 (R), ×) is a group. 2. Let (S, ∗) be a group with identity element e. Since e ∗ e = e, it follows that e is idempotent. Suppose x ∈ S is idempotent. Then x∗e ⇒ ⇒ ⇒ ⇒ 1

216

x−1 ∗ (x ∗ e) (x−1 ∗ x) ∗ e e∗e e

= = = = = =

x x∗x x−1 ∗ (x ∗ x) (x−1 ∗ x) ∗ x e∗x x.

(since e is the identity) (since x is idempotent) (since ∗ is associative) (since x−1 ∗ x = e)

The notation comes from the fact that this is called a ‘general linear group’.

Exercises 8.2

Solutions Manual

We have shown that if x is idempotent then x = e. Therefore e is the only idempotent element. 3. The Cayley table for Z6 under +6 is given below. +6 [0] [1] [2] [3] [4] [5]

[0] [0] [1] [2] [3] [4] [5]

[1] [1] [2] [3] [4] [5] [0]

[2] [2] [3] [4] [5] [0] [1]

[3] [3] [4] [5] [0] [1] [2]

[4] [4] [5] [0] [1] [2] [3]

[5] [5] [0] [1] [2] [3] [4]

Since only elements of the set Z6 appear in the table, it follows that +6 is a binary operation on Z6 . Associativity of +6 follows from associativity of addition on Z. The identity element is [0] since [0] +6 [n] = [n] and [n] +6 [0] = [n] for all [n] ∈ Z6 . Every [n] ∈ Z6 has an inverse [6−n] ∈ Z6 since [n]+6 [6−n] = [6] = [0] and [6−n]+6 [n] = [6] = [0]. Therefore (Z6 , +6 ) is a group. The Cayley table for Z6 under ×6 is given below. ×6 [0] [1] [2] [3] [4] [5]

[0] [0] [0] [0] [0] [0] [0]

[1] [0] [1] [2] [3] [4] [5]

[2] [0] [2] [4] [0] [2] [4]

[3] [0] [3] [0] [3] [0] [3]

[4] [0] [4] [2] [0] [4] [2]

[5] [0] [5] [4] [3] [2] [1]

The identity element is [1] but the elements [0], [2], [3], [4] do not have inverses. Therefore (Z6 , ×6 ) is not a group. 4. Similarly to Z6 in exercise 8.2.3 above, the identity element is [1] but [0] has no inverse because [0] ×5 [n] = [0] 6= [1] for all [n] ∈ Z5 . The Cayley table for Z5 − {[0]} = {[1], [2], [3], [4]} under ×5 is given below. ×5 [1] [2] [3] [4]

[1] [1] [2] [3] [4]

[2] [2] [4] [1] [3]

[3] [3] [1] [4] [2]

[4] [4] [3] [2] [1]

All the entries in the Cayley table are elements of Z5 − {[0]} so [n], [m] ∈ Z5 − {[0]} ⇒ [n] ×5 [m] ∈ Z5 − {[0]}. Hence ×5 is a binary operation on Z5 − {[0]}. Exercises 8.2

217

Discrete Mathematics: Proofs, Structures and Applications

Associativity of ×5 follows from associativity of multiplication in Z. The identity element is [1] since [1] ×5 [n] = [n] = [n] ×5 [1] for all [n] ∈ Z5 − {[0]}. Each element has an inverse as follows: [1]−1 = [1], [2]−1 = [3], [3]−1 = [2], [4]−1 = [4]. Therefore (Z5 − {[0]}, ×5 ) is a group. The Cayley table for Z4 − {[0]} = {[1], [2], [3]} under ×4 is given below. ×4 [1] [2] [3]

[1] [1] [2] [3]

[2] [2] [0] [2]

[3] [3] [2] [1]

Since [2] ∈ Z4 − {[0]} but [2] ×4 [2] = [0] 6∈ Z4 − {[0]}, it follows that ×4 is not a binary operation on Z4 − {[0]}. Therefore (Z4 − {[0]}, ×4 ) is not a group. From exercise 4.4.12, [a]n , [b]n ∈ Zn − {[0]} ⇒ [a]n ×n [b]n 6= [0] if and only if n is prime. Therefore ×n is a binary operation on Zn − {[0]} if and only if n is prime. In this case ×n is associative and [1] is the identity element. To prove that each element has an inverse is a little harder. Let [a] ∈ Zn −{[0]}. It can be shown that the elements in the list [a], [2a], [3a], . . . , [(n − 1)a] are all distinct. Therefore each of the n−1 elements [1], [2], . . . [n−1] must appear in the list. In particular [ka] = [1] for some value of k. Hence [k] ×n [a] = [1] so [a]−1 = [k]. Hence Zn − {[0]} is a group under ×n in this case. Therefore (Zn − {[0]}, ×n ) is a group if and only if n is prime. 5. The Cayley table for (P , ∗) is the following. ∗ 2 3 2 2 3 3 3 2 5 5 3 7 7 2 11 11 3 13 13 7

5 5 3 2 5 7 2

7 11 13 7 11 13 2 3 7 5 7 2 3 2 3 2 5 11 3 11 3

From the table we can see that ∗ is a binary operation on P and that 2 is the identity element. However ∗ is not associative. For example, (5 ∗ 3) ∗ 7 = 3 ∗ 7 = 2 218

Exercises 8.2

Solutions Manual

but 5 ∗ (3 ∗ 7) = 5 ∗ 2 = 5. Therefore (P , ∗) is not a group. 6. We need to show that ∗ is associative. For all x, y, z ∈ S, (x ∗ y) ∗ z = x ∗ z = x and x ∗ (y ∗ z) = x ∗ y = x, so ∗ is associative. Therefore (S, ∗) is a semigroup. To determine whether or not (S, ∗) is a monoid, we need to determine whether there is an identity element e ∈ S satisfying x ∗ e = x and e ∗ x = x for all x ∈ S. Since e ∗ x = e for all x ∈ S, there is no identity element (unless S is the singleton set {e}). Therefore if S 6= {e} then (S, ∗) is not a monoid. 7. Let (s1 , t1 ), (s2 , t2 ) ∈ S × T . Then (s1 , t1 ).(s2 , t2 ) = (s1 ∗ s2 , t1 ◦ t2 ) ∈ S × T since s1 ∗ s2 ∈ S (as ∗ is a binary operation on S) and t1 ◦ t2 ∈ T (as ◦ is a binary operation on T ). Therefore . is a binary operation on S × T . Let (s1 , t1 ), (s2 , t2 ), (s3 , t3 ) ∈ S × T . Then [(s1 , t1 ).(s2 , t2 )].(s3 , t3 ) = (s1 ∗ s2 , t1 ◦ t2 ).(s3 , t3 ) = ((s1 ∗ s2 ) ∗ s3 , (t1 ◦ t2 ) ◦ t3 ) = (s1 ∗ (s2 ∗ s3 ), t1 ◦ (t2 ◦ t3 )) (since ∗ and ◦ are associative) = (s1 , t1 ).(s2 ∗ s3 , t2 ◦ t3 ) = (s1 , t1 ).[(s2 , t2 ).(s3 , t3 )]. Therefore . is associative. Let eS be the identity element of S and let eT be the identity element of T . (These identity elements exist since (S, ∗) and (T , ◦) are both groups.) For all (s, t) ∈ S × T , (s, t).(eS , eT ) = (s ∗ eS , t ◦ eT ) = (s, t) = (eS ∗ s, eT ◦ t) = (eS , eT ).(s, t). Therefore (eS , eT ) is the identity for (S × T , .). Let (s, t) ∈ S × T . Then s ∈ S so s has an inverse, s−1 . Similarly, t ∈ T so t has an inverse, t−1 . Hence (s, t).(s−1 , t−1 ) = (s ∗ s−1 , t ◦ t−1 ) = (eS , eT ) = (s−1 ∗ s, t−1 ◦ t) = (s−1 , t−1 ).(s, t). Therefore (s, t) has inverse (s−1 , t−1 ). Therefore (S × T , .) is a group. Exercises 8.2

219

Discrete Mathematics: Proofs, Structures and Applications

8. We first need to show that ∗ is associative on N. Let x, y, z ½ x ∗ z if x ≥ y (x ∗ y) ∗ z = y ∗ z if x < y  x if x ≥ y and    z if x ≥ y and = y if x < y and    z if x < y and  if x ≥ y and  x z if y < z and =  y if x < y and Also

½ x ∗ (y ∗ z) =

x∗y x∗z

 x    y = x    z   x y =  z

∈ N. Then

x≥z xz y≤z y>z x≤z x>z y ≤ z.

if y ≤ z if y > z Exercises 8.2

Solutions Manual

 x    y = x    z   x y =  z

if if if if

y y y y

≤z ≤z >z >z

and and and and

x≤y x>y x≤z x>z

if x ≤ z and x ≤ y if y ≤ z and x > y if y > z and x > z.

Therefore (x ◦ y) ◦ z = x ◦ (y ◦ z) so ◦ is associative on N. Hence (N, ◦) is a semigroup. Suppose e ∈ N is an identity element for ◦. Then, for all x ∈ N, e ◦ x = x. But e ◦ x = x ⇒ e ≥ x. Since there is no element e ∈ N satisfying e ≥ x for all x ∈ N, there is no identity element for ◦. Therefore (N, ◦) is not a monoid. ½µ ¶ ¾ a 0 9. Let D2 (R) = : a, b ∈ R . 0 b (The notation is because the matrices in D2 (R) are called diagonal matrices.) (a) We established in Chapter 6 that matrix multiplication is associative, so (D2 (R), ×) is a semigroup. µ ¶ 1 0 belongs to D2 (R), so so (D2 (R), ×) is a monoid. (b) The identity matrix I2 = 0 1 µ ¶ a 0 (c) If ab = 0 then the matrix has no inverse. Hence (D2 (R), ×) is not a group. 0 b ½µ ¶ ¾ µ ¶ µ ¶ 1 n 1 n 1 m 10. Let U2 (Z) = : a, b ∈ Z and let A = ,B= ∈ U2 (Z). 0 1 0 1 0 1 (The notation is because the matrices in U2 (Z) are called upper triangular matrices.) µ ¶µ ¶ µ ¶ 1 n 1 m 1 n+m Then AB = = ∈ U2 (Z). Therefore matrix multiplication 0 1 0 1 0 1 is a binary operation on U2 (Z). We µ know ¶ that matrix multiplication is associative. Further, the identity matrix I2 = 1 0 belongs to U2 (Z). 0 1 µ ¶µ ¶ µ ¶ µ ¶ µ ¶ 1 n 1 −n 1 0 1 n 1 −n Since = , the inverse of is . 0 1 0 1 0 1 0 1 0 1 Therefore (U2 (Z), ×) is a group. µ ¶ µ ¶ 1 4 1 −4 The inverse of is . 0 1 0 1 Exercises 8.2

221

Discrete Mathematics: Proofs, Structures and Applications

¶ ¾ x y : x, y ∈ R are not both 0 . 11. Let M = −y x µ ¶ µ ¶ r s x y , B= ∈ M . Then x and y are not both zero and r and s Let A = −y x −s r are not both zero. Now µ ¶µ ¶ µ ¶ x y r s xr − ys xs + yr AB = = . −y x −s r −(xs + yr) xr − ys ½µ

The product AB has the appropriate form but we must show that xr − ys and xs + yr are not both zero. Suppose that xr − ys and xs + yr are both zero: xr − ys = 0 xs + yr = 0 ⇒ xr2 + xs2 = 0 ⇒ x(rs + s2 ) = 0.

(1) (2) r × (1) + s × (2)

Now r and s are not both zero so r2 + s2 6= 0. Therefore from x(rs + s2 ) = 0, we may deduce x = 0. Since x and y are not both zero, this implies y 6= 0. Since x = 0, equation (1) becomes ys = 0; but, since y 6= 0, this implies s = 0. Similarly, equation (2) becomes yr = 0; but, since y 6= 0, this implies r = 0. This is a contradiction since r and s are not both zero. Therefore xr − ys and xs + yr are not both zero, which implies that AB ∈ M . Therefore matrix multiplication is a binary operation on M . We µ know ¶ that matrix multiplication is associative. Further, the identity matrix I2 = 1 0 belongs to M (take x = 1 and y = 0 in A). 0 1 Since x and y are not both zero then x2 + y 2 6= 0 so  x µ ¶−1 µ ¶ 1 x y x −y  x2 + y 2 = 2 = y −y x x + y2 y x x2 + y 2

 −y x2 + y 2  x  ∈ M. 2 x + y2

Therefore (M , ×) is a group. 12. The identity element is λ, the empty string. Let s ∈ F (A) be a string. The inverse of s is obtained by reversing the order of the symbols in s and, in addition, replacing each symbol x with x and each symbol x with x. For example, (abcab)−1 = bacba.

222

Exercises 8.2

Solutions Manual

8.3

Solutions to Exercises 8.3

1. Let a, b ∈ G. To show that (ab)−1 = b−1 a−1 we need to establish that ‘multiplying’ the elements together gives the identity element: (ab)(b−1 a−1 ) = e. Now

(ab)(b−1 a−1 ) = a(bb−1 )a−1

(using associativity)

−1

= aea

= aa−1 = e. Therefore (ab)−1 = b−1 a−1 . Claim: for all a ∈ G and n ∈ Z, (a−1 )n = (an )−1 . Proof. We separate the proof into three cases: n = 0, n > 0 and n < 0. When n = 0, (a−1 )n = (a−1 )0 = e = e−1 = (a0 )−1 = (an )−1 , so the result holds in this case. Next we prove the case when n > 0 by induction on n. When n = 1, (a−1 )1 = a−1 = (a1 )−1 , so the result is true in this case. Assume the result is true when n = k; that is, assume that (a−1 )k = (ak )−1 . Then: (a−1 )k+1 = a−1 (a−1 )k = a−1 (ak )−1 k

−1

= (a a)

k+1 −1

= (a

)

(since the result holds for n = k) (by the ‘shoes and socks theorem’ above)

.

This shows that, if the result holds for n = k then it also holds for n = k + 1. Therefore (a−1 )n = (an )−1 for all n ∈ Z+ , by induction. Finally, we prove the result for n < 0. If n < 0 then m = −n > 0. Then, using the fact that x−n = (x−1 )n = (xn )−1 , we have: ¡ ¢m ¡ ¢−1 (a−1 )n = (a−1 )−m = (a−1 )−1 = am = (am )−1 = (a−m )−1 = (an )−1 . Since we have proved the result in all three cases, it follows that (a−1 )n = (an )−1 for all a ∈ G and n ∈ Z. Exercises 8.3

223

Discrete Mathematics: Proofs, Structures and Applications

2. Using Theorem 8.5 we may complete the second and fourth rows as shown. ∗ e p q r s t

e e p q r s t

p q r s t p q r s t q e s t r t s e q p

Next we complete row three. Since pq = e we have qp = e. Then q 2 = p2 q = p(pq) = pe = p. The last three entries in row three are drawn from {r, s, t}. By considering the entries in the corresponding columns, we have qr = t (since r and s already appear in column 4), qs = r (since s and t already appear in column 5), and qt = s (since r and t already appear in column 6). This gives the following table. ∗ e p q r s t

e e p q r s t

p p q e t

q q e p s

r r s t e

s s t r q

t t r s p

We can then complete columns two and three. The ‘missing’ entries in column two are r and s. Since s cannot appear a second time in row 5, these must be r above s. Similarly the missing entries in column three are r and t which, because t already appears in row 6, must be t above r. We have now obtained the following table. ∗ e p q r s t

e e p q r s t

p p q e t r s

q q e p s t r

r r s t e

s s t r q

t t r s p

Now sr = (pr)r = p(rr) = pe = p. The remaining two entries in row five (e then q) may now be determines using Theorem 8.5. Finally the last row may be completed because there is only one ‘missing’ entry in reach of columns 4, 5, and 6. The final Cayley table is the following. 224

Exercises 8.3

Solutions Manual

∗ e p q r s t

e e p q r s t

p p q e t r s

q q e p s t r

r r s t e p q

s s t r q e p

t t r s p q e

3. The converse of Theorem 8.5 may be stated as follows. If the Cayley table for a binary operation ∗ on a finite set S is such that every element of S appears exactly once in every row and in every column, then (S, ∗) is a group. To show that the converse is false, we need to find a counter-example; ie we need to find a Cayley table satisfying the ‘once in every row and column’ property but which is not the Cayley table of a group. The given Cayley table satisfies the property that every element of S appears exactly once in every row and in every column. We wish to show that (S, ∗) is not a group. Clearly e is the identity element and every element has an inverse. (In fact, since e appears down the leading diagonal, every element is its own inverse: s−1 = s for all s ∈ S.) Thus, if (S, ∗) is to fail to be a group, it must be the associative property that fails. A little trial and error is sufficient to find a counter-example. For example a(bc) = ad = c

but

(ab)c = dc = a

so ∗ is not associative. Therefore (S, ∗) is not a group. 4. The Cayley table is given below. ∗ r0 r1 m1 m2 r0 r0 r1 m1 m2 r1 r1 r0 m2 m1 m1 m1 m2 r0 r1 m2 m2 m1 r1 r0 The identity element is r0 and every element is self-inverse; ie x−1 = x for all x ∈ {r0 , r1 , m1 , m2 }. We have the usual problem of demonstrating associativity from the table. However, as for the dihedral group of degree 3, we may regard the transformations as a function from the rectangle to itself; associativity then follows because composition of functions is associative. Therefore, since each of the group axioms is satisfied, ({r0 , r1 , m1 , m2 }, ∗) is a group. 5. Suppose that (G, ∗) is a group of order n and let g ∈ G. Consider the set S = {g r : r = 1, 2, . . . , n} = {g, g 2 , g 3 , . . . , g n }. Since there are only n elements in G, the set S contains at most n distinct elements. Exercises 8.3

225

Discrete Mathematics: Proofs, Structures and Applications

Suppose that S contains fewer than n elements. Then the list g, g 2 , g 3 , . . . , g n contains repeats. Therefore g r = g s for some integers 1 ≤ r < s ≤ n, so g s−r = e. In other words g m = e where m = s − r < n. Now suppose that S contains exactly n elements. Then the elements in the list g, g 2 , g 3 , . . . , g n are all distinct. Consider the element g n+1 . Since this is in the group G, g n+1 = g s for some 1 ≤ s ≤ n. Then g n+1 (g s )−1 = e so that g n+1−s = e. Let m = n + 1 − s. Then m ≤ n and g m = e. 6. The square has 8 symmetries, as follows. r0 r1 r2 r3 m1 m2 m3 m4

: : : : : : : :

rotation through 0◦ (anticlockwise) about the centre; rotation through 90◦ (anticlockwise) about the centre; rotation through 180◦ (anticlockwise) about the centre; rotation through 270◦ (anticlockwise) about the centre; reflection in the line L1 ; reflection in the line L2 ; reflection in the line L3 ; reflection in the line L4 .

L2

L4

L1 L3 The Cayley table is the following. ∗ r0 r1 r2 r3 m1 m2 m3 m4

r0 r0 r1 r2 r3 m1 m2 m3 m4

r1 r1 r2 r3 r0 m4 m3 m1 m2

r2 r2 r3 r0 r1 m2 m1 m4 m3

r3 r3 r0 r1 r2 m3 m4 m2 m1

m1 m1 m3 m2 m4 r0 r2 r1 r3

m2 m2 m4 m1 m3 r2 r0 r3 r1

m3 m3 m2 m4 m1 r3 r1 r0 r2

m4 m4 m1 m3 m2 r1 r3 r2 r0

Composition of symmetries is associative (for the reasons given for D3 in the text). The identity element is r0 since r0 ∗ x = x = x ∗ r0 for all x ∈ D4 . Every element has an 226

Exercises 8.3

Solutions Manual

inverse: −1 −1 −1 r0−1 = r0 , r1−1 = r3 , r2−1 = r2 , r3−1 = r1 , m−1 1 = m1 , m2 = m2 , m3 = m3 , m4 = m4 .

Therefore D4 is a group under the operation ∗. 7. Let g be a generator for a group G. Then every x ∈ G can be written as x = g n for some n ∈ Z. Since g n = (g −1 )−n (where −n ∈ Z), it follows that g −1 is also a generator for G. If g is the only generator for G then g −1 = g so g 2 = e. Hence G = {e, g} so G has at most two elements. Note that this includes the case of the trivial group; if g = e then G = {e}. The trivial group is a cyclic group with generator the identity element. 8. The Cayley table for (Z6 , +6 ) is the following. +6 [0] [1] [2] [3] [4] [5]

[0] [0] [1] [2] [3] [4] [5]

[1] [1] [2] [3] [4] [5] [0]

[2] [2] [3] [4] [5] [0] [1]

[3] [3] [4] [5] [0] [1] [2]

[4] [4] [5] [0] [1] [2] [3]

[5] [5] [0] [1] [2] [3] [4]

We now search for generators. Clearly [0] is not a generator since n[0] = [0] for all n ∈ Z. Consider [1] ∈ Z6 : 1[1] = [1], 2[1] = [1] +6 [1] = [2], 3[1] = [2] +6 [1] = [3], 4[1] = [3] +6 [1] = [4], 5[1] = [4] +6 [1] = [5], so every element of Z6 is a multiple of [1]. Hence [1] is a generator for Z6 . Now consider [2] ∈ Z6 : 1[2] = [2], 2[2] = [2] +6 [2] = [4], 3[2] = [4] +6 [2] = [0], so the only elements that are multiples of [2] are [0], [2] and [4]. Hence [2] is not a generator for Z6 . Next consider [3] ∈ Z6 : 1[3] = [3], 2[3] = [3] +6 [3] = [0], so the only elements that are multiples of [3] are [0] and [3]. Hence [3] is not a generator for Z6 . Now consider [4] ∈ Z6 : 1[4] = [4], 2[4] = [4] +6 [4] = [2], 3[4] = [2] +6 [4] = [0], so the only elements that are multiples of [4] are [0], [2] and [4]. Hence [4] is not a generator for Z6 . Finally, consider [5] ∈ Z6 : Exercises 8.3

227

Discrete Mathematics: Proofs, Structures and Applications

1[5] = [5], 2[5] = [5] +6 [5] = [4], 3[5] = [4] +6 [5] = [3], 4[5] = [3] +6 [5] = [2], 5[5] = [2] +6 [5] = [1], so every element of Z6 is a multiple of [5]. Hence [5] is a generator for Z6 . Therefore the generators of (Z6 , +6 ) are [1] and [5]. 9. Let R = {r0 , r1 , r2 } be the set of rotational symmetries. The Cayley table for R is given below. ∗ r0 r1 r2

r0 r0 r1 r2

r1 r1 r2 r0

r2 r2 r0 r1

Composition of symmetries is associative (for the reasons given for D3 in the text). The identity element is r0 since r0 ∗ x = x = x ∗ r0 for all x ∈ R. Every element has an inverse: r0−1 = r0 , r1−1 = r2 , r2−1 = r1 . Therefore (R, ∗) is a group. We now look for generators. The identity element r0 is not a generator since r0n = r0 for any integer n. Consider r1 : r11 = r1 , r12 = r2 , r13 = r2 ∗ r1 = r0 . Every element of R can be expresses as a power of r1 , so r1 is a generator for R. Now consider r2 : r21 = r2 , r22 = r1 , r23 = r1 ∗ r2 = r0 . Every element of R can be expresses as a power of r2 , so r2 is a generator for R. Therefore R is a cyclic group with generators r1 and r2 . 10. Suppose that x2 = e for all x ∈ G. Now x2 = e implies x−1 = x so every element of G is self-inverse. Let x, y ∈ G. Then (xy)−1 But

(xy)−1

= = =

y −1 x−1 yx xy

(from the ‘Shoes and Socks Theorem’ – see exercise 8.3.1) (since x−1 = x and y −1 = y). (since every element of G is self-inverse).

Therefore xy = yx. Hence G is Abelian. ½µ ¶ ¾ 1 n 11. Let M = :n∈Z . 0 1 To show that the group M µ ¶ is cyclic, we need to find a generator. The obvious candidate 1 1 is the matrix A = . We aim to prove that 0 1 µ ¶ 1 n A = for every n ∈ Z. 0 1 n

Case 1 : n ≥ 0. We use mathematical induction. 228

Exercises 8.3

Solutions Manual

¶ µ 1 0 , so the result holds in this case. When n = 0, = I2 = 0 1 µ ¶ 1 k k Assume that, for some k ≥ 0, A = . Then 0 1 A0

k Ak+1 = A µ A ¶µ ¶ 1 k 1 1 = 0 1 0 1 µ ¶ 1 k+1 = . 0 1

(since the result holds when n = k)

Therefore, if the result holds for n = k then it also holds for n = k + 1. µ ¶ 1 n n Therefore A = for all n ∈ Z+ , by induction. 0 1 Case 2 : n < 0. First note that, for any integer k, µ ¶−1 µ ¶ 1 k 1 −k = 0 1 0 1 since

µ ¶µ ¶ µ ¶ 1 k 1 −k 1 0 = . 0 1 0 1 0 1

Suppose n < 0. Let m = −n. Then m is a positive integer. Hence: An = A−m = (Am )−1 µ ¶−1 1 m = µ0 1 ¶ 1 −m = 0 1¶ µ 1 n = . 0 1

(from Case 1, since m > 0) (using the note above)

µ 1 We have shown that, for every integer n, = 0 be expressed as a power of A so A is a generator for An

¶ n . Thus every element of M can 1 M . Therefore M is cyclic.

12. The identity element for ×10 is [1] and [0] does not have an inverse (because [0]×10 [n] = [0] for all [n] ∈ Z10 ). Therefore (Z10 , ×10 ) is not a group. In fact, from exercise 8.2.4, we know that (Z10 − {[0]}, ×10 ) is not a group since 10 is not prime. We need to look for subsets S of Z10 − {[0]} that are groups under ×10 . Any such subset S must contain the identity element [1] and every [n] ∈ S must contain have an inverse that is also in S. Exercises 8.3

229

Discrete Mathematics: Proofs, Structures and Applications

The Cayley table for (Z10 − {[0]}, ×10 ) is given below. ×10 [1] [2] [3] [4] [5] [6] [7] [8] [9]

[1] [1] [2] [3] [4] [5] [6] [7] [8] [9]

[2] [2] [4] [6] [8] [0] [2] [4] [6] [8]

[3] [3] [6] [9] [2] [5] [8] [1] [4] [7]

[4] [4] [8] [2] [6] [0] [4] [8] [2] [6]

[5] [5] [0] [5] [0] [5] [0] [5] [0] [5]

[6] [6] [2] [8] [4] [0] [6] [2] [8] [4]

[7] [7] [4] [1] [8] [5] [2] [9] [6] [3]

[8] [8] [6] [4] [2] [0] [8] [6] [4] [2]

[9] [9] [9] [7] [6] [5] [4] [3] [2] [1]

The element [2] does not have an inverse since there is no element [n] ∈ Z10 such that [2] ×10 [n] = [1]. Similarly, [4], [5], [6] and [8] do not have inverses. Hence none of these elements can be included in a set S that is to form a group under ×10 . This leaves [1], [3], [7], [9] and the Cayley table for these elements is given below. ×10 [1] [3] [7] [9]

[1] [1] [3] [7] [9]

[3] [3] [9] [1] [7]

[7] [7] [1] [9] [3]

[9] [9] [7] [3] [1]

Let S = {[1], [3], [7], [9]}. We know that ×10 is associative. Since S contains the identity [1] and each element has an inverse ([3]−1 = [7], [7]−1 = [3], and [9]−1 = [9]), it follows that (S, ×10 ) is a group. The group is cyclic with generators: [3] since [3]1 = [3], [3]2 = [9], [3]3 = [7], [3]4 = [1], [7] since [7]1 = [7], [7]2 = [9], [7]3 = [3], [7]4 = [1]. There are two further subsets of S that are also groups. The trivial group ({[1]}, ×10 ) which is cyclic with generator [1]. The group ({[1], [9]}, ×10 ) which is cyclic with generator [9]. Finally, there is one subset which we have so far overlooked: {[0]} also forms a trivial group under the operation ×10 since [0] ×10 [0] = [0]. 13. (a) We apply a similar process to that used above in exercise 8.3.12. First we construct the Cayley table for Zn − {[0]} under ×n and then delete those elements that do not have an inverse. (i) The Cayley table for (Z6 − {[0]}, ×6 ) is given below. 230

Exercises 8.3

Solutions Manual

×6 [1] [2] [3] [4] [5]

[1] [1] [2] [3] [4] [5]

[2] [2] [4] [0] [2] [4]

[3] [3] [0] [3] [0] [3]

[4] [4] [2] [0] [4] [2]

[5] [5] [4] [3] [2] [1]

Since [1] does not appear in the row or column corresponding to [2], we see that [2] has no inverse. Similarly, [3] and [4] do not have inverses. Removing [2], [3], [4] from the set gives {[1], [5]} and the Cayley table for this set under ×6 is given below. ×6 [1] [5] [1] [1] [5] [5] [5] [1] This is the Cayley table of a group so the largest subset of Z6 that forms a group under ×6 is {[1], [5]}. (ii) Since 7 is prime, we know from exercise 8.2.4 that Z7 − {[0]} = {[1], [2], [3], [4], [5], [6]} form a group under ×7 . This is clearly the largest subset of Z7 that forms a group under ×7 . (iii) The Cayley table for (Z8 − {[0]}, ×8 ) is given below. ×8 [1] [2] [3] [4] [5] [6] [7]

[1] [1] [2] [3] [4] [5] [6] [7]

[2] [2] [4] [6] [0] [2] [4] [6]

[3] [3] [6] [1] [4] [7] [2] [5]

[4] [4] [0] [4] [0] [4] [0] [4]

[5] [5] [2] [7] [4] [1] [6] [3]

[6] [6] [4] [2] [0] [6] [4] [2]

[7] [7] [6] [5] [4] [3] [2] [1]

The elements [2], [4] and [6] do not have inverses. Removing these from the set gives {[1], [3], [5], [7]} and the Cayley table for this set under ×8 is given below. ×8 [1] [3] [5] [7]

[1] [1] [3] [5] [7]

[3] [3] [1] [7] [5]

[5] [5] [7] [1] [3]

[7] [7] [5] [3] [1]

This is the Cayley table of a group so the largest subset of Z8 that forms a group under ×8 is {[1], [3], [5], [7]}. (iv) The Cayley table for (Z9 − {[0]}, ×9 ) is given below. Exercises 8.3

231

Discrete Mathematics: Proofs, Structures and Applications

×9 [1] [2] [3] [4] [5] [6] [7] [8]

[1] [1] [2] [3] [4] [5] [6] [7] [8]

[2] [2] [4] [6] [8] [1] [3] [5] [7]

[3] [3] [6] [0] [3] [6] [0] [3] [6]

[4] [4] [8] [3] [7] [2] [6] [1] [5]

[5] [5] [1] [6] [2] [7] [3] [8] [4]

[6] [6] [3] [0] [6] [3] [0] [6] [3]

[7] [7] [5] [3] [1] [8] [6] [4] [2]

[8] [8] [7] [6] [5] [4] [3] [2] [1]

Only [3] and [6] do not have inverses. Removing these from the set gives {[1], [2], [4], [5], [7], [8]} and the Cayley table for this set under ×9 is given below. ×9 [1] [2] [4] [5] [7] [8]

[1] [1] [2] [4] [5] [7] [8]

[2] [2] [4] [8] [1] [5] [7]

[4] [4] [8] [7] [2] [1] [5]

[5] [5] [1] [2] [7] [8] [4]

[7] [7] [5] [1] [8] [4] [2]

[8] [8] [7] [5] [4] [2] [1]

This is the Cayley table of a group so the largest subset of Z9 that forms a group under ×9 is {[1], [2], [4], [5], [7], [8]}. (b) We examine the examples in part (a) in an attempt to identify what the elements that have no inverses in Zn − {[0]} have in common, we note that in each case they share a factor with n. • n = 6. The elements without inverses are [2] : 2 and 6 have common factor 2; [3] : 3 and 6 have common factor 3; [4] : 4 and 6 have common factor 4. • n = 7. No elements are without inverses. • n = 8. The elements without inverses are [2] : 2 and 8 have common factor 2; [4] : 4 and 8 have common factor 4 (or 2); [6] : 6 and 8 have common factor 2. • n = 9. The elements without inverses are [3] : 3 and 9 have common factor 3; [6] : 6 and 9 have common factor 3. In each case, when the elements with no inverses are removed the remaining elements form a group under ×n . Thus the largest S ⊆ Zn − {[0]} that is a group under ×n is S = {[k] : 1 ≤ k < n and k and n have no common factor greater than 1} = {[k] : 1 ≤ k < n and k and n are coprime}. 232

Exercises 8.3

Solutions Manual

14. (a) Clearly e is not a generator and g is a generator. We consider the remaining elements in turn, in each case evaluating the powers of the elements to see which elements of C5 we can obtain. g 2 : The powers of g 2 are: (g 2 )1 = g 2 ; (g 2 )2 = g 4 ; (g 2 )3 = g 6 = g 5 g = eg = g; (g 2 )4 = g 8 = g 5 g 3 = eg 3 = g 3 ; 2 5 10 5 5 (g ) = g = g g = ee = e. Since every element of C5 can be expressed as a power of g 2 , it follows that g 2 is a generator. 3 g : The powers of g 3 are: (g 3 )1 = g 3 ; (g 3 )2 = g 6 = g 5 g = eg = g; (g 3 )3 = g 9 = g 5 g 4 = eg 4 = g 4 ; (g 3 )4 = g 12 = (g 5 )2 g 2 = e2 g 2 = g 2 ; (g 3 )5 = g 15 = (g 5 )3 = e3 = e. Since every element of C5 can be expressed as a power of g 3 , it follows that g 3 is a generator. 4 g : The powers of g 4 are: (g 4 )1 = g 4 ; (g 4 )2 = g 8 = g 5 g 3 = g 3 ; 4 3 12 5 2 2 2 2 2 (g ) = g = (g ) g = e g = g ; (g 4 )4 = g 16 = (g 5 )3 g = e3 g = g; (g 4 )5 = g 20 = (g 5 )4 = e4 = e. Since every element of C5 can be expressed as a power of g 4 , it follows that g 4 is a generator. Hence each non-identity element of C5 – that is, g, g 2 , g 3 and g 4 – is a generator for C5 . (b) First, consider C6 . Clearly e is not a generator and g is a generator. We consider the remaining elements in turn, in each case evaluating the powers of the elements to see which elements of C6 we can obtain. g 2 : The powers of g 2 are: (g 2 )1 = g 2 ; (g 2 )2 = g 4 ; 2 3 6 (g ) = g = e; (g 2 )4 = (g 2 )3 g 2 = eg 2 = g 2 . The pattern now repeats so that the only elements that can be expressed as powers of g 2 are e, g 2 and g 4 . Hence g 2 is not a generator of C6 . Note that we only ever need to calculate the powers until we obtain the identity element e because thereafter the pattern up to that point will repeat. We will use this observation in the remaining calculations. 3 g : The powers of g 3 are: (g 3 )1 = g 3 ; (g 3 )2 = g 6 = e. The only elements that can be expressed as powers of g 3 are e and g 3 . Hence g 3 is not a generator of C6 . g 4 : The powers of g 4 are: (g 4 )1 = g 4 ; (g 4 )2 = g 8 = g 6 g 2 = g 2 ; 4 3 12 6 2 2 (g ) = g = (g ) = e = e. The only elements that can be expressed as powers of g 4 are e, g 2 and g 4 . Hence g 4 is not a generator of C6 . Exercises 8.3

233

Discrete Mathematics: Proofs, Structures and Applications

g 5 : The powers of g 5 are: (g 5 )1 = g 5 ; (g 5 )2 = g 10 = g 6 g 4 = eg 4 = g 4 ; 5 3 15 6 2 3 2 3 3 (g ) = g = (g ) g = e g = g ; (g 5 )4 = g 20 = (g 6 )3 g 2 = e3 g 2 = g 2 ; (g 5 )5 = g 25 = (g 6 )4 g = e4 g = g; (g 5 )6 = g 30 = (g 6 )5 = e5 = e. Since every element of C6 can be expressed as a power of g 5 , it follows that g 5 is a generator. The generators of C6 are g and g 5 . Secondly, consider C9 . As before e is not a generator and g is a generator. The rows of the following table shows the powers of each of the elements g 2 , g 3 , . . . , g 8 up to the first time that the identity element appears. n (g 2 )n (g 3 )n (g 4 )n (g 5 )n (g 6 )n (g 7 )n (g 8 )n

1 g2 g3 g4 g5 g6 g7 g8

2 g4 g6 g8 g g3 g5 g7

3 g6 e g3 g6 e g3 g6

4 g8

5 g

6 7 8 9 g3 g5 g7 e

g7 g2 g6 g g5 e g2 g7 g3 g8 g4 e g g8 g6 g4 g2 e g5 g4 g3 g2 g e

The generators of C9 are g, g 2 , g 4 , g 5 , g 7 and g 8 . (c) The element g r generates Cn , where 1 ≤ r < n, if and only if r and n are coprime (have no common factor greater than 1).

8.4

Solutions to Exercises 8.4

1. Let (M , ∗) be an abelian monoid and let M 0 = {x ∈ M : x2 = x} be the set of idempotent elements in M . Clearly M 0 ⊆ M and e ∈ M 0 (since e2 = e). We need to show that M 0 is closed under the binary operation. Let x, y ∈ M 0 . Then x = x2 and y = y 2 . Therefore xy = x2 y 2 = xxyy = xyxy

(since (G, ∗) is abelian)

2

= (xy) . Hence xy is idempotent so xy ∈ M 0 . Therefore M 0 is closed under ∗ so (M 0 , ∗) is a submonoid of (M , ∗). 2.

(i) (Z7 , +7 ) has no proper subgroups. To show this, first note that every [n] 6= [0] in Z7 is a generator. For example, consider [3] ∈ Z7 : 1[3] = [3], 2[3] = [3] +7 [3] = [6], 3[3] = [6] +7 [3] = [2], 4[3] = [2] +7 [3] = [5],

234

Exercises 8.4

Solutions Manual

5[3] = [5] +7 [3] = [1], 6[3] = [1] +7 [3] = [4], 7[3] = [4] +7 [3] = [0], so every element of Z7 is a multiple of [3]. Hence [3] is a generator for Z7 . A similar argument works for any [n] 6= [0] in Z7 . Now let G be a non-trivial subgroup of Z7 . Since G 6= {[0]} it contains some [n] 6= [0]. Since G is a group it is closed under +7 , so G contains all multiples of [n]. But [n] is a generator so every element of Z7 is some multiple of [n]. Therefore G = Z7 . Therefore(Z7 , +7 ) has no proper subgroups. (ii) The proper subgroups of (Z8 , +8 ) are: {[0], [2], [4], [6]} {[0], [4]}

(generated by [2] or [6]); (generated by [4]).

Each of the elements [1], [3], [5] and [7] generates Z8 . (iii) The proper subgroups of (Z10 , +10 ) are: {[0], [2], [4], [6], [8]} {[0], [5]}

(generated by any of its elements); (generated by [5]).

Each of the elements [1], [3], [5], [7] and [9] generates Z10 . (iv) The proper subgroups of (Z12 , +12 ) are: {[0], [2], [4], [6], [8], [10]} {[0], [3], [6], [9]} {[0], [4], [8]} {[0], [6]}

(generated (generated (generated (generated

by by by by

[2] or [10]); [3] or [9]); [4] or [8]); [6]);

Each of the elements [1], [5], [7] and [11] generates Z12 . 3.

(i) We use the Subgroup Test (Theorem 8.6). Let 3Z = {3z : z ∈ Z} and let 3x, 3y ∈ 3Z. Then 3x + 3y = 3(x + y) ∈ 3Z (since x + y ∈ Z) so 3Z is closed under addition. Also 3(−x) ∈ 3Z and 3x + 3(−x) = 3x − 3x = 0, the identity element, so 3x has inverse 3(−x). Therefore 3Z is closed under taking inverses. Therefore, by the Subgroup Test (Theorem 8.6), (3Z, +) is a subgroup of (Z, +). (ii) The proof is similar to part (i). Let n ∈ Z be a fixed integer. Let nZ = {nz : z ∈ Z} and let nx, ny ∈ nZ. Then nx + ny = n(x + y) ∈ nZ (since x + y ∈ Z) so nZ is closed under addition. Also n(−x) ∈ nZ and nx + n(−x) = nx − nx = 0, the identity element, so nx has inverse n(−x). Therefore nZ is closed under taking inverses. Therefore, by the Subgroup Test (Theorem 8.6), (nZ, +) is a subgroup of (Z, +).

4. The group (S3 , ∗) has four proper subgroups. Three subgroups of order 2 : ({p1 , p4 }, ∗), ({p1 , p5 }, ∗), ({p1 , p6 }, ∗). One subgroup of order 3 : ({p1 , p2 , p3 }, ∗). Exercises 8.4

235

Discrete Mathematics: Proofs, Structures and Applications

5. The Cayley table shows that {[0], [3], [6]} is closed under +9 . +9 [0] [3] [6]

[0] [0] [3] [6]

[3] [3] [6] [0]

[6] [6] [0] [3]

Therefore, by the Finite Subgroup Test (Theorem 8.7), ({[0], [3], [6]}, +9 ) is a subgroup of (Z9 , +9 ). 6. The Cayley table for D4 is given in the solution to exercise 8.3.6 on page 226. The group D4 has six (proper) cyclic subgroups. Order 2 :

Order 4 :

{r0 , r2 } generated by r2 ; {r0 , m1 } generated by m1 ; {r0 , m2 } generated by m2 ; {r0 , m3 } generated by m3 ; {r0 , m4 } generated by m4 . {r0 , r1 , r2 , r3 } generated by r1 or by r3 .

There are two proper non-cyclic subgroups, each of order 4: {r0 , r2 , m1 , m2 } and {r0 , r2 , m3 , m4 }. 7. (ii) The Cayley table for D3 is given in Section 8.4 of the text. An element a lies in the centre if and only if ag = ga for all g ∈ D3 . In terms of the Cayley table, this means that the row and column corresponding to a are the transpose of one another. In the case of D3 , only r0 has this property. Therefore the centre is {r0 }. (iii) The Cayley table for D4 is given in the solution to exercise 8.3.6 on page 226. The elements of D4 with the property that their row and column in the Cayley table are transpose of one another are r0 and r2 . Therefore the centre is {r0 , r2 }. 8. Let H be a non-empty subset of G where (G, ∗) is a group. Since the theorem is an ‘if and only if’ result, there are two parts to the proof. (⇒) Suppose that (H, ∗) is a group. Then ∗ is a binary operation on H so that condition (a) holds. Also each element of H has an inverse in H so condition (b) holds. (⇐) Suppose that (H, ∗) satisfies conditions (a) and (b). We verify that (H, ∗) satisfies the three conditions that define a group (Definition 8.8). (G1) First note that ∗ is associative on H since H ⊆ G and ∗ is associative on G. (Formally, let x, y, z ∈ H; then x, y, z ∈ G and, since (G, ∗) is a group, we have x(yz) = (xy)z, so ∗ is associative on H.) (G2) Let a ∈ H. (We know such an element exists since H 6= ∅.) Then a−1 ∈ H by condition (b). Hence, by condition (a) applied to a and a−1 , aa−1 = e ∈ H. (G3) Finally, for all a ∈ H, a−1 ∈ H by condition (b). 236

Exercises 8.4

Solutions Manual

Therefore (H, ∗) satisfies the three conditions (G1), (G2) (G3) for a group. 9. Let H be a non-empty subset of G where (G, ∗) is a group. Again the result is an ‘if and only if’ result, so there are two parts to the proof. (⇒) Suppose that (H, ∗) is a group. Let a, b ∈ H. Then b−1 ∈ H since H is closed under taking inverses. Therefore, since H is closed under the operation, we have ab−1 ∈ H. Therefore (H, ∗) satisfies the given condition. (⇐) Suppose that (H, ∗) satisfies the given condition: if a, b ∈ H then ab−1 ∈ H. To prove that (H, ∗) is a group we will appeal to Theorem 8.6. Therefore we need to show that (H, ∗) satisfies conditions (a) and (b) of Theorem 8.6. Let a ∈ H. (We know such an element exists since H 6= ∅.) Then, applying the given condition with b = a, we have aa−1 = e ∈ H. Now that we know e ∈ H, we can apply the given condition with e and a. This gives ea−1 = a−1 ∈ H Therefore (H, ∗) satisfies condition (b) of Theorem 8.6. Let a, b ∈ H. Then we have just shown that b−1 ∈ H. Now apply the given condition with a and b−1 ; this gives a(b−1 )−1 = ab ∈ H. Therefore (H, ∗) satisfies condition (b) of Theorem 8.6. Since (H, ∗) satisfies condition (a) and (b) of Theorem 8.6, it follows that (H, ∗) is a group. 10. Suppose (H, ∗) and (K, ∗) are subgroups of (G, ∗). We use Theorem 8.6 to show that (H ∩ K, ∗) is a subgroup of (G, ∗). First note that e ∈ H and e ∈ K so that e ∈ H ∩ K. Therefore H ∩ K is non-empty and clearly H ∩ K is a subset of G. Let x, y ∈ H ∩ K. Then x, y ∈ H so xy ∈ H (because ∗ is a binary operation on H). Similarly, x, y ∈ K so xy ∈ K. Since xy ∈ H and xy ∈ K it follows that xy ∈ H ∩ K. Therefore H ∩ K satisfies condition (a) of Theorem 8.6. Since x ∈ H ∩ K we have x ∈ H and x ∈ K. Now (H, ∗) and (K, ∗) are subgroups of (G, ∗) and hence each is closed under taking inverses. Therefore x−1 ∈ H and x−1 ∈ K. Hence x−1 ∈ H ∩ K. Therefore H ∩ K satisfies condition (a) of Theorem 8.6. Since H ∩ K satisfies both properties of Theorem 8.6, it follows that (H ∩ K, ∗) is a subgroup of (G, ∗), as required. (H ∪ K, ∗) is not necessarily a subgroup of (G, ∗). A counter-example is given in the Hints and Solutions to Selected Exercises. Exercises 8.4

237

Discrete Mathematics: Proofs, Structures and Applications

11. The Cayley table for (Z7 − {[0]}, ×7 ) is given below. ×7 [1] [2] [3] [4] [5] [6]

[1] [1] [2] [3] [4] [5] [6]

[2] [2] [4] [6] [1] [3] [5]

[3] [3] [6] [2] [5] [1] [4]

[4] [4] [1] [5] [2] [6] [3]

[5] [5] [3] [1] [6] [4] [2]

[6] [6] [5] [4] [3] [2] [1]

In example 8.7.1, we have shown that ({[1], [2], [4]}, ∗) is a subgroup of (Z7 − {[0]}, ×7 ). Since [6] ×7 [6] = [1] it follows that ({[1], [6]}, ∗) is a subgroup of (Z7 − {[0]}, ×7 ). There are no other proper subgroups. (The elements [3] and [5] are both generators for (Z7 − {[0]}, ×7 ).) 12. The Cayley table for (T , ×) is given below. A A A B B C C D D

B B A D C

C C D A B

D D C B A

In exercise 8.2.1 (page 216) we showed that the set of all 2× 2 real matrices is a group under matrix multiplication. We denoted the group GL2 (R). We use Theorem 8.6 to show that T is a subgroup of GL2 (R). Each element in T is non-singular (each has determinant 1 or −1) so T is a non-empty subset of GL2 (R). Since only the elements A, B, C and D appear in the table, it follows that T is closed under matrix multiplication. Therefore T satisfies condition (a) of Theorem 8.6. Each element in T is self-inverse (since XX = A, the identity). Therefore T satisfies condition (b) of Theorem 8.6. Therefore, by Theorem 8.6, T is a subgroup of GL2 (R) (and is therefore a group). 13. Let (G, ∗) be a cyclic group with generator g and let (H, ∗) be a subgroup. Assume that G is not the trivial group (in which case the result is obvious). Every element of G can be expressed as g n for some n ∈ Z. Since H ⊆ G the same is true for the elements of H; that is, every element of H is of the form g n for some n ∈ Z. Let m be the smallest positive integer such that g m ∈ H. Claim: g m is a generator for H. Proof Let K = {(g m )k : k ∈ Z} be the set of elements generated by g m . We need to prove that K = H. 238

Exercises 8.4

Solutions Manual

Let a ∈ K. Then a = (g m )k for some k ∈ Z. Now g m ∈ H so any power of g m is also in H (by Theorem 8.8 applied to the group H). Therefore a ∈ H. This shows that K ⊆ H. Now let b ∈ H. Then b = g s for some s ∈ Z. By the Division Algorithm, dividing s by m, there exist q, r ∈ Z such that s = qm + r

where 0 ≤ r < m.

Therefore b = g qm+r = (g m )q g r so g r = b(g m )−q . Since b ∈ H and g m ∈ H, it follows that g r = b(g m )−q ∈ H. But m is the smallest positive integer such that g m ∈ H and r satisfies 0 ≤ r < m. The only possibility, therefore, is that r = 0. Hence b = (g m )q

so b ∈ K.

This shows that H ⊆ K. Since K ⊆ H and H ⊆ K, we have H = K which completes the proof of the claim. Since H has a generator (namely g m ), it is cyclic.

8.5

Solutions to Exercises 8.5

1. Let f : G1 → G2 be an isomorphism between (G1 , ∗) and (G2 , ◦). (1) Let y ∈ G2 . Then, since f is surjective, y = f (x) for some x ∈ G1 . Therefore y ◦ f (e) = = = =

f (x) ◦ f (e) f (x ∗ e) (from the isomorphism property) f (x) (since e ∈ G1 is the identity) y.

Similarly f (e) ◦ y = y. Therefore f (e) is the identity for G2 . (2) Suppose that (G1 , ∗) is abelian. Let y1 , y2 ∈ G2 . Since f is surjective, there exist x1 , x2 ∈ G1 such that y1 = f (x1 ) and y2 = f (x2 ). Then y1 ◦ y2 = = = = =

f (x1 ) ◦ f (x2 ) f (x1 ∗ x2 ) (from the isomorphism property) f (x2 ∗ x1 ) (since G1 is abelian) f (x2 ) ◦ f (x1 ) (from the isomorphism property) y2 ◦ y1 .

Therefore (G2 , ◦) is abelian. Conversely suppose that (G2 , ◦) is abelian. Then it follows that (G1 , ∗) is abelian from the argument above once we have established (see (4) below) that f −1 : G2 → G1 is also an isomorphism. Exercises 8.5

239

Discrete Mathematics: Proofs, Structures and Applications

(3) Let f (a) ∈ G2 (so that a ∈ G1 ). Then, denoting the identity elements of G1 and G2 by e1 and e2 respectively, we have: f (a) ◦ f (a−1 ) = f (a ∗ a−1 ) (from the isomorphism property) = f (e1 ) (since a ∗ a−1 = e1 in G1 ) = e2 (from part (1)). Similarly f (a−1 ) ◦ f (a) = e2 . Therefore f (a) is the inverse of f (a−1 ): [f (a)]−1 = f (a−1 ). (4) First note that, since f : G1 → G2 is a bijection, it follows (from Theorem 5.9) that f −1 : G2 → G1 is also a bijection. Let y1 , y2 ∈ G2 . Then there exist x1 , x2 ∈ G1 such that y1 = f (x1 ) and y2 = f (x2 ). Hence x1 = f −1 (y1 ) and x2 = f −1 (y2 ). Now y1 ◦ y2 = = −1 ⇒ f (y1 ◦ y2 ) = =

f (x1 ) ◦ f (x2 ) f (x1 ∗ x2 ) (from the isomorphism property for f ) x1 ∗ x2 f −1 (y1 ) ∗ f −1 (y2 ).

Therefore f −1 : G2 → G1 is an isomorphism. (5) Let H1 be a subgroup of G1 and let H2 = {f (a) : a ∈ H1 }. Clearly H2 ⊆ G2 ; we shall use the Subgroup Test (Theorem 8.6) to show that H2 is a subgroup of G2 . Let b1 , b2 ∈ H2 . Then there exist a1 , a2 ∈ H1 such that b1 = f (a1 ) and b2 = f (a2 ). Then b1 ◦ b2 = f (a1 ) ◦ f (a2 ) = f (a1 ∗ a2 ) (from the isomorphism property). Since (H1 , ∗) is a group, a1 ∗ a2 ∈ H1 so b1 ◦ b2 = f (a1 ∗ a2 ) ∈ H2 . Therefore H2 is closed under ◦. Let b ∈ H2 . Then there exists a ∈ H1 such that b = f (a). Now a−1 ∈ H1 (since H1 is a group) so f (a−1 ) ∈ H2 . By part (3), b−1 = (f (a))−1 = f (a−1 ) ∈ H2 . Therefore H2 is closed under taking inverses. Since H2 satisfies both conditions of the Subgroup Test (Theorem 8.6), it follows that (H2 , ◦) is a subgroup of (G2 , ◦). The restriction of f to H1 , f |H1 : H1 → H2 is a bijection which satisfies the isomorphism property (because f does). Therefore (H1 , ∗) ∼ = (H2 , ◦). (6) Suppose that (G1 , ∗) is cyclic. Then there is a generator a ∈ G1 such that every x ∈ G1 can be written as x = an for some n ∈ Z. We aim to show that f (a) is a generator for G2 . Claim: for all integers n and for all g ∈ G1 , f (g n ) = (f (g))n . 240

Exercises 8.5

Solutions Manual

Proof: We first prove the result for all positive integers, by induction. When n = 1, the result is trivially true. Suppose that f (g k ) = (f (g))k for some positive integer k. Then f (g k+1 ) = = = =

f (g k ∗ g) f (g k ) ◦ f (g) (from the isomorphism property) k (f (g)) ◦ f (g) (from part the inductive assumption) (f (g))k+1 .

Therefore f (g n ) = (f (g))n for all positive integers n by induction. When n = 0, f (g n ) = f (g 0 ) = f (e1 ) = e2 = (f (g))0 = (f (g))n so the result holds in this case. Finally suppose that n is a negative integer. Then n = −m where m is a positive integer. Therefore f (g n ) = = = = = =

f (g −m ) f ((g −1 )m ) (f (g −1 ))m (from the result for positive integers) −1 m ((f (g)) ) (from part (3)) (f (g))−m (f (g))n .

Hence the result also holds for negative integers. Now it is straightforward to prove that f (a) is a generator for G2 . Let y ∈ G2 . Since f is surjective, y = f (x) for some x ∈ G1 . Now a is a generator for G1 so x = an for some n ∈ Z. Therefore, using the result above, y = f (x) = f (an ) = (f (a))n so f (a) is a generator for G2 so that (G2 , ◦) is cyclic. Suppose that(G2 , ◦) is cyclic. Then, since f −1 : G2 → G1 is an isomorphism, the result we have just proved applied to f −1 shows that (G1 , ∗) is cyclic. (7) Suppose that a ∈ G1 has order n, |a| = n. Then n is the smallest positive integer such that an = e1 . Now (f (a))n = f (an ) (using the claim proved in part (6)) = f (e1 ) = e2 (from part (1)). To establish |f (a)| = n we also need to show that no smaller power of f (a) equals the identity e2 . Suppose that (f (a))m = e2 where 1 ≤ m < n. Then f (am ) = f (e1 ). Since f is injective, this implies am = e1 where 1 ≤ m < n. This is a contradiction since n is the smallest positive integer such that an = e1 . Therefore n is the smallest positive integer such that (f (a))n = e2 so |f (a)| = n = |a|. Exercises 8.5

241

Discrete Mathematics: Proofs, Structures and Applications

2. Let (A, ∗) and (B, ◦) be algebraic structures and let f : A → B be a morphism. (a) Suppose that (A, ∗) is a semigroup. Then, for all a1 , a2 , a3 ∈ A, (a1 ∗ a2 ) ∗ a3 = a1 ∗ (a2 ∗ a3 ) ⇒ f [(a1 ∗ a2 ) ∗ a3 ] = f [a1 ∗ (a2 ∗ a3 )] ⇒ f (a1 ∗ a2 ) ◦ f (a3 ) = f (a1 ) ◦ f (a2 ∗ a3 ) ⇒ (f (a1 ) ◦ f (a2 )) ◦ f (a3 ) = f (a1 ) ◦ (f (a2 ◦ f (a3 )). Therefore ◦ is associative on f (A). Hence (f (A), ◦) is a semigroup. (b) Suppose that (A, ∗) is a monoid. Then ∗ is associative on A and A has an identity element, e1 , say. Part (a) establishes that ◦ is associative on f (A). We show that f (e1 ) is the identity element for (f (A), ◦). For all f (a) ∈ f (A), a ∗ e1 = a ⇒ f (a ∗ e1 ) = f (a) ⇒ f (a) ◦ f (e1 ) = f (a). Therefore f (e1 ) is the identity element for (f (A), ◦) so (f (A), ◦) is a monoid. (c) Suppose that (A, ∗) is a group. Part (b) establishes that ◦ is associative on f (A) and e2 = f (e1 ) is the identity for (f (A), ◦). It only remains to show that every element of f (A) has an inverse. Let f (a) ∈ f (A) where a ∈ A. Since (A, ∗) is a group, a has an inverse a−1 such that a ∗ a−1 = e1 . Now f (a) ◦ f (a−1 ) = f (a ∗ a−1 ) (since f is a morphism) = f (e1 ) = e2 (from part (b)). Therefore f (a−1 ) is the inverse of f (a): (f (a))−1 = f (a−1 ). Since each element of f (A) has an inverse, (f (A), ◦) is a group. 3. We first show that f is bijective. Since µ ¶ µ ¶ µ ¶ µ ¶ 1 n 1 m 1 n 1 m f =f ⇒ n=m ⇒ = , 0 1 0 1 0 1 0 1 it follows that f is injective. µ ¶ µ ¶ 1 n 1 n Let n ∈ Z. Then ∈ A and f = n, so f is surjective. 0 1 0 1 Therefore f is bijective. Now ·µ f

1 n 0 1

¶µ ¶¸ µ ¶ 1 m 1 n+m = f 0 1 0 1 = n+m µ ¶ µ ¶ 1 n 1 m = + 0 1 0 1

so f is an isomorphism. 242

Exercises 8.5

Solutions Manual

4. We note that the identity of (R, +) is 0 and the inverse of x ∈ R is −x ∈ R. (i) Since f (0) = −3 6= 0, the mapping f fails part (1) of Theorem 8.11. Therefore f is not a morphism. (ii) Let x, y ∈ R. Then f (x + y) = 5(x + y) = 5x + 5y = f (x) + f (y), so f is a morphism. Let x, y ∈ R. Then f (x) = f (y) ⇒ 5x = 5y ⇒ x = y. so f is injective. Let y ∈ R. Then

y 5

∈ R and f

³y ´ 5

=5×

y = y, 5

so f is surjective. Therefore f is a bijective so f is an isomorphism. (iii) Since f (1 + 2) = f (3) = 32 = 9 but f (1) + f (2) = 12 + 22 = 1 + 4 = 5, we have f (1 + 2) 6= f (1) + f (2). Therefore f is not a morphism. [Note that any counter-example is sufficient to show that f is not a morphism.] (iv) Let x, y ∈ R. Then f (x + y) =

x+y x y = + = f (x) + f (y), 2 2 2

so f is a morphism. Let x, y ∈ R. Then f (x) = f (y) ⇒ so f is injective. Let y ∈ R. Then 2y ∈ R and f (2y) =

y x = ⇒ x = y. 2 2

2y = y, 2

so f is surjective. Therefore f is a bijective so f is an isomorphism. Exercises 8.5

243

Discrete Mathematics: Proofs, Structures and Applications

(v) Since f (−1 + 2) = f (1) = |1| = 1 but f (−1) + f (2) = | − 1| + |2| = 1 + 2 = 3, we have f (−1 + 2) 6= f (−1) + f (2). Therefore f is not a morphism. (vi) Since f (1 + 2) = f (3) = 23 = 8 but f (1) + f (2) = 21 + 22 = 2 + 4 = 6, we have f (1 + 2) 6= f (1) + f (2). Therefore f is not a morphism. 5.

(i) Let x, y ∈ R. Then f (x + y) = 2x+y = 2x 2y = f (x) × f (y). Therefore f is a morphism. Since 2x > 0 for all x ∈ R, there is no x ∈ R with f (x) = −1. Therefore f is not surjective. (An alternative is to note that the horizontal line through −1 does not meet the graph of the function – see example 8.12.1.) Therefore f is not an isomorphism. (ii) Since f (0) = 5 6= 1, f does not map the identity of (R, +) to the identity of (R − {0}, ×). Therefore, by Theorem 8.11, f is not a morphism. (iii) Let x, y ∈ R. Then f (x + y) = 1 = 1 × 1 = f (x) × f (y). Therefore f is a morphism. Since im(f ) = {1} 6= R−{0}, f is not surjective. Therefore f is not an isomorphism. (iv) Let x, y ∈ R. Then f (x + y) = 3−(x+y) = 3−x 3−y = f (x) × f (y). Therefore f is a morphism. Since 3−x > 0 for all x ∈ R, there is no x ∈ R with f (x) = −1. Therefore f is not surjective. Therefore f is not an isomorphism.

244

Exercises 8.5

Solutions Manual

6. Let (A, ∗) and (B, ◦) be algebraic structures with identity elements eA and eB respectively. Let b ∈ f (A). Then there exists a ∈ A such that b = f (a). Now b ◦ f (eA ) = = = =

f (a) ◦ f (eA ) f (a ∗ eA ) (by the morphism property for f ) f (a) (since eA is the idfentity for A) b.

Therefore f (eA ) is the identity element for (f (A), ◦): eB = f (eA ). 7. The Cayley table for T is the following. A A A B B C C D D For example,

B B C D A

C C D A B

D D A B C

µ BC =

¶µ ¶ µ ¶ 0 1 −1 0 0 −1 = = D. −1 0 0 −1 1 0

Matrix multiplication is a binary operation on T since only elements of T appear in the table; ie T is closed under matrix multiplication. Matrix multiplication is associative (see chapter 6.3). The matrix A is the identity element since AX = X for all X ∈ T . Each element has an inverse: B −1 = D, C −1 = C and D−1 = B. Therefore (T , ×) is a group (where × denotes matrix multiplication). (See exercise 8.4.12, page 238, for a different approach to the proof that T is a group.) The Cayley table for Z5 , −{0}, ×5 ) is given in Exercise 8.2.4 on page 217. An isomorphism f : T → Z5 − {0} is given by: f : A 7→ [1], B 7→ [2], C 7→ [4], D 7→ [3]. That f is an isomorphism is clear if we reorder the Cayley table for Z5 , −{0}, ×5 ) as shown below and compare it with the Cayley table for (T , ×) given above. ×5 [1] [2] [4] [3]

[1] [1] [2] [4] [3]

[2] [2] [4] [3] [1]

[4] [4] [3] [1] [2]

[3] [3] [1] [2] [4]

It is worth noting that the isomorphism f is not unique. The mapping g : T → Z5 − {0} is given by g : A 7→ [1], B 7→ [3], C 7→ [4], D 7→ [2] ∼ (Z5 , −{0}, ×5 ). also defines an isomorphism (T , ×) = Exercises 8.5

245

Discrete Mathematics: Proofs, Structures and Applications

8. Let x, y ∈ G. Then f (xy) = g −1 xyg = g −1 xeyg = g −1 x(gg −1 )yg = (g −1 xg)(g −1 yg) = f (x)f (y). Therefore f is a morphism. We now need to show that f is bijective. Let x, y ∈ G. Then ⇒ ⇒ ⇒ ⇒ ⇒

f (x) g −1 xg gg −1 xg xg xgg −1 x

= = = = = =

f (y) g −1 yg gg −1 yg yg ygg −1 y

(multiplying on the left by g) (since gg −1 = e) (multiplying on the right by g −1 ) (since gg −1 = e).

Therefore f is injective. Let z ∈ G. Let x = gzg −1 . Then x ∈ G and f (x) = g −1 xg = g −1 (gzg −1 )g = (g −1 g)z(g −1 g) = eze = z, so f is surjective. Therefore f is bijective so f is an isomorphism. 9.

(i) Let x, y ∈ R∗ . Then f (xy) = (xy)2 = x2 y 2 = f (x)f (y), so f is a morphism from (R∗ , ×) to itself. (ii) The result is an ‘if and only if’ result so there are two parts to the proof. (⇒) Suppose that f : G → G, x 7→ x2 is a morphism. Let x, y ∈ G. Then f (xy) = f (x)f (y) (since f is a morphism) ⇒ (xy)2 = x2 y 2 ⇒ xyxy = xxyy −1 ⇒ x xyxyy −1 = x−1 xxyyy −1 (multiplying on the left by x−1 and on the right by y −1 ) −1 −1 −1 −1 ⇒ (x x)yx(yy ) = (x x)xy(yy ) ⇒ eyxe = exye ⇒ yx = xy. Therefore G is abelian. (⇐) Suppose that G is abelian.

246

Exercises 8.5

Solutions Manual

Let x, y ∈ G. Then f (xy) = = = = =

(xy)2 x(yx)y x(xy)y (since G is abelian) 2 2 x y f (x)f (y).

Therefore f is a morphism. 10. Let x1 , x2 ∈ G1 . Then (g ◦ f )(x1 ∗ x2 ) = = = =

g[f (x1 ∗ x2 )] g[f (x1 ) ◦ f (x2 )] (since f is a morphism) g[f (x1 )] . g[f (x2 )] (since g is a morphism) (g ◦ f )(x1 ) . (g ◦ f )(x2 ).

Therefore g ◦ f is a morphism. 12.

(i) Recall from Example 8.3.2 that the free semigroup generated by A = {a} is A∗ which comprises all strings over A. Since A comprises a single letter a, a string over A is just a non-empty sequence of a’s: aa . . . a. Define f : A∗ → Z+ by f (aa . . . a) = the number of symbols in the string. Since there is a unique string with n letters for each n ∈ Z+ , it is clear that f is a bijection. It will help to introduce some notation. Let an denote the string of n a’s: an = aa . . . a. ← n →

Thus f is the mapping an 7→ n. Now f (an ∗ am ) = f (an+m ) = n + m = f (an ) + f (am ), so f is a morphism. Since f is also bijective, it is an isomorphism so (A, ∗) ∼ = (Z+ , +). (ii) The free monoid is A∗ ∪ {λ} where A∗ is given in part (i) and λ is the empty string. If we extend the notation from part (i) to include λ = a0 , then it should be clear that the mapping f : A∗ ∪ {λ} → N, f (an ) = n, defines an isomorphism (A∗ ∪ {λ}, ∗) ∼ = (N, +) in a similar way to part (i). (iii) A construction of the free group F (A) is given in exercise 8.2.12. The elements of F (A) are of three types: • an a string of n copies of a for some n ∈ Z+ ; • the empty string λ = a0 ; • a ¯n , a string of n copies of a ¯ for some n ∈ Z+ . Exercises 8.5

247

Discrete Mathematics: Proofs, Structures and Applications

The binary operation is concatenation of strings followed by successive removal of pairs of the form a¯ a or a ¯a. We may summarise this by noting that λ is the identity element and: n+m an ∗ am = a ½ n−m a an ∗ a ¯m = a ¯m−n ½ n−m a a ¯m ∗ an = a ¯m−n

if n ≥ m if n < m if n ≥ m if n < m

a ¯n ∗ a ¯m = a ¯n+m . A simple extension of the notation introduced earlier simplifies this greatly. Let a ¯m = a−m . Then the binary operation defined above is simplifies to an ∗ am = an+m in all cases (including when n = 0). Now it is clear that f : F (A) → Z, f (an ) = n defines a bijection. Further, since f (an ∗ am ) = f (an+m ) = n + m = f (an ) + f (am ), we see that f is an isomorphism. Therefore (F (A), ∗) ∼ = (Z, +). 13. The Cayley table for (T , ×) is given in the solution to Exercise 8.4.12 (page 238) and the Cayley table for the symmetries of the rectangle {r0 , r1 , m1 , m2 } is given in the solution to Exercise 8.3.4 (page 225). These tables are repeated below. × A B C A A B C B B A D C C D A D D C B

D D C B A

∗ r0 r1 m1 m2 r0 r0 r1 m1 m2 r1 r1 r0 m2 m1 m1 m1 m2 r0 r1 m2 m2 m1 r1 r0

A bijection f : T → {r0 , r1 , m1 , m2 } that also maps the first Cayley table to the second is given by A 7→ r0 , B 7→ r1 , C 7→ m1 , D 7→ m2 . Therefore (T , ×) ∼ = ({r0 , r1 , m1 , m2 }, ∗). 14. (a) (i) Since f (x) = 0 ⇒ 7x = 0 ⇒ x = 0, the only element that maps to 0 is 0 itself. Therefore ker(f ) = {0}. (ii) The same argument as given in part (i) shows that ker(f ) = {0}. (iii) For all x ∈ R, f (x) = 0 so every real number lies in the kernel; ker(f ) = R. (iv) The identity element of (R+ , ×) is 1 so the kernel contains those elements of R that map to 1. Now f (x) = 1 ⇒ 2x = 1 ⇒ x = 0, so ker(f ) = {0}. 248

Exercises 8.5

Solutions Manual

(v) The identity element of (Z6 , +6 ) is the equivalence class [0] = {. . . , −12, −6, 0, 6, 12, 18, . . .} = {6n : n ∈ Z}. Now f (x) = [0] ⇔ [x] = [0] ⇔ x ∈ {. . . , −12, −6, 0, 6, 12, 18, . . .}. Hence ker(f ) = {. . . , −12, −6, 0, 6, 12, 18, . . .} = {6n : n ∈ Z}. (vi) The mapping is: [0] 7→ [0], [1] 7→ [2], [2] 7→ [4], [3] 7→ [0], [4] 7→ [2], [5] 7→ [4]. Therefore ker(f ) = {[0], [3]}.

8.6

Solutions to Exercises 8.6

1. Bit-wise addition modulo 2 ⊕ defines a binary operation on B n since addition of two elements of B n gives another element of B n . Also, since addition modulo 2 +2 is associative, it follows that ⊕ is associative. The identity element is the zero word, 0 = 00 . . . 0 since 0 + x = x for all x ∈ B n . Since 0 +2 0 = 0 and 1 +2 1 = 0, it follows that x ⊕ x = 0 for all x ∈ B n . Therefore every element of B n is self-inverse, x−1 = x. Since all of the group axioms are satisfied (B n , ⊕) is a group. 2. The generator matrix G is given by   1 0 0 1 0 0 1 0 0 G = 0 1 0 0 1 0 0 1 0 . 0 0 1 0 0 1 0 0 1 The minimum distance between codewords is 3 (since the minimum distance between 3bit words x1 x2 x3 is 1 and the blocks are repeated three times). Therefore, by Theorems 8.12 and 8.13, the code is 2-error detecting and 1-error correcting. 3. The generator matrix is of the form G = (I3 F ) where   1 0 0 F = 1 1 0 . 0 1 1 By Theorem 8.15, a parity check matrix is of the form H = (F T I3 ). This gives   1 1 0 1 0 0 H = 0 1 1 0 1 0 . 0 0 1 0 0 1 Exercises 8.6

249

Discrete Mathematics: Proofs, Structures and Applications

(i) Since the syndrome is

  1 1     0 1  = 0 , H 0   0 0 1

it follows that the received word 111001 is a codeword and was probably correctly transmitted. (Note that the codeword 111001 is the sum of all three rows of the generator matrix.) (ii) The syndrome is

  1 0     1 1  = 0 . H 0   0 1 1

Since the syndrome is not zero, the received word is not a codeword so there was an error in transmission. Note that, although we can identify that an error has occurred, we cannot reliably correct the error. The syndrome is the first column of the parity check matrix H; this would suggest that the first bit is in error and the transmitted word was 001011. Note that this is a codeword; it is the third row of the generator matrix G. Note that the syndrome is also the fourth column of the parity check matrix. This would suggest that the fourth bit is in error and the transmitted word was 101111. Note that this is a codeword; it is the sum of the first and third rows of the generator matrix G. This code has minimum distance 2 so cannot correct a single error. This example shows that the received word is distance 1 from two different codewords which is why the error cannot reliably be corrected. (iii) The syndrome is (0 0 0)T so is is most likely that the word was correctly transmitted. The received word is a codeword; it is the third row of the generator matrix G. (iv) The syndrome is

  1 0     0 1  = 1 . H 1   0 0 1

Since the syndrome is not zero, the received word is not a codeword so there was an error in transmission. The syndrome is the 5th column of H so it is most likely that the 5th bit was in error and that the codeword 101111 was transmitted. (This codeword is the sum of the first and third of the rows of G.) 250

Exercises 8.6

Solutions Manual

Note that, unlike in part (ii), there is only one codeword that is distance 1 from the received word so that, on this occasion, the error can be corrected. (v) The syndrome is

  0 1     0 1    H   = 1 . 1 0 1 1

Since the syndrome is not zero, the received word is not a codeword so there was an error in transmission. The syndrome is the 5th column of H so it is most likely that the 5th bit was in error and that the codeword 011101 was transmitted. (This codeword is the sum of the second and third of the rows of G.) As in part (iv), there is only one codeword that is distance 1 from the received word which is why the error can be corrected. 4. Let C = {00000, 101010, 01111, 11010}. Since x ⊕ x = 0 = 00000 ∈ C for all x ∈ C and 10101 ⊕ 01111 = 11010 ∈ C 10101 ⊕ 11010 = 01111 ∈ C 01111 ⊕ 11010 = 10101 ∈ C it follows that C is closed under ⊕. We know that (B 5 , ⊕) is a group (see the solution to exercise 8.6.1, page 249). Therefore, by the Finite Subgroup Test (Theorem 8.7), (C, ⊕) is a subgroup of (B 5 , ⊕) and is therefore a group. The minimum weight of non-zero codewords is 3 so, by Theorem 8.14, the minimum distance of C is 3. Therefore (i) C can detect 2 errors, by Theorem 8.12; (ii) C can correct 1 error, by Theorem 8.13. 5. Note that H is of the form (F I3 ) where F is a 3 × 4 matrix. It follows from Theorem 8.15 that a generator matrix is of the form (I4 F T ). Hence 

1 0 G= 0 0

0 1 0 0

0 0 1 0

0 0 0 1

1 0 1 1

1 1 1 0

 0 1 . 1 1

Therefore n = 7 and m = 4. Note that we can obtain m and n directly from H rather than first computing G. It follows from Theorem 8.15 that a parity check matrix is an (m − n) × n matrix. Here H is an 3 × 7 matrix so n = 7 and m = 4. Exercises 8.6

251

Discrete Mathematics: Proofs, Structures and Applications

6. A generator matrix is G = (Im F ) where F 1:  1 0 0 1  F = . .  .. ..

is the m × 1 matrix with all entries equal to  ··· 0 1 · · · 0 1  . . . .. ..  . . .

0 0 ··· 1 1 The parity check matrix is the 1 × (m + 1) matrix H = (F T 1) = (1 1 . . . 1 1). 7. For each received word, w, we evaluate the syndrome HwT .   1 (i) HwT = 0. 0 The syndrome is non-zero, so the word has not been correctly transmitted. The syndrome is the 4th column of H so it is most likely that the error is in the 4th bit and the codeword 011101 was transmitted.   0 (ii) HwT = 0 so the received word is a codeword and, most probably, there has 0 been no error.   1 (iii) HwT = 1. 1 The syndrome is non-zero, so the word has not been correctly transmitted. The syndrome is not equal to any column of H indicating that there is an error in more than one bit. For example, there are three ways that two errors could have occurred: • the syndrome is the sum of the 3rd and 4th columns of H so it could be that there are errors in the 3rd and 4th bits; • the syndrome is the sum of the 2nd and 6th columns so that it could be that there are errors in the 2nd and 6th bits; • the syndrome is the sum of the 1st and 5th columns so that it could be that there are errors in the 1st and 5th bits.   1 (iv) HwT = 1. 0 The syndrome is non-zero, so the word has not been correctly transmitted. The syndrome is the 2nd column of H so it is most likely that the error is in the 2nd bit and the codeword 101110 was transmitted. 8. For the code to be able to correct one error, the minimum distance must be 3. The columns of the parity check matrix must be distinct and non-zero. Each column has r entries so there are 2r −1 possible distinct non-zero columns. Thus the maximum number of digits in a codeword is 2r − 1. Since r of the bits are check digits, it follows that the maximum number of information bits is 2r − r − 1. 252

Exercises 8.6

Solutions Manual

9. The converse of Theorem 8.15 is the following. Let G be an m × n generator matrix such that G = (Im F ) where F is an m × r matrix and m = n − r. Let an encoding function E : B m → B n be defined by E(x) = xG for any x ∈ B m . For any w ∈ B m , if HwT = 0r×1

where H = (F T Ir )

then w is a codeword.

Exercises 8.6

253

Chapter 9

Introduction to Number Theory 9.1 1.

Solutions to Exercises 9.1 (i) (b) gcd(1485, 1745) 1745 = 1 × 1485 + 260 1485 = 5 × 260 + 185 260 = 1 × 185 + 75 185 = 2 × 75 + 35 75 = 2 × 35 + 5 35 = 7 × 5 + 0 Hence gcd(1485, 1745) = 5. (d) gcd(13 376, 7980) 13 376 = 1 × 7980 + 5396 7980 = 1 × 5396 + 2584 5396 = 2 × 2584 + 228 2584 = 11 × 228 + 76 228 = 3 × 76 + 0 Hence gcd(13 376, 7980) = 76. (ii) (b) gcd(1485, 1745) 5 = 75 − 2 × 35 = 75 − 2 × (185 − 2 × 75) = −2 × 185 + 5 × 75 = −2 × 185 + 5 × (260 − 1 × 185) = 5 × 260 − 7 × 185 = 5 × 260 − 7 × (1485 − 5 × 260) = −7 × 1485 + 40 × 260 254

Solutions Manual

= −7 × 1485 + 40 × (1745 − 1 × 1485) = −47 × 1485 + 40 × 1745. (d) gcd(13 376, 7980) 76 = 2584 − 11 × 228 = 2584 − 11 × (5396 − 2 × 2584) = −11 × 5396 + 23 × 2584 = −11 × 5396 + 23 × (7980 − 5396) = 23 × 7980 − 34 × 5396 = 23 × 7980 − 34 × (13 376 − 7980) = −34 × 13 376 + 57 × 7980. 2. (ii) If a|b and c|d then ac|bd. Proof Suppose a|b and c|d. Then there exist m, n ∈ N such that b = ma and d = nc. Therefore bd = (mn)(ac) where nm ∈ N, so ac|bd. 4. 21 = −59 × 273 + 8 × 2016. 5. Let a and b be integers. Suppose that a and b are coprime. Then, by B´ezout’s identity, there exist integers m and n such that 1 = ma + nb. Hence, for any integer c, we have c = cma + cnb = sa + tb where s = cm and t = cn. Conversely, suppose that every integer c can be expressed as c = sa + tb for some integers s and t. In particular, 1 can be expressed as 1 = sa + tb for some integers s and t. By Theorem 9.6, gcd(a, b) is the smallest positive integer that can be expressed as sa+tb. Hence gcd(a, b) = 1 so a and b are coprime. 6. Of the three integers, only 228 is a multiple of 76 = gcd(13 276, 7980). Hence only 228 can be expressed as 13 376s + 7980t. In fact, from question 1 (ii) (d), we have 228 = 3 × 76 = −102 × 13 376 + 171 × 7980. 7. (ii) 101 is prime so 54 and 101 are coprime. 8.

(i) (a) gcd(63, 165, 297) gcd(63, 165) = 3 ⇒

gcd(63, 165, 297) = gcd(gcd(63, 165), 297) = gcd(3, 297) = 3.

Exercises 9.1

255

Discrete Mathematics: Proofs, Structures and Applications

(c) gcd(72, 48, 108, 54) gcd(72, 48) = 24 gcd(72, 48, 108) = gcd(24, 108) = 12 ⇒ gcd(72, 48, 108, 54) = gcd(12, 54) = 6. ⇒

(ii) Suppose that c|a1 , c|a2 , . . . , c|ak . Then there exist integers l1 , l2 , . . . lk such that a1 = l1 c, a2 = l2 c, . . . ak = lk c. Let n1 , n2 , . . . , nk ∈ Z. Then n1 a1 + n2 a2 + . . . + nk ak = n1 l1 c + n2 l2 c + . . . + nk lk c = c(n1 l1 + n2 l2 + . . . + nk lk ) = cM

where M = n1 l1 + n2 l2 + . . . + nk lk ∈ Z.

Hence c|(n1 a1 + n2 a2 + . . . + nk ak ). 9.

(i) gcd(21, 13) 21 = 1 × 13 + 8 13 = 1 × 8 + 5 8 = 1×5+3 5 = 1×3+2 3 = 1×2+1 2 = 1×1+1 1 = 1×1+0 Hence gcd(21, 13) = 1. (iii) gcd(21, 13) = 1 = 2−1 = 2 − (3 − 2) = −3 + 2 × 2 = −3 + 2 × (5 − 3) = 2×5−3×3 = 2 × 5 − 3 × (8 − 5) = −3 × 8 + 5 × 5 = −3 × 8 + 5 × (13 − 8) = 5 × 13 − 8 × 8 = 5 × 13 − 8 × (21 − 13) = −8 × 21 + 13 × 13.

256

Exercises 9.1

Solutions Manual

(iv) For all n ∈ Z+ , (−1)n+1 an an+2 + (−1)n+2 a2n+1 = 1. Proof Base case When n = 1, (−1)n+1 an an+2 + (−1)n+2 a2n+1 = a1 a3 − a22 = 1 × 2 − 12 = 1, so the result holds when n = 1. Inductive step Suppose that, (−1)k+1 ak ak+2 + (−1)k+2 a2k+1 = 1. Then (−1)k+2 ak+1 ak+3 + (−1)k+3 a2k+2 = (−1)k+2 ak+1 (ak+2 + ak+1 ) + (−1)k+3 (ak+1 + ak )ak+2 = (−1)k+2 ak+1 ak+2 + (−1)k+2 a2k+1 + (−1)k+3 ak+1 ak+2 + (−1)k+3 ak ak+2 = (−1)k+2 ak+1 ak+2 + (−1)k+2 a2k+1 + (−1)k+1 ak+1 ak+2 + (−1)k+1 ak ak+2 (since (−1)k+3 = (−1)k+1 ) = (−1)k+1 (−ak+1 ak+2 + ak+1 ak+2 ) + (−1)k+2 a2k+1 + (−1)k+1 ak ak+2 = 0 + (−1)k+2 a2k+1 + (−1)k+1 ak ak+2 = 1

(by the inductive assumption).

This is the result for n = k + 1. Therefore (−1)n+1 an an+2 + (−1)n+2 a2n+1 = 1 for all n ∈ Z+ , by induction. 10. Let a and b be integers such that b = a + 1 and let p be a prime number. If p|a then the next smallest integer that p divides is a + p. Therefore, if p divides a then p does not divide b. Therefore a and b have no common prime factors. Hence a and b have no common factors greater than 1, so a and b are coprime.

9.2 1.

Solutions to Exercises 9.2 (i) (b) 792 = 8 × 99 = 23 × 9 × 11 = 23 × 32 × 11. (d) 22 680 = 567 × 40 = 9 × 63 × 5 × 8 = 32 × 7 × 9 × 5 × 23 = 23 × 34 × 5 × 7. (ii) (a) gcd(1008, 792) = gcd(24 × 32 × 7, 23 × 32 × 11) = 23 × 32 = 72. (c) gcd(3276, 22 680) = gcd(22 × 32 × 7 × 13, 23 × 34 × 5 × 7) = 22 × 32 × 7 = 252. (d) gcd(1008, 792, 3276) = gcd(24 ×32 ×7, 23 ×32 ×11, 22 ×32 ×7×13) = 22 ×32 = 36.

2.

(i) The first sequence of 3 consecutive composite positive integers is: 8, 9, 10. (iii) For each integer n ≥ 2, the sequence of n − 1 positive integers n! + 2, n! + 3, n! + 4, . . . , n! + n are all composite.

Exercises 9.2

257

Discrete Mathematics: Proofs, Structures and Applications

Proof First note that n! = 1 × 2 × 3 × 4 × . . . × (n − 1) × n is divisible by 2, 3, 4, . . . n. Therefore n! + 2 is divisible by 2, n! + 3 is divisible by 3, n! + 4 is divisible by 4, . . . , n! + n is divisible by n. Hence each of the integers n! + 2, n! + 3, n! + 4, . . . , n! + n is composite. 4. Let p be prime and let a1 , a2 , . . . , an ∈ Z+ . If p|(a1 a2 . . . an ) then p|ai for some i = 1, 2, . . . , n. Proof The proof is by induction on n, the number of terms in the product. When n = 1 the result is ‘p|a1 ⇒ p|a1 ’ which is trivially true. Suppose the result is true when n = k; that is, if p|(a1 a2 . . . ak ) where a1 , a2 , . . . , ak ∈ Z+ then p|ai for some i = 1, 2, . . . , k. Now let a1 , a2 , . . . , ak+1 ∈ Z+ and suppose p|(a1 a2 . . . ak+1 ). Let a = a1 a2 . . . ak and b = ak+1 . Then we have p|ab so, by Theorem 9.8 (b), p|a or p|b. In the first case, we have p|(a1 a2 . . . ak ) so, by the inductive hypothesis, p|ai for some i = 1, 2, . . . , k. In the second case p|ak+1 . Therefore p|ai for some i = 1, 2, . . . , k + 1. This completes the inductive step. Therefore the result holds for all n ∈ Z+ , by induction. 6.

4= 12= 20= 28=

2+2 5+7 7 + 13 5 + 23

6= 14= 22= 30=

3+3 7+7 11 + 11 13 + 17.

8= 3 + 5 16= 5 + 11 24= 7 + 17

10= 5 + 5 18= 7 + 11 26= 13 + 13

7. (ii) Let p be prime and a and b be positive integers such that gcd(a, p2 ) = p and gcd(b, p3 ) = p2 . Then a = k1 p where gcd(k1 , p) = 1 and b = k2 p2 where gcd(k2 , p) = 1. Hence ab = k1 k2 p3 where gcd(k1 k2 , p) = 1. Therefore gcd(ab, p4 ) = p3 . (iv) Let gcd(a, b) = p. Then a = k1 p and b = k2 p where k1 , k2 ∈ Z+ are coprime. Note that a3 = k13 p3 so p3 divides a3 . We consider three cases. Case 1: k2 is a multiple of p2 . Then k2 = k20 p2 so b = k20 p3 . Therefore p3 divides both a3 and b and p3 is the highest power of p that divides a3 . Hence gcd(a3 , b) = p3 . Case 2: k2 is a multiple of p but is not a multiple of p2 . Then k2 = k20 p so b = k20 p2 . Therefore p2 divides both a3 and b and p2 is the highest power of p that divides b. Hence gcd(a3 , b) = p2 . Case 3: k2 is not a multiple of p. Therefore p divides both a3 and b and p is the highest power of p that divides b. Hence gcd(a3 , b) = p.

258

Exercises 9.2

Solutions Manual

9.3 2.

Solutions to Exercises 9.3 (i) The congruence classes modulo 6 are the following. [0] = {. . . , −12, −6, 0, 6, 12 . . .} [1] = {. . . , −11, −5, 1, 7, 13, . . .} [2] = {. . . , −10, −4, 2, 8, 14, . . .} [3] = {. . . , −9, −3, 3, 9, 15, . . .} [4] = {. . . , −8, −2, 4, 10, 16, . . .} [5] = {. . . , −7, −1, 5, 11, 17, . . .}. (ii) Z6 = {[0], [1], [2], [3], [4], [5]}. + [0] [1] [2] [3] [4] [5]

[0] [0] [1] [2] [3] [4] [5]

[1] [1] [2] [3] [4] [5] [0]

[2] [2] [3] [4] [5] [0] [1]

[3] [3] [4] [5] [0] [1] [2]

[4] [4] [5] [0] [1] [2] [3]

[5] [5] [0] [1] [2] [3] [4]

− [0] [1] [2] [3] [4] [5]

[0] [0] [1] [2] [3] [4] [5]

[1] [5] [0] [1] [2] [3] [4]

[2] [4] [5] [0] [1] [2] [3]

[3] [3] [4] [5] [0] [1] [2]

[4] [2] [3] [4] [5] [0] [1]

[5] [1] [2] [3] [4] [5] [0]

× [0] [1] [2] [3] [4] [5]

[0] [0] [0] [0] [0] [0] [0]

[1] [0] [1] [2] [3] [4] [5]

[2] [0] [2] [4] [0] [2] [4]

[3] [0] [3] [0] [3] [0] [3]

[4] [0] [4] [2] [0] [4] [2]

[5] [0] [5] [4] [3] [2] [1]

3. In Z3 = {[0], [1], [2]}, [1] = [4] since 4 − 1 = 3. Now [24 ] = [16] = [1] 6= [2] = [21 ]. 4.

(i) 11 × 19 ≡ 11 × −4 = −44 ≡ 2 mod 23. (iii) 33 × 17 ≡ 4 × 17 ≡ 4 × −6 = −24 ≡ −1 ≡ 22 mod 23. (iv) 52 ≡ 2 mod 23 so 512 ≡ 26 = 2 × 32 ≡ 2 × 9 = 18 mod 23.

5.

(i) 23459 ≡ 9 mod 10 so 234593 ≡ 93 = 729 ≡ 9 mod 10, so the last decimal digit of 234593 is 9.

Exercises 9.3

259

Discrete Mathematics: Proofs, Structures and Applications

(iii) 4! = 24 ≡ 4 mod 10 and, for n ≥ 5, n! ≡ 0 mod 10 since n! has a factor 5×2 = 10. Therefore 1! + 2! + 3! + · · · + 10! ≡ 1 + 2 + 6 + 4 ≡ 3 mod 10. Hence the last decimal digit of 1! + 2! + 3! + · · · + 10! is 3. 8. (ii) Since 11 is prime this has a unique solution which is x = 9 since 5 × 9 = 45 ≡ 1 mod 11. (iv) 18x ≡ 42 mod 50 gcd(18, 50) = 2 and 2|42 so 18x ≡ 42 mod 50 has solutions. Any solution is also a solution of 9x ≡ 21 mod 25. For this congruence, 9 and 25 are coprime and 3 divides both 9 and 21. Hence any solution is also a solution of 3x ≡ 7 mod 25. Note that 7 ≡ −18 = 3 × (−6) mod 25 so 3x ≡ 7 mod 25 has solution x = −6 ≡ 19 mod 25. Hence x = 19 is also the solution of the original congruence 18x ≡ 42 mod 50 in the range 0 ≤ x < 24. The other solution is x = 19 + 25 = 44. Therefore 18x ≡ 42 mod 50 has solutions x = 19, 44. (vii) 16x ≡ 301 mod 595 gcd(16, 595) = 1 so 16x ≡ 301 mod 595 has a unique solution. gcd(16, 301) = 1 so no further simplification of the congruence is possible. Since 16 × 19 = 304 and 16 × 37 = 592 ≡ −3 mod 595, we have 16 × 56 = 16 × (19 + 37) ≡ 304 − 3 = 301 mod 595 so x = 56 is the unique solution.

9.4

Solutions to Exercises 9.4

1. (ii) φ(30) = φ(2) × φ(3) × φ(5) = 1 × 2 × 4 = 8. (iv) φ(32) = 16 since the integers m coprime with 32 in the range 1 ≤ m < 32 are: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29 and 31. (vi) φ(195) = φ(5) × φ(19) = 4 × 18 = 72. (viii) φ(385) = φ(5) × φ(7) × φ(11) = 4 × 6 × 10 = 240. 2. (ii) Conjecture: if p is prime, then φ(p2 ) = p(p − 1). Proof The only integers in the range 1, 2, . . . , p, p + 1, p + 2, . . . , 2p, 2p + 2, . . . , 3p, . . . p2 which are divisible by p are p, 2p, 3p, . . . , p2 . There are p such integers. Hence φ(p2 ) = p2 − p = p(p − 1). 260

Exercises 9.4

Solutions Manual

3.

(i) (b) 143 ≡ 27 mod 209 ⇒ 146 ≡ 272 ≡ 102 mod 209 ⇒ 147 ≡ 14 × 102 ≡ 174 mod 209. (c) M = 195 ≡ −14 mod 209. Hence, using part (b), 1957 ≡ (−14)7 ≡ −174 ≡ 35

mod 209.

Therefore M 0 = 35. (ii) (a) M 0 = 3 ⇒ M = 3103 mod 209. ⇒ ⇒ ⇒ ⇒ ⇒

35 ≡ 34 mod 209 310 ≡ 342 ≡ 111 mod 209 320 ≡ 1112 ≡ 199 ≡ −10 mod 209 360 ≡ −103 ≡ −164 ≡ 45 mod 209 3100 ≡ 360 × (320 )2 ≡ 45 × 100 ≡ 111 mod 209 3103 ≡ 3100 × 27 ≡ 111 × 27 ≡ 71 mod 209.

Therefore M = 71. (b) Since M = 14 encrypts to M 0 = 174 (part (i) (b)) it follows that M 0 = 174 decrypts to M = 14. 4. (ii) M 0 = M 17 mod 57 Since n = 57 = 3 × 19 we have φ(57) = 2 × 18 = 36. Therefore we need to solve the equation 17d ≡ 1 mod 36. Now 17 × 2 ≡ −2 mod 36 and 17 × 3 ≡ 15 mod 36 ⇒ 17 × (7 × 2 + 3) ≡ 7 × (−2) + 15 ≡ 1 mod 36. Therefore d = 7 × 2 + 3 = 17 so the decryption scheme is M ≡ (M 0 )17

mod 57.

(iv) M 0 = M 11 mod 247 Since n = 247 = 13 × 19 we have φ(247) = 12 × 18 = 216. Therefore we need to solve the equation 11d ≡ 1 mod 216. Now 11 × 20 ≡ 4 mod 216 and 11 × 19 ≡ −7 mod 216 ⇒ 11 × (2 × 20 + 19) ≡ 2 × 4 − 7 ≡ 1 mod 216. Therefore d = 2 × 20 + 19 = 59 so the decryption scheme is M ≡ (M 0 )59

Exercises 9.4

mod 247.

261

Chapter 10

Boolean Algebra 10.1 1.

Solutions to Exercises 10.1 (i) (0 ⊕ 1) ∗ 0 = 1 ∗ 0 = 0. (ii) 0 ∗ ¯1 = 0 ∗ 0 = 0.

(iii) (1 ∗ 1) ⊕ (0 ∗ ¯0) = 1 ⊕ (0 ∗ 1) = 1 ⊕ 0 = 1. (iv) ¯1 ⊕ [(0 ∗ 1) ∗ 1] = 0 ⊕ (0 ∗ 1) = 0 ⊕ 0 = 0. ¯ ∗ 1) ∗ (0 ⊕ 1)] ⊕ 1 (v) [(0 ∗ 1) ∗ 1] ∗ (¯1 ⊕ 1)] ⊕ 1 = [(0 = [(1 ∗ 1) ∗ 1] ⊕ 1 = (1 ∗ 1) ⊕ 1 = 1 ⊕ 1 = 1. ¯ ¯ (vi) [1 ⊕ (1 ∗ 1)] ∗ (0 ⊕ 0) = [1 ⊕ (0 ∗ 1)] ∗ (1 ⊕ 0) = (1 ⊕ 0) ∗ 1 = (1 ∗ 1) ⊕ 1 = 1 ∗ 1 = 1. (vii) [(1 ∗ 1) ⊕ ¯0] ∗ [(1 ⊕ 0) ∗ 1] = (1 ⊕ 1) ∗ (1 ∗ 1) = 1∗¯ 1 = 1 ∗ 0 = 0. 2. (B1) For all x ∈ R, we have x + 0 = 0 + x = x and x × 1 = 1 × 1 = x so axiom B1 is satisfied. (B2) For all x, y, z ∈ R, we have (x + y) + z = x + (y + z) and (xy)z = x(yz), so axiom B2 is satisfied. (B3) For all x, y ∈ R, we have x + y = y + x and xy = yx so axiom B3 is satisfied. (B4) For all x, y, z ∈ R, we have x(y + z) = (xy) + (xz), so multiplication is distributive over addition. 262

Solutions Manual

However, in general, x + (yz) 6= (x + y)(x + z); for example, 1 + (2 × 3) = 1 + 6 = 7 6= 12 = 3 × 4 = (1 + 2) × (1 + 3). Hence addition is not distributive over multiplication. Therefore axiom B4 is not satisfied. (B5) For B5 to be satisfied, for each x ∈ R, we require there to be an element x ¯ ∈ R such that x+x ¯ = 1 and x¯ x = 0. Clearly no such x ¯ can be defined. Hence there is no unary operation ¯ for which B5 is satisfied. 3. Given integers a and b, we will write gcd(a, b) for their greatest common divisor or highest common factor and we will write lcm(a, b) for their least common multiple. The identities with respect to ⊕ and ∗ are 1 and 30 respectively since, for all b ∈ B, b ⊕ 1 = lcm(b, 1) = b and b ∗ 30 = gcd(b, 30) = b. We now verify that the five axioms are satisfied. (B1) We have identified distinct identity elements for the two operations. (B2) For all b1 , b2 , b3 ∈ B, we have (b1 ⊕ b2 ) ⊕ b3 = lcm(b1 , b2 , b3 ) = b1 ⊕ (b2 ⊕ b3 ), and (b1 ∗ b2 ) ∗ b3 = gcd(b1 , b2 , b3 ) = b1 ∗ (b2 ∗ b3 ). Hence axiom B2 is satisfied. (B3) The two operations are clearly commutative. (B4) It is true for positive integers in general that greatest common divisor and least common multiple are distributive over one another; that is, for all positive integers a, b, c, lcm(a, cgd(b, c)) = cgd(lcm(a, b), lcm(a, c)) and gcd(a, lcm(b, c)) = lcm(gcd(a, b), gcd(a, c)). Translated into our notation, these two equations are precisely the required statements that axiom B4 holds. We outline a proof of this below that some readers may wish to omit. Proof We first note how the greatest common divisor and least common multiple of two positive integers relate to their prime factorisation. Let a and b be positive integers and let p1 , p2 , . . . , pn be the prime numbers that occur in the prime factorisation of a or the prime factorisation of b (or both). Then Exercises 10.1

263

Discrete Mathematics: Proofs, Structures and Applications

there exist integers e1 , e2 , . . . , en and f1 , f2 , . . . , fn , each greater than or equal to zero, such that a = pe11 pe22 . . . penn and b = pf11 pf22 . . . pfnn . Note that, if pi is not a factor of a (or b) then ei = 0 (or fi = 0). For example, if a = 60 and b = 84 then we have a = 22 × 31 × 51 × 70 and b = 21 × 32 × 50 × 71 . Now Mn mn 1 M2 1 m2 and lcm(a, b) = pM gcd(a, b) = pm 1 p2 . . . pn 1 p2 . . . pn where, for i = 1, 2, . . . , n, mi = min{ei , fi } and Mi = max{ei , fi }. To illustrate this, with our example above where a = 60 and b = 84, we have gcd(60, 84) = 6 = 21 × 31 × 50 × 70 and lcm(60, 84) = 1260 = 22 × 32 × 51 × 71 . We can now turn to the results we wish to establish. Let a, b and c be positive integers and, this time, let p1 , p2 , . . . , pn be the prime numbers that occur in the prime factorisation of at least one of a, b or c. Then, for i = 1, 2, . . . , n, there exist integers ei , fi and gi such that a = pe11 pe22 . . . penn , b = pf11 pf22 . . . pfnn and c = pg11 pg22 . . . pgnn . It follows form the results above, firstly, that lcm(a, gcd(b, c)) = pα1 1 pα2 2 . . . pαnn where, for each i, αi = max{ei , min{fi , gi }} and, secondly, that gcd(lcm(a, b), lcm(a, c) = pβ1 1 pβ2 2 . . . pβnn where, for each i, βi = min{max{ei , fi }, max{ei , gi }}. Since max{e, min{f , g}} = min{max{e, f }, max{e, g}} for all integers e, f and g, it follows that lcm(a, gcd(b, c)) = gcd(lcm(a, b), lcm(a, c)). The proof of the other equality is similar. We have gcd(a, lcm(b, c)) = pγ11 pγ22 . . . pγnn where, for each i, γi = min{ei , max{fi , gi }} and

264

lcm(gcd(a, b), gcd(a, c) = pδ11 pδ22 . . . pδnn Exercises 10.1

Solutions Manual

where, for each i, δi = max{min{ei , fi }, min{ei , gi }}. Since min{e, max{f , g}} = max{min{e, f }, min{e, g}} for all integers e, f and g, it follows that gcd(a, lcm(b, c)) = lcm(gcd(a, b), gcd(a, c)). (B5) Let b ∈ B. Then b ⊕ ¯b = lcm(b, 30/b) = 30, the idenmtity for ∗ and

b ∗ ¯b = gcd(b, 30/b) = 1, the idenmtity for ⊕ .

Therefore axiom B5 is satisfied 4. See Hints and Solutions. Given the examples in questions 3 and 4, it may be worth noting when the set B of divisors of N , with the definitions for b1 ⊕ b2 = lcm(b1 , b2 ), b1 ∗ b2 = gcd(b1 , b2 ) and ¯b = N/b forms a Boolean algebra. Those values of N for which B is a Boolean algebra are products of distinct primes; for example 30 = 2 × 3 × 5 and 42 = 2 × 3 × 7. By contrast, those values of N for which B is a not Boolean algebra have the square of a prime as a factor; for example 24 = 23 × 3 (so 22 is a factor) and 45 = 32 × 5. 6. Recall that, from Theorem 9.2, given b ∈ B there is a unique element ¯b ∈ B such that b ⊕ ¯b = 1 and b ∗ ¯b = 0. From axiom B1, we have 0 ⊕ 1 = 1 ⊕ 0 = 1 and 0 ∗ 1 = 1 ∗ 0 = 0. Hence it follows that ¯ = 1 and 1 ¯ = 0. 0 7. Let b1 , b2 , b3 ∈ B. Following the hint, we consider the element [(b1 ⊕ b2 ) ⊕ b3 ] ∗ [b1 ⊕ (b2 ⊕ b3 )] ∈ B. From the the distributive law, axiom B4, we have   

[(b1 ⊕ b2 ) ⊕ b3 ] ∗ [b1 ⊕ (b2 ⊕ b3 )] = ([(b1 ⊕ b2 ) ⊕ b3 ] ∗ b1 ) ⊕ ([(b1 ⊕ b2 ) ⊕ b3 ] ∗ (b2 ⊕ b3 )) = a1 ⊕ a2

 

(10.1)

where a1 = [(b1 ⊕ b2 ) ⊕ b3 ] ∗ b1 and a2 = [(b1 ⊕ b2 ) ⊕ b3 ] ∗ (b2 ⊕ b3 ). We consider a1 and a2 in turn. We have a1 = = = = = Exercises 10.1

[(b1 ⊕ b2 ) ⊕ b3 ] ∗ b1 b1 ∗ [(b1 ⊕ b2 ) ⊕ b3 ] [b1 ∗ (b1 ⊕ b2 )] ⊕ (b1 ∗ b3 ) b1 ⊕ (b1 ∗ b3 ) b1

(using (using (using (using

B3) B4) the absorbtion law) the absorbtion law) 265

Discrete Mathematics: Proofs, Structures and Applications

and a2 = = = = = = = =

[(b1 ⊕ b2 ) ⊕ b3 ] ∗ (b2 ⊕ b3 ) ([(b1 ⊕ b2 ) ⊕ b3 ] ∗ b2 ) ⊕ ([(b1 ⊕ b2 ) ⊕ b3 ] ∗ b3 ) (b2 ∗ [(b1 ⊕ b2 ) ⊕ b3 ]) ⊕ (b3 ∗ [(b1 ⊕ b2 ) ⊕ b3 ]) ([b2 ∗ (b1 ⊕ b2 )] ⊕ [b2 ∗ b3 ]) ⊕ ([b3 ∗ (b1 ⊕ b2 )] ⊕ [b3 ∗ b3 ]) ([b2 ∗ (b2 ⊕ b1 )] ⊕ [b2 ∗ b3 ]) ⊕ ([b3 ∗ (b1 ⊕ b2 )] ⊕ [b3 ∗ b3 ]) (b2 ⊕ [b2 ∗ b3 ]) ⊕ ([b3 ∗ (b1 ⊕ b2 )] ⊕ b3 ) (b2 ⊕ [b2 ∗ b3 ]) ⊕ (b3 ⊕ [b3 ∗ (b1 ⊕ b2 )]) b2 ⊕ b3

(B4) (B3) (B4) (B3) (absorbtion law) (B3) (absorbtion law).

Therefore, substituting for a1 and a2 in equation (10.1) gives [(b1 ⊕ b2 ) ⊕ b3 ] ∗ [b1 ⊕ (b2 ⊕ b3 )] = b1 ⊕ (b2 ⊕ b3 ).

(10.2)

We also need to show that [(b1 ⊕ b2 ) ⊕ b3 ] ∗ [b1 ⊕ (b2 ⊕ b3 )] = (b1 ⊕ b2 ) ⊕ b3 but we can simplify this by making use of commutativity and equation (10.2) as follows:  [(b1 ⊕ b2 ) ⊕ b3 ] ∗ [b1 ⊕ (b2 ⊕ b3 )] = [b1 ⊕ (b2 ⊕ b3 )] ∗ [(b1 ⊕ b2 ) ⊕ b3 ] (B3)    = [(b2 ⊕ b3 ) ⊕ b1 ] ∗ [b3 ⊕ (b1 ⊕ b2 )] (B3)     = [(b3 ⊕ b2 ) ⊕ b1 ] ∗ [b3 ⊕ (b2 ⊕ b1 )] (B3) (10.3) = b3 ⊕ (b2 ⊕ b1 ) (10.2)     = (b2 ⊕ b1 ) ⊕ b3 (B3)    = (b1 ⊕ b2 ) ⊕ b3 (B3) Finally, from (10.2) and (10.3) we have b1 ⊕ (b2 ⊕ b3 ) = (b1 ⊕ b2 ) ⊕ b3 . From the duality principle we also have b1 ∗ (b2 ∗ b3 ) = (b1 ∗ b2 ) ∗ b3 . 8. (ii) b1 ⊕ [(¯b2 ⊕ b1 ) ∗ b2 ] = b1 ⊕ [(¯b2 ⊕ b1 ) ⊕ ¯b2 ] = b1 ⊕ [(¯b2 ∗ ¯b1 ) ⊕ ¯b2 ] = b1 ⊕ [(b2 ∗ ¯b1 ) ⊕ ¯b2 ] = b1 ⊕ [¯b2 ⊕ (b2 ∗ ¯b1 )] = b1 ⊕ [(¯b2 ⊕ b2 ) ∗ (¯b2 ⊕ ¯b1 )] = b1 ⊕ [1 ∗ (¯b2 ⊕ ¯b1 )] = b1 ⊕ (¯b2 ⊕ ¯b1 ) = b1 ⊕ (¯b1 ⊕ ¯b2 ) = (b1 ⊕ ¯b1 ) ⊕ ¯b2 = 1 ⊕ ¯b2 = 1 Dual: b1 ∗ [(¯b2 ∗ b1 ) ⊕ b2 ] = 0. 266

(De Morgan’s law) (De Morgan’s law) (Involution law) (Axiom B3) (Axiom B4) (Axiom B5) (Axiom B1) (Axiom B3) (Axiom B2) (Axiom B5) (Identity law).

Exercises 10.1

Solutions Manual

(iv) b1 ∗ (¯b1 ⊕ b2 = (b1 ∗ ¯b1 ) ⊕ (b1 ∗ b2 ) (Axiom B4) = 0 ⊕ (b1 ∗ b2 ) (Axiom B5) = b1 ∗ b2 (Axiom B1). Dual: b1 ⊕ (¯b1 ∗ b2 ) = b1 ⊕ b2 . (vi) (b1 ⊕ b2 ) ∗ (b1 ⊕ b2 ) = b1 ⊕ b2 follows directly from the Idempotent Law applied to b = b1 ⊕ b2 . Dual: (b1 ∗ b2 ) ⊕ (b1 ∗ b2 ) = b1 ∗ b2 . (vii) b1 ⊕ [b1 ∗ (b2 ⊕ 1)] = b1 ⊕ (b1 ∗ 1) (Identity law) = b1 ⊕ b1 (Axiom B1) = b1 (Idempotent law). Dual: b1 ∗ [b1 ⊕ (b2 ∗ 0)] = b1 . 9. In any Boolean algebra (B, ⊕, ∗,¯, 0, 1), b1 ∗ ¯b2 = 0 if and only if b1 ∗ b2 = b1 . Proof First suppose that b1 ∗ ¯b2 = 0. Then b1 ∗ b2 = = = = =

(b1 ∗ b2 ) ⊕ 0 (b1 ∗ b2 ) ⊕ (b1 ∗ ¯b2 ) b1 ∗ (b2 ⊕ ¯b2 ) b1 ∗ 1 b1

(axiom B1) (since b1 ∗ ¯b2 = 0) (axiom B4) (axiom B5) (axiom B1).

Conversely, suppose that b1 ∗ b2 = b1 . Then b1 ∗ ¯b2 = = = =

(b1 ∗ b2 ) ∗ ¯b2 b1 ∗ (b2 ∗ ¯b2 ) b1 ∗ 0 0

(since b1 ∗ b2 = b1 ) (axiom B2) (axiom B5) (Identity law).

10. Cancelation Law. Let (B, ⊕, ∗,¯, 0, 1) be a Boolean algebra and let b1 , b2 , b3 ∈ B. Then b1 ∗ b2 = b1 ∗ b3 and ¯b1 ∗ b2 = ¯b1 ∗ b3 implies b2 = b3 . Proof Suppose that b1 , b2 , b3 ∈ B are such that b1 ∗ b2 = b1 ∗ b3 and ¯b1 ∗ b2 = ¯b1 ∗ b3 . Then ⇒ ⇒ ⇒ ⇒

(b1 ∗ b2 ) ⊕ (¯b1 ∗ b2 ) (b2 ∗ b1 ) ⊕ (b2 ∗ ¯b1 ) b2 ∗ (b1 ⊕ ¯b1 ) b2 ∗ 1 b2

= = = = =

(b1 ∗ b3 ) ⊕ (¯b1 ∗ b3 ) (b3 ∗ b1 ) ⊕ (b3 ∗ ¯b1 ) b3 ∗ (b1 ⊕ ¯b1 ) b3 ∗ 1 b3

(axiom (axiom (axiom (axiom

B3) B4) B5) B1).

Both conditions are necessary. The first condition alone is not sufficient because b1 ∗ b2 = b1 ∗ b3 holds if b1 = 0 and b2 6= b3 . The second condition alone is not sufficient because ¯b1 ∗ b2 = ¯b1 ∗ b3 holds if b1 = 1 and b2 6= b3 . Exercises 10.1

267

Discrete Mathematics: Proofs, Structures and Applications

11.

(i) Let (B, ⊕, ∗,¯, 0, 1) be a Boolean algebra and let R be the relation defined on B by b1 R b2

if and only if b1 ∗ b2 = b1 .

Proof We need to show that R id reflexive, anti-symmetric and transitive. For all b ∈ B, we have b ∗ b = b by the idempotent law so b R b. Hence R is reflexive. Now let b1 , b2 ∈ B be such that b1 R b2 and b2 R b1 . Then, by definition of R, we have b1 ∗ b2 = b1 and b2 ∗ b1 = b2 . Since b1 ∗ b2 = b2 ∗ b1 , by axiom B3, this implies b1 = b2 . Hence R is anti-symmetric. Now let b1 , b2 , b3 ∈ B be such that b1 R b2 and b2 R b3 . Then, by definition of R, we have b1 ∗ b2 = b1 and b2 ∗ b3 = b2 . Then

b1 ∗ b3 = = = =

(b1 ∗ b2 ) ∗ b3 b1 ∗ (b2 ∗ b3 ) b1 ∗ b2 b1

(since b1 ∗ b2 = b1 ) (axiom B2) (since b2 ∗ b3 = b2 ) (since b1 ∗ b2 = b1 ).

Hence R is transitive. Therefore R is a partial order relation on B.

10.2 1.

Solutions to Exercises 10.2 (i) The function is already in disjunctive normal form. (ii) The values of f (e1 , e2 ) = e1 are recorded in the following table. e1 e2 f (e1 , e2 ) 0 0 0 0 1 0 1 0 1 1 1 1 Hence f (x1 , x2 ) = x1 x ¯2 ⊕ x1 x2 .

(iii) The values of f (e1 , e2 ) = e1 (¯ e1 ⊕ e2 ) are calculated in the following table. e1 e2 e¯1 e¯1 ⊕ e2 e1 (¯ e1 ⊕ e2 ) 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 Hence the disjunctive normal form is x1 x2 . (iv) The function is already in disjunctive normal form. 268

Exercises 10.2

Solutions Manual

(v) f (x1 , x2 ) = (x1 ⊕ x2 )(x1 ⊕ x ¯2 ). e1 e2 e¯2 e1 ⊕ e2 e1 ⊕ e¯2 (e1 ⊕ e2 )(e1 ⊕ e¯2 ) 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 1 1 1 0 1 1 1 Hence, in disjunctive normal form, f (x1 , x2 ) = x1 x ¯2 ⊕ x1 x2 . (vi) f (x1 , x2 , x3 ) = x2 (x1 x3 ⊕ x ¯1 ) e1 e2 e3 e1 e3 e¯1 e1 e3 ⊕ e¯1 e2 (e1 e3 ⊕ e¯1 ) 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 1 Therefore f (x1 , x2 , x3 ) = x ¯ 1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x2 x3 . ¯2 ⊕ x3 (vii) f (x1 , x2 , x3 ) = x1 ⊕ x e1 e2 e3 e¯2 e1 ⊕ e¯2 ⊕ e3 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 Therefore f (x1 , x2 , x3 ) = x ¯1 x ¯2 x ¯3 ⊕ x ¯1 x ¯2 x3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x ¯3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . (viii) f (x1 , x2 , x3 ) = x2 (¯ x1 ⊕ x3 ) e1 e2 e3 e¯1 e¯1 ⊕ e3 e2 (¯ e1 ⊕ e3 ) 0 0 0 1 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 0 1 1 1 0 1 1 Exercises 10.2

269

Discrete Mathematics: Proofs, Structures and Applications

Therefore f (x1 , x2 , x3 ) = x ¯ 1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x2 x3 . (ix) f (x1 , x2 , x3 ) = x3 ⊕ x ¯1 x2 e1 e2 e3 e¯1 e¯1 e2 e3 ⊕ e¯1 e2 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1 1 1 0 0 1 Therefore f (x1 , x2 , x3 ) = x ¯1 x ¯2 x3 ⊕ x ¯1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 . (x) f (x1 , x2 , x3 ) = (x1 ⊕ x2 ⊕ x3 )(¯ x1 ⊕ x3 ) e1 e2 e3 e1 ⊕ e2 ⊕ e3 e¯1 e¯1 ⊕ e3 (e1 ⊕ e2 ⊕ e3 )(¯ e1 ⊕ e3 ) 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1 Therefore f (x1 , x2 , x3 ) = x ¯1 x ¯2 x3 ⊕ x ¯1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 . Equal functions are: (ii) (iii) (vi) (ix) 2.

and and and and

(v) (iv) (viii) (x).

¯3 . (i) f (x1 , x2 , x3 ) = x1 ⊕ x2 ⊕ x e1 e2 e3 e¯3 e1 ⊕ e2 ⊕ e¯3 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 Disjunctive normal form: x ¯1 x ¯2 x ¯3 ⊕ x ¯ 1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x ¯3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 .

270

Exercises 10.2

Solutions Manual

Conjunctive normal form: x1 ⊕ x2 ⊕ x ¯3 . (ii) f (x1 , x2 , x3 ) = x1 x2 ⊕ x ¯3 ⊕ x1 . e1 e2 e3 e1 e2 e¯3 e1 e2 ⊕ e¯3 ⊕ e1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 Disjunctive normal form: x ¯1 x ¯2 x ¯3 ⊕ x ¯ 1 x2 x ¯ 3 ⊕ x1 x ¯2 x ¯ 3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . Conjunctive normal form: (x1 ⊕ x2 ⊕ x ¯3 )(x1 ⊕ x ¯2 ⊕ x ¯3 ). (iii) f (x1 , x2 , x3 ) = 1(x2 ⊕ x3 )x1 . e1 e2 e3 e2 ⊕ e3 1(e2 ⊕ e3 )e1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 Disjunctive normal form: x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . Conjunctive normal form: (x1 ⊕ x2 ⊕ x ¯3 )(x1 ⊕ x ¯2 ⊕ x3 )(x1 ⊕ x ¯2 ⊕ x ¯3 )(¯ x1 ⊕ x2 ⊕ x3 ). (iv) f (x1 , x2 , x3 ) = x ¯1 x2 ⊕ x1 x3 . Exercises 10.2

271

Discrete Mathematics: Proofs, Structures and Applications

e1 e2 e3 e¯1 e¯1 e2 e1 e3 e¯1 e2 ⊕ e1 e3 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 1 Disjunctive normal form: x ¯ 1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 . Conjunctive normal form: (x1 ⊕ x2 ⊕ x3 )(x1 ⊕ x2 ⊕ x ¯3 )(¯ x1 ⊕ x2 ⊕ x3 )(¯ x1 ⊕ x ¯2 ⊕ x3 ). 3. For any Boolean expression E, 0 ⊕ E = E ⊕ 0 = E. Hence, if f0 = 0, then f0 ⊕ fi = fi ⊕ f0 = fi for all fi ∈ F . Therefore f0 = 0 is the identity element with respect to ⊕. Similarly, if f1 = 1 then f1 ∗ fi = fi ∗ f1 = fi for all fi ∈ F . Therefore f1 = 1 is the identity element with respect to ∗. Since each f ∈ F can be defined by a Boolean expression, the axioms B2–B5 hold so the structure is a Boolean algebra. 4. Let (B, ⊕, ∗,¯, 0, 1) be a Boolean algebra and let the binary operation ◦ be defined on B by b1 ◦ b2 = b1¯b2 ⊕ ¯b1 b2 . Then (B, ◦) is an abelian group with identity 0. Proof We need to verify that the three axioms for a group, given in definition 8.8, hold for (B, ◦). (G1) To establish associativity of ◦, we obtain the disjunctive normal for of each of the expressions (b1 ◦ b2 ) ◦ b3 and b1 ◦ (b2 ◦ b3 ).

272

(b1 ◦ b2 ) ◦ b3 = (b1¯b2 ⊕ ¯b1 b2 ) ◦ b3 ¯ ¯ = (b1¯b2 ⊕ ¯b1 b2 )¯b3 ⊕ (b ´3 ³ 1 b2 ⊕ ´³b1 b2 )b = b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ b1¯b2 ¯b1 b2 b3

(B4, De Morgan’s law)

= b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ (¯b1 ⊕ b2 )(b1 ⊕ ¯b2 )b3 = b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ (¯b1 b1 ⊕ b2 b1 ⊕ ¯b1¯b2 ⊕ b2¯b2 )b3 = b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ (b2 b1 ⊕ ¯b1¯b2 )b3 = b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ b1 b2 b3 ⊕ ¯b1¯b2 b3

(Involution, De Morgan’s laws) (B4) (B1, B5) (B3, B4) Exercises 10.2

Solutions Manual

b1 ◦ (b2 ◦ b3 ) = b1 ◦ (b2¯b3 ⊕ ¯b2 b3 ) ¯ ⊕ ¯b2 b3 ) ⊕ ¯b1 (b2¯b3 ⊕ ¯b2 b3 ) = b1 (b ³ 2 b3 ´³ ´ = b1 b2¯b3 ¯b2 b3 ⊕ ¯b1 b2¯b3 ⊕ ¯b1¯b2 b3

(B4, De Morgan’s law)

= b1 (¯b2 ⊕ b3 )(b2 ⊕ ¯b3 ) ⊕ ¯b1 b2¯b3 ⊕ ¯b1¯b2 b3 = b1 (¯b2 b2 ⊕ b3 b2 ⊕ ¯b2¯b3 ⊕ b3¯b3 ) ⊕ ¯b1 b2¯b3 ⊕ ¯b1¯b2 b3 = b1 (b3 b2 ⊕ ¯b2¯b3 ) ⊕ ¯b1 b2¯b3 ⊕ ¯b1¯b2 b3 = b1 b2 b3 ⊕ b1¯b2¯b3 ⊕ ¯b1 b2¯b3 ⊕ ¯b1¯b2 b3

(Involution, De Morgan’s laws) (B4) (B1, B5) (B3, B4)

Therefore (b1 ◦ b2 ) ◦ b3 = b1 ◦ (b2 ◦ b3 ) so ◦ is associative. (G2) For all b ∈ B we have

¯ ⊕ ¯b0 = b1 + 0 = b b ◦ 0 = b0

and

¯ = 0 ⊕ 1b = b. 0 ◦ b = 0¯b ⊕ 0b

Therefore 0 is the identity element for ◦. (G3) For all b ∈ B we have

b ◦ B = b¯b ⊕ ¯bb = 0 ⊕ 0 = 0.

Therefore every element of b is self inverse so (G3) is satisfied. Since (G1), (G2) and (G3) hold, (B, ◦) is a group. Finally, we must show that ◦ is commutative. For all b1 , b2 ∈ B, we have b2 ◦ b1 = = = =

b2¯b1 ⊕ ¯b2 b1 ¯b2 b1 ⊕ b2¯b1 (B3) b1¯b2 ⊕ ¯b1 b2 (B3) b1 ◦ b2 .

Therefore ◦ is commutative so (B, ◦) is an abelian group.

10.3

Solutions to Exercises 10.3

1. (ii) f (x1 , x2 ) = x1 (¯ x1 x2 ⊕ x ¯2 ) (iv) f (x1 , x2 ) = (x1 x2 ⊕ x3 ⊕ x ¯1 x3 )x2 2.

(i) The following system of switches has switching function f (x1 , x2 ) = (x1 ⊕ x2 )¯ x1 . (iii) The following system of switches has switching function f (x1 , x2 , x3 ) = (x1 ⊕ x ¯2 ⊕ x3 )¯ x1 .

Exercises 10.3

273

Discrete Mathematics: Proofs, Structures and Applications

A1 A1 A2

A1 A2

A1

A3 (v) The system of switches with switching function f (x1 , x2 , x3 ) = x ¯1 (x2 x3 ⊕ x ¯2 x1 ) is shown below. 3. (iii) A switching function is f (x1 , x2 , x3 ) = (¯ x1 ⊕ x2 x3 )(¯ x2 x ¯3 ⊕ x1 ). The values of f (e1 , e2 , e3 ) are calculated in the following table.

e1 e2 e3 e¯1 e2 e3 e¯2 e¯3 e¯2 e¯3 e¯1 ⊕ e2 e3 e¯2 e¯3 ⊕ e1 (¯ e1 ⊕ e2 e3 )(¯ e2 e¯3 ⊕ e1 ) 0 0 0 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 Hence the disjunctive normal form is f (x1 , x2 , x3 ) = x ¯1 x ¯2 x ¯3 ⊕ x1 x2 x3 . An equivalent system of switches is the following. 4. The table showing what is required of the switches is given below. (Again we arbitrarily assume that initially all switches are up and the light is off.) S1 Up Up Up Up Down Down Down Down 274

S2 Up Up Down Down Up Up Down Down

S3 Up Down Up Down Up Down Up Down

Current No Yes Yes No Yes No No Yes Exercises 10.3

Solutions Manual

A2

A3

A2

A1

A1

A2

A3

A1

A2

A3

A1

If we use x1 , x2 and x3 to denote the state of the circuit switches and f (x1 , x2 , x3 ) to denote the state of the current flow, then the values of f (x1 , x2 , x3 ) are given in the following table. x1 x2 x3 f (x1 , x2 , x3 ) 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 1 So, in disjunctive normal form, f (x1 , x2 , x3 ) = x ¯1 x ¯2 x3 ⊕ x ¯1 x2 x ¯ 3 ⊕ x1 x ¯2 x ¯3 ⊕ x1 x2 x3 . For a possible switching circuit, see Hints and Solutions. 5. We denote the temperatures detected by each of the thermostats to be T1 , T2 and T3 . The table showing current flow for each possible combination of temperatures is given below. T1 ≥ 15◦ C ≥ 15◦ C ≥ 15◦ C ≥ 15◦ C < 15◦ C < 15◦ C < 15◦ C < 15◦ C

T2 ≥ 15◦ C ≥ 15◦ C < 15◦ C < 15◦ C ≥ 15◦ C ≥ 15◦ C < 15◦ C < 15◦ C

T3 Current ≥ 15◦ C No ◦ < 15 C No ≥ 15◦ C No < 15◦ C Yes ≥ 15◦ C No < 15◦ C Yes ≥ 15◦ C Yes < 15◦ C Yes

We use x1 , x2 and x3 to denote the state of the circuit switches corresponding to the thermostats associated with temperatures T1 , T2 and T3 respectively. Then the Boolean Exercises 10.3

275

Discrete Mathematics: Proofs, Structures and Applications

function f (x1 , x2 , x3 ) denotes whether or not the current flows. The function f is defined by the following table. x1 x2 x3 f (x1 , x2 , x3 ) 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 0 1 1 1 1 So, in disjunctive normal form, f (x1 , x2 , x3 ) = x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . A switching circuit, corresponding to the disjunctive normal form, is shown in figure 10.1.

A1

A2

A3

A1

A2

A3

A1

A2

A3

A1

A2

A3

Figure 10.1: A system of switches corresponding to the disjunctive normal form In fact, the system of switches can be simplified quite significantly. First we note that f (x1 , x2 , x3 ) = x1 x2 + x1 x3 + x2 x3 . This can be shown (a) algebraically, (b) using a table of values of f or (c) using Karnaugh maps (see §9.6). We establish the result algebraically below. (The simplification using a Karnaugh map is given in exercise 9.5.2 (iv) on page 281.) f (x1 , x2 , x3 ) =x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 =x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 ⊕ x1 x2 x3 ⊕ x1 x2 x3 =x ¯1 x2 x3 ⊕ x1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 = (¯ x1 ⊕ x1 )x2 x3 ⊕ x1 x3 (¯ x2 ⊕ x2 ) ⊕ x1 x2 (¯ x3 ⊕ x3 ) = 1x2 x3 ⊕ x1 x3 1 ⊕ x1 x2 1 = x2 x3 ⊕ x1 x3 ⊕ x1 x2 = x1 x2 ⊕ x1 x3 ⊕ x2 x3 276

(idempotent law) (axiom B3) (axiom B4) (axiom B5) (axiom B1) (axiom B3). Exercises 10.3

Solutions Manual

Finally, we make one further small simplification and use axiom B4 to write f as f (x1 , x2 , x3 ) = x1 (x2 ⊕ x3 ) ⊕ x2 x3 . The switching circuit corresponding to this expression for f is the following.

A3 A1 A2 A2

10.4

A3

Solutions to Exercises 10.4

1. (ii) x1 x2 (x1 ⊕ x3 ) (iv) (x1 ⊕ x2 )(¯ x1 ⊕ x2 ) 2.

(i) The following logic network has output (x1 ⊕ x2 )(¯ x1 ⊕ x3 ).

x1 x2 x3 (iii) The following logic network has output x1 x3 ⊕ x ¯1 ⊕ x2 x ¯3 .

x1 x3

x2 (v) The following logic network has output (x1 ⊕ x ¯2 ⊕ x3 )(¯ x1 ⊕ x3 )x2 . 3. (ii) (x1 ⊕ x ¯2 )x2 x3 and (x1 ⊕ x ¯2 )x2 x3 5.

(i) (x1 ⊕ x2 ) ⊕ (x1 ⊕ x2 ) = (x1 ⊕ x2 ) ∗ (x1 ⊕ x2 ) (De Morgan’s law) = (x1 ⊕ x2 ) ∗ (x1 ⊕ x2 ) (Involution law) = x1 ⊕ x2 (Idempotent law). Hence a logic network only using NOR-gates with output x1 ⊕ x2 is given in the figure below.

Exercises 10.4

277

Discrete Mathematics: Proofs, Structures and Applications

x1 x2 x3

x1 x2

(ii) (x1 ⊕ x1 ) ⊕ (x2 ⊕ x2 ) = (x1 ⊕ x1 ) ∗ (x2 ⊕ x2 ) (De Morgan’s law) = (x1 ⊕ x1 ) ∗ (x2 ⊕ x2 ) (Involution law) = x1 ∗ x2 (Idempotent law). Hence a logic network only using NOR-gates with output x1 ∗ x2 is given below.

x1 x2

(iii) Since (x1 ⊕ x1 ) = x ¯1 , by the identity law, a logic network only using NOR-gates with output x ¯1 is given in the figure below.

x1

7.

(i) The table is as follows. x1 x2 x3 z1 z2 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1

10.5 1. 278

Solutions to Exercises 10.5 (i) The Karnaugh map is given in the figure below. Exercises 10.5

Solutions Manual

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

x1

1 1

1

Hence a minimal representation is x1 x2 x3 ⊕ x ¯1 x2 ⊕ x ¯2 x ¯3 . (iii) The Karnaugh map is the following.

x3 x4 x3 x4 x3 x4 x3 x4 x1x2 x1x2

1

x1x2 x1x2

1 1

1

Hence a minimal representation is x ¯1 x2 x3 x4 ⊕ x ¯1 x ¯2 x ¯3 x ¯ 4 ⊕ x1 x ¯ 2 x3 . (v) The Karnaugh map is the following.

x3 x4 x3 x4 x3 x4 x3 x4 x1x2

1

x1x2

1

x1x2 x1x2

1 1

1

1

Hence a minimal representation is x ¯1 x2 x3 x ¯4 ⊕ x ¯2 x ¯3 x ¯4 ⊕ x1 x ¯2 x ¯4 ⊕ x1 x3 x4 . 2.

(i) f (x1 , x2 , x3 ) = x1 (x2 x3 ⊕ x ¯3 ). e1 e2 e3 e2 e3 e¯3 e2 e3 ⊕ e¯3 e1 (e2 e3 ⊕ e¯3 ) 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1

Exercises 10.5

279

Discrete Mathematics: Proofs, Structures and Applications

The disjunctive normal form for f is x1 x ¯2 x ¯3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . The Karnaugh map is the following.

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

1

1

x1 Hence a minimal form is x1 x2 ⊕ x1 x ¯3 . x2 ⊕ x3 ). (ii) f (x1 , x2 , x3 ) = (x1 ⊕ x2 )(¯ e1 e2 e3 e1 ⊕ e2 e¯2 e¯2 ⊕ e3 (e1 ⊕ e2 )(¯ e2 ⊕ e3 ) 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 1 1 1 The disjunctive normal form for f is x ¯1 x2 x3 ⊕ x1 x ¯2 x ¯3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 . The Karnaugh map is:

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

x1

1

1

1

Hence a minimal form is x2 x3 ⊕ x1 x ¯2 . (iii) f (x1 , x2 , x3 ) = (x1 ⊕ x2 ⊕ x3 )(¯ x1 ⊕ x3 ). e1 e2 e3 e1 ⊕ e2 ⊕ e3 e¯1 e¯1 ⊕ e3 (e1 ⊕ e2 ⊕ e3 )(¯ e1 ⊕ e3 ) 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 0 0 0 1 1 1 1 0 1 1 The disjunctive normal form for f is x ¯1 x ¯ 2 x3 ⊕ x ¯1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x3 . The Karnaugh map is: 280

Exercises 10.5

Solutions Manual

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

1

x1

1

1

1

Hence a minimal form is x3 ⊕ x ¯1 x2 . (iv) f (x1 , x2 , x3 ) = (x1 ⊕ x ¯2 ⊕ x3 )(¯ x1 ⊕ x2 ⊕ x3 )(x1 ⊕ x2 ). e1 e2 e3 e¯2 e1 ⊕ e¯2 ⊕ e3 e¯1 e¯1 ⊕ e2 ⊕ e3 e1 ⊕ e2 f (e1 , e2 , e3 ) 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 The disjunctive normal form for f is x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . The Karnaugh map is:

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

x1

1

1

1

Hence a minimal form is x1 x2 + x1 x3 + x2 x3 . 3. (iii) f (x1 , x2 , x3 ) = x1 x3 ⊕ x ¯1 ⊕ x2 x ¯3 . e1 e2 e3 e1 e3 e¯1 e¯3 e2 e¯3 e1 e3 ⊕ e¯1 ⊕ e2 e¯3 0 0 0 0 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 1 The disjunctive normal form for f is x ¯1 x ¯2 x ¯3 ⊕ x ¯1 x ¯2 x3 ⊕ x ¯1 x2 x ¯3 ⊕ x ¯1 x2 x3 ⊕ x1 x ¯2 x3 ⊕ x1 x2 x ¯3 ⊕ x1 x2 x3 . Karnaugh map: Exercises 10.5

281

Discrete Mathematics: Proofs, Structures and Applications

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

1

x1

1

1

1 1

1

Hence a minimal form is x ¯1 + x3 + x2 x ¯3 . The logic network corresponding to the minimal form of f is:

x1 x3 x2

(v) f (x1 , x2 , x3 ) = (x1 ⊕ x ¯2 ⊕ x3 )(¯ x1 ⊕ x3 )x2 .

e1 e2 e3 e¯2 e1 ⊕ e¯2 ⊕ e3 e¯1 e¯1 ⊕ e3 (e1 ⊕ e¯2 ⊕ e3 )(¯ e1 ⊕ e3 )e2 0 0 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 1

The disjunctive normal form for f is x ¯1 x2 x3 ⊕ x1 x2 x3 . The Karnaugh map is:

x2 x3 x2 x3 x2 x3 x2 x3 x1

1

x1

1

Hence a minimal form is x2 x3 . The logic network corresponding to the minimal form of f is the following. 282

Exercises 10.5

Solutions Manual

x2 x3 5. The Karnaugh map, with grouping of ones as described in the text is the following.

x3 x4 x3 x4 x3 x4 x3 x4 x1x2

1

x1x2

1

x1x2

1

1

x1x2

1

1

1

1

1

1

1

1

The corresponding expression for f , with five terms, is x1 x2 ⊕ x3 x4 ⊕ x ¯2 x4 ⊕ x2 x ¯4 ⊕ x ¯1 x ¯3 x ¯4 . An improved blocking of ones, using only four blocks, is given in the figure below.

x3 x4 x3 x4 x3 x4 x3 x4 x1x2

1

x1x2

1

x1x2

1

1

x1x2

1

1

1

1

1

1

1

1

This gives rise to the minimal form with only four terms x1 x2 ⊕ x ¯2 x4 ⊕ x2 x3 ⊕ x ¯1 x ¯3 x ¯4 .

Exercises 10.5

283

Chapter 11

Graph Theory Note: When referring to figures in Discrete Mathematics: Proofs, Structures and Applications we will use the shorthand ‘DM:PSA’. Thus, for example, we will use ‘DM:PSA figure 11.5’ to refer to figure 11.5 in the main text (as opposed to figure 11.5 in this solutions manual).

11.1

Solutions to Exercises 11.1

1. The diagrams for K6 and K4,4 are given in Hints and Solutions. In the figure below, for the bipartite graph K2,5 , we have represented the vertices in the two subsets by ‘filled-in’ and ‘open’ circles.

K2 2.

K 2,5

(i) Each vertex has degree 5 – recall that a loop contributes 2 to the degree of its incident vertex. The graph is not simple since it has loops. The graph is regular since every vertex has the same degree.

v1

v2

v4

v3

(ii) The vertex degrees are: 284

Solutions Manual

deg(v1 ) = 2, deg(v2 ) = 2, deg(v3 ) = 3, deg(v4 ) = 2, deg(v5 ) = 2 and deg(v6 ) = 3. The graph is simple since it has no loops and no multiple edges. The graph is not regular since, for example, v1 and v3 have different degrees.

v1

v2

v6

v3

v5

v4

(iii) The vertex degrees are: deg(v1 ) = 7, deg(v2 ) = 7, deg(v3 ) = 7, deg(v4 ) = 7 and deg(v5 ) = 4. The graph is not simple since it has both loops and multiple edges. The graph is not regular since, for example, v1 and v5 have different degrees.

v1

v2

v5

v4

v3

4. It is possible for a graph to be both null and complete. Let Γ be a graph with a single vertex and no edges. Then Γ is null since it has no edges. Also Γ is complete since there are no pairs of distinct vertices so it is vacuously true that every pair of distinct vertices is joined by an edge. 5.

(i) See figure 11.1 for the labelling of the vertices. (a) With the vertex set arranged as {v1 , v2 , v3 , v4 , w1 , w2 , w3 , w4 , w5 }, the adjacency matrix is  0 0  0  0  1  1  0  0 1

Exercises 11.1

0 0 0 0 0 1 1 0 2

0 0 0 0 0 0 1 1 1

0 0 0 0 1 0 0 1 2

1 0 0 1 0 0 0 0 0

1 1 0 0 0 0 0 0 0

0 1 1 0 0 0 0 0 0

0 0 1 1 0 0 0 0 0

 1 2  1  2  0 . 0  0  0 0 285

Discrete Mathematics: Proofs, Structures and Applications

v1

w1

v4

w5

w4

v3

w2

v1

v2

v3

w1

w2

w3

v2

w3

(a)

(b)

Figure 11.1: Labelling the vertices in figure 10.5. (b) Again with the vertex set arranged as {v1 , v2 , v3 , w1 , w2 , w3 , }, the adjacency matrix is   0 0 0 1 1 1 0 0 0 1 1 1   0 0 0 1 1 1   1 1 1 0 0 0 .   1 1 1 0 0 0 1 1 1 0 0 0 7.

(i) The Handshaking Lemma In any graph, the sum of the vertex degrees is twice the number of edges, X deg(v) = 2 × |E|. v∈V

Proof Let Γ be a graph with vertex set V and edge set E. Let e be an edge of Γ that is incident with vertices v1 and v2 . If v1 = 6 v2 – that is, if e is not a loop – then e contributes 1 to the vertex degree of v1 and 1 to the vertex degree of v2 . If v1 = v2 – that is, e is a loop – then e contributes 2 to the vertex degree of v1 . X In either case, e contributes 2 so the sum of vertex degrees, deg(v). v∈V

Hence, summing over all of the edges in Γ gives X deg(v) = 2 × |E|, v∈V

as required. (ii) In any graph, the number of vertices of odd degree is even. Proof P By the handshaking lemma, the sum of the vertex degrees v∈V deg(v) is an even integer (since it is twice the number of edges in the graph). 286

Exercises 11.1

Solutions Manual

We partition the vertex set V into those vertices with even degree, Veven = {v ∈ V : deg(v) is even}, and those with odd degree Vodd = {v ∈ V : deg(v) is odd}. Summing the vertex degrees of Veven and Vodd separately gives: X v∈V

deg(v) =

X

X

deg(v) +

v∈Veven

deg(v).

v∈Vodd

The first term is even since each deg(v) is even. However the second term is a sum of odd integers which is only even when the number of integers being summed is even. Hence the number of vertices with odd degree, |Vodd |, is even. 8. (ii) (a) In a null graph, every vertex has zero degree so the degree sequence of a null graph with n vertices is (0, 0, . . . , 0). ← n terms →

(b) In the complete graph Kn , each vertex is adjacent to the other n − 1 vertices so each vertex has degree n − 1. Hence the degree sequence is (n − 1, n − 1, . . . , n − 1). ←−−−

n terms

−−−→

(c) In an r-regular graph, each vertex has degree r, so the degree sequence is (r, r, . . . , r). ← n terms →

(d) Suppose that Kn,m has vertex set partitioned as {V1 , V2 } where |V1 | = n and |V2 | = m. Every vertex in V1 is adjacent to each of the m vertices in V2 so has degree m. Similarly, every vertex in V2 is adjacent to each of the n vertices in V1 so has degree n. We are given that n ≤ m so the m vertices of degree n are listed in the degree sequence before the n vertices of degree m. Therefore the degree sequence is: (n, n, . . . , n, m, m, . . . m). ← m terms → ← n terms →

9. (ii) There is no graph with the given degree sequence. The sum of the entries in the sequence is 1 + 2 + 2 + 2 + 3 + 3 = 13 but the sum of the vertex degrees in any graph is even by the handshaking lemma (see exercise 10.1.7 (i) above). Hence the sequence cannot represent the degree sequence of any graph. Exercises 11.1

287

Discrete Mathematics: Proofs, Structures and Applications

Figure 11.2: A graph with degree sequence (2, 2, 2, 3, 3, 3, 3) (iv) Figure 11.2 shows a graph with degree sequence (2, 2, 2, 3, 3, 3, 3). There is a simple way of generating this graph. There are 7 terms in the sequence so the graph has 7 vertices. The cycle graph C7 with 7 vertices – see figure 10.2 (a) in Chapter 10 – has degree sequence (2, 2, 2, 2, 2, 2, 2). Adding an extra edge between two vertices changes both from having degree 2 to degree 3. Hence adding two such edges to the cycle graph produces the graph below with degree sequence (2, 2, 2, 3, 3, 3, 3). 12. For n ≥ 2, the complete graph Kn contains Kn−1 as a subgraph. Proof As in Example 10.2.1, we take Kn to have vertex set V (Kn ) = {v1 , v2 , . . . , vn }, edge set E(Kn ) = {eij : 1 ≤ i < j ≤ n} with δKn : E(Kn ) → P(V (Kn )) given by δKn (eij ) = {vi , vj }. Then V (Kn−1 ) = {v1 , v2 , . . . , vn−1 } ⊆ {v1 , v2 , . . . , vn } = V (Kn ) and E(Kn−1 ) = {eij : 1 ≤ i < j ≤ n − 1} ⊆ {eij : 1 ≤ i < j ≤ n} = E(Kn ). Further, for each eij ∈ E(Kn−1 ), we have δKn−1 (eij ) = {vi , vj } = δKn (eij ). Therefore, Kn−1 and Kn satisfy the conditions of definition 10.5, so Kn−1 is a subgraph of Kn . 13. If Γ is a simple graph with n vertices then |E| ≤ 21 n(n − 1). Proof Since Γ is simple, it has at no loops and at most one edge joining each pair of vertices. Therefore the number of edges |E| is less than or equal to the number of pairs of vertices. Since there are n vertices, the number of (unordered) pairs of vertices is the number of ways of selecting a set of two vertices which is given by: µ ¶ n n(n − 1) = . 2 2 Therefore |E| ≤ 12 n(n − 1) as required. 14. Figure 11.3 illustrates the construction of Γ + Σ. 288

Exercises 11.1

Solutions Manual

S

S

G

G

GÈS

G+S

Figure 11.3: Illustrating the graphs Γ ∪ Σ and Γ + Σ. (i) Let Γ = Np be the null graph with p vertices and Σ = Nq be the null graph with q vertices. In Np + Nq , the only edges are those connecting the vertices of Np to those of Np . Since every vertex of Np is connected to every vertex of Nq , the resulting graph Np + Nq is the complete bipartite graph, Kp,q . Figure11.4 illustrates the situation.

Np

Nq

N p + Nq Figure 11.4: The graph Np + Nq . (ii) Let Γ = Kp be the complete graph with p vertices and Σ = Kq be the complete graph with q vertices. In Kp + Kq , every vertex in Γ = Kp is joined by an edge to every vertex in Σ = Kq . This is in addition to every vertex in Kp being joined to every other vertex in Kp and every vertex in Kq being joined to every other vertex in Kq . As a result, every one of the p + q vertices is joined by an edge to every other vertex. Hence the result is the complete graph with p + q vertices, Kp + Kq = Kp+q . Figure 11.5 illustrates the situation.

Kp

Kq

K p + Kq Figure 11.5: The graph Kp + Kq .

Exercises 11.1

289

Discrete Mathematics: Proofs, Structures and Applications

15. Any simple graph Γ may be regarded as a subgraph of the complete graph Kn . Informally, we can think of the complete graph Kn as having ‘as many edges as we might need’ to build a simple graph with n vertices. Since Γ has no loops or multiple edges, it can be obtained from the complete graph Kn be erasing the edges that are ‘not required’. We make this argument more formal in the following proof. Proof Suppose that Γ has vertex set {v1 , v2 , . . . , vn } and let Kn be the complete graph with this vertex set. Then, trivially, V (Γ) ⊆ V (Kn ). Since Γ is simple it has no loops or multiple edges so each edge in e ∈ E(Γ) is also an edge in E(Kn ) so E(Γ) ⊆ E(Kn ). Since the vertex sets ‘match up’, each edge e joins the same vertices in Kn as it does in Γ; more formally, δΓ (e) = δKn (e). Therefore, Γ and Kn satisfy the conditions of definition 10.5, so Γ is a subgraph of Kn .

16.

(i) The graph given in Discrete Mathematics: Proofs, Structures and Algorithms, figure 11.1 has a loop so the incident matrix is not defined. Figure 11.2. Using the vertex labelling given and with the edges labelled eij where i < j and eij joins vertices vi and vj , the incidence matrix is the following. We have labellled the rows and columns for convenience. Note that the diagrams in (a) and (b) of the figure are just different drawings of the same graph.

e12 e23 e34 e45 e56 e67 e17

v1  1 0  0  0  0  0 1

v2 1 1 0 0 0 0 0

v3 0 1 1 0 0 0 0

v4 0 0 1 1 0 0 0

v5 0 0 0 1 1 0 0

v6 0 0 0 0 1 1 0

v7  0 0  0  0 . 0  1 1

Figure 11.3. The figure contains two different drawings of Petersen’s graph. A labelling of the vertices and edges of Petersen’s graph is given in the solution to exercise 11.1.3 in Hints and Solutions. Using this labelling, the incidence matrix is the following. 290

Exercises 11.1

Solutions Manual

e12 e15 e16 e23 e27 e34 e38 e45 e49 e5 10 e68 e69 e79 e7 10 e8 10

v 1 1 1  1  0  0  0   0  0  0  0  0  0  0  0 0

v2 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0

v3 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0

v4 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0

v5 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0

v6 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0

v7 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0

v8 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1

v9 v10  0 0 0 0  0 0  0 0  0 0  0 0   0 0  0 0 .  1 0  0 1  0 0  1 0  1 0  0 1 0 1

Figure 11.4. We will adopt the ‘standard’ labelling for Kn with vertex set V (Kn ) = {v1 , v2 , . . . , vn }, edge set E(Kn ) = {eij : 1 ≤ i < j ≤ n} and δKn : E(Kn ) → P(V (Kn )) given by δKn (eij ) = {vi , vj }.

K3

K5

Exercises 11.1

e12 e23 e13

v1  1 0 1

v2 1 1 0

v3  0 1 . 1

e12 e13 e14 e15 e23 e24 e25 e34 e35 e45

v1  1 1  1  1  0  0  0  0  0 0

v2 1 0 0 0 1 1 1 0 0 0

v3 0 1 0 0 1 0 0 1 1 0

v4 0 0 1 0 0 1 0 1 0 1

K4

e12 e13 e14 e23 e24 e34

v1  1 1  1  0  0 0

v2 1 0 0 1 1 0

v3 0 1 0 1 0 1

v4  0 0  1 . 0  1 1

v5  0 0  0  1  0 . 0  1  0  1 1 291

Discrete Mathematics: Proofs, Structures and Applications

(ii) In each row there are two 1s corresponding to the two vertices that are incident with the edge. Hence the row sum is always 2. (iii) In the column corresponding to a vertex v, there is a 1 for every edge that is incident with v. Hence the column sum is the degree of the corresponding vertex. 18.

(i) Axiom A2 ensures that the system can be modelled by a graph Γ with vertices the ‘blubs’ and edges the ‘glugs’. In the language of graph theory, axiom A2 just says that every edge is incident with exactly two vertices. To be a model for the axiom system, the graph Γ must satisfy three properties, as follows. • Γ can have no isolated vertices; that is vertices of degree zero. By axiom A1, every vertex (blub) is incident with at least one edge (glug). • Γ can have no loops. By axiom A2, every edge (glug) is incident with exactly two vertices (blubs). • There are exactly 5 vertices (blubs), |V (Γ)| = 5. (ii) Now let V1 be the set of blubs and V2 be the set of glugs. Now ‘lies on’ is interpreted as ‘adjacent’; in other words there is an edge joining b ∈ V1 to g ∈ V2 if and only if b ‘lies on’ g. Let Σ denote this bipartite graph. Then Σ must satisfy three properties, as follows. • Every vertex (blub) b in V1 has degree at least 1 so there are no isolated vertices in V1 . From axiom A1, for every b ∈ V1 there is a vertex (glug) g ∈ V2 such that b and g are adjacent. • Every vertex (glug) g in V2 has degree 2. From axiom A2, for every g ∈ V2 there are exactly two vertices (blubs) b1 , b2 ∈ V2 such that g is adjacent to both b1 and b2 . • There are exactly 5 vertices (blubs) in the set V1 , |V1 | = 5. Figure 11.6 (a) shows such a model with 5 blubs, V1 = {b1 , b2 , b3 , b4 , b5 }, and 4 glugs, V2 = {g1 , g2 , g3 , g4 }. The previous interpretation, given in part (i), of this axiom system is represented in figure 11.6 (b).

b1

b1

g1

b2

g1

g2

b3

b5 g3

b4 b5

g4

(a)

g4

g2 b3

b2

g3 b4

(b)

Figure 11.6: Two models for a ‘blubs’ and ‘glugs’ axiom system.

292

Exercises 11.1

Solutions Manual

11.2

Solutions to Exercises 11.2

1. Theorem 10.1 Let Γ be a graph with vertex set {v1 , v2 , . . . , vr } and adjacency matrix A. The (i, j)-entry of An is the number of edge sequences of length n joining vi and vj . Proof The proof is by induction on n. When n = 1, the (i, j)-entry of A1 = A is the number of edges joining vi and vj which is the number of edge sequences of length 1 joining vi and vj . Hence the result holds when n = 1. Assume that, for some positive integer k, the (i, j)-entry of Ak is the number of edge sequences of length k joining vi and vj . (k)

(k+1)

Let aij denote the (i, j)-entry of Ak and, similarly, let aij Ak+1 . From the definition of matrix multiplication, (k+1)

aij

(k)

(k)

denote the (i, j)-entry of

(k)

= ai1 a1j + ai2 a2j + · · · + ain anj .

(11.1)

(k)

Consider one of the terms on the right hand side: aip apj . By the inductive hypothesis, (k)

aip is the number of edge sequences of length k joining vi and vp . Also apj is the number (k)

of edges joining vp and vj . Therefore, the product aip apj denotes the number of edge sequences of length k + 1 joining vi and vj via vp . The figure below illustrates this. (k ) aip edge sequences of length k

a pj edges

vp

vi

vj

Therefore the right hand side of equation (10.1) is the sum over all of the vertices vp of (k+1) the number of edge sequences of length k + 1 joining vi and vj via vp . Therefore aij is the total number of edge sequences of length k + 1 joining vi and vj . This completes the inductive step. Hence, for all positive integers n, the (i, j)-entry of An is the number of edge sequences of length n joining vi and vj , by induction. 2. Let Γ be a graph with vertex set V and let R be the relation on V defined by vRw

there is a path in Γ joining v and w.

Then R is an equivalence relation. Proof Let v ∈ V . Regarding the empty path as joining v to itself, we have v R v so R is reflexive. Exercises 11.2

293

Discrete Mathematics: Proofs, Structures and Applications

Let v, w ∈ V and suppose that v R w. Then there is a path e1 , e2 , . . . , ek−1 , ek joining v to w. The edge sequence ek , ek−1 , . . . , e2 , e1 is a path from w to v, so w R v. Therefore R is symmetric. Let u, v, w ∈ V and suppose that u R v and v R w. Then there are paths P : e1 , e2 , . . . , ek−1 , ek joining u to v and Q : e01 , e02 , . . . , e0l−1 , e0l joining v to w. All the edges in P are distinct (since P is a path) and, similarly, all the edges in Q are distinct. If the edges of P are all distinct from the edges of Q then the edge sequence e1 , e2 , . . . , ek−1 , ek , e01 , e02 , . . . , e0l−1 , e0l is a path from u to w. It may be, however, that some of the edges of P are common with some of the edges of Q. This is illustrated in the figure where the edges of P are represented by wavy lines and the edges of Q are represented by thicker lines. e2¢

u

e1¢

e* e1

ek el¢-1

v

el¢

w

In this case, let e∗ be the last edge of Q that is common with some edge of P ; that is, e∗ = ea = e0b and b is the largest integer with this property. Then the edge sequence e1 , . . . , ea−1 , e∗ , e0b+1 , . . . , e0l is a path from u to w. Since there is a path from u to w, we have u R w. Therefore R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on V . 4.

(i) Every vertex of Kn has degree n − 1. Therefore, by Euler’s theorem (theorem 10.2), Kn is Eulerian if and only if n − 1 is even; hence, Kn is Eulerian if and only if n is odd. (ii) Suppose the vertex set of Kr,s has a partition {V1 , V2 } where |V1 | = r and |V2 | = s. Then each vertex in V1 has degree s and each vertex in V2 has degree r. Therefore, again by Euler’s theorem, Kr,s is Eulerian if and only if both r and s are even.

5.

(i) Recall that the sum of the entries in a row (with the ‘diagonal element’ being doubled) gives the degree of the corresponding vertex. (a) By considering the row sums, the vertex degrees are 4, 2, 2, 4, 4 and 2. The graph is also connected. Hence, by Euler’s theorem, the graph is Eulerian. (b) The sum of entries in the first row is 3, the degree of the corresponding vertex. Therefore, by Euler’s theorem, the graph is not Eulerian. (c) The row sums are all equal to 2. However the graph is not connected because no vertex represented by the rows 1, 3 and 5 is joined to any vertex represented by rows 2, 4 and 6. In fact the graph comprises two triangles as shown in the figure below.

294

Exercises 11.2

Solutions Manual

v1

v5

v2

v3

v6

v4

(d) By considering the row sums (with the diagonal element doubled in row 1), the vertex degrees are 4, 6, 2, 4, 2 and 2. The graph is also connected. Hence, by Euler’s theorem, the graph is Eulerian. 6.

(i) Since Γ is connected and every vertex has even degree, it is Eulerian by Euler’s theorem. An Eulerian path is a b c d b e f g h f l j h i j k d a although there are many others. (ii) Γ is not Hamiltonian. Suppose there is a Hamiltonian cycle, C. Since C must pass through the vertex a, both the edges da and ab must belong to C. Similarly, since C must pass through the vertex c, both the edges bc and cd must belong to C. These four edges form a cycle abcda which cannot be enlarged further. Hence C must be this cycle. But then C is not a Hamiltonian cycle since it does not contain every vertex. Therefore Γ is not Hamiltonian.

7. A connected graph Γ is semi-Eulerian but not Eulerian if and only if all vertices except two have even degree. Proof Since the statement to be proved is a biconditional – if and only if – there are two parts to the proof. First suppose that Γ is semi-Eulerian but not Eulerian. Then there is a path, P say, that is not closed and contains every edge of Γ. Suppose that P joins vertices v, w ∈ V (Γ). Add the edge vw to Γ to give a new graph Γ0 . Clearly Γ0 is Eulerian since a closed path, beginning and ending at the vertex v, containing all the edges of Γ0 is the path P followed by the edge wv. By Euler’s theorem, every vertex of Γ0 has even degree. Removing the edge vw to obtain Γ reduces the degree of v and w by 1 (but changes no other vertex degree). Therefore, in Γ, the vertices v and w have odd degree but all other vertices have even degree. Hence Γ has exactly two vertices of odd degree. Conversely, suppose that Γ has exactly two vertices of odd degree. By Euler’s theorem, Γ is not Eulerian. Let the two vertices of odd degree be v and w. Add the edge vw to Γ to give a new graph Γ0 . Then, in Γ0 , every vertex has even degree (since the degrees of v and w have been increased by 1 but no other vertex degrees have changed). Therefore, by Euler’s theorem, Γ0 is Eulerian. Choose a closed path P in Γ0 containing all the edges of Γ0 . Since P is closed, we can traverse its edges beginning with any edge. Suppose we traverse P beginning with the edge vw so that P is the edge sequence vw, e1 , e2 , . . . , ek . Remove the edge vw from Γ0 Exercises 11.2

295

Discrete Mathematics: Proofs, Structures and Applications

to obtain Γ. Then the edge sequence e1 , e2 , . . . , ek is a path in Γ from w to v containing every edge of Γ. Therefore Γ is semi-Eulerian. Therefore Γ is semi-Eulerian but not Eulerian, as required. 9.

(i) Every closed path in a bipartite graph contains an even number of edges. Proof Let Γ be a bipartite graph with vertex set partitioned as {V1 , V2 }. Since each edge in Γ joins a vertex in V1 to a vertex in V2 , every edge sequence has associated vertex sequence that alternates between V1 and V2 . Therefore, any edge sequence beginning in V1 will return to V1 after an even number of edges have been traversed and similarly for an edge sequence beginning in V2 . Therefore a closed edge sequence must contain an even number of edges. (ii) Let the vertex set of Kr,s be partitioned as {V1 , V2 } where |V1 | = r and |V2 | = s. Suppose that Kr,s is Hamiltonian. Then there is a cycle, C say,in Kr,s containing every vertex. By part (i), the associated vertex sequence alternates between vertices in V1 and vertices in V2 . Hence the cycle C contains the same number of vertices in V1 and V2 . Since C contains every vertex of Kr,s , it follows that |V1 | = |V2 |. If |V1 | = 1 = |V2 | then the graph contains only a single edge and there is no cycle at all. Hence, if Kr,s is Hamiltonian then r = s ≥ 2. Conversely, suppose that r = s ≥ 2. Let the vertex sets be V1 = {v1 , v2 , . . . , vr } and V2 = {w1 , w2 , . . . , wr }. Then the edge sequence v1 w1 , w1 v2 , v2 w2 , w2 v3 , . . . , vn−1 wn−1 , wn−1 vn , vn wn , wn v1 is a cycle that contains every vertex – see the figure below. Hence Kr,s is Hamiltonian. We have shown that Kr,s is Hamiltonian if and only if r = s ≥ 2.

10.

v1

w1

v2

w2

vr -1

wr -1

vr

wr

(i) Using Euler’s theorem, only the graphs in DM:PSA figure 11.2, and K3 and K5 in DM:PSA figure 11.4 are Eulerian. (ii) Using the result in question 7 above, the graphs in DM:PSA figure 11.1, figure 10.5 (a) and Σ in figure 10.6 are semi-Eulerian but not Eulerian. (iii) The graphs in DM:PSA figure 11.2, figure 10.4 (K3 , K4 and K5 ), figure 10.5 (b) and Γ in figure 10.6 are Hamiltonian. For the cycle graph in DM:PSA figure 11.2, a Hamiltonian cycle is the edge sequence v1 v2 , v2 v3 , v3 v4 , v4 v5 , v5 v6 , v6 v7 , v7 v1 .

296

Exercises 11.2

Solutions Manual

For the other graphs, a Hamiltonian cycle is indicated by the ‘bold’ edges in the figure.

K3

K4

Figure 11.4

K5

G

Figure 11.5(b)

Figure 11.6

(iv) Every graph in section 10.1, except those in part (iii) (which are Hamiltonian) and the graph in figure 10.1 (which is not semi-Hamiltonian), is semi-Hamiltonian but not Hamiltonian. There are three such graphs – Petersen’s graph (DM:PSA figure 11.3), the graph in DM:PSA figure 11.5 (a) and Γ in DM:PSA figure 11.6. The figure below shows non-closed paths containing every vertex – the ‘bold’ edges – in each graph.

G

Figure 11.3

11.

Figure 11.5(a)

Figure 11.6

(i) The graph of the K¨onigsberg bridges, DM:PSA figure 11.8, has four vertices of odd degree. (a) One bridge, built anywhere, will add an edge to the graph. The new graph will have exactly two vertices of odd degree so, by the result of question 7 above, the graph is semi-Eulerian. (b) Two bridges will suffice provided they do not have a land area in common. Two such bridges will add two edges to the graph with no vertex in common. Hence

Exercises 11.2

297

Discrete Mathematics: Proofs, Structures and Applications

the resulting graph will have all four vertices with even degree and will therefore be Eulerian. (ii) The graph of the K¨onigsberg bridges is Hamiltonian. A Hamiltonian cycle is shown in the figure.

12.

(i) Graph I is semi-Eulerian – see question 10 above as this graph is the graph given in DM:PSA figure 11.5 (a). Graph II has 4 vertices of odd degree so is neither Eulerian nor semi-Eulerian. (ii) Graph I is semi-Hamiltonian – again, see question 10 above. Graph II is Hamiltonian; a Hamiltonian cycle is shown in the figure.

14. Note that a knight’s tour on an n × n board, if it exists, corresponds to a Hamiltonian cycle in the corresponding graph. (i) The knight’s tour graph for the 3 × 3 board, shown in the figure is not connected. Therefore there is no knight’s tour on a 3 × 3 board.

(ii) For the 4 × 4 board, any Hamiltonian cycle must include the four ‘corner vertices’ corresponding to the corner squares on the board. However, including the only available edges for these vertices gives two disjoint cycles that cannot be extended to a Hamiltonian cycle – see figure 11.7. Therefore there is no knight’s tour on a 4 × 4 board. 298

Exercises 11.2

Solutions Manual

Figure 11.7: Knight’s tour graph for a 4 × 4 board. (iii) A bipartite graph with an odd number of vertices is not Hamiltonian. Proof By question 9 (i) above, if Γ is a bipartite graph then every cycle has even length and therefore contains an even number of vertices. Since a Hamiltonian cycle passes through every vertex, a bipartite Hamiltonian graph must have an even number of vertices. The graphs of the chess boards are bipartite since every knight move takes the piece from a white square to a black square or vice versa. Since the graphs of the 5 × 5 and 7 × 7 boards have an odd number of vertices (25 and 49 respectively), these graphs are not Hamiltonian. Therefore there is no knight’s tour for these boards. 15. If Γ is a connected graph and every vertex has even degree then Γ is Eulerian. Proof The proof is by induction on |E|, the number of edges of Γ. Any graph with no edges, |E| = 0, is trivially Eulerian since the empty path contains all the edges of the graph. Suppose that, for any connected graph Γ with |E| ≤ k, if every vertex has even degree then Γ is Eulerian. Let Γ be a connected graph with k + 1 edges and such that every vertex has even degree. Choose any closed path P in Γ beginning and ending at some vertex v. We need to justify the existence of such a closed path. Starting at any vertex, start traversing edges in any order but not repeating any edge. Since every vertex in Γ has even degree whenever we ‘arrive’ at a vertex, there is a different edge that we can use to ‘leave’ the vertex. At some stage we will visit a vertex, v say, that we have previously visited. The closed path P comprises those edges between the first and second occurrence of the vertex v. If P contains every edge of Γ it is an Eulerian path and we are done. Otherwise, remove all of the edges of P to give a new graph Γ0 . Now Γ0 may be disconnected but each component of Γ0 is connected (by definition) and has no more than k edges. Note that removing the edges of P either leaves a vertex degree unchanged (if the vertex does not belong to P ) or reduces the degree by 2 (if the vertex does belong to P ). Thus every vertex in (each component of) Γ0 also has even degree. Exercises 11.2

299

Discrete Mathematics: Proofs, Structures and Applications

From the inductive hypothesis, each component of Γ0 is Eulerian. Choose an Eulerian path in each component of Γ0 . We can use these Eulerian paths, together with P to construct an Eulerian path in Γ as follows. Start at the vertex v. Traverse the edges in P until a vertex is reached that is incident with edges not in P . Stop traversing P and instead traverse the Eulerian path in the component of Γ0 containing that vertex. Then continue along P until another vertex is reached that is incident with some edge that has not so far been traversed. Break from traversing P to traverse the Eulerian path in the corresponding component of Γ0 . Resume traversing P . Continue in this way until we return to v having traversed every edge of Γ. Therefore Γ is Eulerian and this completes the inductive step. Hence, by the strong form of mathematical induction, if Γ is a connected graph and every vertex has even degree then Γ is Eulerian. The construction of the Eulerian path in Γ is illustrated in the figure below.The path P is indicated by the thick edges. Removing P from Γ gives Γ0 which has two components that are not isolated vertices, Γ01 and Γ02 . Suppose an Eulerian path has been selected in each of these two components. The Eulerian path for Γ starts at v and traverses the edges of P to the vertex v1 . Then the Eulerian path in Γ01 is traversed, beginning and ending at v1 . The ‘journey’ along P resumes until v2 is reached. Then the Eulerian path in Γ02 is then traversed, beginning and ending at v2 . Finally, we return from v2 back to v along P . G1¢

v1

v1

P v

v

G¢2 v2

v2 G

11.3



Solutions to Exercises 11.3

3. Let the graphs be Γ(i) , Γ(ii) and Γ(iii) . The identity mapping V (Γ(i) ) → V (Γ(ii) ) defines an isomorphism Γ(i) → Γ(ii) . The vertex bijection V (Γ(i) ) → V (Γ(iii) ) given by a 7→ d, b 7→ c, c 7→ b, d 7→ a, e 7→ e defines an isomorphism Γ(i) → Γ(iii) . The same vertex bijection V (Γ(ii) ) → V (Γ(iii) ), a 7→ d, b 7→ c, c 7→ b, d 7→ a, e 7→ e, defines an isomorphism Γ(ii) → Γ(iii) . 300

Exercises 11.3

Solutions Manual

4. (ii) The graphs Γ and Σ shown in the figure below each has degree sequence (2, 2, 2, 4, 4, 5, 5). To distinguish the vertices of different degree, the vertices of degree 2 are represented by open circles, the vertices of degree 4 by filled-in circles and the vertices of degree 5 by squares. In Σ, there is a vertex of degree 2 that is adjacent to both vertices of degree 4 but in Γ there is no vertex of degree 2 with this property. Hence the two graphs are not isomorphic.

S

G

6. Note that all three graphs have degree sequence (2, 3, 3, 3, 4, 4, 5). ∼ Γ2 . An isomorphism is given by the vertex mapping V (Γ1 ) → V (Γ2 ) defined by Γ1 = a 7→ e, b 7→ f , c 7→ g, d 7→ c, e 7→ b, f 7→ a, g 7→ d. To see this we can redraw Γ1 so that it has the same appearance as Γ2 – see the figure below – and then ‘read off’ which vertices in Γ1 correspond to which vertices in Γ2 . There are other isomorphisms. For example, reflecting the redrawn Γ1 in figure 11.3, in the vertical line of symmetry gives rise to a different matching of the vertices of Γ1 and Γ2 . e a

b

c

b

f

d a

b

c

a

c e

f

g

g f

d e G1

g G1 redrawn

d G2

Γ1 ∼ 6 Γ3 and Γ2 ∼ 6 Γ3 . In Γ3 the vertex of degree 2 (vertex d) is adjacent to two vertices = = of degree 3. However in both Γ1 and Γ2 , the vertex of degree 2 (vertex e in Γ1 and vertex b in Γ2 ) is adjacent to two vertices of degree 4. 7. Let the graphs be Γ(i) , Γ(ii) , Γ(iii) , Γ(iv) and Γ(v) . Γ(i) ∼ = Γ(iii) with an isomorphism given by the vertex mapping V (Γ(i) ) → V (Γ(iii) ) defined by a 7→ h, b 7→ a, c 7→ e, d 7→ b, e 7→ f , f 7→ c, g 7→ g, h 7→ d. Exercises 11.3

301

Discrete Mathematics: Proofs, Structures and Applications

Γ(ii) ∼ = Γ(v) with an isomorphism given by the vertex mapping V (Γ(ii) ) → V (Γ(v) ) defined by a 7→ a, b 7→ b, c 7→ c, d 7→ d, e 7→ e, f 7→ g, g 7→ h, h 7→ f . No other pair of these graphs is isomorphic. First note that Γ(i) and Γ(iii) have degree sequence (2, 2, 2, 2, 4, 4, 4, 4) whereas Γ(ii) , Γ(iv) and Γ(v) have degree sequence (3, 3, 3, 3, 3, 3, 3, 3). Hence neither Γ(i) nor Γ(iii) is isomorphic to any one of Γ(ii) , Γ(iv) and Γ(v) . It remains to show that Γ(ii) ∼ 6 Γ(iv) . In Γ(ii) the shortest cycle has length 4 but in = Γ(iv) there are cycles of length 3 – the cycle agf a, for example. Hence Γ(ii) 6∼ = Γ(iv) and ∼ ∼ therefore also Γ(v) = 6 Γ(iv) (since Γ(ii) = Γ(v) ). 8. (ii) There are 34 non-isomorphic simple graphs with 5 vertices of which 21 are connected. Diagrams for these graphs, arranged in order of increasing numbers of edges, are given in the figure.

302

Exercises 11.3

Solutions Manual

11.4 1.

Solutions to Exercises 11.4 (i) There is only one tree with three vertices, shown in figure 11.8. (ii) There are two non-isomorphic trees with four vertices, shown in figure 11.8.

Figure 11.8: The non-isomorphic trees with 3 or 4 vertices. (iii) There are three non-isomorphic trees with five vertices, shown in figure 11.9.

Figure 11.9: The non-isomorphic trees with 5 vertices. (iv) There are six non-isomorphic trees with six vertices, shown in figure 11.10.

Figure 11.10: The non-isomorphic trees with 6 vertices.

3. Spanning trees are illustrated in the following figures. In each case the edges of the spanning tree are the thick edges. Figure 11.11 gives spanning trees for DM:PSA figures 11.3, 11.4 and 11.5. Figure 11.12 gives spanning trees for DM:PSA figures 11.9 and 11.10 (b). The graph in DM:PSA figure 11.10 (a) – the complete graph K3,3 – is the same as that in DM:PSA figure 11.5 (a); a spanning tree is given in figure 11.11. Spanning trees for the graphs of the regular solids (DM:PSA figure 11.11) are given in figure 11.13. Exercises 11.4

303

Discrete Mathematics: Proofs, Structures and Applications

K3

K4

K5

Figure 11.4

Figure 11.3

(a)

(b) Figure 11.5

Figure 11.11: Spanning trees for DM:PSA figures 11.3, 11.4 and 11.5.

Figure 11.9

Figure 11.10 (b)

Figure 11.12: Spanning trees for DM:PSA figures 11.9 and 11.10 (b).

Tetrahedron

Octahedron Icosahedron Cube

Figure 11.13: Spanning trees for graphs of the regular solids (DM:PSA figure 11.11). Finally, spanning trees for the isomorphic graphs in DM:PSA figure 11.12 are given in figure 11.14. 304

Exercises 11.4

Solutions Manual

Figure 11.14: Spanning trees for DM:PSA figure 11.12. 5. If r = 1 or s = 1 then Kr,s is a tree. For example, the graph K1,8 is the fourth tree from the left in DM:PSA figure 11.15. Suppose that r ≥ 2 and s ≥ 2 and the two sets of vertices in Kr,s are V1 = {v1 , v2 , . . . , vr } and V2 = {w1 , w2 , . . . , ws }. Then Kr,s contains the cycle v1 w1 v2 w2 v1 – see figure 2b on page 296. Therefore Kr,s is a tree if and only if r = 1 or s = 1. 6.

(i) A full binary tree has exactly one vertex of even degree; all the other vertices have odd degree. By exercise 10.1.7 (ii), in any graph there is an even number of vertices of odd degree. Hence full binary tree has an odd number of vertices. (ii) Let T be a full binary tree with n ≥ 3 vertices. Then T has exactly two more leaf vertices than decision vertices. Proof The proof is by induction on the number of decision vertices. If T has no decision vertices then it comprises the root vertex and two leaf vertices as shown below. Hence there are two more leaf vertices than decision vertices in this case.

Suppose that result holds for any full binary tree with k decision vertices. Let T be a full binary tree with k + 1 decision vertices. Choose any pair of leaf vertices in T that are adjacent to the same decision vertex, v say. Delete the two leaf vertices and their incident edges to form a new full binary tree T 0 . In T 0 the vertex v is now a leaf vertex – see the figure below.

v T Exercises 11.4

v T¢ 305

Discrete Mathematics: Proofs, Structures and Applications

The tree T 0 has k decision vertices so, by the inductive assumption, T 0 has two more root vertices than decision vertices. Compared with T 0 , the tree T has one more decision vertex and one more leaf vertex. This is because it has ‘gained’ two new leaf vertices but also lost one leaf vertex since v is now a decision vertex not a leaf vertex. Therefore T has two more leaf vertices than decision vertices, so the result holds for full binary trees with k + 1 decision vertices. Therefore, for all full binary trees, there are two more root vertices than decision vertices, by induction. (iii) (a) There is 1 full binary tree with 5 vertices. (b) There are 2 full binary tree with 7 vertices. (c) There are 3 full binary tree with 9 vertices. The trees are illustrated in figure 11.15.

5 vertices 7 vertices

9 vertices Figure 11.15: The full binary trees with 5, 7 and 9 vertices. 8.

(i) Let T be a tree with vertex set V and edge set E. Then |E| = |V | − 1. Proof The proof is by induction on the number of edges, |E|. If T has no edges then, since it is connected, T has only a single vertex. Hence the result holds in this case. Suppose that for all trees with k edges, |E| = |V | − 1. Let T be a tree with k + 1 edges. The tree T must have at least one vertex of degree 1. For suppose that every vertex of T has degree at least 2. Then we can start at some vertex and follow edges to

306

Exercises 11.4

Solutions Manual

keep visiting new vertices making sure we leave a vertex by a different edge than we used to enter the vertex. At some point we will visit a vertex, w say, that we have visited previously. Then the edges between the two occurrences of w form a cycle. This is a contradiction since T is a a tree. Hence T has at least one vertex of degree 1. Select any vertex v of degree 1 in T . Delete v and its incident edge to form T 0 – see the figure.

T

v



Clearly T 0 is connected and has no cycles. So T 0 is a tree with k vertices. By the inductive hypothesis, |E(T 0 )| = |V (T 0 )| − 1. Since T has one more vertex and one more edge than T 0 , we have |E(T )| = |V (T )| − 1 which completes the inductive step. Therefore |E(T )| = |V (T )| − 1 for all trees T , by induction. (ii) For any connected graph Γ, |E(Γ)| ≥ |V (Γ)| − 1. Proof Let Γ be any connected graph. Choose a spanning tree T in Γ; such a tree exists by Theorem 10.5. Then V (T ) = V (Γ) and E(T ) ⊆ E(Γ) so |V (T )| = |V (Γ)| and |E(T )| ≤ |E(Γ)|. By Theorem 10.6 (iii), |E(T )| = |V (T )| − 1. Therefore |E(Γ)| ≥ |E(T )| = |V (T )| − 1 = |V (Γ)| − 1. as required. (iii) Let Γ be a connected graph that is not a tree. Then |E(Γ)| > |V (Γ)| − 1. Proof Let Γ be a connected graph that is not a tree. Choose a spanning tree T in Γ; such a tree exists by Theorem 10.5. As in part (ii), V (T ) = V (Γ) so |V (T )| = |V (Γ)|. Since Γ is not a tree, Γ 6= T so E(T ) is a proper subset of E(Γ), E(T ) ⊂ E(Γ). Hence |E(T )| < |E(Γ)|. Exercises 11.4

307

Discrete Mathematics: Proofs, Structures and Applications

As before, |E(T )| = |V (T )| − 1, by Theorem 10.6 (iii). Therefore |E(Γ)| > |E(T )| = |V (T )| − 1 = |V (Γ)| − 1. as required. 9.

(i) Let F be a forest with c components. Then |E(F )| = |V (F )| − c. Proof The components of F are trees, T1 , T2 , . . . , Tc . For each component Ti , |E(Ti )| = |V (Ti )| − 1 and adding these equations for i = 1, 2, . . . , c gives |E(F )| = |V (F )| − c.

(ii) Let Γ be a graph with c components. Then |E(Γ)| ≥ |V (Γ)| − c. Proof Let the components of Γ be Γ1 , Γ2 , . . . , Γc . For each component Γi , |E(Γi )| ≥ |V (Γi )| − 1 by question 8 (ii). Adding these inequalities for i = 1, 2, . . . , c gives |E(Γ)| ≥ |V (Γ)| − c.

11.

(i) Let Γ be a connected graph and let e be an edge of Γ that is not a bridge. Then t(Γ) = t(Γ − e) + t(Γ \ e). Proof The set of spanning trees of Γ partitions into those that contain e and those that do not. Hence t(Γ) = number of spanning trees containing e + number of spanning trees not containing e. Any spanning tree that does not contain e is a spanning tree of Γ − e, so t(Γ − e) = number of spanning trees not containing e.

308

Exercises 11.4

Solutions Manual

Note that contracting any edge of a tree gives another tree. Thus if T is a spanning tree for Γ that contains e then T \ e is a spanning tree for Γ \ e. Also every spanning tree for Γ \ e arises in this way. Therefore t(Γ \ e) = number of spanning trees containing e. Putting these three equations together gives t(Γ) = t(Γ − e) + t(Γ \ e), as required. (ii) The result of part (i) still holds when e is a bridge but it may be simplified. If e is a bridge then every spanning tree contains e so, by part (i), t(Γ) = t(Γ \ e). Also when e is a bridge, Γ − e is disconnected so it has no spanning trees. Hence t(Γ − e) = 0. In summary, the result of part (i) holds but t(Γ − e) = 0 so t(Γ) = t(Γ \ e). 12.

(i) Graph A Clearly any spanning tree must include the edge vw. The 3-cycle subgraph with vertices v, a and b has three spanning trees, which are shown in the figure below.

a

a v

b

a v

b

v b

Similarly, the 3-cycle subgraph with vertices w, c and d also as three spanning trees. A spanning tree for Graph A is obtained by choosing a spanning tree in each of these subgraphs and adding the edge vw. The choices of spanning trees in the two subgraphs are independent. Thus there are 9 = 3 × 3 spanning trees for Graph A. Graph B A similar argument shows that we need to consider the number of spanning trees in the two subgraphs of graph B shown in the figure below. 1a.

d

b v

a c

w

e f

The first of these has eight spanning trees, shown in figure 11.16. Exercises 11.4

309

Discrete Mathematics: Proofs, Structures and Applications

b

b v

a

b v

a

b v

a

v

a

c

c

c

c

b

b

b

b

a

a

v

v

c

a

v

c

a

v

c

c

Figure 11.16: Spanning trees of the ‘left-hand’ subgraph. The second of the two subgraphs has four spanning trees (since any one of the edges may be deleted). A spanning tree for Graph B is obtained by choosing a spanning tree in each of the two subgraphs. Again the choices of spanning trees in the two subgraphs are independent. Therefore there are 32 = 8 × 4 spanning trees for Graph B. 13. (iv) Pentane C5 H12 has 5 structural isomers, shown, in figure 1

H

H

H

H

H

H

C

C

C

C

C

H

H

H

H

H

H

H H

C

H H

H

H

H

H

H

H

C

C

C

C

H

H

H H

C

H

H H

C

C

C

H

H

H H

C

H

H

H

Hexane C6 H14 has 3 structural isomers, shown in figure 11.17 . 14.

(i) The two structural isomers of C3 H6 are shown in figure 11.18. (ii) The four structural isomers of C4 H8 are shown in figure 11.19.

15. The 27 structural isomers of C5 H8 that we found are shown in figure 11.20. To keep the diagrams manageable, the carbon atoms are represented by black circles and the hydrogen atoms are represented by white circles.

310

Exercises 11.4

Solutions Manual

H

H

H

H

H

H

H

C

C

C

C

C

C

H H

H

C

H

H H

H

H

H

H

H

H

H

H

H

H

H

C

C

H H

H

C

C

C

H

H

H

C

C

C

H

C

C

H

H

H

H

C

C

H

H

H

C

H H

H H

H

H

H

H

C

C

C

C

C

H

H

H

H

H

H

H H

H

H

C

H H

H

H

C

C

C

H

H

H

H

H

H H

C

H

H

H

Figure 11.17: Structural isomers of hexane C6 H14 .

H H

H

C H

C

C

H

H

H C

H

H

H C

C

H

H

Figure 11.18: Structural isomers of C3 H6 .

H C H

H

H

C

C

C

H

H

H

H

H

H

H

C

C

H H

H

H

H

C

C

H C

C

H

H

H

H C

H

H

H C

H

H H

C

C

H

H

H

C H

C H

Figure 11.19: Structural isomers of C4 H8 .

Exercises 11.4

311

Discrete Mathematics: Proofs, Structures and Applications

Figure 11.20: Structural isomers of C5 H8 . 312

Exercises 11.4

Solutions Manual

11.5

Solutions to Exercises 11.5

1. The complete graph K5 is not planar. Proof Suppose that K5 is planar. Then a plane drawing of K5 divides the plane into faces where the boundary of each face is a cycle in K5 . Every edge forms part of the boundary of two faces so the sum of the edges belonging to the boundary of all the faces is 2|E|. In K5 the shortest cycle has length 3 so each face in the plane drawing has at least three edges in its boundary. Since every edge belongs to some cycle, 2|E| ≥ 3|F |. Now |F | = |E| − |V | + 2 from Euler’s formula, so 2|E| ≥ 3(|E| − |V | + 2) which gives 3|V | ≥ |E| + 6. However, in K5 there are 5 vertices and 10 edges so 3|V | = 15 < 16 = |E| + 6 which contradicts the inequality 3|V | ≥ |E| + 6. Hence K5 is not planar. 4.

(i) Figure 11.21 gives a plane drawing of the graph.

Figure 11.21: A plane drawing for the graph in Q4(i). (ii) (a) The graph is planar. Figure 11.22 gives a plane drawing of the graph.

Figure 11.22: A plane drawing for the graph in Q4(ii)(a). (b) Figure 11.23 shows that the graph has a subgraph isomorphic to K3,3 . Hence, by Kuratowski’s Theorem, the graph is not planar. Exercises 11.5

313

Discrete Mathematics: Proofs, Structures and Applications

Figure 11.23: A subgraph isomorphic to K3,3 . 5. (ii) The given graph, Γ say, has a subgraph which is homeomorphic to K5 . Figure 11.24 shows this. Firstly, delete the dashed edge; then remove the square vertices of degree 2. This gives a graph isomorphic to K5 . Hence, by Kuratowski’s theorem, Γ is not planar.

@ K5

Figure 11.24: A subgraph homeomorphic to K5 . 6. First, we note that, for n ≥ 1, Cn is homeomorphic to Cn+1 since adding a vertex of degree 2 into any edge of Cn produces Cn+1 . It therefore follows, by a simple induction argument, that C1 is homeomorphic to Cn for all n ≥ 1. Hence any two cyclic graphs are homeomorphic to one another (since they are each homeomorphic to C1 ). Since C3 = K3 (they are two different descriptions of thew same graph), it follows that any cyclic graph is homeomorphic to K3 . 7. (ii) Referring to figure 11.25, we first redraw the graph on the left to produce the graph in the middle. To help follow the redrawing, two vertices have been shown as an open circle and square respectively. Then the two gray vertices of degree 2 are removed and vertices of degree 2 inserted into the curved edges to produce the graph on the right of the figure. Hence the graphs are homeomorphic.

redraw

add & remove vertices of degree 2

Figure 11.25: Showing the graphs in Ex10.5.7 (ii) are homeomorphic.

314

Exercises 11.5

Solutions Manual

9.

(i) The construction of the dual graphs is illustrated in the following figures. (a)

G*

G (b)

G*

G (c)

G*

G

11.6

Solutions to Exercises 11.6

2. In any digraph D with edge set E, sum of in-degrees = sum of out-degrees = |E|. Proof Each directed edge contributes 1 to the out-degree of its initial vertex and 1 to the indegree of its final vertex. Hence each edge contributes 1 to the sum of the in-degrees and 1 to the sum of the out-degrees. Summing over all of the edged of the digraph gives the result. 4. (ii) Figure 11.26 shows a diagram of the directed graph. The vertices v1 , . . . , v5 correspond to the rows and columns of the adjacency matrix. 5. (a) All the digraphs are simple since none has directed loops or multiple directed edges. Exercises 11.6

315

Discrete Mathematics: Proofs, Structures and Applications

v1 v5

v2 v4

v3

Figure 11.26: The directed graph for Exercise 10.6.4 (ii). (b) The digraph (i) does not have a simple underlying graph since each pair of directed edges of the form

gives rise to a pair of multiple edges

in the underlying graph. Each of the remaining digraphs has simple underlying graph. (c) The digraph (i) is strongly connected. For example, following an appropriate subset of the thick directed edges in figure 11.27 gives a directed path from any selected vertex to any other selected vertex.

Figure 11.27: Defining directed paths between the vertices of digraph (i). Similarly, digraphs (ii) and (iii) are strongly connected. Digraph (iv) is not strongly connected. Referring to figure 11.28, the vertex v has out-degree 0. Therefore there is no directed path from v to any other vertex.

v Figure 11.28: There is no directed path from v to any other vertex.

316

Exercises 11.6

Solutions Manual

(d) Only digraph (iii) satisfies the condition that, for every vertex, the in-degree equals the out-degree. Hence, by Theorem 10.9, only digraph (iii) is Eulerian. (e) Figure11.29 shows a Hamiltonian cycle for digraph (iii). A little trial and error should be sufficient to show that none of the remaining graphs has a Hamiltonian cycle.

Figure 11.29: A Hamiltonian cycle for digraph (iii). 6. Let R be a relation on a set A and let D be the directed graph of R. Then the vertex set of D is A and vertices a, b ∈ A are joined by a directed edge from a to b if and only if a R b. The adjacency matrix of D has rows and columns representing the vertices; that is the elements of A. Further, the position in the row representing a and column representing b has value 1 if a R b and has value 0 if a6 R b. This is precisely the description of the binary matrix of R. Therefore the binary matrix of R is the adjacency matrix of the directed graph or R. 8. For Petersen’s graph, see Hints and Solutions. For K5 and K3,3 , figure11.30 gives strongly connected digraphs with underlying graphs K5 and K3,3 . In each case the thick directed edges form a Hamiltonian cycle which shows that the digraph is strongly connected. The directions of the thin directed edges is then arbitrary. (In the case of the digraph with underlying graph K5 , the thin directed edges also form a Hamiltonian cycle.)

Figure 11.30: Strongly connected digraphs whose underlying graphs are K5 and K3,3 . 10. A connected digraph is Eulerian if and only if the in-degree equals the out-degree for every vertex. Proof The proof is similar to the proof of Theorem 10.2 – see exercise 10.2.15 on page 299 for the proof of sufficiency. Exercises 11.6

317

Discrete Mathematics: Proofs, Structures and Applications

Let D be a connected digraph. Firstly, suppose that D is Eulerian. Then there is a closed directed path containing every directed edge of D. Whenever the path ‘passes through’ a vertex it contributes 1 to both the in-degree and the out-degree of the vertex. Since every directed edge appears exactly once in the directed path, it follows that the in-degree equals the out-degree for every vertex. The converse is proved by induction on the number of directed edges, |E|. Any digraph with no edges, |E| = 0, is trivially Eulerian since the empty (directed) path contains all the edges of the graph. Suppose that, for any connected digraph D with |E| ≤ k, if the in-degree equals the out-degree for every vertex then D is Eulerian. Let D be a connected digraph with k + 1 edges and such that the in-degree equals the out-degree for every vertex. Choose any closed directed path P in D beginning and ending at some vertex v. We need to justify the existence of such a closed directed path. Starting at any vertex, start traversing edges, respecting their directions, in any order but not repeating any edge. Since every vertex in D has equal in-degree and out-degree, whenever we ‘arrive’ at a vertex, there is a different directed edge that we can use to ‘leave’ the vertex. At some stage we will visit a vertex, v say, that we have previously visited. The closed path P comprises those directed edges between the first and second occurrence of the vertex v. If P contains every directed edge of D it is an Eulerian path and we are done. Otherwise, remove all of the edges of P to give a new graph D0 . Now D0 may be disconnected but each component of D0 is connected (by definition), has no more than k edges. Note that removing the edges of P either leaves the in-degree and out-degree of a vertex degree unchanged (if the vertex does not belong to P ) or reduces both the in-degree and outdegree by 1 (if the vertex does belong to P ). Thus every vertex in (each component of) D0 also has the property that the in-degree equals the out-degree for every vertex. From the inductive hypothesis, each component of D0 is Eulerian. In each component of D0 , choose a directed Eulerian path; that is, a directed path that contains every edge. We use these paths, together with P , to construct a directed Eulerian path in D as follows. Start at the vertex v. Traverse the edges in P until a vertex is reached that is incident with edges not in P . Stop traversing P and instead traverse the directed Eulerian path in the component of D0 containing that vertex. Then continue along P until another vertex is reached that is incident with some edge that has not so far been traversed. Break from traversing P to traverse the directed Eulerian path in the corresponding component of D0 . Resume traversing P . Continue in this way until we return to v having traversed every edge of D. Therefore D is Eulerian and this completes the inductive step. Hence, by the strong form of mathematical induction, if D is a connected graph and every vertex has even degree then D is Eulerian.

318

Exercises 11.6

Solutions Manual

12.

(i) The (in-degree, out-degree) pairs for the three digraphs are the following. D1 : (0, 2), (1, 1), (1, 3), (4, 0) D2 : (1, 1), (1, 2), (0, 3), (4, 0) D3 : (0, 2), (2, 0), (1, 3), (3, 1). Since no pair of the digraphs have the same collection of (in-degree, out-degree) pairs, no pair of the digraphs are isomorphic. (ii) Let Γi be the underlying graphs for Di for i = 1, 2, 3. The degree sequences (see Exercise 10..1.8) of the three graphs are: Γ1 : (2, 2, 4, 4) Γ2 : (2, 3, 3, 4) Γ3 : (2, 2, 4, 4). Hence Γ2 is not isomorphic either to Γ1 or to Γ3 . However Γ1 ∼ = Γ3 . An isomorphism is defined by the vertex mapping V (Γ1 ) → V (Γ3 ),

a 7→ b, b 7→ a, c 7→ c, d 7→ d.

This is illustrated in figure 11.31.

a

b

b

a

redraw d

c

G1

a

b

q

d

c

d

G2

c

Figure 11.31: Illustrating the isomorphism Γ1 → Γ3 . 13. The (in-degree, out-degree) pairs for the four digraphs are the following. D1 D2 D3 D4

: : : :

(0, 2), (0, 2), (0, 2), (1, 1),

(1, 1), (1, 1), (1, 1), (1, 1),

(1, 2), (1, 2), (1, 2), (1, 2),

(3, 0), (2, 1), (2, 1), (2, 1),

(2, 2) (3, 1) (3, 1) (2, 2).

Hence D1 is not isomorphic to any of the other three digraphs since it has a different collection of (in-degree, out-degree) pairs from each of the other three digraphs. Similarly, D4 is not isomorphic to any of the other three digraphs. Therefore the only pair of digraphs which may be isomorphic are D2 and D3 . In fact, these two digraphs are isomorphic, with an isomorphism defined by the vertex mapping V (D2 ) → V (D3 ),

a 7→ e, b 7→ a, c 7→ b, d 7→ c, e 7→ d.

This is illustrated in figure 11.32. Exercises 11.6

319

Discrete Mathematics: Proofs, Structures and Applications

a b e

c

a

b redraw

d

c

b

q

a

e

d

e

D2

d D3

c

Figure 11.32: Illustrating the isomorphism D2 → D3 .

320

Exercises 11.6

Chapter 12

Applications of Graph Theory 12.1

Solutions to Exercises 12.1

1. The redrawn trees are given in figure 12.1. (The labelings of the vertices are needed for question 2 below.) (i) (a) The height is 2. (b) The tree is complete since all leaf vertices are at height 2. (c) The tree is not full since there are parent vertices with 1, 3 and 4 children. (ii) (a) The height is 6. (b) The tree is not complete since there are leaf vertices at heights 1, 2, 3, 4, 5 and 6. (c) The tree is not full since there are parent vertices with 1, 2 and 3 children. (iii) (a) The height is 6. (b) The tree is not complete since there are leaf vertices at heights 1, 2, 3, 4, 5 and 6. (c) The tree is not full since there are parent vertices with 1, 2 and 4 children. (iv) (a) The height is 6. (b) The tree is not complete since there are leaf vertices at heights 2, 3, 4, 5 and 6. (c) The tree is not full since there are parent vertices with 2 and 3 children. (v) (a) The height is 3. (b) The tree is complete since all leaf vertices are at height 3. (c) The tree is not full since there are parent vertices with 1, 2, 3 and 4 children. (vi) (a) The height is 5. (b) The tree is not complete since there are leaf vertices at heights 1, 2, 3, 4 and 5. (c) The tree is not full since there are parent vertices with 1, 2, 3 and 5 children. 2. We use grandchildren(v ∗ ) and great-grandchildren(v ∗ ) to denote the sets of grandchildren and great-grandchildren of the root, respectively. In each of the following, the set of great-grandchildren is expressed as a union of sets of siblings. 321

Discrete Mathematics: Proofs, Structures and Applications

v*

v* a

b

c

d

a

b

c

e e

f

g

h

i

j

k

l

f

d

g

i

j

h

m k

(i)

n

l

s p q r

(ii)

t

v* a

v*

b

e

d

f

j

g

m

p r

q

b

d

g

m

j k

n p

s t

r w

x y z

(iii)

ˆ

(iv) ˆ ˆ

v* a

v* c

b e

f

g

h

a i

b

j f g h

k

q u

s

t

d

i h

l

l

c

e f

h i

k n

a

c

l m n

p

q r s t u w x y

(v)

c i

j

q

w y z

e

d k

l

r s

m

n p

t u

x

(vi)

Figure 12.1: Redrawing the rooted trees in Exercise 12.1.1. (i) grandchildren(v ∗ ) = {e, f , g, h, i, j, k, l}. great-grandchildren(v ∗ ) = ∅. (ii) grandchildren(v ∗ ) = {d, e, f , g}. great-grandchildren(v ∗ ) = {h} ∪ {i} ∪ {j}. (iii) grandchildren(v ∗ ) = {e, f , g, h, i}. great-grandchildren(v ∗ ) = {j, k} ∪ {l}. (iv) grandchildren(v ∗ ) = {d, e, f , g, h, i}. great-grandchildren(v ∗ ) = {j, k} ∪ {l, m} ∪ {n, p} ∪ {q, r}. (v) grandchildren(v ∗ ) = {d, e, f , g, h, i, j}. great-grandchildren(v ∗ ) = {k} ∪ {l, m, n} ∪ {p} ∪ {q} ∪ {r, s, t} ∪ {u, w} ∪ {x, y}. (vi) grandchildren(v ∗ ) = {f , g, h, i, j, k, l, m, n, p}. great-grandchildren(v ∗ ) = {q} ∪ {r, s} ∪ {t, u}. 322

Exercises 12.1

Solutions Manual

3. Let T be a rooted tree with root v ∗ . The relation R on VT is defined by p R q if and only if the lengths of the paths from v ∗ to p and from v ∗ to q are equal. Then R is an equivalence relation on VT . Proof For a, b ∈ VT , let d(a, b) (‘d’ for distance) denote the length of the unique path in T from a to b. Then R is defined as a R b if and only if d(v ∗ , a) = d(v ∗ , b). For all vertices a, d(v ∗ , a) = d(v ∗ , a) so a R a. Hence R is reflexive. For all vertices a and b, a R b ⇒ d(v ∗ , a) = d(v ∗ , b) ⇒ d(v ∗ , b) = d(v ∗ , a) ⇒ b R a. Hence R is symmetric. For all vertices a, b and c, a R b and b R c ⇒ d(v ∗ , a) = d(v ∗ , b) and d(v ∗ , b) = d(v ∗ , c) ⇒ d(v ∗ , a) = d(v ∗ , c) ⇒ a R c. Hence R is transitive. Since R is reflexive, symmetric and transitive, it is an equivalence relation on VT . The equivalence class of a ∈ VT is [a] = {b ∈ VT : d(v ∗ , b) = d(v ∗ , a)}. Since d(v ∗ , a) is the level of the vertex a, the equivalence class [a] is thew set of all those vertices at the same level as a. 9. Let T be a full m-ary tree of height h and vertex set V . Let B denote the set of leaf vertices and let Vk denote the set of vertices at level k where 1 ≤ k ≤ h. Then: (i) m ≤ |Vk | ≤ mk (ii) hm + 1 ≤ |V | ≤ (1 + m + m2 + · · · + mh ) (iii) h(m − 1) + 1 ≤ |B| ≤ mh . Furthermore, these inequalities cannot be strengthened. Proof Recall that in a full m-ary tree, every parent vertex has exactly m children. (i) There is at least one parent vertex at each level k = 0, 1, . . . , h − 1 and every parent vertex at level k − 1 gives rise to m vertices at level k. Since there is at least one parent vertex at level k − 1, there are at least m vertices at level k; in other words, |Vk | ≥ m. There are m vertices at level 1 since the root has m children. Exercises 12.1

323

Discrete Mathematics: Proofs, Structures and Applications

The maximum number of vertices at level 2 is m × m = m2 and this occurs when every one of the m vertices at level 1 is a parent. The maximum number of vertices at level 3 is m × m2 = m3 and this occurs when (a) there are m2 vertices at level 2 and (b) every vertex at level 2 is a parent. The maximum number of vertices at level 4 is m × m3 = m4 and this occurs when (a) there are m3 vertices at level 3 and (b) every vertex at level 3 is a parent. Continuing in this way, the maximum number of vertices at level k is mk and this occurs when every vertex at every level less than k is a parent. Hence |Vk | ≤ mk . Therefore m ≤ |Vk | ≤ mk , as required. (ii) Adding the number of vertices at each level from 0 to the height h (and noting that the root is the only vertex at level 0) gives |V | = 1 + |V1 | + |V2 | + · · · + |Vh |. From part (i), m ≤ |Vk | ≤ mk for 1 ≤ k ≤ h. Therefore hm + 1 ≤ |V | ≤ (1 + m + m2 + · · · + mh ), as required. (iii) The tree has the fewest leaf vertices when it has the fewest number of vertices in total; this is when there is only one parent vertex at each level k where 1 ≤ k ≤ h. In this case, by part (i), there are m vertices at each level k = 1, 2, . . . , h. At each level up to level h − 1, m − 1 of the m vertices are leaf vertices, since there is exactly one parent vertex at each level up to h−1. At level h, all m vertices are leaf vertices. Therefore |B| ≥ (h − 1)(m − 1) + m = hm − m − h + 1 + m = hm − h + 1 = h(m − 1) + 1. The tree has the most leaf vertices when it has the greatest number of vertices in total; this is when every vertex below level h is a parent vertex so all the leaf vertices are at level h. By part (i), there are mh leaf vertices at level h, so |B| ≤ mh . Therefore,combining the two previous inequalities gives h(m − 1) + 1 ≤ |B| ≤ mh , as required. To see that the inequalities cannot be strengthened we note that it is possible for a tree to have (a) only one parent vertex at each level below h or (b) every vertex below level h as a parent vertex. These two cases are illustrated in figure 12.2 where m = 3 and h = 3. For the tree T1 , there is only one parent vertex at each level so |Vk (T1 )| = 3 for k = 1, 2, 3. Thus T1 achieves the lower bound in the inequality in part (i). Adding the vertices at each level, T1 has |V (T1 )| = 1 + 3 × 3 = 1 + hm, the lower bound in part (ii). Finally, adding the leaf vertices at each level T1 has |B| = 2 + 2 + 3 = 3 × 2 + 1 = h(m − 1) + 1; again, T1 attains the lower bound in part (iii). 324

Exercises 12.1

Solutions Manual

V1 = 3

V1 = 3

V2 = 3

V2 = 32

V3 = 3

V3 = 33 T1

T2

Figure 12.2: Trees with |Vk | = m and |Vk | = mk .

For the tree T2 , every vertex at each level less than h = 3 is a parent so |Vk (T2 )| = 3k for k = 1, 2, 3. Thus T2 achieves the upper bound in the inequality in part (i). Adding the vertices at each level, T2 has |V (T2 )| = 1 + 3 + 32 + 33 = 1 + m + m2 + · · · + mh , the upper bound in part (ii). Finally, T2 has |B| = 33 = mh leaf vertices, all at level h = 3; again, T2 attains the upper bound in part (iii). 10.

(i) (a)

* Å x

Å y

z

t

(c)

Å

* r

* s

z

Å x

y

(e)

* z

Å y

Å x

* r

s

(ii) (a) There are two different interpretations: x ∗ (y ∗ z) and (x ∗ y) ∗ z. If ∗ is associative, these two expressions are equal so there is only 1 interpretation. (b) There are five different interpretations: t ⊕ (x ∗ (y ∗ z)), t ⊕ ((x ∗ y) ∗ z), (t ⊕ x) ∗ (y ∗ z), (t ⊕ (x ∗ y)) ∗ z, ((t ⊕ x) ∗ y) ∗ z. If ∗ is associative then t ⊕ (x ∗ (y ∗ z)) = t ⊕ ((x ∗ y) ∗ z) Exercises 12.1

325

Discrete Mathematics: Proofs, Structures and Applications

and (t ⊕ x) ∗ (y ∗ z) = ((t ⊕ x) ∗ y) ∗ z, so there are 3 essentially different interpretations. (c) There are five different interpretations: t ∗ (x ⊕ (y ∗ z)), t ∗ ((x ⊕ y) ∗ z), (t ∗ x) ⊕ (y ∗ z), (t ∗ (x ⊕ y)) ∗ z, ((t ∗ x) ⊕ y) ∗ z. If ∗ is associative then t ∗ ((x ⊕ y) ∗ z) = (t ∗ (x ⊕ y)) ∗ z so there are 4 essentially different interpretations. 11.

(i) (b) ⊕ ∗ ⊕ x y z t. (d) ∗ r ⊕ s ∗ ⊕ x y z. (ii) The construction of the binary tree from an infix expression is best described recursively, as follows. Read the next symbol in the infix expression. • If the symbol is an operation symbol (⊕ or ∗), write the symbol as the root of a binary tree with two branches. Go to the left branch end and read the next symbol in the infix expression. • If the symbol is a variable symbol (x, y, z etc), write the symbol at the current branch end. Go to the next branch end and read the next symbol in the infix expression. Stop when all symbols have been read. We illustrate this by constructing the binary tree of the expression ⊕ ∗ r ⊕ s t ⊕ ∗ x y z. The indentation in the description indicates the level of our current position in the tree. Read ⊕. Write ⊕ as the root of as binary tree with two branches. Go to the left branch end. Read ∗. Write ∗ as the root of as binary tree with two branches. Go to the left branch end. Read r. Write r at the current branch end. Go to next branch end. At this stage we have the following tree where the dashed box indicates our current ‘position’ in the tree.

326

Exercises 12.1

Solutions Manual

Å

* r Read ⊕. Write ⊕ as the root of as binary tree with two branches. Go to left branch end. Read s. Write s at the current branch end. Go to next branch end. Read t. Write t at the current branch end. Go to next branch end. At this stage we have the tree shown below where the dashed box indicates our current ‘position’ in the tree.

Å

* r

Å s

t

Read ⊕. Write ⊕ as the root of as binary tree with two branches. Go to left branch end. Read ∗. Write ∗ as the root of as binary tree with two branches. Go to left branch end. Read x. Write x at the current branch end. Go to next branch end. Read y. Write y at the current branch end. Go to next branch end. Read z. Write z at the current branch end. Go to next branch end. Stop: no further branch ends available. This gives the binary tree for the infix expression ⊕ ∗ r ⊕ s t ⊕ ∗ x y z shown in figure 12.3. 12.

(i) (b) x y ⊕ z ∗ t ⊕. (d) r s x y ⊕ z ∗ ⊕∗.

Exercises 12.1

327

Discrete Mathematics: Proofs, Structures and Applications

Å

* r

Å

s

z

*

Å t

x

y

Figure 12.3: Binary tree for ⊕ ∗ r ⊕ s t ⊕ ∗ x y z. (ii) The construction of the binary tree is essentially that given in Exercise 11.11 (ii) above but read ‘right to left’ (including visiting rightmost branches of the binary tree before leftmost branches). Reading from right to left, read the next symbol in the postfix expression. • If the symbol is an operation symbol (⊕ or ∗), write the symbol as the root of a binary tree with two branches. Go to the right branch end and read the next symbol in the postfix expression. • If the symbol is a variable symbol (x, y, z etc), write the symbol at the current branch end. Go to the next branch end (visiting branches from right to left( and read the next symbol in the postfix expression. Stop when all symbols have been read. We illustrate the construction by constructing the binary tree for the expression r s x y ⊕ z ∗ ⊕∗ given in part (i) (d) above. Read ∗. Write ∗ as the root of as binary tree with two branches. Go to right branch end. Read ⊕. Write ⊕ as the root of as binary tree with two branches. Go to right branch end. Read ∗. Write ∗ as the root of as binary tree with two branches. Go to right branch end. Read z. Write z at the current branch end. Go to next branch end. Read ⊕. Write ⊕ as the root of as binary tree with two branches. Go to right branch end. Read y. Write y at the current branch end. Go to next branch end. Read x. Write x at the current branch end. Go to next branch end. Read s. 328

Exercises 12.1

Solutions Manual

Write s at the current branch end. Go to next branch end. Read r. Write r at the current branch end. Go to next branch end. Stop: no further branch ends available. The result is the binary tree given in Hints and Solutions. 13. (ii)

Infix: Prefix: Postfix:

(x ∗ (y ⊕ t) ∗ (y ∗ (x ⊕ (z ∗ r))) ∗∗x⊕y t∗y⊕x∗z r x y t ⊕ ∗ z x z r ∗ ⊕ ∗ ∗.

14. (ii) (a) The tree for the expression x1 ⊕ (x2 ∗ x3 ) is given in the figure.

Å x1



* x2

x3

(c) The tree for the expression x1 ⊕ {x2 ∗ [x3 ⊕ (x4 ∗ x5 )]} is given in the figure.

Å x1

* x2



Å x3

* x4 – x5

12.2

Solutions to Exercises 12.2

1. (iii)

8 1

64 4 2

Exercises 12.2

32 16

256 128 512

329

Discrete Mathematics: Proofs, Structures and Applications

2. In each case the sorted list is 2, 3, 4, 6, 10, 12, 15, 16, 18, 19, 20, 21, 22, 23, 25, 26. However, the way that the algorithm obtains the list is different. We shall describe the working of the algorithm in a similar way to Example 11.6 in the the text. (i) Step 1: Process left-subtree(18) Step 1: Process left-subtree(10) Step 1: Process left-subtree(6) Step 1: Process left-subtree(2) [Empty] Step 2: List 2 Step 3: Process right-subtree(2) Step 1: Process left-subtree(4) Step 1: Process left-subtree(3) [Empty] Step 2: List 3 Step 1: Process right-subtree(3) [Empty] Step 2: List 4 Step 3: Process right-subtree(4) Step 1: Process left-subtree(5) [Empty] Step 2: List 5 Step 3: Process right-subtree(5) [Empty] Step 2: List 6 Step 3: Process right-subtree(6) [Empty] Step 2: List 10 Step 3: Process right-subtree(10) Step 1: Process left-subtree(15) Step 1: Process left-subtree(12) [Empty] Step 2: List 12 Step 3: Process right-subtree(12) [Empty] Step 2: List 15 Step 3: Process right-subtree(15) Step 1: Process left-subtree(16) [Empty] Step 2: List 16 Step 3: Process right-subtree(16) [Empty] Step 2: List 18 Step 3: Process right-subtree(18) Step 1: Process left-subtree(20) Step 1: Process left-subtree(19) [Empty] Step 2: List 19 Step 3: Process right-subtree(19) [Empty] Step 2: List 20 Step 3: Process right-subtree(20) Step 1: Process left-subtree(25) Step 1: Process left-subtree(22) Step 1: Process left-subtree(21) [Empty] Step 2: List 21 Step 3: Process right-subtree(21) [Empty] Step 2: List 22 Step 3: Process right-subtree(22) Step 1: Process left-subtree(23) [Empty] Step 2: List 23 330

Exercises 12.2

Solutions Manual

Step 3: Process right-subtree(23) [Empty] Step 2: List 25 Step 3: Process right-subtree(25) Step 1: Process left-subtree(26) [Empty] Step 2: List 26 Step 3: Process right-subtree(26) [Empty] (ii) Step 1: Process left-subtree(6) Step 1: Process left-subtree(4) Step 1: Process left-subtree(2) [Empty] Step 2: List 2 Step 3: Process right-subtree(2) Step 1: Process left-subtree(3) [Empty] Step 2: List 3 Step 3: Process right-subtree(3) [Empty] Step 2: List 4 Step 3: Process right-subtree(4) Step 1: Process left-subtree(5) [Empty] Step 2: List 5 Step 3: Process right-subtree(5) [Empty] Step 2: List 6 Step 3: Process right-subtree(6) Step 1: Process left-subtree(20) Step 1: Process left-subtree(19) Step 1: Process left-subtree(10) [Empty] Step 2: List 10 Step 3: Process right-subtree(10) Step 1: Process left-subtree(15) Step 1: Process left-subtree(12) [Empty] Step 2: List 12 Step 3: Process right-subtree(12) [Empty] Step 2: List 15 Step 3: Process right-subtree(15) Step 1: Process left-subtree(16) [Empty] Step 2: List 16 Step 3: Process right-subtree(16) Step 1: Process left-subtree(18) [Empty] Step 2: List 18 Step 3: Process right-subtree(18) [Empty] Step 2: List 19 Step 3: Process right-subtree(19) [Empty] Step 2: List 20 Step 3: Process right-subtree(20) Step 1: Process left-subtree(22) [Empty] Step 2: List 22 Step 3: Process right-subtree(22) Step 1: Process left-subtree(26) Step 1: Process left-subtree(25) Step 1: Process left-subtree(23) [Empty] Step 2: List 23 Exercises 12.2

331

Discrete Mathematics: Proofs, Structures and Applications

Step 3: Process right-subtree(23) [Empty] Step 2: List 25 Step 3: Process right-subtree(25) [Empty] Step 2: List 26 Step 3: Process right-subtree(26) [Empty] 3.

(i) The sort tree constructed from the unsorted list is shown in figure 12.4.

17 5 2

31 7

3

23 11

19

29

13 Figure 12.4: The sort tree for Q3 (i). Processing the sort tree is described below. Step 1: Process left-subtree(17) Step 1: Process left-subtree(5) Step 1: Process left-subtree(2) [Empty] Step 2: List 2 Step 3: Process right-subtree(2) Step 1: Process left-subtree(3) [Empty] Step 2: List 3 Step 3: Process right-subtree(3) [Empty] Step 2: List 5 Step 3: Process right-subtree(5) Step 1: Process left-subtree(7) [Empty] Step 2: List 7 Step 3: Process right-subtree(7) Step 1: Process left-subtree(11) [Empty] Step 2: List 11 Step 3: Process right-subtree(11) Step 1: Process left-subtree(13) [Empty] Step 2: List 13 Step 3: Process right-subtree(13) [Empty] Step 2: List 17 Step 3: Process right-subtree(17) Step 1: Process left-subtree(31) Step 1: Process left-subtree(23) Step 1: Process left-subtree(19) [Empty] Step 2: List 19 Step 3: Process right-subtree(19) [Empty] Step 2: List 23 Step 3: Process right-subtree(23) 332

Exercises 12.2

Solutions Manual

Step 1: Process left-subtree(29) [Empty] Step 2: List 29 Step 3: Process right-subtree(29) [Empty] Step 2: List 31 Step 3: Process right-subtree(31) [Empty] Hence the final sorted list is 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31. 4.

(i) The heap is given in Hints and Solutions. The construction of the heap is shown in figure 12.5. Reading left to right, top to bottom the trees in the figure are the heaps created by adding the next element of the list as a branch and then performing any bubbling up that may be necessary. 7

7

15

3

3

15 7

4

15 7

12

3 15 14 4

7

8

14 4

7

6

8 3

14 4

2 4

14 7 5

7

7

6

8 3

14 5

7

6

2 4

19

13

3

4

12

2

15

12

3

14

15

12

3

8

12

15

12 6

7 4

15

12 3

3

15

13 6

8 3

15 12

2 4

14

6

5 7

Figure 12.5: Creating the heap for Exercise 4 (i). (ii) The heap is given in Hints and Solutions. Again, the step-by-step construction of the heap is shown in figure 12.6. (iii) In this case we describe the construction of the heap in more detail although we will not draw a diagram for every stage of the construction. The order relation is divisibility: a R b if and only if a|b. In the chapter, the order relation has been denoted ≤. To remind ourselves that the relation here is not ordinary ‘less than or equals’ for integers, we will write a 4 b for a R b (or a|b). Firstly, place 8 as the root and then add 64 as a left branch. Since 8 4 64, we swap the two vertices. Next, add 1 as a right branch which completes level 1 of the (current) heap. The vertices 4 and 256 are then added as left and right children of 8, respectively. Now 8 4 256 so 256 is bubbled up through the tree by swapping firstly with 8 and then with 64 (since 64 4 256). This is illustrated in figure 12.7, where the Exercises 12.2

333

Discrete Mathematics: Proofs, Structures and Applications

when

when

when

shall

when

shall

we

three

when we

three

shall when

when

three shall

shall

we shall

meet when

three

meet again

we

we meet again

thunder in

three

we

meet again

in

shall when

when

thunder three shall

we meet

again

thunder in

three

lightening

we or

again

shall lightening meet when

when

thunder three

in

we or

thunder

again

in

three

shall lightening meet in

we or

rain

shall lightening meet in

in

again

Figure 12.6: Creating the heap for Exercise 4 (ii).

tree on the right of the diagram is the ‘partial heap’ constructed from the segment 8, 64, 1, 4, 256 of the unsorted list.

64 8 4

64 1

256

1

256 4

256

8

64 4

1 8

Figure 12.7: The ‘partial heap’ constructed from 8, 64, 1, 4, 256. Now 512 is added as a left branch of 1. Since 1 4 512, these vertices are swapped; then 256 4 512 so these vertices are swapped. The effect of this is that 512 has bubbled up to the root of the tree; this is ilustrated in figure 12.8 (a). Next 2 is added as a right branch of 256 to give the ‘partial heap’ shown in figure 12.8 (b). The next step is start level 3 of the tree. Firstly, 32 is added as a left branch of 4. Since 4 4 32, these vertices are swapped but, since 32 4 64, the vertex 32 is not bubbled up any further. 334

Exercises 12.2

Solutions Manual

256

512

64 4

1 8

512

64

512

256

4

8

64

1

4

256 8

(a)

1

2

(b)

Figure 12.8: Partial heaps for (a) 8, 64, 1, 4, 256, 512; (b) 8, 64, 1, 4, 256, 512, 2.

Then 128 is added a a right branch of 32 and then bubbled up through the tree as shown in figure 12.9. The tree on the right of the figure is the partial heap for 8, 64, 1, 4, 256, 512, 32, 128.

512 64 32 4 128

512 256

8

1

512

64 2

8

128 4

256 1

256

128 2

64

32

4

8

1

2

32

Figure 12.9: Bubbling 128.

Finally, 16 is firstly added as a left branch from 8 and then, because 8 4 16, these vertices are swapped. Since 16 4 64, 16 is not bubbled up the tree any further. This gives the final heap, shown in figure 12.10.

512 128 64 4 32

256 16

1

2

8

Figure 12.10: The heap for 8, 64, 1, 4, 256, 512, 32, 128, 16.

5. (ii) The sequence in figure 12.11 shows the positions after each new vertex is fixed and the remaining part of the tree is restored to a heap. Exercises 12.2

335

Discrete Mathematics: Proofs, Structures and Applications

40

35

35

30

15 8 7

18 3

5

18

20 13

6

25 2

4

30

15 14

50

8

13 3

5

7

6

25 2

4

14

5

6 7

4

14 2 30

15 35

8

13 3

5

6 7

14 7 5

6 18

20

4

8

2 25 30

2

8 35

40 50

4

35

7 3 15

5 18

13

3 14 15

5 18

20

2

4 35

20

2 25 30

2

6 7

35

13

14 15

6

7

5 18

20

7 14 15

5 18

20

25 30

13

35

2 25 30

35

8

2 35

13

5 3

14 15

7 18

20

8 25 30

35

40 50

5 35

20

4

25 30

3

2 8

2 25 30

6

4 3

20

6

3

5 4

18

3

6

40 50

14 15

5

8

25 30

4

40 50

2

13 3

7 6

35

40 50

8

4

4

6

40 50

7

4

13

13

25 30

2

14

14

13

6

40 50

15

3

7

15

14

40 50

8

5

14

18

18

40 50

4

3

20

20

13 3

8

13

40 50

20

15 8

25

15

40 50

18

13

18

20

25

40 50

30

3 6

14 15

7 18

20

2 8

25 30

5 35

40 50

13

4 6

14 15

7 18

20

8 25 30

35

40 50 2 3

5 13

4 6

14 15

7 18

20

8 25 30

35

40 50

Figure 12.11: Creating the ‘sorted tree’ for Exercise 5 (ii).

6.

(i) The construction of the heap is shown in figure 12.12. Reading left to right, top to bottom the trees in the figure are the heaps created by adding the next element of the list as a branch and then performing any bubbling up that may be necessary. The sequence in figure 12.13 shows the positions after each new vertex is fixed and the remaining ‘unfixed’ part of the tree is restored to a heap. (The last two iterations are used to obtain the final diagram.) The sorted list can be read from the final tree: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31.

336

Exercises 12.2

Solutions Manual

17

31

31

17

31

17

5

23

31 5

23

17 31

2

31

23

7

17

17

2

31

23

5

19

17

2

5

29

5

7

23

19 2

5

7

17 31

31

29 23

19 2

5

31

29 7

19

23

17 11

3

29

5

7

23

17 11 2

19 13

17 11 2

5

7

3

Figure 12.12: Creating the heap for Exercise 6 (i). 29

23

23 17

19 13

3 11 2

5

17 7

31

11 3

19 13

7 5

2

2

13

3

5

17

2

3

7

19 23 29 31

17

2 3

11

13

19 23 29 31

2 17

2

7

5 3

5

5

19 23 29 31

5

19 23 29 31

13

11 7

7

11

11

3 23 29 31

11

19 23 29 31

2

7

7

13

13 3

5

17

2 29 31

17

11

19

13

3 17

7

5 11

13

17

19 23 29 31

Figure 12.13: Creating the ‘sorted tree’ for Exercise 6 (i).

(ii) The construction of the heap is shown in figure 12.14 where the first diagram shows the heap comprising the first three elements of the list. The sequence in figure 12.15 shows the creation of the ‘sorted tree’. To save space, the positions are shown only after two new vertices have been fixed (and the remaining part of the tree is restored to a heap). Exercises 12.2

337

Discrete Mathematics: Proofs, Structures and Applications

cbc

cbc

bca

acb

cbc

bcb

acb

bcb

bca

bca

cbc cac bac

acb bac

bca

cac bac

bcb

acb

abc

bca

cac bac

acb

bcb abc

bac

cbc cac

bac

bca

cac

acb

aca bab aba

abc

cbc

cba abc

acb

aca bab

cbc bcb

acb

cbc

aca

bca

bcb

cbc

bcb bca

cbc

bca

cac bcb

acb

cba abc

aca bab aba bac

bca

cac bcb

cab

aca bab aba bac

abc

acb

Figure 12.14: Creating the heap for Exercise 6 (ii).

The sorted list can be read from the final tree: aba, abc, aca, acb, bab, bac, bca, bcb, cab, cac, cba, cbc. cac

bcb

bcb bca

cab bac

acb

aca bab aba cba

bca abc

cbc

bab

acb bac

abc

abc

acb aca

aba bac

bcb cab cac cba cbc

acb

aca bab

bca

aba

aba bca

aba

bcb cab cac cba cbc

abc

aca bab

aba

bab

aca cab cac cba cbc

acb

abc

bac

bac

bcb cab cac cba cbc

abc bca

acb

aca bab

bac

bca

bcb cab cac cba cbc

Figure 12.15: Creating the ‘sorted tree’ for Exercise 6 (ii).

7.

(i) The sort tree constructed from the unsorted list is shown in figure 12.16. Processing the sort tree is described below. Step 1: Process left-subtree(group) Step 1: Process left-subtree(heap) [Empty] Step 2: List heap Step 3: Process right-subtree(heap)

338

Exercises 12.2

Solutions Manual

group heap

morphism sort tree

Boolean

algorithm

algebra discrete

Figure 12.16: The sort tree for Exercise 7 (i). Step 1: Process left-subtree(sort) [Empty] Step 2: List sort Step 3: Process right-subtree(sort) Step 1: Process left-subtree(tree) [Empty] Step 2: List tree Step 3: Process right-subtree(tree) [Empty] Step 2: List group Step 3: Process right-subtree(group) Step 1: Process left-subtree(morphism) Step 1: Process left-subtree(Boolean) Step 1: Process left-subtree(algebra) [Empty] Step 2: List algebra Step 3: Process right-subtree(algebra) [Empty] Step 2: List Boolean Step 3: Process right-subtree(Boolean) Step 1: Process left-subtree(discrete) [Empty] Step 2: List discrete Step 3: Process right-subtree(discrete) [Empty] Step 2: List morphism Step 3: Process right-subtree(morphism) Step 1: Process left-subtree(algorithm) [Empty] Step 2: List algorithm Step 3: Process right-subtree(algorithm) [Empty] Hence the final sorted list is heap, sort, tree, group, algebra, Boolean, discrete, morphism, algorithm. (ii) The construction of the heap is shown in figure 12.17 where the first diagram shows the heap comprising the first three elements of the list. The sequence in figure 12.18 shows the creation of the ‘sorted tree’. To save space, the positions are only shown after two new vertices have been fixed and the remaining part of the tree is restored to a heap. Hence the sorted list can be read from the final tree: heap, sort, tree, group, algebra, Boolean, discrete, morphism, algorithm. Exercises 12.2

339

Discrete Mathematics: Proofs, Structures and Applications

morphism group

morphism

heap

group

morphism heap

Boolean

sort

sort

morphism Boolean sort

heap

Boolean sort

morphism

group

algorithm Boolean tree

heap

algebra

algorithm morphism

group

group

algorithm algebra

group

heap

heap

algebra

sort

discrete Boolean sort

morphism

group

heap

algebra

tree

Figure 12.17: Creating the heap for Exercise 7 (ii). discrete Boolean sort

algebra algebra

group

heap

group

tree

morphism algorithm

sort

heap tree

morphism algorithm tree

sort group

Boolean discrete

heap heap

sort

algebra Boolean discrete

morphism algorithm

group

tree

algebra Boolean discrete

morphism algorithm

Figure 12.18: Creating the ‘sorted tree’ for Exercise 7 (ii). 10. The sort tree constructed from the unsorted list is shown in figure 12.19. Processing the sort tree is described below. Step 1: Process left-subtree(10) Step 1: Process left-subtree(2) Step 1: Process left-subtree(1) [Empty] Step 2: List 1 Step 3: Process right-subtree(1) [Empty] Step 2: List 2 Step 3: Process right-subtree(2) 340

Exercises 12.2

Solutions Manual

10 2 1

6 5

3

30 15

60 4 20 12

Figure 12.19: The sort tree for Exercise 10. Step 1: Process left-subtree(5) [Empty] Step 2: List 5 Step 3: Process right-subtree(5) [Empty] Step 2: List 10 Step 3: Process right-subtree(10) Step 1: Process left-subtree(6) Step 1: Process left-subtree(3) [Empty] Step 2: List 3 Step 3: Process right-subtree(3) [Empty] Step 2: List 6 Step 3: Process right-subtree(6) Step 1: Process left-subtree(30) Step 1: Process left-subtree(15) [Empty] Step 2: List 15 Step 3: Process right-subtree(15) [Empty] Step 2: List 30 Step 3: Process right-subtree(30) Step 1: Process left-subtree(60) Step 1: Process left-subtree(4) [Empty] Step 2: List 4 Step 3: Process right-subtree(4) Step 1: Process left-subtree(20) [Empty] Step 2: List 20 Step 3: Process right-subtree(20) Step 1: Process left-subtree(12) [Empty] Step 2: List 12 Step 3: Process right-subtree(12) [Empty] Step 2: List 60 Step 3: Process right-subtree(60) [Empty] Exercises 12.2

341

Discrete Mathematics: Proofs, Structures and Applications

The elements have been listed in the following order: 1, 2; 5, 10; 3, 6; 15, 30; 4, 20; 12, 60. This list forms five blocks, each of which is a chain, as indicated.

12.3

Solutions to Exercises 12.3

1. In each of the figures 12.20-12.23, graph (a) shows a spanning tree produced by a depthfirst search and graph (b) shows a spanning tree produced by a breadth-first search. In each case, the vertices are labelled in the order in which they are visited. For the depthfirst search graphs, the ‘open’ vertices show where backtracking was required. For the breadth-first graphs, the ‘open’ vertices are those vertices where new edges are added to the tree when the vertex is the current centre. (i) In figure 12.20, backtracking was required twice in the depth-first search and the breadth-first search was completed in three phases.

v6 v3

v5

v4 v2

v7

v7

v0

v5

v1

v6

v3 v2

(a)

v4 v0 v1

(b)

Figure 12.20: Spanning trees for graph (i) (ii) In figure 12.21, no backtracking was required in the depth-first search and the breadth-first search was completed in two phases.

v7

v0

v6 v5

v4

(a)

v1

v5

v2

v4

v3

v7

v0

v1 v2

v3

v6

(b)

Figure 12.21: Spanning trees for graph (ii) (iv) In figure 12.22, backtracking was required twice in the depth-first search and the breadth-first search was completed in six phases. 342

Exercises 12.3

Solutions Manual

v1

v14

v15 v12 v10 v11

v13

v2

v9

v5 v6

v8

v0

v6

v3

v10

v4

v13

v7

v15

v3

v1

v7

v4

v11

v8

v2 v5 v9

v12

v14

(a)

v0

(b)

Figure 12.22: Spanning trees for graph (iv) (v) In figure 12.23, backtracking was required at six vertices in the depth-first search and the breadth-first search was completed in three phases. v8

v7 v6 v5

v9

v11

v10

v12

v0 v3

v4

(a)

v9

v1

v8

v2

v12 v11

v10

v5

v6

v4

v0

v1 v2

v3

v7

(b)

Figure 12.23: Spanning trees for graph (v)

3. If Γ is a connected graph then the breadth-first algorithm 11.5 produces a spanning tree in Γ. Proof Since we only ever add an edge to a new vertex, it is clear that, if Tn is a tree, then adjoining en to form Tn+1 does not create a cycle. Hence, if Tn is a tree then so, too, is Tn+1 . The single vertex T0 is a tree so, by induction, all of the graphs produced by the algorithm are trees. Let Tm be the final tree produced by the algorithm. We need to show that Tm is a spanning tree. Suppose that Tm is not a spanning tree. Let W be the set of vertices of Γ that do not belong to Tm ; since Tm is not a spanning tree, W 6= ∅. Since Γ is connected, there is some vertex v in Tm that is adjacent to some vertex w ∈ W that is not in Tm . Then Tm could not have been the final tree produced by the algorithm because, when Exercises 12.3

343

Discrete Mathematics: Proofs, Structures and Applications

v ∈ V (Tm ) was the current centre, the edge vw would have been added to the tree. This contradiction shows that Tm must be a spanning tree. 5. (ii) Spanning trees obtained by depth-first search – graph (a) – and breadth-first search – graph (b) – are given in figure 12.24. As in the solution to question 1, the vertices are labelled in the order in which they are visited. For the depth-first search graph, the ‘open’ vertices show where backtracking was required. For the breadth-first graph, the ‘open’ vertices are those vertices where new edges are added to the tree when the vertex is the current centre. v3

v2

v10

v5 v1

X = v6

v4

v7

v9

v8 v11

E = v0

(a)

v4

v2

v3 v1

X = v6

v5

v8

v7 v9

v10 v11

E = v0

(b)

Figure 12.24: Spanning trees for the museum. (iii) In both cases, the vertex X is the sixth vertex to be visited (with the particular set of choices that have been made). However, in terms of the number of edges traversed by the visitor to reach X, the depth-first search is to be preferred. For the depth-first search, the sequence of edges traversed is v0 v1 , v1 v2 , v2 v3 , v3 v4 , v4 v5 , v5 v4 , v4 v6 . For breadth-first search, the visitor traverses the edges v0 v1 , v1 v2 , v2 v1 , v1 v3 , v3 , v1 , v1 v2 , v2 v4 , v4 v2 , v2 v1 , v1 v3 , v3 v5 , v5 v3 , v3 v1 , v1 v2 , v2 v4 , v4 v2 , v2 v1 , v1 v3 , v3 v5 , v5 v6 . 6. The graph representing the maze is given in the Hints and Solutions. Figure 12.25 shows trees obtained by depth-first search – graph (a) – and breadth-first search – graph (b). (As previously, for the depth-first search graph, the ‘open’ vertices show where backtracking was required and, for the breadth-first graph, the ‘open’ vertices are those vertices where new edges are added to the tree when the vertex is the current centre.) In the depth-first search, the vertices are added to the tree in the order: E, M, L, R, S, T, G, P, Q, U, H, B. In the breadth-first search, the vertices are added to the tree in the order: E, M, D, L, S, A, J, R, U, T, F, K, Q, G, P, H, B. In this case, the depth-first search exits the maze more quickly. Figure 12.26 shows the results of depth-first search – graph (a) – and breadth-first search – graph (b) – where the vertex that comes first in the alphabet is always chosen when there is a choice of vertices. 344

Exercises 12.3

Solutions Manual

R

K

S

U

Q

K

L P

M D

F

S

U

Q

L

J

A

R

E

T

G

N

C

J

H

B

P

M D

A

F

E

(a)

T

G

N

C

H

B

(b)

Figure 12.25: Partial searches for the maze. In the depth-first search, the vertices are added to the tree in the order: E, M, D, A, F, J, K, R, L, S, T, G, P, H, B. In the breadth-first search, the vertices are added to the tree in the order: E, M, D, L, S, A, J, R, T, U, F, K, G, Q, P, H, B. Again, the depth-first search exits the maze more quickly. R

K

S

U

Q

K

L J

P

M

F

S

U

Q

L

D

A

R

E

T

G

N

C

J

H

B

(a)

P

M D

A

F

E

T

G

N

C

H

B

(b)

Figure 12.26: Partial searches for the maze following the ‘alphabetical ordering’ rule.

12.4

Solutions to Exercises 12.4

1. (ii) The construction of a minimal spanning tree using Prim’s algorithm is shown in figure 12.27. Each diagram (except the last) shows the result of two steps in the algorithm; in other words, each diagram shows two edges added to the tree. The final spanning tree has weight 54. (iv) The construction of a minimal spanning tree using Prim’s algorithm is shown in figure 12.28. Again, each diagram (except the last) shows two edges added to the tree. The final spanning tree has weight 20. Exercises 12.4

345

Discrete Mathematics: Proofs, Structures and Applications

3 2

2

3 1

2

5 2

3

4

5

5

3

5

2

v

1

5

5

v

1

3

5

v

3

v

1

3 2

3

v

1

3

3

5

v

1

5

7

4

5 5

7

4

2

4

2 5

3 2

3

5 5

2

v

1

3 3

4

7 4

5

v

1

5

5 5 4

7

2

4

2 5

5 1

4

1

4

3

Figure 12.27: Prim’s algorithm applied to graph (ii).

2 1

1

4

3

4

v

v 4 2

2

1 4

v

3 3

1 3 4

3 3

3

v

Figure 12.28: Prim’s algorithm applied to graph (iv).

2.

346

(i) Figure 12.29 gives the result of applying Kruskal’s algorithm to graph (i). Each diagram in the figure shows the result of adding two edges to the subgraph; that is, of applying two iterations of the algorithm. The resulting minimal spanning tree, with weight 21, is the same as that obtained by Prim’s algorithm (see Hints and Solutions) but the edges are added to the subgraph in a different order. Exercises 12.4

Solutions Manual

2

2 1

1

2

3

1

3

1 4

1

2

1

3

1

2

5

3

1

2

Figure 12.29: Kruskal’s algorithm applied to graph (i). (ii) Figure 12.30 gives the result of applying Kruskal’s algorithm to graph (ii). Again, each diagram in the figure shows the result of adding two edges to the subgraph. The resulting minimal spanning tree has weight 54 and is different from the minimal spanning tree found using Prim’s algorithm due to the particular set of choices made. 3 2

2

1

3

1

1 2

2

1

1

1 3

2

3

3

2

3

3

1

2

5

3

1

5

1 4

4

2

4

4

2

3

4

2

3

1

1

3

4

1

3 2

3

3 5

5

1

5

4

2

2

3

5

5

1

5

4

2

4

4 5

5

7

3 1

4

4

3 1

4

Figure 12.30: Kruskal’s algorithm applied to graph (ii). (iii) Figure 12.31 gives the result of applying Kruskal’s algorithm to graph (iii). Again, each diagram in the figure shows the result of adding two edges to the subgraph. The resulting minimal spanning tree has weight 18 and is the same as that found using Prim’s algorithm. (iv) Figure 12.32 gives the result of applying Kruskal’s algorithm to graph (iv). The resulting minimal spanning tree, with weight 20, is the same as that found using Prim’s algorithm although the edges are added to the subgraph in a different order. Exercises 12.4

347

Discrete Mathematics: Proofs, Structures and Applications

3

3

1

1

2

1

5

4

2

2

3

3

Figure 12.31: Kruskal’s algorithm applied to graph (iii).

2

2 1

1

3 3

4

4

2

2

1

3 3

1 3 4

3 3

3

Figure 12.32: Kruskal’s algorithm applied to graph (iv). 4. Let T be a minimal spanning tree for a connected weighted graph Γ and let e be be an edge not belonging to T that joins distinct vertices v and w. Then w(e) ≥ w(e0 ) for every edge e0 belonging to the unique path in T joining v and w. Proof Suppose that w(e) < w(e0 ) for some edge e0 belonging to the unique path in T joining v and w. Let T 0 be the subgraph of Γ obtained from T by replacing e0 by e. Then w(T 0 ) < w(T ). Furthermore T 0 is connected and has the same number of vertices and edges as T . Hence, by Theorem 10.6, T 0 is a tree. Thus T 0 is a spanning tree for Γ with weight strictly less than the weight of T . This is a contradiction since T is a minimal spanning tree. Hence there is no such edge e, as required.

12.5 1.

348

Solutions to Exercises 12.5 (i) The iterations of Dijkstra’s algorithm are shown in figure 12.33. The shortest path from v to w, with total length 17, is given in the last graph. Exercises 12.5

Solutions Manual

2

2

0 v

7

2

0 v

w

11 2

12 2

19 w 10

12

10

7

0 v

19 w

0 v

w

15

7

7 17 w

0 v

11

10

11

Figure 12.33: Finding the shortest path from v to w in graph (i). (ii) The iterations of Dijkstra’s algorithm are shown in the first eight graphs in figure 12.34. The shortest path from v to w, with total length 15, is shown in the last graph. 6 5 1

w

v

3

1 v

6

0

5 w

v

6

0

6

0

6

5 18 w

3

1 v 0

4

6

5

4

13

6

10

5

18 w

3

1

10

5 18 w

3

1 v 0

4

13

6

10

18 w

3

1 v 0

4

13

6

10

5 15 w

3

1 v

3

1

15 w

v 0

4

13

3

1

15 w

v 0

4

13

0

Figure 12.34: Finding the shortest path from v to w in graph (ii). (iii) The iterations of Dijkstra’s algorithm are shown in the first four graphs in figure 12.35. Here, each diagram shows two iterations of the algorithm. In other words, each diagram shows the situation when two more vertices have received a permanent label (except the last diagram where, in addition, w is given a permanent label). Note that, in the third diagram, when the vertex labelled 13 is made permanent, there are two choices of which edge to add to the tree. The alternative to the edge between the vertices with permanent labels 8 and 13 is the edge shown using a dashed line in the figure. We could modify algorithm 11.7 so that, in a case such as Exercises 12.5

349

Discrete Mathematics: Proofs, Structures and Applications

this, both edges are added to the subgraph, which would no longer be a tree. The result of such a modification would be that the subgraph produced by the algorithm would contain all the shortest paths from v to w in a situation where there is more than one path with shortest length. In this example, there is a unique shortest path from v to w, with total length 20, and this is shown in the last graph. 5 0 v 4

5

7

0 v 13

w

6

5 8

13

4

16

13

0 v

w

4

6

12

16

21 w

5

6

4

13

15

5 0 v

8

8

0 v

13

6

20 w

12

8 20 w

12

15

15

Figure 12.35: Finding the shortest path from v to w in graph (iii).

4 5

3

4 v

4 w

3

4 v

9 0

5

12 w

5

10 w

9 0

12

12

4 3

4 v 0

5

9

10 w

18

3

v 0

12

Figure 12.36: Finding the shortest path from v to w in graph (iv).

350

Exercises 12.5

Solutions Manual

(iv) The iterations of Dijkstra’s algorithm are shown in the first three graphs in figure 12.36. Again, each diagram shows two iterations of the algorithm. There is also a choice of edge to add to the three in the third diagram. When the vertex labelled 9 has its label made permanent, the dashed edge could have been added to the tree in place of the edge from v. However, neither edge features in a shortest path from v to w so, again, the shortest path is unique. The last graph shows the unique shortest path from v to w, with total length 10. 3. (b) (i) The iterations of the algorithm from part (a) are shown in the first five graphs in figure 12.37. Again, each diagram shows two iterations of the algorithm (except for the fifth diagram which also gives a permanent label to w). The last graph shows the shortest directed path from v to w, with total length 38. 9 6

6

9

6

w

w 11

0 v

0 v

6 9

31 0 v 6

11

6

11

14

6 9

24

0 v

22

6

37 34

31

w

w 0 v

6

6

9

11

14

22

31

22

14

6

38 w 24

11

34

31 0 v

11

14

38 w 24

22

Figure 12.37: Finding the shortest directed path from v to w in graph (i). (ii) The iterations of the algorithm from part (a) are shown in the first five graphs in figure 12.38 where each diagram shows two iterations of the algorithm. Note that the algorithm terminates when w receives a permanent label even though some vertices have not yet received a (temporary or permanent) label. The last graph shows the shortest directed path from v to w, with total length 20. 5.

(i) Figure 12.39 shows the iterations of the nearest insertion algorithm. Each graph shows the current cycle (except the first graph where the repeated edge is not a genuine cycle) and the vertex to be inserted. The Hamiltonian cycle has weight 37.

Exercises 12.5

351

Discrete Mathematics: Proofs, Structures and Applications

6

6

0 v

6

2

2 10

2

0 v w

4

9

0 v 4

14 6

18

0 v

6

9

16

34 17

17

22

w

17

20 w

6 2

9

0 v w

17

17

21

18

2

4

14

14

23

2

16

34

w

4

9

0 v

16

34 4

20 w

17

14

17

9

22

Figure 12.38: Finding the shortest directed path from v to w in graph (ii). 8 10 8

8

7

7

8 4

8 4

10

4

9

Figure 12.39: Finding a Hamiltonian cycle using the nearest insertion algorithm. (ii) For this exercise, we will describe the workings of the algorithm in a little more detail, referring to figure 12.40. (Each of the graphs (a)-(c) in the figure show the current cycle and the vertex to be inserted.) The smallest weight edge incident with v0 = A is AE with weight 6. Then the closest vertex to either A or E is vertex F (since w(EF ) = 6). Inserting vertex F gives the first ‘proper’ cycle AEF A shown in graph (a) in figure 12.40. Each of the remaining three vertices – B, C and D – could be inserted next since each is equally close to A, E or F : w(AB) = w(AC) = w(ED) = 7. Arbitrarily, we select vertex C to be inserted. The potential cost of inserting C is: replacing AE : I(AE) = w(AC) + w(CE) − w(AE) = 7 + 9 − 6 = 10; replacing EF : I(EF ) = w(EC) + w(CF ) − w(EF ) = 9 + 12 − 5 = 16; replacing F A : I(F A) = w(F C) + w(BC) − w(F A) = 12 + 7 − 8 = 11. Therefore C is inserted between A and E, giving the cycle ACEF A shown in graph (b). 352

Exercises 12.5

Solutions Manual

F

C

A

(a)

E

(c)

C

A

D

E

C

A

F

B

F

B

D

E

D

E

(b)

B

D

F

C

A

(d)

B

Figure 12.40: Finding a Hamiltonian cycle using the nearest insertion algorithm. The vertex D is closest to A, C, E or F since w(CD) = 4. Hence D is the next vertex to insert. The potential cost of inserting D is: replacing replacing replacing replacing

AC : CE : EF : FA :

I(AC) = w(AD) + w(DC) − w(AC) = 10 + 4 − 7 = 7; I(CE) = w(CD) + w(DE) − w(CE) = 4 + 7 − 9 = 2; I(EF ) = w(ED) + w(DF ) − w(EF ) = 7 + 10 − 5 = 12; I(F A) = w(F D) + w(DA) − w(F A) = 10 + 10 − 8 = 12.

Therefore D is inserted between C and E, giving the cycle ACDEF A shown in graph (c). The last vertex to be inserted is vertex B. The potential cost of inserting B is: replacing replacing replacing replacing replacing

AC : CD : DE : EF : FA :

I(AC) = w(AB) + w(BC) − w(AC) = 7 + 8 − 7 = 8; I(CD) = w(CB) + w(BD) − w(CD) = 8 + 6 − 4 = 10; I(DE) = w(DB) + w(BE) − w(DE) = 6 + 11 − 7 = 10; I(EF ) = w(EB) + w(BF ) − w(EF ) = 11 + 9 − 5 = 15; I(F A) = w(F B) + w(BA) − w(F A) = 9 + 7 − 8 = 8.

Hence B could be inserted between A and C giving Hamiltonian cycle ABCDEF A or between F and A giving Hamiltonian cycle ACDEF BA shown in graph (d). Both the Hamiltonian cycles have length 39. Exercises 12.5

353

Discrete Mathematics: Proofs, Structures and Applications

6. Nearest Neighbour Algorithm 1. Choose any vertex v as initial vertex. Select an edge e of minimum weight incident with v. Set the current path P equal to e and the current vertex equal to w, the other vertex incident with e. 2. Choose an edge e0 of minimum weight that joins the current vertex to a vertex w0 not in the current path P . Add the edge e0 to P to give a new current path. Set the new current vertex equal w0 . 3. Repeat step 2 until all vertices are in the current path. Finally, turn the current path into a Hamiltonian cycle by joining the current vertex to the initial vertex v. We now apply the algorithm to each of the weighted graphs in question 5. In each case, we will begin at the indicated vertex v0 . (i) Figure 12.41 shows the construction of a Hamiltonian cycle using the nearest neighbour algorithm. The resulting Hamiltonian cycle is the same as that produced by the nearest insertion algorithm.

7 8

8

8 4

4

8

8 7

7

8

8 4

10

4

Figure 12.41: Finding a Hamiltonian cycle using the nearest neighbour algorithm. (ii) Figure 12.42 shows the construction of a Hamiltonian cycle using the nearest neighbour algorithm. The resulting Hamiltonian cycle has length 37 so, in this case, the nearest neighbour algorithm produces a better (that is, smaller weight) Hamiltonian cycle than the nearest insertion algorithm. 7.

354

(i) Figure 12.43 shows the complete weighted graph. Alternatively, the weight matrix is given in Hints and Solutions. Nearest Insertion Algorithm We begin by selecting v1 . The smallest weight edge incident with v1 is v1 v6 with weight 9. Then the closest vertex to either v1 or v6 is vertex v5 where w(v6 v5 ) = 7. Inserting vertex v5 gives the first ‘proper’ cycle v1 v6 v5 v1 shown in graph (a) in figure 12.44. Exercises 12.5

Solutions Manual

5

5

6

6

6

9

5

4

5 6

6

6

9

4

5

6

6

6

9

9

7

Figure 12.42: Finding a Hamiltonian cycle using the nearest neighbour algorithm.

v2

v3

12 18

10

6 21

18 24

v1

v4 14

19 14

24

9

10 15

v6

7

v5

Figure 12.43: The complete weighted graph for part (i). The vertices v2 and v4 both have minimum distance from v1 , v5 or v6 , the vertices in the current cycle: w(v1 v2 ) = 10 = w(v5 v4 ). Therefore we could choose either v2 or v4 to insert next; we select v2 . The potential cost of inserting v2 is: replacing v1 v6 : I(v1 v6 ) = w(v1 v2 ) + w(v2 v6 ) − w(v1 v6 ) = 10 + 19 − 9 = 20; replacing v6 v5 : I(v6 v5 ) = w(v6 v2 ) + w(v2 v5 ) − w(v6 v5 ) = 19 + 24 − 7 = 36; replacing v5 v1 : I(v5 v1 ) = w(v5 v2 ) + w(v2 v1 ) − w(v5 v1 ) = 24 + 10 − 14 = 20. The cost of inserting v2 between v1 and v6 is the same as the cost of inserting it between v5 and v1 . We choose to insert v2 between v5 and v1 , giving the cycle v1 v6 v5 v2 v1 shown in graph (b) in figure 12.44. The vertex v4 is closest to v1 , v2 , v5 or v6 , the vertices in the current cycle: w(v5 v4 ) = 10. Hence v4 is the next vertex to insert. The potential cost of inserting v4 is: replacing replacing replacing replacing Exercises 12.5

v1 v6 v6 v5 v5 v2 v2 v1

: : : :

I(v1 v6 ) = w(v1 v4 ) + w(v4 v6 ) − w(v1 v6 ) = 24 + 15 − 9 = 30; I(v6 v5 ) = w(v6 v4 ) + w(v4 v5 ) − w(v6 v5 ) = 15 + 10 − 7 = 18; I(v5 v2 ) = w(v5 v4 ) + w(v4 v2 ) − w(v5 v2 ) = 10 + 18 − 24 = 4; I(v2 v1 ) = w(v2 v4 ) + w(v4 v1 ) − w(v2 v1 ) = 18 + 24 − 10 = 32. 355

Discrete Mathematics: Proofs, Structures and Applications

Therefore v4 is inserted between v5 and v2 , giving the cycle v1 v6 v5 v4 v2 v1 shown in graph (c) in figure 12.44.

v2

v3

v1

v2

v4

v6

v1

v4

v5

v6

v3

v1

v2

v4

v6

v5

(b)

(a) v2

v3

v3

v1

v4

v5

v6

(c)

v5

(d)

Figure 12.44: Finding a Hamiltonian cycle using the nearest insertion algorithm. The last vertex to be inserted is vertex v3 . The potential cost of inserting v3 is: replacing replacing replacing replacing replacing

v1 v6 v6 v5 v5 v4 v4 v2 v2 v1

: : : : :

I(v1 v6 ) = w(v1 v3 ) + w(v3 v6 ) − w(v1 v6 ) = 18 + 21 − 9 = 30; I(v6 v5 ) = w(v6 v3 ) + w(v3 v5 ) − w(v6 v5 ) = 21 + 14 − 7 = 28; I(v5 v4 ) = w(v5 v3 ) + w(v3 v4 ) − w(v5 v4 ) = 14 + 6 − 10 = 10; I(v4 v2 ) = w(v4 v3 ) + w(v3 v2 ) − w(v4 v2 ) = 6 + 12 − 18 = 0; I(v2 v1 ) = w(v2 v3 ) + w(v3 v1 ) − w(v2 v1 ) = 12 + 18 − 10 = 20.

Hence v3 should be inserted between v4 and v2 giving Hamiltonian cycle v1 v6 v5 v4 v3 v2 v1 , with total length 54, shown in graph (d) in figure 12.44. (ii) The weight matrix for the complete graph is given in Hints and Solutions and repeated below. 

0 9  19  20  15  7 15

356

9 0 10 12 21 12 7

19 10 0 10 19 14 6

20 12 10 0 9 13 5

15 21 19 9 0 10 14

 7 15 12 7   14 6   13 5   10 14  0 8 8 0

Exercises 12.5

Solutions Manual

Nearest Insertion Algorithm We begin by selecting v1 . The smallest weight edge incident with v1 is v1 v6 with weight 7. Then the closest vertex to either v1 or v6 is vertex v7 where w(v6 v7 ) = 8. Inserting vertex v7 gives the first ‘proper’ cycle v1 v6 v7 v1 shown in graph (a) in figure 12.45. The vertex v4 is closest to v1 , v6 or v7 , the vertices in the current cycle: w(v7 v4 ) = 5. Hence v4 is the next vertex to insert. The potential cost of inserting v4 is: replacing v1 v6 : I(v1 v6 ) = w(v1 v4 ) + w(v4 v6 ) − w(v1 v6 ) = 20 + 13 − 7 = 26; replacing v6 v7 : I(v6 v7 ) = w(v6 v4 ) + w(v4 v7 ) − w(v6 v7 ) = 13 + 5 − 8 = 10; replacing v7 v1 : I(v7 v1 ) = w(v7 v4 ) + w(v4 v1 ) − w(v7 v1 ) = 5 + 20 − 15 = 30. Therefore v4 is inserted between v6 and v7 , giving the cycle v1 v6 v4 v7 v1 shown in graph (b) in figure 12.45. The vertex v3 is closest to v1 , v4 , v6 or v7 , the vertices in the current cycle: w(v3 v7 ) = 6. Hence v3 is the next vertex to insert. The potential cost of inserting v3 is: replacing replacing replacing replacing

v1 v6 v6 v4 v4 v7 v7 v1

: : : :

I(v1 v6 ) = w(v1 v3 ) + w(v3 v6 ) − w(v1 v6 ) = 19 + 14 − 7 = 26; I(v6 v4 ) = w(v6 v3 ) + w(v3 v4 ) − w(v6 v4 ) = 14 + 10 − 13 = 11; I(v4 v7 ) = w(v4 v3 ) + w(v3 v7 ) − w(v4 v7 ) = 10 + 6 − 5 = 11; I(v7 v1 ) = w(v7 v3 ) + w(v3 v1 ) − w(v7 v1 ) = 6 + 19 − 15 = 10.

Therefore v3 is inserted between v7 and v1 , giving the cycle v1 v6 v4 v7 v3 v1 shown in graph (c) in figure 12.45. v2

v3

v2

v7

v3

v2

v7

v1

v4

v6

v7

v1

v4

v5

v6

(a)

v1

v4

v5

v6

(b) v2 v7

v6

v5

(d)

v2

v4

v5

(c)

v3

v1

v3

v3 v7

v1

v4

v6

v5

(e)

Figure 12.45: Finding a Hamiltonian cycle using the nearest insertion algorithm. The vertex v2 is closest to v1 , v3 , v4 , v6 or v7 , the vertices in the current cycle: w(v2 v7 ) = 7. Hence v2 is the next vertex to insert. The potential cost of inserting Exercises 12.5

357

Discrete Mathematics: Proofs, Structures and Applications

v2 is: replacing replacing replacing replacing replacing

v1 v6 v6 v4 v4 v7 v7 v3 v3 v1

: : : : :

I(v1 v6 ) = w(v1 v2 ) + w(v2 v6 ) − w(v1 v6 ) = 9 + 12 − 7 = 10; I(v6 v4 ) = w(v6 v2 ) + w(v2 v4 ) − w(v6 v4 ) = 12 + 12 − 13 = 11; I(v4 v7 ) = w(v4 v2 ) + w(v2 v7 ) − w(v4 v7 ) = 12 + 7 − 5 = 14; I(v7 v3 ) = w(v7 v2 ) + w(v2 v3 ) − w(v7 v3 ) = 7 + 10 − 6 = 11; I(v3 v1 ) = w(v3 v2 ) + w(v2 v1 ) − w(v3 v1 ) = 10 + 9 − 19 = 0.

Therefore v2 is inserted between v3 and v1 , giving the cycle v1 v6 v4 v7 v3 v2 v1 shown in graph (d) in figure 12.45. The last vertex to be inserted is vertex v5 . The potential cost of inserting v5 is: replacing replacing replacing replacing replacing replacing

v1 v6 v6 v4 v4 v7 v7 v3 v3 v2 v2 v1

: : : : : :

I(v1 v6 ) = w(v1 v5 ) + w(v5 v6 ) − w(v1 v6 ) = 15 + 10 − 7 = 18; I(v6 v4 ) = w(v6 v5 ) + w(v5 v4 ) − w(v6 v4 ) = 10 + 12 − 13 = 9; I(v4 v7 ) = w(v4 v5 ) + w(v5 v7 ) − w(v4 v7 ) = 12 + 9 − 5 = 16; I(v7 v3 ) = w(v7 v5 ) + w(v5 v3 ) − w(v7 v3 ) = 9 + 19 − 6 = 22; I(v3 v2 ) = w(v3 v5 ) + w(v5 v2 ) − w(v3 v2 ) = 19 + 21 − 10 = 30. I(v2 v1 ) = w(v2 v5 ) + w(v5 v1 ) − w(v2 v1 ) = 21 + 15 − 9 = 27.

Hence v5 should be inserted between v6 and v4 giving Hamiltonian cycle v1 v6 v5 v4 v7 v3 v2 v1 , with total length 56, shown in graph (e) in figure 12.45.

12.6

Solutions to Exercises 12.6

1. (iii) The minimum completion time is 40. Earliest times, latest times, float times and a critical path are given in the figure.

0

6

15

11

37

19

40

31

0

0

37

40

31

Latest times

0

0

Float times

358

11

23 0

0

38

19

Earliest times 0

0

6

Critical path

Exercises 12.6

Solutions Manual

(iv) The minimum completion time is 63. Earliest times, latest times, float times and a critical path are given in the figure. 1. 25

17

17

23 0

32 63

7

15 42

9

25

0

35

7

56

15

Earliest times

63 35

21 42

56

Latest times

0

0

11 0

0

0

0

6

6

0

0

Float times

Critical path

2. (iii) The value of a maximal flow is is 31. A maximal flow and minimal cut are given in the figure.In the diagram showing the maximal flow, ‘saturated’ directed edges – that is, directed edges whose flow equals its capacity – are shown as thick edges. 14

8

1

12

8 7

2 8

7

10

11

5

1

3 1 10

5

3

8

7 10

5

5

6

Maximal flow

Minimal cut

(iv) The value of a maximal flow is is 31. A maximal flow two minimal cuts are given in figure 12.46. Again, the ‘saturated’ edges in the maximal flow are shown as thick edges. 3. (ii) (a) Figure 12.47 shows the scheduling network and a critical path. Each vertex has been labelled with a pair earliest time, latest time. The minimum completion time is 85. (b) Figure 12.48 shows a maximal flow and a minimal cut. The value of the maximal flow is 46.

Exercises 12.6

359

Discrete Mathematics: Proofs, Structures and Applications

9

14 4 15

1

5

10 5

2 4

5

8

3

16

16 6

5

17

8 10

10

4

10

9

10 10

8 3

2

5

10

15

Maximal flow

Minimal cuts

Figure 12.46: A maximal flow and minimal cuts for part (iv).

0,0

43,54

14,14

46,81

26,26 0,21

65,85

54,57 36,47

85,85

0,0 0,21

46,46

85,85

62,65

12,51

60,60

Figure 12.47: Digraph (ii) as a scheduling problem.

12 8

3 12

7

20 5

10

2

2

3

7

5

12 5

5

20 2 2

21

14 3

17 8

12

34

17

9

Figure 12.48: Digraph (ii) as a network flow problem.

360

Exercises 12.6

Solutions Manual

4. Removing all the edges incident with the sink leaves the sink as an isolated vertex and therefore separates the digraph into two components, one containing the source and one containing the sink. Hence the set of edges incident with the sink is a cut in the network. Similarly, removing all the edges incident with the source leaves the source as an isolated vertex. Therefore the set of edges incident with the source is a cut in the network.

Exercises 12.6

361

K11961

an informa business

www.taylorandfrancisgroup.com

6000 Broken Sound Parkway, NW Suite 300, Boca Raton, FL 33487 270 Madison Avenue New York, NY 10016 2 Park Square, Milton Park Abingdon, Oxon OX14 4RN, UK