0% found this document useful (0 votes)
27 views94 pages

Chapter 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views94 pages

Chapter 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 94

Chapter 2 Solutions, Susanna Epp Discrete Math 5th

Edition

https://github.com/spamegg1

September 6, 2024

Contents
1 Exercise Set 2.1 8
1.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6 Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8 Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.8.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.8.5 (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.9 Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.9.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1
1.9.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.9.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.10 Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.10.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.10.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.10.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.10.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.10.5 (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.11 Exercise 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.12 Exercise 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.13 Exercise 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.14 Exercise 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.15 Exercise 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.16 Exercise 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.17 Exercise 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.18 Exercise 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.19 Exercise 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.20 Exercise 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.21 Exercise 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.22 Exercise 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.23 Exercise 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.24 Exercise 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.25 Exercise 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.26 Exercise 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.27 Exercise 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.28 Exercise 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.29 Exercise 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.30 Exercise 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.31 Exercise 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.31.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.31.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.31.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.32 Exercise 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.33 Exercise 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.34 Exercise 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.35 Exercise 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.36 Exercise 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.37 Exercise 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.38 Exercise 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.39 Exercise 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.40 Exercise 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.41 Exercise 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.42 Exercise 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.43 Exercise 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.44 Exercise 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.44.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2
1.44.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.45 Exercise 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.46 Exercise 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.46.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.46.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.46.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.47 Exercise 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.48 Exercise 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.49 Exercise 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.50 Exercise 50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.51 Exercise 51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.52 Exercise 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.53 Exercise 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.54 Exercise 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2 Exercise Set 2.2 28


2.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3 Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.5 Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6 Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7 Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8 Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.9 Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.10 Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.11 Exercise 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.12 Exercise 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.13 Exercise 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.13.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.13.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.14 Exercise 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.14.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.14.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.15 Exercise 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.16 Exercise 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.17 Exercise 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.18 Exercise 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.19 Exercise 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.20 Exercise 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.20.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.20.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.20.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.20.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.20.5 (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.20.6 (f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3
2.20.7 (g) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.21 Exercise 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.21.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.21.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.21.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.22 Exercise 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.23 Exercise 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.24 Exercise 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.25 Exercise 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.26 Exercise 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.27 Exercise 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.28 Exercise 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.29 Exercise 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.30 Exercise 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.31 Exercise 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.32 Exercise 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.33 Exercise 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.34 Exercise 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.35 Exercise 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.36 Exercise 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.37 Exercise 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.38 Exercise 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.39 Exercise 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.40 Exercise 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.41 Exercise 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.42 Exercise 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.43 Exercise 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.44 Exercise 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.45 Exercise 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46 Exercise 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.5 (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.46.6 (f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.47 Exercise 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.48 Exercise 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.49 Exercise 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.50 Exercise 50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.51 Exercise 51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

3 Exercise Set 2.3 45


3.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

4
3.4 Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.5 Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6 Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.7 Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.8 Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.9 Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.10 Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.11 Exercise 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.12 Exercise 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.12.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.12.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.13 Exercise 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.14 Exercise 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.15 Exercise 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.16 Exercise 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.17 Exercise 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.18 Exercise 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.19 Exercise 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.20 Exercise 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.21 Exercise 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.22 Exercise 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.23 Exercise 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.24 Exercise 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.25 Exercise 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.26 Exercise 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.27 Exercise 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.28 Exercise 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.29 Exercise 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.30 Exercise 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.31 Exercise 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.32 Exercise 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.33 Exercise 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.34 Exercise 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.35 Exercise 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.36 Exercise 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.37 Exercise 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.38 Exercise 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.38.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.38.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.38.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.38.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.39 Exercise 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.40 Exercise 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.41 Exercise 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.42 Exercise 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.43 Exercise 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5
3.44 Exercise 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

4 Exercise Set 2.4 65


4.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.3 Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.4 Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.5 Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.6 Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.7 Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.8 Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.9 Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.10 Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.11 Exercise 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.12 Exercise 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.13 Exercise 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.14 Exercise 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.15 Exercise 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.16 Exercise 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.17 Exercise 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.18 Exercise 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.19 Exercise 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.20 Exercise 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.21 Exercise 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.22 Exercise 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.23 Exercise 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4.24 Exercise 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
4.25 Exercise 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.26 Exercise 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.27 Exercise 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.28 Exercise 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.29 Exercise 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.30 Exercise 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.31 Exercise 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.32 Exercise 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.33 Exercise 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.33.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.33.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.34 Exercise 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.34.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.34.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.34.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.34.4 (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.34.5 (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

5 Exercise Set 2.5 82

6
5.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.3 Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.4 Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.5 Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.6 Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.7 Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.8 Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.9 Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.10 Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.11 Exercise 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.12 Exercise 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.13 Exercise 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.14 Exercise 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.15 Exercise 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.16 Exercise 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.17 Exercise 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.18 Exercise 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.19 Exercise 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.20 Exercise 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.21 Exercise 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.21.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.21.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.21.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.22 Exercise 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.23 Exercise 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.24 Exercise 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.25 Exercise 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.26 Exercise 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.27 Exercise 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.28 Exercise 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.29 Exercise 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.30 Exercise 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.31 Exercise 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.32 Exercise 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.33 Exercise 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.34 Exercise 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.35 Exercise 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.36 Exercise 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.37 Exercise 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.37.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.37.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.38 Exercise 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.39 Exercise 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.40 Exercise 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.41 Exercise 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

7
5.42 Exercise 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.43 Exercise 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.44 Exercise 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.45 Exercise 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.46 Exercise 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.47 Exercise 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.47.1 (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.47.2 (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.47.3 (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

1 Exercise Set 2.1


In each of 1 − 4 represent the common form of each argument using letters to
stand for component sentences, and fill in the blanks so that the argument
in part (b) has the same logical form as the argument in part (a).

1.1 Exercise 1
1.1.1 (a)
If all integers are rational, then the number 1 is rational.
All integers are rational.
Therefore, the number 1 is rational.

Proof. Common form: 1) If p then q. 2) p. 3) Therefore, q.

1.1.2 (b)
If all algebraic expressions can be written in prefix notation, then .
Therefore, (a + 2b)(a2 − b) can be written in prefix notation.

Proof. If all algebraic expressions can be written in prefix notation, then


(a + 2b)(a2 − b) can be written in prefix notation. (If p, then q.)
All algebraic expressions can be written in prefix notation. (p.)
Therefore, (a + 2b)(a2 − b) can be written in prefix notation. (Therefore, q.)

1.2 Exercise 2
1.2.1 (a)
If all computer programs contain errors, then this program contains an error.
This program does not contain an error.
Therefore, it is not the case that all computer programs contain errors.

8
Proof. Common form: 1) If p then q. 2) ∼ q. 3) Therefore, ∼ p.

1.2.2 (b)
If then .
2 is not odd.
Therefore, it is not the case that all prime numbers are odd.

Proof. If all prime numbers are odd then 2 is odd. (If p then q.)
2 is not odd. (∼ q.)
Therefore, it is not the case that all prime numbers are odd. (Therefore, ∼ p.)

1.3 Exercise 3
1.3.1 (a)
This number is even or this number is odd.
This number is not even.
Therefore, this number is odd.

Proof. Common form: 1) p ∨ q. 2) ∼ p. 3) Therefore, q.

1.3.2 (b)
or logic is confusing.
My mind is not shot.
Therefore, .

Proof. My mind is shot or logic is confusing. (p ∨ q.)


My mind is not shot. (∼ p.)
Therefore, logic is confusing. (Therefore, q.)

1.4 Exercise 4
1.4.1 (a)
If the program syntax is faulty, then the computer will generate an error message.
If the computer generates an error message, then the program will not run.
Therefore, if the program syntax is faulty, then the program will not run.

Proof. Common form: 1) If p then q. 2) If q then r. 3) Therefore, if p then r.

9
1.4.2 (b)
If this simple graph , then it is complete.
If this graph , then any two of its vertices can be joined by a path.
Therefore, if this simple graph has 4 vertices and 6 edges, then .

Proof. If this simple graph has 4 vertices and 6 edges, then it is complete.
If this graph is complete, then any two of its vertices can be joined by a path.
Therefore, if this simple graph has 4 vertices and 6 edges, then any two of its vertices
can be joined by a path.

1.5 Exercise 5
Indicate which of the following sentences are statements.

1.5.1 (a)
1,024 is the smallest four-digit number that is a perfect square.

Proof. It is a statement because it is a true sentence. 1,024 is a perfect square because


1, 024 = 322 , and the next smaller perfect square is 312 = 961, which has fewer than
four digits.

1.5.2 (b)
She is a mathematics major.

Proof. It is not a statement because its truth value depends on the “She”. (Here “She”
can be thought of as a variable, like x.)

1.5.3 (c)
128 = 26

Proof. It is a statement because it is false: 26 = 64 ̸= 128.

1.5.4 (d)
x = 26

Proof. Not a statement, because its truth depends on the value of x.

Write the statements in 6 − 9 in symbolic form using the symbols ∼, ∨ and


∧ and the indicated letters to represent component statements.

10
1.6 Exercise 6
Let s = “stocks are increasing” and i = “interest rates are steady.”

1.6.1 (a)
Stocks are increasing but interest rates are steady.

Proof. s ∧ i.
(Notice that the “but” makes it sound like there should be a negation involved, but
that’s just a quirk of English. In this case, “but” has the same meaning as “and”.
We have an intuitive expectation that there should be some “causal link” between stocks
and interest rates, like: “stocks are increasing, that should affect interest rates”, so if
the interest rates are remaining steady, it’s as if they are remaining steady DESPITE
the fact that stocks are increasing, hence the “but” being used.)

1.6.2 (b)
Neither are stocks increasing nor are interest rates steady.

Proof. ∼ s ∧ ∼ i.
(Another quirk of English: when “neither nor” is used, even though “nor” sounds like
there should be an OR involved, it’s actually AND and negation.)

1.7 Exercise 7
Juan is a math major but not a computer science major. (m = “Juan is a math major,”
c = “Juan is a computer science major”)

Proof. m ∧ ∼ c

1.8 Exercise 8
Let h = “John is healthy,” w = “John is wealthy,” and s = “John is wise.”

1.8.1 (a)
John is healthy and wealthy but not wise.

Proof. h ∧ w ∧ ∼ s.

1.8.2 (b)
John is not wealthy but he is healthy and wise.

Proof. ∼ w ∧ h ∧ s.

11
1.8.3 (c)
John is neither healthy, wealthy, nor wise.

Proof. ∼ h ∧ ∼ w ∧ ∼ s.

1.8.4 (d)
John is neither wealthy nor wise, but he is healthy.

Proof. (∼ w ∧ ∼ s) ∧ h.

1.8.5 (e)
John is wealthy, but he is not both healthy and wise.

Proof. w ∧ ∼ (h ∧ s).

1.9 Exercise 9
Let p = “x > 5,” q = “x = 5,” and r = “10 > x.”

1.9.1 (a)
x≥5

Proof. x ≥ 5 means x > 5 or x = 5. So: p ∨ q.

1.9.2 (b)
10 > x > 5

Proof. 10 > x > 5 means 10 > x and x > 5. So: r ∧ p.

1.9.3 (c)
10 > x ≥ 5

Proof. 10 > x ≥ 5 means 10 > x and x ≥ 5, i.e. 10 > x and (x > 5 or x = 5).
So: r ∧ (p ∨ q).

1.10 Exercise 10
Let p be the statement “DATAENDFLAG is off,” q the statement “ERROR equals
0,” and r the statement “SUM is less than 1,000.” Express the following sentences in
symbolic notation.

12
1.10.1 (a)
DATAENDFLAG is off, ERROR equals 0, and SUM is less than 1,000.

Proof. p ∧ q ∧ r.

1.10.2 (b)
DATAENDFLAG is off but ERROR is not equal to 0.

Proof. p ∧ ∼ q.

1.10.3 (c)
DATAENDFLAG is off; however, ERROR is not 0 or SUM is greater than or equal to
1,000.

Proof. p ∧ (∼ q ∨ ∼ r).

1.10.4 (d)
DATAENDFLAG is on and ERROR equals 0 but SUM is greater than or equal to 1,000.

Proof. ∼ p ∧ q ∧ ∼ r.

1.10.5 (e)
Either DATAENDFLAG is on or it is the case that both ERROR equals 0 and SUM is
less than 1,000.

Proof. ∼ p ∨ (q ∧ r).

1.11 Exercise 11
In the following sentence, is the word “or” used in its inclusive or exclusive sense? A
team wins the playoffs if it wins two games in a row or a total of three games.

Proof. Inclusive or. For instance, a team could win the playoff by winning games 1, 3,
and 4 and losing game 2. Such an outcome would satisfy both conditions.

Write truth tables for the statement forms in 12 − 15.

13
1.12 Exercise 12
∼p∧q

Proof.
p q ∼p ∼p∧q
T T F F
T F F F
F T T T
F F T F

1.13 Exercise 13
∼ (p ∧ q) ∨ (p ∨ q)

Proof. This is a tautology:

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

1.14 Exercise 14
p ∧ (q ∧ r)

Proof.
p q r p∧q∧r
T T T T
T T F F
T F T F
T F F F
F T T F
F T F F
F F T F
F F F F

1.15 Exercise 15
p ∧ (∼ q ∨ r)

14
Proof.
p q r ∼ q ∨ r p ∧ (∼ q ∨ r)
T T T T T
T T F F F
T F T T T
T F F T T
F T T T F
F T F F F
F F T T F
F F F T F

Determine whether the statement forms in 16 − 24 are logically equivalent.


In each case, construct a truth table and include a sentence justifying your
answer. Your sentence should show that you understand the meaning of
logical equivalence.

1.16 Exercise 16
p ∨ (p ∧ q) and p

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

p ∨ (p ∧ q) and p always have the same truth values, so they are logically equivalent.
(This proves one of the absorption laws.)

