Chapter 2
Chapter 2
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
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
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
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.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.
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.
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.
1.3.2 (b)
or logic is confusing.
My mind is not shot.
Therefore, .
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.
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.
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
1.5.4 (d)
x = 26
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
1.9.2 (b)
10 > x > 5
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.
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)
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
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
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.
1.25 Exercise 25
Hal is a math major and Hal’s sister is a computer science major.
1.26 Exercise 26
Sam is an orange belt and Kate is a red belt.
18
1.27 Exercise 27
The connector is loose or the machine is unplugged.
1.28 Exercise 28
The train is late or my watch is 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
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
1.34 Exercise 34
x < 2 or x > 5
1.35 Exercise 35
x ≤ −1 or x > 1
1.36 Exercise 36
1 > 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)
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
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
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.”]
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 ∨.
1.50 Exercise 50
(p ∧ ∼ q) ∨ p ≡ p
1.51 Exercise 51
p ∧ (∼ q ∨ p) ≡ p
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
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.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.
2.3 Exercise 3
Freeze or I’ll shoot.
2.4 Exercise 4
Fix my ceiling or I won’t pay my rent.
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.
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.
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.
32
2.15 Exercise 15
Determine whether the following statement forms are logically equivalent:
p → (q → r) and (p → q) → r
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.
33
So the two statements have the forms: p ∧ q → r and ∼ p ∨ ∼ q ∨ r.
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.
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.”
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.
2.20.2 (b)
If today is New Year’s Eve, then tomorrow is January.
2.20.3 (c)
If the decimal expansion of r is terminating, then r is 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.
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.
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
2.21.2 (b)
p∨q
2.21.3 (c)
q→p
2.22 Exercise 22
Write contrapositives for the statements of exercise 20.
2.23 Exercise 23
Write the converse and inverse for each statement of exercise 20.
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.
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.
2.29 Exercise 29
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)
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
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
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.
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.
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.
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.
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.
2.40 Exercise 40
Catching the 8:05 bus is a sufficient condition for my being 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.
2.42 Exercise 42
Being divisible by 3 is a necessary condition for this number to be divisible by 9.
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.
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.
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)
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.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.
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.
∴
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.
∴
3.5 Exercise 5
If they were unsure of the address, then they would have 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.
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.
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
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
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.
3.25 Exercise 25
This real number is rational or it is irrational.
This real number is not rational.
∴ This real number is irrational.
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.
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.
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.
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.
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.
3.31 Exercise 31
Sandra knows Java and Sandra knows C++.
∴ Sandra knows C++.
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.
56
3.33 Exercise 33
Give an example (other than Example 2.3.11) of a valid argument with a false conclusion.
3.34 Exercise 34
Give an example (other than Example 2.3.12) of an invalid argument with a true con-
clusion.
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.
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?
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?
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?
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?
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?
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.)
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.1 Exercise 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)
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
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
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
(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
Alternatively, by the absorption laws, both statement forms are logically equivalent to
Q.
4.27 Exercise 27
4.28 Exercise 28
77
(P ∧ Q) ∨ (P ∧ ∼ Q) ∨ (∼ P ∧ ∼ Q)
4.29 Exercise 29
78
4.30 Exercise 30
(P ∧ Q) ∨ (∼ P ∧ Q) ∨ (∼ P ∧ ∼ Q)
Proof. (P ∧ Q) ∨ (∼ P ∧ Q) ∨ (∼ P ∧ ∼ Q)
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)
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)
4.33 Exercise 33
4.33.1 (a)
Show that for the Sheffer stroke |,
P ∧ Q ≡ (P |Q)|(P |Q)
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)
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 )
5.1 Exercise 1
19
5.2 Exercise 2
55
5.3 Exercise 3
287
82
5.4 Exercise 4
458
5.5 Exercise 5
1609
5.6 Exercise 6
1424
5.7 Exercise 7
11102
5.8 Exercise 8
101112
5.9 Exercise 9
1101102
5.10 Exercise 10
11001012
83
5.11 Exercise 11
10001112
5.12 Exercise 12
10110112
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 .
5.23 Exercise 23
−23
5.24 Exercise 24
−67
5.25 Exercise 25
−4
Proof. | − 4|10 = 410 = 000001002 → flip the bits → 111110112 → add 1 → 111111002 .
87
5.26 Exercise 26
−115
Find the decimal representations for the integers with the 8-bit two’s com-
plements given in 27 − 30.
5.27 Exercise 27
11010011
5.28 Exercise 28
10011001
5.29 Exercise 29
11110010
5.30 Exercise 30
10111010
88
5.31 Exercise 31
57 + (−118)
5.32 Exercise 32
62 + (−18)
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)
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
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.
91
Convert the integers in 38 − 40 from hexadecimal to decimal notation.
5.38 Exercise 38
A2BC16
5.39 Exercise 39
E0D16
Proof. 359710
5.40 Exercise 40
39EB16
Proof. 1482710
5.41 Exercise 41
1C0ABE16
Proof. 0001110000001010101111102
5.42 Exercise 42
B53DF 816
Proof. 1011010100111101111110002
5.43 Exercise 43
4ADF 8316
Proof. 0100101011011111100000112
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.
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.
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