Florida State University Course Notes MAD 2104 Discrete Mathematics I Florida State University
Total Page:16
File Type:pdf, Size:1020Kb
Florida State University Course Notes MAD 2104 Discrete Mathematics I Florida State University Tallahassee, Florida 32306-4510 Copyright c 2004 Florida State University Written by Dr. John Bryant and Dr. Penelope Kirby All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means without permission from the authors or a license from Florida State University. Contents Chapter 1. Introduction to Sets and Functions 9 1. Introduction to Sets 9 1.1. Basic Terminology 9 1.2. Notation for Describing a Set 9 1.3. Common Universal Sets 10 1.4. Complements and Subsets 10 1.5. Element v.s. Subsets 11 1.6. Cardinality 12 1.7. Set Operations 12 1.8. Example 1.8.1 13 1.9. Product 13 2. Introduction to Functions 15 2.1. Function 15 2.2. Terminology Related to Functions 16 2.3. Example 2.3.1 16 2.4. Floor and Ceiling Functions 17 2.5. Characteristic Function 18 Chapter 2. Logic 20 1. Logic Definitions 20 1.1. Propositions 20 1.2. Examples 20 1.3. Logical Operators 21 1.4. Negation 22 1.5. Conjunction 23 1.6. Disjunction 23 1.7. Exclusive Or 24 1.8. Implications 24 1.9. Terminology 25 1.10. Example 26 1.11. Biconditional 26 1.12. NAND and NOR Operators 27 1.13. Example 28 1.14. Bit Strings 30 2. Propositional Equivalences 31 2.1. Tautology/Contradiction/Contingency 31 3 CONTENTS 4 2.2. Logically Equivalent 32 2.3. Examples 33 2.4. Important Logical Equivalences 35 2.5. Simplifying Propositions 36 2.6. Implication 38 2.7. Normal or Canonical Forms 38 2.8. Examples 38 2.9. Constructing Disjunctive Normal Forms 39 2.10. Conjunctive Normal Form 40 3. Predicates and Quantifiers 42 3.1. Predicates and Quantifiers 42 3.2. Example of a Propositional Function 42 3.3. Quantifiers 43 3.4. Example 3.4.1 44 3.5. Converting from English 44 3.6. Additional Definitions 45 3.7. Examples 45 3.8. Multiple Quantifiers 45 3.9. Ordering Quantifiers 46 3.10. Unique Existential 47 3.11. De Morgan’s Laws for Quantifiers 48 3.12. Distributing Quantifiers over Operators 50 Chapter 3. Methods of Proofs 51 1. Logical Arguments and Formal Proofs 51 1.1. Basic Terminology 51 1.2. More Terminology 51 1.3. Formal Proofs 53 1.4. Rules of Inference 54 1.5. Example 1.5.1 55 1.6. Rules of Inference for Quantifiers 57 1.7. Example 1.7.1 58 1.8. Fallacies 59 2. Methods of Proof 63 2.1. Types of Proofs 63 2.2. Trivial Proof/Vacuous Proof 63 2.3. Direct Proof 64 2.4. Proof by Contrapositive 66 2.5. Proof by Contradiction 67 2.6. Proof by Cases 69 2.7. Existence Proofs 71 2.8. Constructive Proof 71 2.9. Nonconstructive Proof 72 2.10. Nonexistence Proofs 73 CONTENTS 5 2.11. The Halting Problem 74 2.12. Counterexample 74 2.13. Biconditional 75 3. Mathematical Induction 76 3.1. First Principle of Mathematical Induction 76 3.2. Using Mathematical Induction 77 3.3. Example 3.3.1 78 3.4. Example 3.4.1 81 3.5. Example 3.5.1 83 3.6. The Second Principle of Mathematical Induction 85 3.7. Well-Ordered Sets 87 Chapter 4. Applications of Methods of Proof 89 1. Set Operations 89 1.1. Set Operations 89 1.2. Equality and Containment 89 1.3. Union and Intersection 90 1.4. Complement 90 1.5. Difference 90 1.6. Product 91 1.7. Power Set 91 1.8. Examples 91 1.9. Venn Diagrams 92 1.10. Examples 93 1.11. Set Identities 94 1.12. Union and Intersection of Indexed Collections 98 1.13. Infinite Unions and Intersections 99 1.14. Example 1.14.1 100 1.15. Computer Representation of a Set 101 2. Properties of Functions 104 2.1. Injections, Surjections, and Bijections 104 2.2. Examples 104 2.3. Example 2.3.1 106 2.4. Example 2.4.1 107 2.5. Example 2.5.1 107 2.6. Example 2.6.1 108 2.7. Inverse Functions 108 2.8. Inverse Image 110 2.9. Composition 111 2.10. Example 2.10.1 112 3. Recurrence 113 3.1. Recursive Definitions 113 3.2. Recursive definition of the function f(n) = n! 114 3.3. Recursive definition of the natural numbers 114 CONTENTS 6 3.4. Proving assertions about recursively defined objects 115 3.5. Definition of f n 118 3.6. Example 3.6.1 119 3.7. Fibonacci Sequence 120 3.8. Strings 123 3.9. Bit Strings 124 4. Growth of Functions 128 4.1. Growth of Functions 128 4.2. The Big-O Notation 128 4.3. Proofs of Theorems 4.2.1 and 4.2.2 130 4.4. Example 4.4.1 131 4.5. Calculus Definition 132 4.6. Basic Properties of Big-O 134 4.7. Proof of Theorem 4.6.3 135 4.8. Example 4.8.1 135 4.9. Big-Omega 136 4.10. Big-Theta 136 4.11. Summary 137 4.12. Appendix. Proof of the Triangle Inequality 138 Chapter 5. Number Theory 139 1. Integers and Division 139 1.1. Divisibility 139 1.2. Basic Properties of Divisibility 139 1.3. Theorem 1.3.1 - The Division Algorithm 140 1.4. Proof of Division Algorithm 140 1.5. Prime Numbers, Composites 141 1.6. Fundamental Theorem of Arithmetic 142 1.7. Factoring 142 1.8. Mersenne Primes 143 1.9. Greatest Common Divisor and Least Common Multiple 143 1.10. Modular Arithmetic 144 1.11. Applications of Modular Arithmetic 146 2. Integers and Algorithms 148 2.1. Euclidean Algorithm 148 2.2. GCD’s and Linear Combinations 149 2.3. Uniqueness of Prime Factorization 152 3. Applications of Number Theory 156 3.1. Representation of Integers 156 3.2. Constructing Base b Expansion of n 156 3.3. Cancellation in Congruences 157 3.4. Inverses mod m 158 3.5. Linear Congruence 159 3.6. Criterion for Invertibility mod m 159 CONTENTS 7 3.7. Example 3.7.1 160 3.8. Fermat’s Little Theorem 160 3.9. RSA System 162 4. Matrices 163 4.1. Definitions 163 4.2. Matrix Arithmetic 164 4.3. Example 4.3.1 164 4.4. Special Matrices 166 4.5. Boolean Arithmetic 168 4.6. Example 4.6.1 169 Chapter 6. Introduction to Graph Theory 171 1. Introduction to Graphs 171 1.1. Simple Graphs 171 1.2. Examples 171 1.3. Multigraphs 172 1.4. Pseudograph 173 1.5. Directed Graph 174 1.6. Directed Multigraph 175 1.7. Graph Isomorphism 176 2. Graph Terminology 179 2.1. Undirected Graphs 179 2.2. The Handshaking Theorem 180 2.3. Example 2.3.1 180 2.4. Directed Graphs 181 2.5. The Handshaking Theorem for Directed Graphs 182 2.6. Underlying Undirected Graph 182 2.7. New Graphs from Old 182 2.8. Complete Graphs 183 2.9. Cycles 184 2.10. Wheels 184 2.11. n-Cubes 185 2.12. Bipartite Graphs 186 2.13. Examples 186 3. Representing Graphs and Graph Isomorphism 188 3.1. Adjacency Matrix 188 3.2. Example 3.2.1 188 3.3. Incidence Matrices 190 3.4. Degree Sequence 191 3.5. Graph Invariants 191 3.6. Example 3.6.1 192 3.7. Example 193 3.8. Proof of Theorem 3.5.1 Part 3 for finite simple graphs 196 Chapter 7. Introduction to Relations 197 CONTENTS 8 1. Relations and Their Properties 197 1.1. Definition of a Relation 197 1.2. Examples 198 1.3. Directed Graphs 199 1.4. Inverse Relation 200 1.5. Special Properties of Binary Relations 201 1.6. Examples of Relations and their Properties 201 1.7. Proving or disproving relations have a property 202 1.8. Combining Relations 204 1.9. Example of Combining Relations 205 1.10. Composition 205 1.11. Example of Composition 206 1.12. Characterization of Transitive Relations 208 CHAPTER 1 Introduction to Sets and Functions 1. Introduction to Sets 1.1. Basic Terminology. We begin with a refresher in the basics of set theory. Our treatment will be an informal one rather than taking an axiomatic approach at this time. Later in the semester we will revisit sets with a more formal approach. A set is a collection or group of objects or elements or members. (Cantor 1895) • A set is said to contain its elements. • In each situation or context, there must be an underlying universal set U, either specifically stated or understood. Notation: • If x is a member or element of the set S, we write x ∈ S. • If x is not an element of S we write x 6∈ S. 1.2. Notation for Describing a Set. Example 1.2.1. List the elements between braces: • S = {a, b, c, d} = {b, c, a, d, d} Specify by attributes: • S = {x|x ≥ 5 or x < 0}, where the universe is the set of real numbers. Use brace notation with ellipses: • S = {..., −3, −2, −1}, the set of negative integers. Discussion 9 1. INTRODUCTION TO SETS 10 Sets can be written in a variety of ways. One can, of course, simply list the elements if there are only a few. Another way is to use set builder notation, which specifies the sets using a predicate to indicate the attributes of the elements of the set.