1.17 Exercise 17
∼ (p ∧ q) and ∼ p ∧ ∼ q

Proof.
p q ∼ (p ∧ q) ∼ p ∧ ∼ q
T T F F
T F T F
F T T F
F F T T
Not logically equivalent. When p = T and q = F we have
∼ (p ∧ q) ≡ ∼ (T ∧ F ) ≡ ∼ F ≡ T , but
∼ p ∧ ∼ q ≡ ∼ T ∧ ∼ F ≡ F ∧ T ≡ F.

15
1.18 Exercise 18
p ∨ t and t

Proof.
p t p∨t
T T T
F T T

t and p ∨ t always have the same truth values, so they are logically equivalent. (This
proves one of the universal bound laws.)

1.19 Exercise 19
p ∧ t and p

Proof.
p t p∧t
T T T
F T F

p ∧ t and p always have the same truth values, so they are logically equivalent.

1.20 Exercise 20
p ∧ c and p ∨ c

Proof.
p c p∧c p∨c
T F F T
F F F F

p ∧ c and p ∨ c are not logically equivalent.

1.21 Exercise 21
(p ∧ q) ∧ r and p ∧ (q ∧ r)

16
Proof.
p q r p ∧ q q ∧ r (p ∧ q) ∧ r p ∧ (q ∧ r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F T F F
F T F F F F F
F F T T F F F
F F F F F F F

(p ∧ q) ∧ r and p ∧ (q ∧ r) always have the same truth values, so they are logically
equivalent. (This proves the associative law for ∧.)

1.22 Exercise 22
p ∧ (q ∨ r) and (p ∧ q) ∨ (p ∧ r)

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

p ∧ (q ∨ r) and (p ∧ q) ∨ (p ∧ r) always have the same truth values, so they are logically
equivalent. (This proves one of the distributive laws for ∧.)

1.23 Exercise 23
(p ∧ q) ∨ r and p ∧ (q ∨ r)

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

17
(p ∧ q) ∨ r and p ∧ (q ∨ r) have different truth values in the fifth and seventh rows, so
they are not logically equivalent. (This proves that parentheses are needed with ∧ and
∨.)

1.24 Exercise 24
(p ∨ q) ∨ (p ∧ r) and (p ∨ q) ∧ r

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

(p ∨ q) ∨ (p ∧ r) and (p ∨ q) ∧ r have different truth values in the fifth and seventh rows,
so they are not logically equivalent.

Use De Morgan’s laws to write negations for the statements in 25 − 30.

1.25 Exercise 25
Hal is a math major and Hal’s sister is a computer science major.

Proof. p = Hal is a math major, q = Hal’s sister is a computer science major


The statement is p ∧ q. By De Morgan’s laws, the negation is ∼ (p ∧ q) ≡ ∼ p ∨ ∼ q:
Hal is not a math major, or Hal’s sister is not a computer science major.

1.26 Exercise 26
Sam is an orange belt and Kate is a red belt.

Proof. p = Sam is an orange belt, q = Kate is a red belt.


The statement is p ∧ q. By De Morgan’s laws, the negation is ∼ (p ∧ q) ≡ ∼ p ∨ ∼ q:
Sam is not an orange belt, or Kate is not a red belt.

18
1.27 Exercise 27
The connector is loose or the machine is unplugged.

Proof. p = The connector is loose, q = the machine is unplugged.


The statement is p ∨ q. By De Morgan’s laws, the negation is ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q:
The connector is not loose and the machine is not unplugged.

1.28 Exercise 28
The train is late or my watch is fast.

Proof. p = The train is late, q = my watch is fast.


The statement is p ∨ q. By De Morgan’s laws, the negation is ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q:
The train is not late and my watch is not fast.

1.29 Exercise 29
This computer program has a logical error in the first ten lines or it is being run with
an incomplete data set.

Proof. p = This computer program has a logical error in the first ten lines, q = it (this
computer) is being run with an incomplete data set.
The statement is p ∨ q. By De Morgan’s laws, the negation is ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q:
This computer program does not have a logical error in the first ten lines and it is not
being run with an incomplete data set.

1.30 Exercise 30
The dollar is at an all-time high and the stock market is at a record low.

Proof. p = The dollar is at an all-time high, q = the stock market is at a record low.
The statement is p ∧ q. By De Morgan’s laws, the negation is ∼ (p ∧ q) ≡ ∼ p ∨ ∼ q:
The dollar is not at an all-time high or the stock market is not at a record low.

1.31 Exercise 31
Let s be a string of length 2 with characters from {0, 1, 2}, and define statements a, b, c,
and d as follows:
• a = “the first character of s is 0”
• b = “the first character of s is 1”

19
• c = “the second character of s is 1”
• d = “the second character of s is 2”
Describe the set of all strings for which each of the following is true.
(Here are all the possible length 2 strings: 00, 01, 02, 10, 11, 12, 20, 21, 22)

1.31.1 (a)
(a ∨ b) ∧ (c ∨ d)

Proof. This translates to: “the first character is 0 or 1, and the second character is1 or
2”. So the answer is: 01, 02, 11, 12

1.31.2 (b)
(∼ (a ∨ b)) ∧ (c ∨ d)

Proof. This translates to: “the first character is not 0 or 1, and the second character is
1 or 2”. So the answer is: 21, 22

1.31.3 (c)
((∼ a) ∨ b) ∧ (c ∨ (∼ d))

Proof. This translates to: “the first character is not 0 or it is 1, and the second character
is 1 or is not 2”.
So the first character can be 1 or 2, and the second character can be 0 or 1.
So the answer is: 10, 11, 20, 21

Assume x is a particular real number and use De Morgan’s laws to write


negations for the statements in 32 − 37.

1.32 Exercise 32
−2 < x < 7

Proof. This is (−2 < x) ∧ (x < 7). Keep in mind that the negation of < is ≥. By De
Morgan, the negation is
∼ ((−2 < x) ∧ (x < 7)) ≡ ∼ (−2 < x) ∨ ∼ (x < 7) ≡ (−2 ≥ x) ∨ (x ≥ 7)
The answer is: −2 ≥ x or x ≥ 7.

20
1.33 Exercise 33
−10 < x < 2

Proof. Similar to 32, the answer is: −10 ≥ x or x ≥ 2.

1.34 Exercise 34
x < 2 or x > 5

Proof. The negation of > is ≤. By De Morgan, the negation is:


∼ (x < 2 ∨ x > 5) ≡ ∼ (x < 2) ∧ ∼ (x > 5) ≡ (x ≥ 2) ∧ (x ≤ 5)
The answer is: 2 ≤ x ≤ 5.

1.35 Exercise 35
x ≤ −1 or x > 1

Proof. Similar to 34. The answer is: −1 < x ≤ 1.

1.36 Exercise 36
1 > x ≥ −3

Proof. Rewriting this as −3 ≤ x < 1, we see that it is similar to 32 and 33.


The answer is: −3 > x or x ≥ 1. In other words: 1 ≤ x or x < −3.

1.37 Exercise 37
0 > x ≥ −7

Proof. This is just like 36. The answer is: 0 ≤ x or x < −7.

In 38 and 39, imagine that num orders and num instock are particular values,
such as might occur during execution of a computer program. Write nega-
tions for the following statements.

1.38 Exercise 38
(num orders > 100 and num instock ≤ 500) or num instock < 200

Proof. This statement’s logical form is (p ∧ q) ∨ r, so its negation has the form

∼ ((p ∧ q) ∨ r) ≡ ∼ (p ∧ q) ∧ ∼ r ≡ (∼ p ∨ ∼ q) ∧ ∼ r

21
Thus a negation for the statement is:
(num orders ≤ 100 or num instock > 500) and num instock ≥ 200.

1.39 Exercise 39
(num orders < 50 and num instock > 300)
or (50 ≤ num orders < 75 and num instock > 500)

Proof. This statement’s logical form is (p ∧ q) ∨ (∼ p ∧ r ∧ s), so its negation has the
form

∼ ((p ∧ q) ∨ (∼ p ∧ r ∧ s)) ≡ ∼ (p ∧ q) ∧ ∼ (∼ p ∧ r ∧ s) ≡ (∼ p ∨ ∼ q) ∧ (p ∨ ∼ r ∨ ∼ s)

Thus a negation for the statement is:


(num orders ≥ 50 or num instock ≤ 300) and
(num orders < 50 or num orders ≥ 75 or num instock ≤ 500).

Use truth tables to establish which of the statement forms in 40 − 43 are


tautologies and which are contradictions.

1.40 Exercise 40
(p ∧ q) ∨ (∼ p ∨ (p ∧ ∼ q))

Proof.
p q ∼ p ∼ q p ∧ q p ∧ ∼ q ∼ p ∨ (p ∧ ∼ q) (p ∧ q) ∨ (∼ p ∨ (p ∧ ∼ q))
T T F F T F F T
T F F T F T T T
F T T F F F T T
F F T T F F T T
We see that (p ∧ q) ∨ (∼ p ∨ (p ∧ ∼ q)) is a tautology.

1.41 Exercise 41
(p ∧ ∼ q) ∧ (∼ p ∨ q))

Proof.
p q ∼ p ∼ q p ∧ ∼ q ∼ p ∨ q (p ∧ ∼ q) ∧ (∼ p ∨ q)
T T F F F T F
T F F T T F F
F T T F F T F
F F T T F T F
(p ∧ ∼ q) ∧ (∼ p ∨ q) is always false, so it is a contradiction.

22
1.42 Exercise 42
((∼ p ∧ q) ∧ (q ∧ r))) ∧ ∼ q

Proof.

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

((∼ p ∧ q) ∧ (q ∧ r))) ∧ ∼ q is a contradiction.

1.43 Exercise 43
(∼ p ∨ q) ∨ (p ∧ ∼ q)

Proof.
p q ∼ p ∼ q ∼ p ∨ q p ∧ ∼ q (∼ p ∨ q) ∨ (p ∧ ∼ q)
T T F F T F T
T F F T F T T
F T T F T F T
F F T T T F T
We see that (∼ p ∨ q) ∨ (p ∧ ∼ q) is a tautology.

1.44 Exercise 44
Recall that a < x < b means that a < x and x < b. Also a ≤ b means that a < b or
a = b. Find all real numbers x that satisfy the following inequalities.

1.44.1 (a)
2<x≤0

Proof. No real numbers satisfy this inequality. If x > 2 then x > 2 > 0 so x >
0.Therefore x ≤ 0 cannot be true at the same time.

1.44.2 (b)
1 ≤ x < −1

Proof. Similar to (a). no real numbers satisfy this inequality.

23
1.45 Exercise 45
Determine whether the statements in (a) and (b) are logically equivalent.
(a) Bob is both a math and computer science major and Ann is a math major, but Ann
is not both a math and computer science major.
(b) It is not the case that both Bob and Ann are both math and computer science
majors, but it is the case that Ann is a math major and Bob is both a math and
computer science major.

Proof. Define
1. p: Bob is a math major.
2. q: Bob is a CS major.
3. r: Ann is a math major.
4. s: Ann is a CS major.
The statement in (a) has the form: (p ∧ q ∧ r) ∧ ∼ (r ∧ s)
The statement in (b) has the form: ∼ (p ∧ q ∧ r ∧ s) ∧ (r ∧ p ∧ q)
We could write down the entire truth table with 24 = 16 rows, but let’s try to take some
shortcuts.
If we look at the two expressions, they both have the form (p ∧ q ∧ r) ∧ Z. Such an
expression is true when (p ∧ q ∧ r) and Z are both true, and it is false otherwise.
Therefore, when evaluating Z, we can concentrate only on the rows of the truth table
where (p ∧ q ∧ r) is true. We can disregard Z on the other rows (because both (a) and
(b) are false for those rows).
(p ∧ q ∧ r) is true only when all 3 of p, q, r are true. When this is the case, we only need
to consider the possibilities for s. This gives us 2 rows only:

s ∼ (r ∧ s) ∼ (p ∧ q ∧ r ∧ s)
T F F
F T T

The two Z expressions have the same truth values in all cases. Therefore (a) and (b)
are logically equivalent.

1.46 Exercise 46
Let the symbol ⊕ denote exclusive or; so p ⊕ q ≡ (p ∨ q) ∧ ∼ (p ∧ q). Hence the truth
table for p ⊕ q is as follows:

24
p q p⊕q
T T F
T F T
F T T
F F F

1.46.1 (a)
Find simpler statement forms that are logically equivalent to p ⊕ p and (p ⊕ p) ⊕ p.

Proof. The meaning of the exclusive or ⊕ is that, it returns true when the two operands
have different truth values; otherwise it returns false.
In p ⊕ p, the two operands p and p always have the same truth value. Therefore p ⊕ p
is a contradiction: p ⊕ p ≡ c.
So we have (p ⊕ p) ⊕ p ≡ c ⊕ p. This is true only when p and c have different truth
values, in other words, when p is true. Therefore c ⊕ p is logically equivalent to p.

1.46.2 (b)
Is (p ⊕ q) ⊕ r ≡ p ⊕ (q ⊕ r)? Justify your answer.

Proof.
p q r p ⊕ q q ⊕ r (p ⊕ q) ⊕ r p ⊕ (q ⊕ r)
T T T F F T T
T T F F T F F
T F T T T F F
T F F T F T T
F T T T F F F
F T F T T T T
F F T F T T T
F F F F F F F
They are logically equivalent.

1.46.3 (c)
Is (p ⊕ q) ∧ r ≡ (p ∧ r) ⊕ (q ∧ r)? Justify your answer.

25
Proof.
p q r p ⊕ q p ∧ r q ∧ r (p ⊕ q) ∧ r (p ∧ r) ⊕ (q ∧ r)
T T T F T T F F
T T F F F F F F
T F T T T F T T
T F F T F F F F
F T T T F T T T
F T F T F F F F
F F T F F F F F
F F F F F F F F
They are logically equivalent.

1.47 Exercise 47
In logic and in standard English, a double negative is equivalent to a positive.There is
one fairly common English usage in which a “double positive” is equivalent to a negative.
What is it? Can you think of others?

Proof. There is a famous story about a philosopher who once gave a talk in which
he observed that whereas in English and many other languages a double negative is
equivalent to a positive, there is no language in which a double positive is equivalent to
a negative. To this, another philosopher, Sidney Morgenbesser, responded sarcastically,
“Yeah, yeah.”
[Strictly speaking, sarcasm functions like negation. When spoken sarcastically, the words
“Yeah, yeah” are not a true double positive; they just mean “no.”]

In 48 and 49 below, a logical equivalence is derived from Theorem 2.1.1.


Supply a reason for each step.

1.48 Exercise 48
(p ∧ ∼ q) ∨ (p ∧ q) ≡ p ∧ (∼ q ∨ q) by (a)
≡ p ∧ (q ∨ ∼ q) by (b)
≡ p∧t by (c)
≡ p by (d)
Therefore, (p ∧ ∼ q) ∨ (p ∧ q) ≡ p.

Proof. (a) is the distributive law. (b) is the commutative law for ∨. (c) is the negation
law for ∨. (d) is the identity law for ∧.

1.49 Exercise 49
(p ∨ ∼ q) ∧ (∼ p ∨ ∼ q) ≡ (∼ q ∨ p) ∧ (∼ q ∨ ∼ p) by (a)
≡ ∼ q ∨ (p ∧ ∼ p) by (b)
≡ ∼q∨c by (c)
≡ ∼q by (d)
26
Therefore, (p ∨ ∼ q) ∧ (∼ p ∨ ∼ q) ≡ ∼ q.

Proof. (a) is the commutative law for ∨. (b) is the distributive law. (c) is the negation
law for ∧. (d) is the identity law for ∨.

Use Theorem 2.1.1 to verify the logical equivalences in 50 − 54. Supply a


reason for each step.

1.50 Exercise 50
(p ∧ ∼ q) ∨ p ≡ p

≡ p ∨ (p ∧ ∼ q) (by the commutative law for ∨)


Proof. (p ∧ ∼ q) ∨ p
≡ p (by the absorption law for ∨)

1.51 Exercise 51
p ∧ (∼ q ∨ p) ≡ p

≡ p ∧ (p ∨ ∼ q) (by the commutative law for ∨)


Proof. p ∧ (∼ q ∨ p)
≡ p (by the absorption law for ∧)

1.52 Exercise 52
∼ (p ∨ ∼ q) ∨ (∼ p ∧ ∼ q) ≡ ∼ p

Proof. ∼ (p ∨ ∼ q) ∨ (∼ p ∧ ∼ q)
≡ (∼ p ∧ q) ∨ (∼ p ∧ ∼ q) (by De Morgan laws)
≡ ∼ p ∧ (q ∨ ∼ q) (by distributive law for ∧)
≡ ∼p∧t (by negation law for ∨)
≡ ∼p (by identity law for ∧)

1.53 Exercise 53
∼ ((∼ p ∧ q) ∨ (∼ p ∧ ∼ q)) ∨ (p ∧ q) ≡ p

Proof. ∼ ((∼ p ∧ q) ∨ (∼ p ∧ ∼ q)) ∨ (p ∧ q)


≡ ∼ (∼ p ∧ (q ∨ ∼ q)) ∨ (p ∧ q) (by the distributive law)
≡ ∼ (∼ p ∧ t) ∨ (p ∧ q) (by the negation law for ∨)
≡ ∼ (∼ p) ∨ (p ∧ q) (by the identity law for ∨)
≡ p ∨ (p ∧ q) (by the double negative law)
≡ p (by the absorption law)

27
1.54 Exercise 54
(p ∧ (∼ (∼ p ∨ q))) ∨ (p ∧ q) ≡ p

Proof. (p ∧ (∼ (∼ p ∨ q))) ∨ (p ∧ q)
≡ (p ∧ (p ∧ ∼ q)) ∨ (p ∧ q) (by De Morgan law)
≡ ((p ∧ p) ∧ ∼ q) ∨ (p ∧ q) (by the associative law)
≡ (p ∧ ∼ q) ∨ (p ∧ q) (by the idempotent law)
≡ p ∧ (∼ q ∨ q) (by the distributive law)
≡ p∧t (by the negation law)
≡ p (by the identity law)

2 Exercise Set 2.2


Rewrite the statements in 1 − 4 in if-then form.

2.1 Exercise 1
This loop will repeat exactly N times if it does not contain a stop or a go to.

Proof. If this loop does not contain a stop or a go to, then it will repeat exactly N
times.

2.2 Exercise 2
I am on time for work if I catch the 8:05 bus.

Proof. If I catch the 8:05 bus then I am on time for work.

2.3 Exercise 3
Freeze or I’ll shoot.

Proof. If you do not freeze, then I’ll shoot.

2.4 Exercise 4
Fix my ceiling or I won’t pay my rent.

Proof. If you do not fix my ceiling then I won’t pay my rent.

Construct truth tables for the statement forms in 5 − 11.

28
2.5 Exercise 5
∼p∨q →∼q

Proof.
p q ∼p ∼q ∼p∨q ∼p∨q →∼q
T T F F T F
T F F T F T
F T T F T F
F F T T T T

2.6 Exercise 6
(p ∨ q) ∨ (∼ p ∧ q) → q

Proof.

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

2.7 Exercise 7
p∧∼q →r

Proof.
p q r ∼q p∧∼q p∧∼q →r
T T T F F T
T T F F F T
T F T T T T
T F F T T F
F T T F F T
F T F F F T
F F T T F T
F F F T F T

2.8 Exercise 8
∼p∨q →r

29
Proof.
p q r ∼p ∼p∨q ∼p∨q →r
T T T F T T
T T F F T F
T F T F F T
T F F F F T
F T T T T T
F T F T T F
F F T T T T
F F F T T F

2.9 Exercise 9
p∧∼r ↔q∨r

Proof.
p q r ∼r p∧∼r q∨r p∧∼r ↔q∨r
T T T F F T F
T T F T T T T
T F T F F T F
T F F T T F F
F T T F F T F
F T F T F T F
F F T F F T F
F F F T F F T

2.10 Exercise 10
(p → r) ↔ (q → r)

Proof.
p q r p → r q → r (p → r) ↔ (q → r)
T T T T T T
T T F F F T
T F T T T T
T F F F T F
F T T T T T
F T F T F F
F F T T T T
F F F T T T

30
2.11 Exercise 11
(p → (q → r)) ↔ ((p ∧ q) → r)

Proof.

p q r q → r (p → (q → r)) p ∧ q (p ∧ q) → r (p → (q → r)) ↔ ((p ∧ q) → r)


T T T T T T T T
T T F F F T F T
T F T T T F T T
T F F T T F T T
F T T T T F T T
F T F F T F T T
F F T T T F T T
F F F T T F T T

2.12 Exercise 12
Use the logical equivalence established in Example 2.2.3, p ∨ q → r ≡ (p → r) ∧ (q → r),
to rewrite the following statement. (Assume that x represents a fixed real number.)
If x > 2 or x < −2 then x2 > 4.

Proof. If x > 2 then x2 > 4, and if x < −2 then x2 > 4.

2.13 Exercise 13
Use truth tables to verify the following logical equivalences. Include a few words of
explanation with your answers.

2.13.1 (a)
p→q ≡∼p∨q

Proof.
p q ∼p p→q ∼p∨q
T T F T T
T F F F F
F T T T T
F F T T T
p → q and ∼ p ∨ q always have the same truth values, therefore they are logically
equivalent.

31
2.13.2 (b)
∼ (p → q) ≡ p ∧ ∼ q

Proof.
p q ∼ q ∼ (p → q) p ∧ ∼ q
T T F F F
T F T T T
F T F F F
F F T F F
∼ (p → q) and p ∧ ∼ q always have the same truth values, therefore they are logically
equivalent.

2.14 Exercise 14
2.14.1 (a)
Show that the following statement forms are all logically equivalent:
p → q ∨ r, p ∧ ∼ q → r, and p ∧ ∼ r → q

Proof. Repeatedly using the fact that A → B ≡ ∼ A ∨ B, De Morgan laws and the
double negation law:
p → q ∨ r ≡ ∼ p ∨ (q ∨ r).
p ∧ ∼ q → r ≡ ∼ (p ∧ ∼ q) ∨ r ≡ (∼ p ∨ ∼ ∼ q) ∨ r ≡ (∼ p ∨ q) ∨ r.
p ∧ ∼ r → q ≡ ∼ (p ∧ ∼ r) ∨ q ≡ (∼ p ∨ ∼ ∼ r) ∨ q ≡ (∼ p ∨ r) ∨ q.
These three are equivalent by the commutative and associative laws for ∨.

2.14.2 (b)
Use the logical equivalences established in part (a) to rewrite the following sentence in
two different ways. (Assume that n represents a fixed integer.)
If n is prime, then n is odd or n is 2.

Proof. Here p: “n is prime”, q: “n is odd”, r: “n is 2”.


So the statement is p → q ∨ r.
By part (a) this is equivalent to both p ∧ ∼ q → r and to p ∧ ∼ r → q:
If n is prime and n is not odd, then n is 2.
If n is prime and n is not 2, then n is odd.

32
2.15 Exercise 15
Determine whether the following statement forms are logically equivalent:
p → (q → r) and (p → q) → r

Proof. No. When all three are false, we have p → (q → r) ≡ F → (F → F ) ≡ F →


T ≡ T;
however, we have (p → q) → r ≡ (F → F ) → F ≡ T → F ≡ F .

In 16 and 17, write each of the two statements in symbolic form and de-
termine whether they are logically equivalent. Include a truth table and a
few words of explanation to show that you understand what it means for
statements to be logically equivalent.

2.16 Exercise 16
If you paid full price, you didn’t buy it at Crown Books. You didn’t buy it at Crown
Books or you paid full price.

Proof. Let p represent “You paid full price” and q represent “You didn’t buy it at Crown
Books.” Thus, “If you paid full price, you didn’t buy it at Crown Books” has the form
p → q. And “You didn’t buy it at Crown Books or you paid full price” has the form
q ∨ p.
p q p→q q∨p
T T T T
T F F T
F T T T
F F T F
These two statements are not logically equivalent because their forms have different
truth values in rows 2 and 4.
(An alternative representation for the forms of the two statements is p → ∼ q and
∼ q ∨ p. In this case, the truth values differ in rows 1 and 3.)

2.17 Exercise 17
If 2 is a factor of n and 3 is a factor of n, then 6 is a factor of n. 2 is not a factor of n
or 3 is not a factor of n or 6 is a factor of n.

Proof. Let p represent “2 is a factor of n” and q represent “3 is a factor of n” and r


represent “6 is a factor of n”.

33
So the two statements have the forms: p ∧ q → r and ∼ p ∨ ∼ q ∨ r.

p q r p∧q p∧q →r ∼p∨∼q∨r


T T T T T T
T T F T F F
T F T F T T
T F F F T T
F T T F T T
F T F F T T
F F T F T T
F F F F T T

These two statements are logically equivalent. We can also see this without the truth
table: p ∧ q → r ≡ ∼ (p ∧ q) ∨ r ≡ (∼ p ∨ ∼ q) ∨ r. Here we used A → B ≡ ∼ A ∨ B
and De Morgan laws.

2.18 Exercise 18
Write each of the following three statements in symbolic form and determine which pairs
are logically equivalent. Include truth tables and a few words of explanation.
If it walks like a duck and it talks like a duck, then it is a duck.
Either it does not walk like a duck or it does not talk like a duck, or it is a duck.
If it does not walk like a duck and it does not talk like a duck, then it is not a duck.

Proof. They are: p ∧ q → r and ∼ p ∨ ∼ q ∨ r and ∼ p ∧ ∼ q → ∼ r.


The first two are equivalent by Exercise 17. The last is not equivalent to the first two:
when p is true, q is true and r is false, we have
p ∧ q → r ≡ T ∧ T → F ≡ T → F ≡ F , but
∼ p ∧ ∼ q → ∼ r ≡ F ∧ F → T ≡ F → T ≡ T.

2.19 Exercise 19
True or false? The negation of “If Sue is Luiz’s mother, then Ali is his cousin” is “If
Sue is Luiz’s mother, then Ali is not his cousin.”

Proof. False. The negation of an if-then statement is not an if-then statement. It is an


and statement.

2.20 Exercise 20
Write negations for each of the following statements. (Assume that all variables repre-
sent fixed quantities or entities, as appropriate.)

34
2.20.1 (a)
If P is a square, then P is a rectangle.

Proof. P is a square and P is not a rectangle.

2.20.2 (b)
If today is New Year’s Eve, then tomorrow is January.

Proof. Today is New Year’s Eve and tomorrow is not January.

2.20.3 (c)
If the decimal expansion of r is terminating, then r is rational.

Proof. The decimal expansion of r is terminating and r is not rational.

2.20.4 (d)
If n is prime, then n is odd or n is 2.

Proof. n is prime and both n is not odd and n is not 2. Or: n is prime and n is neither
odd nor 2.

2.20.5 (e)
If x is nonnegative, then x is positive or x is 0.

Proof. x is nonnegative and x is not positive and x is not 0.

2.20.6 (f )
If Tom is Ann’s father, then Jim is her uncle and Sue is her aunt.

Proof. Tom is Ann’s father and either Jim is not her uncle or Sue is not her aunt.

2.20.7 (g)
If n is divisible by 6, then n is divisible by 2 and n is divisible by 3.

Proof. n is divisible by 6 and, either n is not divisible by 2 or n is not divisible by 3.

2.21 Exercise 21
Suppose that p and q are statements so that p → q is false. Find the truth values of
each of the following:

35
2.21.1 (a)
∼p→q

Proof. Because p → q is false, p is true and q is false. Hence ∼ p is false, and so ∼ p → q


is true.

2.21.2 (b)
p∨q

Proof. Again, p is true and q is false. So p ∨ q is true.

2.21.3 (c)
q→p

Proof. Again, p is true and q is false. So q → p is true.

2.22 Exercise 22
Write contrapositives for the statements of exercise 20.

Proof. (a) If P is not a rectangle, then P is not a square.


(b) If tomorrow is not January, then today is not New Year’s Eve.
(c) If r is not rational, then the decimal expansion of r is not terminating.
(d) If n is not odd and n is not 2, then n is not prime.
(e) If x is not positive and x is not 0, then x is not nonnegative.
(f) If either Jim is not Ann’s uncle or Sue is not her aunt, then Tom is not her father.
(g) If n is not divisible by 2 or n is not divisible by 3, then n is not divisible by 6.

2.23 Exercise 23
Write the converse and inverse for each statement of exercise 20.

Proof. (a) Converse: If P is a rectangle, then P is a square.


Inverse: If P is not a square, then P is not a rectangle.
(b) Converse: If tomorrow is January, then today is New Year’s Eve.
Inverse: If today is not New Year’s Eve, then tomorrow is not January.
(c) Converse: If r is rational, then the decimal expansion of r is terminating.
Inverse: If the decimal expansion of r is not terminating, then r is not rational.

36
(d) Converse: If n is odd or n is 2, then n is prime.
Inverse: If n is not prime, then n is not odd and n is not 2.
(e) Converse: If x is positive or x is 0, then x is nonnegative.
Inverse: If x is not nonnegative, then x is not positive and x is not 0.
(f) Converse: If Jim is Ann’s uncle and Sue is her aunt, then Tom is her father.
Inverse: If Tom is not Ann’s father, then Jim is not her uncle or Sue is not her aunt.
(g) Converse: If n is divisible by 2 and n is divisible by 3, then n is divisible by 6.
Inverse: If n is not divisible by 6, then n is not divisible by 2 or n is not divisible by
3.

Use truth tables to establish the truth of each statement in 24 − 27.

2.24 Exercise 24
A conditional statement is not logically equivalent to its converse.

Proof.
p q p→q q→p
T T T T
T F F T
F T T F
F F T T
They have different truth values in the second and third rows, so they are not logically
equivalent.

2.25 Exercise 25
A conditional statement is not logically equivalent to its inverse.

Proof.
p q p→q ∼p→∼q
T T T T
T F F T
F T T F
F F T T
They have different truth values in the second and third rows, so they are not logically
equivalent.

37
2.26 Exercise 26
A conditional statement and its contrapositive are logically equivalent to each other.

Proof.
p q p→q ∼q →∼p
T T T T
T F F F
F T T T
F F T T
They have the same truth values, so they are logically equivalent.

2.27 Exercise 27
The converse and inverse of a conditional statement are logically equivalent to each
other.

Proof.
p q q→p ∼p→∼q
T T T T
T F T T
F T F F
F F T T
They have the same truth values, so they are logically equivalent.

2.28 Exercise 28
“Do you mean that you think you can find out the answer to it?” said the March Hare.
“Exactly so,” said Alice.
“Then you should say what you mean,” the March Hare went on.
“I do,” Alice hastily replied; “at least—at least I mean what I say—that’s the same
thing, you know.”
“Not the same thing a bit!” said the Hatter.
“Why, you might just as well say that ‘I see what I eat’ is the same thing as ‘I eat what
I see’ !”
—from “A Mad Tea-Party” in Alice in Wonderland, by Lewis Carroll
The Hatter is right. “I say what I mean” is not the same thing as “I mean what I
say.” Rewrite each of these two sentences in if-then form and explain the logical relation
between them. (This exercise is referred to in the introduction to Chapter 4.)

Proof. “I say what I mean” is: “If I believe X is true, then I will say it.” (I won’t hide
it, stay quiet, or say something else; I will speak precisely about my belief in X.)

38
“I mean what I say” is: “If I say that X is true, then I believe it.” (I don’t say “X is
true” as a lie. I genuinely, sincerely believe that X is true.)
They are converses of each other, therefore not logically equivalent.

If statement forms P and Q are logically equivalent, then P ↔ Q is a tau-


tology. Conversely, if P ↔ Q is a tautology, then P and Q are logically
equivalent. Use ↔ to convert each of the logical equivalences in 29 − 31 to a
tautology. Then use a truth table to verify each tautology.

2.29 Exercise 29
p → (q ∨ r) ≡ (p ∧ ∼ q) → r

Proof. The tautology is (p → (q ∨ r)) ↔ ((p ∧ ∼ q) → r).

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

2.30 Exercise 30
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)

Proof. The tautology is Z : (p ∧ (q ∨ r)) ↔ ((p ∧ q) ∨ (p ∧ r)). (It’s abbreviated in the


truth table below, because it does not fit the screen.)

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

39
2.31 Exercise 31
p → (q → r) ≡ (p ∧ q) → r

Proof. The tautology is (p → (q → r)) ↔ ((p ∧ q) → r).

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

Rewrite each of the statements in 32 and 33 as a conjunction of two if-then


statements.

2.32 Exercise 32
This quadratic equation has two distinct real roots if, and only if, its discriminant is
greater than zero.

Proof. If this quadratic equation has two distinct real roots then its discriminant is
greater than zero, and, if the discriminant of this quadratic equation is greater than
zero then it has two distinct real roots.

2.33 Exercise 33
This integer is even if, and only if, it equals twice some integer.

Proof. If this integer is even then it equals twice some integer, and, if this integer equals
twice some integer then it is even.

Rewrite the statements in 34 and 35 in if-then form in two ways, one of


which is the contrapositive of the other. Use the formal definition of “only
if.”

2.34 Exercise 34
The Cubs will win the pennant only if they win tomorrow’s game.

Proof. If the Cubs win the pennant, then they will have won tomorrow’s game.
If the Cubs don’t win tomorrow’s game, then they won’t win the pennant.

40
2.35 Exercise 35
Sam will be allowed on Signe’s racing boat only if he is an expert sailor.

Proof. If Sam is be allowed on Signe’s racing boat, then he is an expert sailor.


If Sam is not an expert sailor, then he won’t be allowed on Signe’s racing boat.

2.36 Exercise 36
Taking the long view on your education, you go to the Prestige Corporation and ask
what you should do in college to be hired when you graduate. The personnel director
replies that you will be hired only if you major in mathematics or computer science, get
a B average or better, and take accounting. You do, in fact, become a math major, get
a B+ average, and take accounting. You return to Prestige Corporation, make a formal
application, and are turned down. Did the personnel director lie to you?

Proof. “you will be hired only if you major in mathematics or computer science, get a
B average or better, and take accounting” can be written as:
If you are hired, then you must have majored in mathematics or computer science,
gotten a B average or better, and taken accounting.
This means that the “then ...” portion of the statement is a necessary condition for
being hired, but it’s not a sufficient condition. They didn’t lie to you.

Some programming languages use statements of the form “r unless s” to


mean that as long as s does not happen, then r will happen. More formally:

Definition 1. If r and s are statements,


r unless s means if ∼ s then r.

In 37 − 39, rewrite the statements in if-then form.

2.37 Exercise 37
Payment will be made on fifth unless a new hearing is granted.

Proof. If a new hearing is not granted, payment will be made on the fifth.

2.38 Exercise 38
Ann will go unless it rains.

Proof. It if does not rain, Ann will go.

41
2.39 Exercise 39
This door will not open unless a security code is entered.

Proof. If a security code is not entered, this door will not open.

Rewrite the statements in 40 and 41 in if-then form.

2.40 Exercise 40
Catching the 8:05 bus is a sufficient condition for my being on time for work.

Proof. If I catch the 8:05 bus, then I am on time for work.

2.41 Exercise 41
Having two 45° angles is a sufficient condition for this triangle to be a right triangle.

Proof. If this triangle has two 45° angles, then it is a right triangle.

Use the contrapositive to rewrite the statements in 42 and 43 in if-then form


in two ways.

2.42 Exercise 42
Being divisible by 3 is a necessary condition for this number to be divisible by 9.

Proof. If this number is not divisible by 3, then it is not divisible by 9.


If this number is divisible by 9, then it is divisible by 3.

2.43 Exercise 43
Doing homework regularly is a necessary condition for Jim to pass the course.

Proof. If Jim does not do his homework regularly, he will not pass the course.
If Jim passes course, then he must have done his homework regularly.

Note that “a sufficient condition for s is r” means r is a sufficient condition


for s and that “a necessary condition for s is r” means r is a necessary
condition for s. Rewrite the statements in 44 and 45 in if-then form.

2.44 Exercise 44
A sufficient condition for Jon’s team to win the championship is that it win the rest of
its games.

Proof. If Jon’s team wins the rest of its games, then it will win the championship.

42
2.45 Exercise 45
A necessary condition for this computer program to be correct is that it not produce
error messages during translation.

Proof. If this computer program is correct, then it does not produce error messages
during translation.

2.46 Exercise 46
“If compound X is boiling, then its temperature must be at least 150°C.” Assuming
that this statement is true, which of the following must also be true?

2.46.1 (a)
If the temperature of compound X is at least 150°C, then compound X is boiling.

Proof. This statement is the converse of the given statement, and so it is not necessarily
true. For instance, if the actual boiling point of compound X were 200°C, then the given
statement would be true but this statement would be false.

2.46.2 (b)
If the temperature of compound X is less than 150°C, then compound X is not boiling.

Proof. This statement must be true. It is the contrapositive of the given statement.

2.46.3 (c)
Compound X will boil only if its temperature is at least 150°C.

Proof. True. This is the same as the given statement, written differently: instead of
if-then form, it’s written in only if form. “s only if r” means “if s then r.”

2.46.4 (d)
If compound X is not boiling, then its temperature is less than 150°C.

Proof. Not necessarily true. This is the inverse of the given statement.

2.46.5 (e)
A necessary condition for compound X to boil is that its temperature be at least 150°C.

Proof. True, this translates to the given statement. “A necessary condition for s is r”
means “if s then r”.

43
2.46.6 (f )
A sufficient condition for compound X to boil is that its temperature be at least 150°C.

Proof. “A sufficient condition for s is r” means “if r then s”. So this is equivalent to
the converse of the given statement, therefore is not necessarily true.

In 47 − 50 (a) use the logical equivalences p → q ≡ ∼ p ∨ q and p ↔ q ≡


(∼ p ∨ q) ∧ (∼ q ∨ p) to rewrite the given statement forms without using the
symbol → or ↔, and (b) use the logical equivalence p ∨ q ≡ ∼ (∼ p ∧ ∼ q) to
rewrite each statement form using only ∧ and ∼.

2.47 Exercise 47
p∧∼q →r

Proof. (a) p ∧ ∼ q → r ≡ ∼ (p ∧ ∼ q) ∨ r
(b) ∼ (p ∧ ∼ q) ∨ r ≡ ∼ (∼ (∼ (p ∧ ∼ q)) ∧ ∼ r) ≡ ∼ (p ∧ ∼ q ∧ ∼ r)

2.48 Exercise 48
p∨∼q →r∨q

Proof. (a) p ∨ ∼ q → r ∨ q ≡ ∼ (p ∨ ∼ q) ∨ (r ∨ q)
(b)
∼ (p ∨ ∼ q) ∨ (r ∨ q) ≡ ∼ (∼ (∼ (p ∨ ∼ q)) ∧ ∼ (r ∨ q))
≡ ∼ ((p ∨ ∼ q) ∧ (∼ r ∧ ∼ q))
≡ ∼ (∼ (∼ p ∧ q) ∧ (∼ r ∧ ∼ q))

2.49 Exercise 49
(p → r) ↔ (q → r)

Proof. (a) (p → r) ↔ (q → r) ≡ (∼ p ∨ r) ↔ (∼ q ∨ r) ≡
((∼ p ∨ r) → (∼ q ∨ r)) ∧ ((∼ q ∨ r) → (∼ p ∨ r)) ≡
(∼ (∼ p ∨ r) ∨ (∼ q ∨ r)) ∧ (∼ (∼ q ∨ r) ∨ (∼ p ∨ r))
(b) (∼ (∼ p ∨ r) ∨ (∼ q ∨ r)) ∧ (∼ (∼ q ∨ r) ∨ (∼ p ∨ r)) ≡
∼ ((∼ p ∨ r) ∧ ∼ (∼ q ∨ r)) ∧ ∼ ((∼ q ∨ r) ∧ ∼ (∼ p ∨ r)) ≡
∼ (∼ (p ∧ ∼ r) ∧ (q ∧ ∼ r)) ∧ ∼ (∼ (q ∧ ∼ r) ∧ (p ∧ ∼ r))

44
2.50 Exercise 50
(p → (q → r)) ↔ ((p ∧ q) → r)

Proof. (a) (p → (q → r)) ↔ ((p ∧ q) → r) ≡


[(p → (q → r)) → ((p ∧ q) → r)] ∧ [((p ∧ q) → r) → (p → (q → r))] ≡
[(p → (∼ q ∨ r)) → (∼ (p ∧ q) ∨ r)] ∧ [(∼ (p ∧ q) ∨ r) → (p → (∼ q ∨ r))] ≡
[(∼ p ∨ (∼ q ∨ r)) → (∼ (p ∧ q) ∨ r)] ∧ [(∼ (p ∧ q) ∨ r) → (∼ p ∨ (∼ q ∨ r))] ≡
[∼ (∼ p ∨ (∼ q ∨ r)) ∨ (∼ (p ∧ q) ∨ r)] ∧ [∼ (∼ (p ∧ q) ∨ r) ∨ (∼ p ∨ (∼ q ∨ r))]
(b) Simplifying the above with De Morgan laws, we get
≡ [(p ∧ (q ∧ ∼ r)) ∨ (∼ (p ∧ q) ∨ r)] ∧ [((p ∧ q) ∧ ∼ r) ∨ (∼ p ∨ (∼ q ∨ r))]
Converting the ∨s we get
≡ [(p ∧ (q ∧ ∼ r)) ∨ ∼ ((p ∧ q) ∧ ∼ r)] ∧ [((p ∧ q) ∧ ∼ r) ∨ ∼ (p ∧ (q ∧ ∼ r))]
≡∼ [∼ (p ∧ (q ∧ ∼ r)) ∧ ((p ∧ q) ∧ ∼ r)]∧ ∼ [∼ ((p ∧ q) ∧ ∼ r) ∧ (p ∧ (q ∧ ∼ r))]

2.51 Exercise 51
Given any statement form, is it possible to find a logically equivalent form that uses
only ∧ and ∼? Justify your answer.

Proof. Yes. We can follow the procedure in exercises 47-50. It’s always possible.

3 Exercise Set 2.3


Use modus ponens or modus tollens to fill in the blanks in the arguments of
1 − 5 so as to produce valid inferences.

3.1 Exercise 1
√ √
If 2 is rational, then 2 = a/b for some integers a and b.

It is not true that 2 = a/b for some integers a and b.


Proof. ∴ 2 is not rational.

3.2 Exercise 2
If 1 − 0.99999 . . . is less than every positive real number, then it equals zero.

∴ The number 1 − 0.99999 . . . equals zero.

45
Proof. 1 − 0.99999 . . . is less than every positive real number.

3.3 Exercise 3
If logic is easy, then I am a monkey’s uncle.
I am not a monkey’s uncle.

Proof. ∴ Logic is not easy.

3.4 Exercise 4
If this graph can be colored with three colors, then it can colored with four colors.
This graph cannot be colored with four colors.

Proof. ∴ This graph cannot be colored with three colors.

3.5 Exercise 5
If they were unsure of the address, then they would have telephoned.

∴ They were sure of the address.

Proof. They haven’t telephoned.

Use truth tables to determine whether the argument forms in 6−11 are valid.
Indicate which columns represent the premises and which represent the con-
clusion, and include a sentence explaining how the truth table supports your
answer. Your explanation should show that you understand what it means
for a form of argument to be valid or invalid.

3.6 Exercise 6
p→q
q→p
∴p∨q

46
Proof.
premise premise conclusion
p q p→q q→p p∨q
T T T T T
T F F T T
F T T F T
F F T T F
The last row shows that it is possible for an argument of this form to have true premises
and a false conclusion. Thus this argument form is invalid.

3.7 Exercise 7
pp→q
∼q∨r
∴r

Proof.
premise conclusion premise premise
p q r p→q ∼q∨r
T T T T T
T T F T F
T F T F T
T F F F T
F T T T T
F T F T F
F F T T T
F F F T T
The first row describes the only situation in which all the premises are true. Because
the conclusion is also true here, the argument form is valid.

3.8 Exercise 8
p∨q
p→∼q
p→r
∴r

47
Proof.
conclusion premise premise premise
p q r p∨q p→∼q p→r
T T T T F T
T T F T F F
T F T T T T
T F F T T F
F T T T T T
F T F T T T
F F T F T T
F F F F T T
The sixth row shows that it is possible for an argument of this form to have true premises
and a false conclusion. Thus this argument form is invalid.

3.9 Exercise 9
p∧q →∼r
p∨∼q
∼q→p
∴∼r

Proof.

conclusion premise premise premise


p q r ∼q ∼r p∧q p∧q →∼r p∨∼q ∼q →p
T T T F F T T T T
T T F F T T F T T
T F T T F F T T T
T F F T T F T T T
F T T F F F T F T
F T F F T F T F T
F F T T F F T T F
F F F T T F T T F

This form of argument is invalid; there are critical rows (when all 3 premises are true)
where the conclusion is false.

3.10 Exercise 10
p∨q →r
∴∼r →∼p∧∼q

Proof. No need for a truth table. This argument is valid; it’s just modus tollens!

48
3.11 Exercise 11
p→q∨r
∼q∨∼r
∴∼p∨∼r

Proof.

premise premise conclusion


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

This form of argument is invalid; there is a critical row (when both premises are true)
where the conclusion is false.

3.12 Exercise 12
Use truth tables to show that the following forms of argument are invalid.

3.12.1 (a)
p→q
q
∴ p (converse error)

Proof.
conclusion premise premise
p q p→q
T T T
T F F
F T T
F F T
The third row shows that it is possible for an argument of this form to have true premises
and a false conclusion. Thus this argument form is invalid.

49
3.12.2 (b)
p→q
∼p
∴ ∼ q (inverse error)

Proof.
premise premise conclusion
p q p→q ∼p ∼q
T T T F F
T F F F T
F T T T F
F F T T T
This form of argument is invalid. There is at least one critical row (when both premises
are true) where the conclusion is false.

Use truth tables to show that the argument forms referred to in 13 − 21 are
valid. Indicate which columns represent the premises and which represent
the conclusion, and include a sentence explaining how the truth table sup-
ports your answer. Your explanation should show that you understand what
it means for a form of argument to be valid.

3.13 Exercise 13
Modus tollens:
p→q
∼q
∴∼p

Proof.
premise premise conclusion
p q p→q ∼q ∼p
T T T F F
T F F T F
F T T F T
F F T T T
This form of argument is valid. The conclusion is always true on the critical rows (when
both premises are true).

3.14 Exercise 14
Example 2.3.3(a)

50
Proof.
premise conclusion
p q p∨q
T T T
T F T
F T T
F F F
This form of argument is valid. The conclusion is always true on the critical rows (when
the premise is true).

3.15 Exercise 15
Example 2.3.3(b)

Proof.
premise conclusion
p q p∨q
T T T
T F T
F T T
F F F
This form of argument is valid. The conclusion is always true on the critical rows (when
the premise is true).

3.16 Exercise 16
Example 2.3.4(a)

Proof.
conclusion premise
p q p∧q
T T T
T F F
F T F
F F F
This form of argument is valid. The conclusion is always true on the critical rows (when
the premise is true).

3.17 Exercise 17
Example 2.3.4(b)

51
Proof.
conclusion premise
p q p∧q
T T T
T F F
F T F
F F F
This form of argument is valid. The conclusion is always true on the critical rows (when
the premise is true).

3.18 Exercise 18
Example 2.3.5(a)

Proof.
conclusion premise premise
p q ∼q p∨q
T T F T
T F T T
F T F T
F F T F
This form of argument is valid. The conclusion is always true on the critical rows (when
both premises are true).

3.19 Exercise 19
Example 2.3.5(b)

Proof.
conclusion premise premise
p q ∼p p∨q
T T F T
T F F T
F T T T
F F T F
This form of argument is valid. The conclusion is always true on the critical rows (when
both premises are true).

3.20 Exercise 20
Example 2.3.6

52
Proof.
premise premise conclusion
p q r p→q q→r p→r
T T T T T T
T T F T F F
T F T F T T
T F F F T F
F T T T T T
F T F T F T
F F T T T T
F F F T T T
This form of argument is valid; the conclusion is always true on the critical rows (when
both premises are true).

3.21 Exercise 21
Example 2.3.7

Proof.
conclusion premise premise premise
p q r p∨q p→r q→r
T T T T T T
T T F T F F
T F T T T T
T F F T F T
F T T T T T
F T F T T F
F F T F T T
F F F F T T
This form of argument is valid; the conclusion is always true on the critical rows (when
all 3 premises are true).

Use symbols to write the logical form of each argument in 22 and 23, and then
use a truth table to test the argument for validity. Indicate which columns
represent the premises and which represent the conclusion, and include a few
words of explanation showing that you understand the meaning of validity.

3.22 Exercise 22
If Tom is not on team A, then Hua is on team B.
If Hua is not on team B, then Tom is on team A.
∴ Tom is not on team A or Hua is not on team B.

53
Proof. Let p represent “Tom is on team A” and q represent “Hua is on team B.” Then
the argument has the form

∼p→q
∼q→p
∴∼p∨∼q

premise premise conclusion


p q ∼p ∼q ∼p→q ∼q →p ∼p∨∼q
T T F F T T F
T F F T T T T
F T T F T T T
F F T T F F
The top row shows that it is possible for an argument of this form to have true premises
and a false conclusion. Thus this argument form is invalid.

3.23 Exercise 23
Oleg is a math major or Oleg is an economics major.
If Oleg is a math major, then Oleg is required to take Math 362.
∴ Oleg is an economics major or Oleg is not required to take Math 362.

Proof. Let p represent “Oleg is a math major” and q represent “Oleg is an economics
major” and r represent “Oleg is required to take Math 362”. Then the argument has
the form

p∨q
p→r
∴q∨∼r

premise premise conclusion


p q r p∨q p→r q∨∼r
T T T T T T
T T F T F T
T F T T T F
T F F T F T
F T T T T T
F T F T T T
F F T F T F
F F F F T T
The third row shows that it is possible for an argument of this form to have true premises
and a false conclusion. Thus this argument form is invalid.

54
Some of the arguments in 24 − 32 are valid, whereas others exhibit the con-
verse or the inverse error. Use symbols to write the logical form of each
argument. If the argument is valid, identify the rule of inference that guar-
antees its validity. Otherwise, state whether the converse or the inverse
error is made.

3.24 Exercise 24
If Jules solved this Exercise correctly, then Jules obtained the answer 2.
Jules obtained the answer 2.
∴ Jules solved this Exercise correctly.

Proof. The form is p → q, q, ∴ p. This is invalid due to converse error.

3.25 Exercise 25
This real number is rational or it is irrational.
This real number is not rational.
∴ This real number is irrational.

Proof. The form is: p ∨ q, ∼ p, ∴ ∼ q. This is valid by Elimination.

3.26 Exercise 26
If I go to the movies, I won’t finish my homework.
If I don’t finish my homework, I won’t do well on the exam tomorrow.
∴ If I go to the movies, I won’t do well on the exam tomorrow.

Proof. The form is: p → q, q → r, ∴ p → r. This is valid by Transitivity.

3.27 Exercise 27
If this number is larger than 2, then its square is larger than 4.
This number is not larger than 2.
∴ The square of this number is not larger than 4.

Proof. The form is: p → q, ∼ p, ∴ ∼ q. This is invalid due to inverse error.

55
3.28 Exercise 28
If there are as many rational numbers as there are irrational numbers, then the set of
all irrational numbers is infinite.
The set of all irrational numbers is infinite.
∴ There are as many rational numbers as there are irrational numbers.

Proof. The form is: p → q, q, ∴ p. This is invalid due to converse error.

3.29 Exercise 29
If at least one of these two numbers is divisible by 6, then the product of these two
numbers is divisible by 6.
Neither of these two numbers is divisible by 6.
∴ The product of these two numbers is not divisible by 6.

Proof. The form is: p → q, ∼ p, ∴ ∼ q. This is invalid due to inverse error.

3.30 Exercise 30
If this computer program is correct, then it produces the correct output when run with
the test data my teacher gave me.
This computer program produces the correct output when run with the test data my
teacher gave me.
∴ This computer program is correct.

Proof. The form is: p → q, q, ∴ p. This is invalid due to converse error.

3.31 Exercise 31
Sandra knows Java and Sandra knows C++.
∴ Sandra knows C++.

Proof. The form is: p ∧ q, ∴ q. This is valid by Specialization.

3.32 Exercise 32
If I get a Christmas bonus, I’ll buy a stereo.
If I sell my motorcycle, I’ll buy a stereo.
∴ If I get a Christmas bonus or I sell my motorcycle, then I’ll buy a stereo.

Proof. The argument form is: p → r, q → r, ∴ p ∨ q → r. This is valid: it’s Proof by


Division into Cases minus one application of modus ponens.

56
3.33 Exercise 33
Give an example (other than Example 2.3.11) of a valid argument with a false conclusion.

Proof. If Australia does not exist, then Japan is not an island.


Australia does not exist.
Therefore Japan is not an island.

3.34 Exercise 34
Give an example (other than Example 2.3.12) of an invalid argument with a true con-
clusion.

Proof. If Australia does not exist, then Japan is not an island.


Australia exists.
Therefore Japan is an island.

3.35 Exercise 35
Explain in your own words what distinguishes a valid form of argument from an invalid
one.

Proof. A valid form of argument always results in a true conclusion from true premises.

3.36 Exercise 36
Given the following information about a computer program, find the mistake in the
program.
a. There is an undeclared variable or there is a syntax error in the first five lines.
b. If there is a syntax error in the first five lines, then there is a missing semicolon or a
variable name is misspelled.
c. There is not a missing semicolon.
d. There is not a misspelled variable name.

Proof. The program contains an undeclared variable. One explanation:


1. There is not a missing semicolon and there is not a misspelled variable name. (by
(c) and (d) and definition of ∧)
2. It is not the case that there is a missing semicolon or a misspelled variable name.
(by (1) and De Morgan’s laws)
3. There is not a syntax error in the first five lines. (by (b) and (2) and modus tollens)

57
4. There is an undeclared variable. (by (a) and (3) and elimination)

3.37 Exercise 37
In the back of an old cupboard you discover a note signed by a pirate famous for his
bizarre sense of humor and love of logical puzzles. In the note he wrote that he had
hidden treasure somewhere on the property. He listed five true statements (a–e below)
and challenged the reader to use them to figure out the location of the treasure.
a. If this house is next to a lake, then the treasure is not in the kitchen.
b. If the tree in the front yard is an elm, then the treasure is in the kitchen.
c. This house is next to a lake.
d. The tree in the front yard is an elm or the treasure is buried under the flagpole.
e. If the tree in the back yard is an oak, then the treasure is in the garage.
Where is the treasure hidden?

Proof. The treasure is buried under the flagpole. One explanation:


1. The treasure is not in the kitchen. (by (c) and (a) and modus ponens)
2. The tree in the front yard is not an elm. (by (b) and (1) and modus tollens)
3. The treasure is buried under the flagpole. (by (d) and (2) and elimination)

3.38 Exercise 38
You are visiting the island described in Example 2.3.14 and have the following encounters
with natives.

3.38.1 (a)
Two natives A and B address you as follows:
A says: Both of us are knights.
B says: A is a knave.
What are A and B?

Proof. A is a knave and B is a knight. One explanation:


1. Suppose A is a knight.
2. ∴ What A says is true. (by definition of knight)
3. ∴ B is a knight also. (That’s what A said.)
4. ∴ What B says is true. (by definition of knight)
5. ∴ A is a knave. (That’s what B said.)

58
6. ∴ We have a contradiction: A is a knight and a knave. (by (1) and (5))
7. ∴ The supposition that A is a knight is false. (by the contradiction rule)
8. ∴ A is a knave. (negation of supposition)
9. ∴ What B says is true. (B said A was a knave, which we now know to be true.)
10. ∴ B is a knight. (by definition of knight)

3.38.2 (b)
Another two natives C and D approach you but only C speaks.
C says: Both of us are knaves.
What are C and D?

Proof. 1. Assume C is a knight.


2. ∴ What C says is true. (by definition of knight)
3. ∴ C is a knave. (That’s what C said.)
4. ∴ We have a contradiction: C is both a knight and a knave.
5. ∴ The assumption in (1) that C is a knight is false. (by the contradiction rule)
6. ∴ C is a knave. (negation of assumption in (1))
7. ∴ What C says is false. (by definition of knave)
8. ∴ D is a knight. (negation of what C said)

3.38.3 (c)
You then encounter natives E and F.
E says: F is a knave.
F says: E is a knave.
How many knaves are there?

Proof. 0. There are 0, 1, or 2 knaves.


1. Assume there are 2 knaves.
2. ∴ What E says is false. (by definition of knave)
3. ∴ F is a knight. (negation of what E said)
4. ∴ We have a contradiction: F is both a knave and a knight.
5. ∴ The assumption in (1) that there are 2 knaves is false.
6. ∴ It is not the case that there are 2 knaves. (negation of assumption in (1))

59
7. Now assume there are 0 knaves. So there are 2 knights.
8. ∴ What E says is true. (by definition of knight)
9. ∴ F is a knave. (That’s what E said.)
10. ∴ We have a contradiction: F is both a knight and a knave.
11. ∴ The assumption in (7) that there are 0 knaves is false.
12. ∴ It is not the case that there are 0 knaves. (negation of assumption in (7))
13. ∴ By (0), (6) and (12) there is exactly 1 knave.

3.38.4 (d)
Finally, you meet a group of six natives, U , V , W , X, Y , and Z, who speak to you as
follows:
U says: None of us is a knight.
V says: At least three of us are knights.
W says: At most three of us are knights.
X says: Exactly five of us are knights.
Y says: Exactly two of us are knights.
Z says: Exactly one of us is a knight.
Which are knights and which are knaves?

Proof. U cannot be a knight: if U is a knight, what U says must be true, so nobody is


a knight, which is a contradiction. So U is a knave.
Assume V is a knight. Then what V says is true: there are at least 3 knights. So, there
are at least 2 knights among W, X, Y, Z.
Then Y and Z are knaves, because what they say contradict what V says. So W and
X both have to be knights, but again we have a contradiction, because W says there
are at most 3 knights, but X says there are exactly 5.
Therefore V is a knave. So there can be at most 4 knights (among W, X, Y, Z). Then
it follows that X is also a knave, because X says there are 5 knights.
So there are at most 3 knights (among W, Y, Z). So what W says is true. Therefore W
is a knight.
Z cannot be a knight: if Z is a knight, then there are at least 2 knights (namely W and
Z) which contradicts what Z says. Therefore Z is a knave.
Y must be a knight: if Y is a knave, then what Y says is false, so there is exactly 1
knight (W ), which is what Z says, but we already established that Z is a knave, so
that’s false.

60
In conclusion: W and Y are knights, U, V, X, Z are knaves.

3.39 Exercise 39
The famous detective Percule Hoirot was called in to solve a baffling murder mystery.
He determined the following facts:
a. Lord Hazelton, the murdered man, was killed by a blow on the head with a brass
candlestick.
b. Either Lady Hazelton or a maid, Sara, was in the dining room at the time of the
murder.
c. If the cook was in the kitchen at the time of the murder, then the butler killed Lord
Hazelton with a fatal dose of strychnine.
d. If Lady Hazelton was in the dining room at the time of the murder, then the chauffeur
killed Lord Hazelton.
e. If the cook was not in the kitchen at the time of the murder, then Sara was not in
the dining room when the murder was committed.
f. If Sara was in the dining room at the time the murder was committed, then the wine
steward killed Lord Hazelton.
Is it possible for the detective to deduce the identity of the murderer from these facts?
If so, who did murder Lord Hazelton? (Assume there was only one cause of death.)

Proof. The chauffeur killed Lord Hazelton. One explanation:


1. Suppose the cook was in the kitchen at the time of the murder.
2. ∴ The butler killed Lord Hazelton with strychnine. (by (c) and (1) and modus
ponens)
3. ∴ We have a contradiction: Lord Hazelton was killed by strychnine and a blow on
the head. (by (2) and (a))
4. ∴ The supposition that the cook was in the kitchen is false. (by the contradiction
rule)
5. ∴ The cook was not in the kitchen at the time of the murder. (negation of supposition)
6. ∴ Sara was not in the dining room when the murder was committed. (by (e) and (5)
and modus ponens)
7. ∴ Lady Hazelton was in the dining room when the murder was committed. (by (b)
and (6) and elimination)
8. ∴ The chauffeur killed Lord Hazelton. (by (d) and (7) and modus ponens)

61
3.40 Exercise 40
Sharky, a leader of the underworld, was killed by one of his own band of four henchmen.
Detective Sharp interviewed the men and determined that all were lying except for one.
He deduced who killed Sharky on the basis of the following statements:
a. Socko: Lefty killed Sharky.
b. Fats: Muscles didn’t kill Sharky.
c. Lefty: Muscles was shooting craps with Socko when Sharky was knocked off.
d. Muscles: Lefty didn’t kill Sharky.
Who did kill Sharky?

Proof. (1) By premises (a) and (d), Socko and Muscles say the opposites of each other.
So they cannot both be lying. Therefore, one of them is telling the truth, and one of
them is lying.
(2) Only one of them is telling the truth, and by (1) the only truth-teller is among Socko
and Muscles. Therefore Fats and Lefty are both liars.
(3) By (2) and premise (b), Muscles killed Sharky. (Which means that Lefty didn’t, so
Muscles is the only truth-teller. Not that it’s relevant or needed at this point.)

In 41 − 44 a set of premises and a conclusion are given. Use the valid argu-
ment forms listed in Table 2.3.1 to deduce the conclusion from the premises,
giving a reason for each step as in Example 2.3.8. Assume all variables are
statement variables.

3.41 Exercise 41
a. ∼ p ∨ q → r
b. s ∨ ∼ q
c. ∼ t
d. p → t
e. ∼ p ∧ r → ∼ s
f. ∴ ∼ q

62
(1) p→t by premise (d)
∼p by premise (c)
∴ ∼p by modus tollens
(2) ∼p by (1)
∴ ∼p∨q by generalization
(3) ∼p∨q →r by premise (a)
∼p∨q by (2)
∴ r by modus ponens
Proof. (4) ∼p by (1)
r by (3)
∴ ∼p∧r by conjunction
(5) ∼p∧r →∼s by premise (e)
∼p∧r by (4)
∴ ∼s by modus ponens
(6) s∨∼q by premise (b)
∼s by (5)
∴ ∼q by elimination

3.42 Exercise 42
a. p ∨ q
b. q → r
c. p ∧ s → t
d. ∼ r
e. ∼ q → u ∧ s
f. ∴ t
q→r
(1) by premise (d)
∼r by premise (b)
∴ ∼q by modus tollens
(2) ∼q by (1)
p∨q by premise (a)
∴ p by elimination
(3) ∼q by (1)
∼q →u∧s by premise (e)
Proof. ∴ u∧s by modus ponens
(4) u∧s by (3)
∴ by specialization
(5) p by (2)
s by (4)
∴ p∧s by conjunction
(6) p∧s by (5)
p∧s→t by premise (c)
∴ t by modus ponens

63
3.43 Exercise 43
a. ∼ p → r ∧ ∼ s
b. t → s
c. u → ∼ p
d. ∼ w
e. u ∨ w
f. ∴ ∼ t
(1) ∼w by premise (d)
u∨w by premise (c)
∴ u by elimination
(2) u→∼p by premise (c)
u by (1)
∴ ∼p by modus ponens
(3) ∼p→r∧∼s by premise (a)
Proof.
∼p by (2)
∴ r∧∼s by modus ponens
(4) r∧∼s by (3)
∴ ∼s by specialization
(5) ∼t→s by premise (b)
∼s by
∴ ∼t by modus tollens

3.44 Exercise 44
a. p → q
b. r ∨ s
c. ∼ s → ∼ t
d. ∼ q ∨ s
e. ∼ s
f. ∼ p ∧ r → u
g. w ∨ t
h. ∴ u ∧ w

64
(1) ∼s by premise (e)
∼s→∼t by premise (c)
∴ ∼t by modus ponens
(2) w∨t by premise (g)
∼t by (1)
∴ w by elimination
(3) ∼s by premise (e)
∼q∨s by premise (d)
∴ ∼q by elimination
(4) p→q by premise (a)
∼q by (3)
∴ ∼p by modus tollens
Proof.
(5) ∼s by premise (e)
r∨s by premise (b)
∴ r by elimination
(6) ∼p by (4)
r by (5)
∴ ∼p∧r by conjunction
(7) ∼p∧r by (6)
∼p∧r →u by premise (f)
∴ by modus ponens
(8) u by (7)
w by (2)
∴ u∧w by conjunction

4 Exercise Set 2.4


Give the output signals for the circuits in 1 − 4 if the input signals are as
indicated.

4.1 Exercise 1

input signals: P = 1 and Q = 1

Proof. R = 1

4.2 Exercise 2
input signals: P = 1 and Q = 0

Proof. R = 1

65
4.3 Exercise 3

input signals: P = 1, Q = 0, R = 0

Proof. S = 1

4.4 Exercise 4

input signals: P = 0, Q = 0, R = 0

Proof. S = 1

In 5−8, write an input/output table for the circuit in the referenced exercise.

4.5 Exercise 5
Exercise 1

Proof.
P Q R
1 1 1
1 0 0
0 1 1
0 0 0

66
4.6 Exercise 6
Exercise 2

Proof.
P Q R
1 1 0
1 0 1
0 1 0
0 0 0

4.7 Exercise 7
Exercise 3

Proof.
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 1
0 0 1 0
0 0 0 0

4.8 Exercise 8
Exercise 4

Proof.
P Q R S
1 1 1 1
1 1 0 1
1 0 1 1
1 0 0 1
0 1 1 1
0 1 0 1
0 0 1 1
0 0 0 1

In 9 − 12, find the Boolean expression that corresponds to the circuit in the
referenced exercise.

67
4.9 Exercise 9
Exercise 1

Proof. P ∨ ∼ Q

4.10 Exercise 10
Exercise 2

Proof. (P ∨ Q) ∧ ∼ Q

4.11 Exercise 11
Exercise 3

Proof. (P ∧ ∼ Q) ∨ R

4.12 Exercise 12
Exercise 4

Proof. (P ∨ Q) ∨ ∼ (Q ∧ R)

Construct circuits for the Boolean expressions in 13 − 17.

4.13 Exercise 13
∼P ∨Q

Proof.

4.14 Exercise 14
∼ (P ∨ Q)

Proof.

68
4.15 Exercise 15
P ∨ (∼ P ∧ ∼ Q)

Proof.

4.16 Exercise 16
(P ∧ Q) ∨ ∼ R

Proof.

4.17 Exercise 17
(P ∧ ∼ Q) ∨ (∼ P ∧ R)

Proof.

For each of the tables in 18–21, construct (a) a Boolean expression having
the given table as its truth table and (b) a circuit having the given table as
its input/output table.

69
4.18 Exercise 18
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0

Proof. (P ∧ Q ∧ ∼ R) ∨ (∼ P ∧ Q ∧ R)

4.19 Exercise 19
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 1
0 1 1 0
0 1 0 1
0 0 1 0
0 0 0 0

Proof. (P ∧ Q ∧ ∼ R) ∨ (P ∧ ∼ Q ∧ ∼ R) ∨ (∼ P ∧ Q ∧ ∼ R)

70
4.20 Exercise 20
P Q R S
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 1

Proof. (P ∧ Q ∧ R) ∨ (P ∧ ∼ Q ∧ R) ∨ (∼ P ∧ ∼ Q ∧ ∼ R)

71
4.21 Exercise 21
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 1
0 0 1 0
0 0 0 0

Proof. (P ∧ Q ∧ ∼ R) ∨ (∼ P ∧ Q ∧ R) ∨ (∼ P ∧ Q ∧ ∼ R)

4.22 Exercise 22
Design a circuit to take input signals P, Q, and R and output a 1 if, and only if, P and
Q have the same value and Q and R have opposite values.

72
Proof. The input/output table is:

Input Output
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 1
0 0 0 0

A formula is: (P ∧ Q ∧ ∼ R) ∨ (∼ P ∧ ∼ Q ∧ R).


One circuit (among many) having this input/output table is the following:

4.23 Exercise 23
Design a circuit to take input signals P, Q, and R and output a 1 if, and only if, all
three of P, Q, and R have the same value.

73
Proof. The input/output table is:

Input Output
P Q R S
1 1 1 1
1 1 0 0
1 0 1 0
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 1

A formula (among many) is: (P ∧ Q ∧ R) ∨ (∼ P ∧ ∼ Q ∧ ∼ R).


One circuit (among many) having this input/output table is the following:

4.24 Exercise 24
The lights in a classroom are controlled by two switches: one at the back of the room
and one at the front. Moving either switch to the opposite position turns the lights off
if they are on and on if they are off. Assume the lights have been installed so that when
both switches are in the down position, the lights are off. Design a circuit to control
the switches.

Proof. Let P and Q represent the positions of the switches in the classroom, with 0
being “down” and 1 being “up.” Let R represent the condition of the light, with 0 being
“off” and 1 being “on.” Initially, P = Q = 0 and R = 0. If either P or Q (but not both)
is changed to 1, the light turns on. So when P = 1 and Q = 0, then R = 1, and when
P = 0 and Q = 1, then R = 1. Thus when one switch is up and the other is down the
light is on, and hence moving the switch that is down to the up position turns the light
off. So when P = 1 and Q = 1, then R = 0. It follows that the input/output table has
the following appearance:

74
input input output
P Q R
1 1 0
1 0 1
0 1 1
0 0 0

One circuit (among many) having this input/output table is the following:

4.25 Exercise 25
An alarm system has three different control panels in three different locations. To enable
the system, switches in at least two of the panels must be in the on position. If fewer
than two are in the on position, the system is disabled. Design a circuit to control the
switches.

Proof. Let P, Q, R represent the switches in the 3 control panels. Let S represent the
overall system. It follows that the input/output table has the following appearance:

Input Output
P Q R S
1 1 1 1
1 1 0 1
1 0 1 1
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0

A formula (among many) is:

(P ∧ Q ∧ R) ∨ (P ∧ Q ∧ ∼ R) ∨ (P ∧ ∼ Q ∧ R) ∨ (∼ P ∧ Q ∧ R)

75
In this form, the circuit would be too complicated. Let’s simplify.
By the distributive law, the negation law and the identity law, we can simplify the first
two terms as:

(P ∧ Q ∧ R) ∨ (P ∧ Q ∧ ∼ R) ≡ (P ∧ Q) ∧ (R ∨ ∼ R) ≡ (P ∧ Q) ∧ t ≡ P ∧ Q

By the distributive law we can simplify the last two terms as:

(P ∧ ∼ Q ∧ R) ∨ (∼ P ∧ Q ∧ R) ≡ R ∧ ((P ∧ ∼ Q) ∨ (∼ P ∧ Q))

If you allow me to cheat a little bit, the portion ((P ∧ ∼ Q) ∨ (∼ P ∧ Q)) is equivalent
to the exclusive or of P and Q, namely P ⊕ Q.
So the overall formula simplifies to: (P ∧ Q) ∨ (R ∧ (P ⊕ Q)).
One circuit (among many) having this input/output table is the following:

Use the properties listed in Theorem 2.1.1 to show that each pair of circuits
in 26 − 29 have the same input/output table. (Find the Boolean expressions
for the circuits and show that they are logically equivalent when regarded
as statement forms.)

4.26 Exercise 26

Proof. The Boolean expression for the first is (P ∧ Q) ∨ Q and for the second it is
(P ∨ Q) ∧ Q. We must show that if these expressions are regarded as statement forms,

76
then they are logically equivalent. Now

(P ∧ Q) ∨ Q ≡ Q ∨ (P ∧ Q) by the commutative law


≡ (Q ∨ P ) ∧ (Q ∨ Q) by the distributive law
≡ (Q ∨ P ) ∧ Q by the idempotent law
≡ (P ∨ Q) ∧ Q by the commutative law

Alternatively, by the absorption laws, both statement forms are logically equivalent to
Q.

4.27 Exercise 27

Proof. The first is ∼ P ∧ ∼ (∼ P ∧ Q) and the second is ∼ (P ∨ Q).


If we apply De Morgan laws to both, we get: ∼ P ∧ (P ∨ ∼ Q) and ∼ P ∧ ∼ Q.
If we apply the distributive law, the negation law and the identity law to the first, we
get:
∼ P ∧ (P ∨ ∼ Q) ≡ (∼ P ∧ P ) ∨ (∼ P ∧ ∼ Q) ≡ c ∨ (∼ P ∧ ∼ Q) ≡ ∼ P ∧ ∼ Q.
So they are both equivalent to ∼ P ∧ ∼ Q.

4.28 Exercise 28

Proof. First is (P ∧ Q) ∨ (P ∧ ∼ Q) ∨ (∼ P ∧ ∼ Q) and second is P ∨ ∼ Q.

77
(P ∧ Q) ∨ (P ∧ ∼ Q) ∨ (∼ P ∧ ∼ Q)

≡ (P ∧ (Q ∨ ∼ Q)) ∨ (∼ P ∧ ∼ Q) by distributive law


≡ (P ∧ t) ∨ (∼ P ∧ ∼ Q) by negation law
≡ P ∨ (∼ P ∧ ∼ Q) by identity law
≡ (P ∨ ∼ P ) ∧ (P ∨ ∼ Q) by distributive law
≡ t ∧ (P ∨ ∼ Q) by negation law
≡ P ∨∼Q by identity law

So they are logically equivalent.

4.29 Exercise 29

Proof. First is (P ∧ Q) ∨ (∼ P ∧ Q) ∨ (P ∧ ∼ Q) and second is P ∨ Q.


(P ∧ Q) ∨ (∼ P ∧ Q) ∨ (P ∧ ∼ Q)

≡ ((P ∨ ∼ P ) ∧ Q) ∨ (P ∧ ∼ Q) by distributive law


≡ (t ∧ Q) ∨ (P ∧ ∼ Q) by negation law
≡ Q ∨ (P ∧ ∼ Q) by identity law
≡ (Q ∨ P ) ∧ (Q ∨ ∼ Q) by distributive law
≡ (Q ∨ P ) ∧ t by negation law
≡ Q∨P by identity law
≡ P ∨Q by commutative law

So they are logically equivalent.

For the circuits corresponding to the Boolean expressions in each of 30 and


31 there is an equivalent circuit with at most two logic gates. Find such a
circuit.

78
4.30 Exercise 30
(P ∧ Q) ∨ (∼ P ∧ Q) ∨ (∼ P ∧ ∼ Q)

Proof. (P ∧ Q) ∨ (∼ P ∧ Q) ∨ (∼ P ∧ ∼ Q)

≡ (P ∧ Q) ∨ ((∼ P ∧ Q) ∨ (∼ P ∧ ∼ Q)) by associativity


≡ (P ∧ Q) ∨ (∼ P ∧ (Q ∨ ∼ Q)) by the distributive law
≡ (P ∧ Q) ∨ (∼ P ∧ t) by the negation law
≡ (P ∧ Q) ∨ ∼ P by the identity law
≡ (∼ P ∨ P ) ∧ (∼ P ∨ Q) by the distributive law
≡ t ∧ (∼ P ∨ Q) by the negation law
≡ ∼P ∨Q by the identity law

The following is, therefore, a circuit with at most two logic gates that has the same
input/output table as the circuit corresponding to the given expression.

4.31 Exercise 31
(∼ P ∧ ∼ Q) ∨ (∼ P ∧ Q) ∨ (P ∧ ∼ Q)

Proof. (∼ P ∧ ∼ Q) ∨ (∼ P ∧ Q) ∨ (P ∧ ∼ Q)

≡ (∼ P ∧ (∼ Q ∨ Q)) ∨ (P ∧ ∼ Q) by the distributive law


≡ (∼ P ∧ t) ∨ (P ∧ ∼ Q) by the negation law
≡ ∼ P ∨ (P ∧ ∼ Q) by the identity law
≡ (∼ P ∨ P ) ∧ (∼ P ∨ ∼ Q) by the distributive law
≡ t ∧ (∼ P ∨ ∼ Q) by the negation law
≡ ∼P ∨∼Q by the identity law
≡ ∼ (P ∧ Q) by De Morgan’s law

The following is, therefore, a circuit with at most two logic gates that has the same
input/output table as the circuit corresponding to the given expression.

79
4.32 Exercise 32
The Boolean expression for the circuit in Example 2.4.5 is

(P ∧ Q ∧ R) ∨ (P ∧ ∼ Q ∧ R) ∨ (P ∧ ∼ Q ∧ ∼ R)

(a disjunctive normal form). Find a circuit with at most three logic gates that is
equivalent to this circuit.

Proof. (P ∧ Q ∧ R) ∨ (P ∧ ∼ Q ∧ R) ∨ (P ∧ ∼ Q ∧ ∼ R)

≡ [(P ∧ R) ∧ (Q ∨ ∼ Q)] ∨ (P ∧ ∼ Q ∧ ∼ R) by distributive law


≡ [(P ∧ R) ∧ t] ∨ (P ∧ ∼ Q ∧ ∼ R) by negation law
≡ (P ∧ R) ∨ (P ∧ ∼ Q ∧ ∼ R) by identity law
≡ P ∧ (R ∨ (∼ Q ∧ ∼ R)) by distributive law
≡ P ∧ (R ∨ ∼ Q) ∧ (R ∨ ∼ R)) by distributive law
≡ P ∧ ((R ∨ ∼ Q) ∧ t) by negation law
≡ P ∧ (R ∨ ∼ Q) by identity law

4.33 Exercise 33
4.33.1 (a)
Show that for the Sheffer stroke |,

P ∧ Q ≡ (P |Q)|(P |Q)

Proof. (P |Q)|(P |Q)

≡ ∼ (P ∧ Q)|∼ (P ∧ Q) by definition of Sheffer stroke


≡ ∼ (∼ (P ∧ Q) ∧ ∼ (P ∧ Q)) by definition of Sheffer stroke
≡ (P ∧ Q) ∨ (P ∧ Q) by De Morgan laws
≡ P ∧Q by idempotent law

4.33.2 (b)
Use the results of Example 2.4.7 and part (a) above to write P ∧ (∼ Q ∨ R) using only
Sheffer strokes.

80
Proof. ∼ Q ∨ R is logically equivalent to ∼ (Q ∧ ∼ R), which is Q|∼ R by definition of
Sheffer stroke.
By Example 2.4.7 ∼ R ≡ R|R, so ∼ Q ∨ R ≡ Q|(R|R).
By part (a) above P ∧ (∼ Q ∨ R) ≡ (P |(∼ Q ∨ R))|(P |(∼ Q ∨ R)).
Using the two pieces above, we get P ∧ (∼ Q ∨ R) ≡ (P |(Q|(R|R)))|(P |(Q|(R|R))).

4.34 Exercise 34
Show that the following logical equivalences hold for the Peirce arrow ↓, where P ↓ Q ≡
∼ (P ∨ Q).

4.34.1 (a)
∼P ≡P ↓P

Proof. P ↓ P
≡ ∼ (P ∨ P ) by definition of Peirce arrow
≡ ∼ P ∧ ∼ P by De Morgan laws
≡ ∼P by idempotent law

4.34.2 (b)
P ∨ Q ≡ (P ↓ Q) ↓ (P ↓ Q)

Proof.

(P ↓ Q) ↓ (P ↓ Q) ≡ ∼ (P ↓ Q) by part (a)
≡ ∼ [∼ (P ∨ Q)] by definition of ↓
≡ P ∨Q by the double negation law

4.34.3 (c)
P ∧ Q ≡ (P ↓ P ) ↓ (Q ↓ Q)

Proof. (P ↓ P ) ↓ (Q ↓ Q)

≡ ∼P ↓∼Q by part (a)


≡ ∼ (∼ P ∨ ∼ Q) by definition of Peirce arrow
≡ ∼∼P ∧∼∼Q by De Morgan laws
≡ P ∧Q by double negation laws

81
4.34.4 (d)
Write P → Q using Peirce arrows only.
Hint: Use the results of exercise 13 of Section 2.2 and part (a) and (c) of this exercise.

Proof. P → Q

≡ ∼P ∨Q by Exercise 2.2.13
≡ (P ↓ P ) ∨ Q by part (a)
≡ ((P ↓ P ) ↓ Q) ↓ ((P ↓ P ) ↓ Q) by part (b)

4.34.5 (e)
Write P ↔ Q using Peirce arrows only.

Proof. P ↔ Q ≡ (P → Q) ∧ (Q → P )

≡ [((P ↓ P ) ↓ Q) ↓ ((P ↓ P ) ↓ Q)] ∧ [((Q ↓ Q) ↓ P ) ↓ ((Q ↓ Q) ↓ P )] by part (d)


≡ ([((P ↓ P ) ↓ Q) ↓ ((P ↓ P ) ↓ Q)] ↓ [((P ↓ P ) ↓ Q) ↓ ((P ↓ P ) ↓ Q)]) ↓
([((Q ↓ Q) ↓ P ) ↓ ((Q ↓ Q) ↓ P )] ↓ [((Q ↓ Q) ↓ P ) ↓ ((Q ↓ Q) ↓ P )]) by part (c)

5 Exercise Set 2.5


Represent the decimal integers in 1 − 6 in binary notation.

5.1 Exercise 1
19

Proof. 1910 = 16 + 2 + 1 = 100112

5.2 Exercise 2
55

Proof. 5510 = 32 + 16 + 4 + 2 + 1 = 1101112

5.3 Exercise 3
287

Proof. 28710 = 256 + 16 + 8 + 4 + 2 + 1 = 1000111112

82
5.4 Exercise 4
458

Proof. 45810 = 256 + 128 + 64 + 8 + 2 = 1110010102

5.5 Exercise 5
1609

Proof. 160910 = 1024 + 512 + 64 + 8 + 1 = 110010010012

5.6 Exercise 6
1424

Proof. 142410 = 1024 + 256 + 128 + 16 = 101100100002

Represent the decimal integers in 7 − 12 in decimal notation.

5.7 Exercise 7
11102

Proof. 11102 = 8 + 4 + 2 = 1410

5.8 Exercise 8
101112

Proof. 101112 = 16 + 4 + 2 + 1 = 2310

5.9 Exercise 9
1101102

Proof. 1101102 = 32 + 16 + 4 + 2 = 5410

5.10 Exercise 10
11001012

Proof. 11001012 = 64 + 32 + 4 + 1 = 10110

83
5.11 Exercise 11
10001112

Proof. 10001112 = 64 + 4 + 2 + 1 = 7110

5.12 Exercise 12
10110112

Proof. 10110112 = 64 + 16 + 8 + 2 + 1 = 9110

Perform the arithmetic in 13 − 20 using binary notation.

5.13 Exercise 13
10112 + 1012

Proof.
1 0 1 12
+ 1 0 12
1 0 0 0 02

5.14 Exercise 14
10012 + 10112

Proof.
1 0 0 12
+ 1 0 1 12
1 0 1 0 02

5.15 Exercise 15
1011012 + 111012

Proof.
1 0 1 1 0 12
+ 1 1 1 0 12
1 0 0 1 0 1 02

84
5.16 Exercise 16
1101110112 + 10010110102

Proof.
1 0 0 1 0 1 1 0 1 02
+ 1 1 0 1 1 1 0 1 12
1 0 0 0 0 0 1 0 1 0 12

5.17 Exercise 17
101002 − 11012

Proof.
1 0 1 0 02
− 1 1 0 12
1 1 12

5.18 Exercise 18
110102 − 11012

Proof.
1 1 0 1 02
− 1 1 0 12
1 1 0 12

5.19 Exercise 19
1011012 − 100112

Proof.
1 0 1 1 0 12
− 1 0 0 1 12
1 1 0 1 02

85
5.20 Exercise 20
10101002 − 101112

Proof.
1 0 1 0 1 0 02
− 1 0 1 1 12
1 1 0 1 02

5.21 Exercise 21

Give the output signals S and T for the circuit shown if the input signals P , Q, and R
are as specified. Note that this is not the circuit for a full-adder.

5.21.1 (a)
P = 1, Q = 1, R = 1

Proof. Since P = Q = 1, when added we get 2 = 102 , so the sum S1 = 0 and the carry
C1 = 1.
Since R = 1 and S1 = 0, the sum T = 1 and the carry C2 = 0.
When we AND C1 = 1 with C2 = 0 we get S = 0.
So: S = 0, T = 1.

5.21.2 (b)
P = 0, Q = 1, R = 0

Proof. Since P = 0, Q = 1, when added we get 1 = 012 , so the sum S1 = 1 and the
carry C1 = 0.
Since R = 0 and S1 = 1, the sum T = 1 and the carry C2 = 0.
When we AND C1 = 0 with C2 = 0 we get S = 0.
So: S = 0, T = 1.

86
5.21.3 (c)
P = 1, Q = 0, R = 1

Proof. Since P = 1, Q = 0, when added we get 1 = 012 , so the sum S1 = 1 and the
carry C1 = 0.
Since R = 1 and S1 = 1, when added we get 2 = 102 , so the sum T = 0 and the carry
C2 = 1.
When we AND C1 = 0 with C2 = 1 we get S = 0.
So: S = 0, T = 0.

5.22 Exercise 22
Add 111111112 + 12 and convert the result to decimal notation, to verify that
111111112 = (28 − 1)10 .

Proof. 111111112 + 12 = 1000000002 = 25610 = 2810 .


Since 12 = 110 we can subtract it from both sides:
111111112 + 12 − 12 = 2810 − 110 .
So 111111112 = (28 − 1)10 .

Find the 8-bit two’s complements for the integers in 23 − 26.

5.23 Exercise 23
−23

Proof. | − 23|10 = 2310 = 16 + 4 + 2 + 1 = 000101112 → flip the bits → 111010002 →


add 1 → 111010012 .

5.24 Exercise 24
−67

Proof. | − 67|10 = 6710 = 64 + 2 + 1 = 010000112 → flip the bits → 101111002 → add 1


→ 101111012 .

5.25 Exercise 25
−4

Proof. | − 4|10 = 410 = 000001002 → flip the bits → 111110112 → add 1 → 111111002 .

87
5.26 Exercise 26
−115

Proof. | − 115|10 = 11510 = 64 + 32 + 16 + 2 + 1 = 011100112 → flip the bits →


100011002 → add 1 → 100011012 .

Find the decimal representations for the integers with the 8-bit two’s com-
plements given in 27 − 30.

5.27 Exercise 27
11010011

Proof. Since the leading digit is 1, this is a negative integer.


110100112 → flip the bits 001011002 → add 1 → 001011012 = 32 + 8 + 4 + 1 = 4510 =
| − 45|10 . So the answer is −45.

5.28 Exercise 28
10011001

Proof. Since the leading digit is 1, this is a negative integer.


100110012 → flip the bits 011001102 → add 1 → 011001112 = 64 + 32 + 4 + 2 + 1 =
10310 = | − 103|10 . So the answer is −103.

5.29 Exercise 29
11110010

Proof. Due to leading 1, this is a negative integer.


111100102 → flip the bits → 000011012 → add 1 → 000011102 = 8 + 4 + 2 = 1410 =
| − 14|10 . So the answer is −14.

5.30 Exercise 30
10111010

Proof. Due to leading 1, this is a negative integer.


101110102 → flip the bits → 010001012 → add 1 → 010001102 = 64 + 2 + 1 = 6710 =
| − 67|10 . So the answer is −67.

Use 8-bit two’s complements to compute the sums in 31 − 36.

88
5.31 Exercise 31
57 + (−118)

Proof. 5710 = 3210 + 1610 + 810 + 110 = 1110012 = 001110012


| − 118|10 = 11810 = 6410 + 3210 + 1610 + 410 + 210 = 011101102 → flip the bits →
100010012 → add 1 → 100010102
001110012 + 100010102 = 11000011. So this is a negative number. Convert it back to
decimal:
110000112 → flip the bits → 001111002 → add 1 → 001111012 = 32 + 16 + 8 + 4 + 1 =
6110 = | − 61|10
So the answer is −61.

5.32 Exercise 32
62 + (−18)

Proof. 6210 = 3210 + 1610 + 810 + 410 + 210 = 1111102 = 001111102


| − 18|10 = 1810 = 1610 + 210 = 000100102 → flip the bits → 111011012 → add 1
→ 111011102
001111102 + 111011102 = 100101100 has 9 digits. We truncate the leading 9th digit.
We get 001011002 . So this is a positive number. Convert it back to decimal:
001011002 = 32 + 8 + 4 = 4410
So the answer is 44.

5.33 Exercise 33
(−6) + (−73)

Proof. | − 6|10 = 610 = 410 + 210 = 1102 = 000001102 → flip the bits → 111110012 →
add 1 → 111110102
| − 73|10 = 7310 = 6410 + 810 + 110 = 010010012 → flip the bits → 101101102 → add 1
→ 101101112
111110102 + 101101112 = 110110001 has 9 digits. We truncate the leading 9th digit.
We get 101100012 . So this is a negative number. Convert it back to decimal:
101100012 → flip the bits → 010011102 → add 1 → 010011112 = 64 + 8 + 4 + 2 + 1 =
7910 = | − 79|10
So the answer is −79.

89
5.34 Exercise 34
89 + (−55)

Proof. 8910 = 6410 + 1610 + 810 + 110 = 10110012 = 010110012


| − 55|10 = 5510 = 3210 + 1610 + 410 + 210 + 110 = 1101112 = 001101112 → flip the bits
→ 110010002 → add 1 → 110010012
010110012 + 110010012 = 100100010 has 9 digits. We truncate the leading 9th digit.
We get 001000102 . So this is a positive number. Convert it back to decimal:
001000102 = 32 + 2 = 3410
So the answer is 34.

5.35 Exercise 35
(−15) + (−46)

Proof. | − 15|10 = 1510 = 810 + 410 + 210 + 110 = 11112 = 000011112 → flip the bits
→ 111100002 → add 1 → 111100012
| − 46|10 = 4610 = 3210 + 810 + 410 + 210 = 001011102 → flip the bits → 110100012 →
add 1 → 110100102
111100012 + 110100102 = 111000011 has 9 digits. We truncate the leading 9th digit.
We get 110000112 . So this is a negative number. Convert it back to decimal:
110000112 → flip the bits → 001111002 → add 1 → 001111012 = 32 + 16 + 8 + 4 + 1 =
6110 = | − 61|10
So the answer is −61.

5.36 Exercise 36
123 + (−94)

Proof. 12310 = 6410 + 3210 + 1610 + 810 + 210 + 110 = 11110112 = 011110112
| − 94|10 = 9410 = 6410 + 1610 + 810 + 410 + 210 = 10111102 = 010111102 → flip the bits
→ 101000012 → add 1 → 101000102
011110112 + 101000102 = 100011101 has 9 digits. We truncate the leading 9th digit.
We get 000111012 . So this is a positive number. Convert it back to decimal:
000111012 = 16 + 8 + 4 + 1 = 2910
So the answer is 29.

90
5.37 Exercise 37
5.37.1 (a)
Show that when you apply the 8-bit two’s complement procedure to the 8-bit two’s
complement for −128, you get the 8-bit two’s complement for −128.

Proof. 8-bit two’s complement for −128 is the 8-bit binary representation of 28 − | −
128| = 28 − 27 = 27 = 128 which is 1000 0000.
Let’s apply the procedure to 1000 0000. The procedure says: 1) flip all the 1s and 0s:
10000000 → 01111111, 2) then add 1 in binary: 01111111 + 00000001 = 10000000.
So we get the same thing.

5.37.2 (b)
Show that if a, b, and a + b are integers in the range 1 through 128, then

(28 − a) + (28 − b) = (28 − (a + b)) + 28 ≥ 28 + 27

Explain why it follows that if integers a, b, and a + b are all in the range 1 through 128,
then the 8-bit two’s complement of (−a) + (−b) is a negative number.

Proof. (28 − a) + (28 − b) = (28 − (a + b)) + 28 is true by commutativity of integer


addition.
(28 −(a+b))+28 ≥ 28 +27 if and only if (28 −(a+b)) ≥ 27 , if and only if, (28 −27 ) ≥ (a+b),
if and only if a + b ≤ 27 = 128. The last statement is true by the assumption that a + b
is in the range 1 through 128.
If a, b, a + b are all in the range from 1 to 128, then −a < 0 and −b < 0.
Therefore the 8-bit representations of −a and −b are the 8-bit binary representations
of 28 − | − a| = 28 − a and 28 − | − b| = 28 − b respectively.
So the 8-bit representation of (−a) + (−b) is the 8-bit binary representation of (28 −
a) + (28 − b).
Since (28 − a) + (28 − b) ≥ 28 + 27 , the 8-bit binary representation of (28 − a) + (28 − b)
has its leading 1 in the 9th digit.
Removing the leading 1 in the 9th digit of binary representation is equivalent to sub-
tracting 28 .
Therefore the 8-bit representation of (28 − a) + (28 − b) is the same as the 8-bit binary
representation of (28 − a) + (28 − b) − 28 .
We have (28 − a) + (28 − b) − 28 ≥ 27 , so the leading 1 will occur in the 8th digit in the
binary representation of (28 − a) + (28 − b) − 28 .
So the leading 1 will occur in the 8th digit of the 8-bit representation of (−a) + (−b).
Therefore the 8-bit representation of (−a) + (−b) is negative.

91
Convert the integers in 38 − 40 from hexadecimal to decimal notation.

5.38 Exercise 38
A2BC16

Proof. A2BC16 = 10 · 163 + 2 · 162 + 11 · 161 + 12 · 160 = 4166010

5.39 Exercise 39
E0D16

Proof. 359710

5.40 Exercise 40
39EB16

Proof. 1482710

Convert the integers in 41 − 43 from hexadecimal to binary notation.

5.41 Exercise 41
1C0ABE16

Proof. 0001110000001010101111102

5.42 Exercise 42
B53DF 816

Proof. 1011010100111101111110002

5.43 Exercise 43
4ADF 8316

Proof. 0100101011011111100000112

Convert the integers in 44 − 46 from binary to hexadecimal notation.

5.44 Exercise 44
001011102

Proof. 2E16

92
5.45 Exercise 45
10110111110001012

Proof. B7C516

5.46 Exercise 46
110010010111002

Proof. 325C16

5.47 Exercise 47
Octal Notation: In addition to binary and hexadecimal, computer scientists also use
octal notation (base 8) to represent numbers. Octal notation is based on the fact that
any integer can be uniquely represented as a sum of numbers of the form d · 8n , where
each n is a nonnegative integer and each d is one of the integers from 0 to 7. Thus, for
example, 50738 = 5 · 83 + 0 · 82 + 7 · 81 + 3 · 80 = 261910 .

5.47.1 (a)
Convert 615028 to decimal notation.

Proof. 6 · 84 + 1 · 83 + 5 · 82 + 0 · 8 + 2 · 1 = 25, 41010

5.47.2 (b)
Convert 207638 to decimal notation.

Proof. 2 · 84 + 0 · 83 + 7 · 82 + 6 · 8 + 3 · 1 = 8, 69110

5.47.3 (c)
Describe methods for converting integers from octal to binary notation and the reverse
that are similar to the methods used in Examples 2.5.9 and 2.5.10 for converting back
and forth from hexadecimal to binary notation. Give examples showing that these
methods result in correct answers.

Proof. To convert an integer from binary to octal notation:


Group the digits of the binary number into sets of three, starting from the right and
adding leading zeros as needed.
Convert the binary numbers in each set of three into octal digits. Juxtapose those octal
digits.
11010101112 : 001101010111
1112 = 78 , 0102 = 28 , 1012 = 58 , 0012 = 18

93
11010101112 = 15278
To convert an integer from octal to binary notation:
Convert each octal digit into 3 binary digits. Juxtapose those binary digits.
5678 : 7 = 1112 , 6 = 1102 , 5 = 1012
5678 = 1011101112

94

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy