Docsity

Discrete Mathematics: A Foundation for Computer Science, Study notes of Discrete Mathematics

Partial preview of the text

Download Discrete Mathematics: A Foundation for Computer Science and more Study notes Discrete Mathematics in PDF only on Docsity!

Jean Gallier

Discrete Mathematics

December 11, 2010

Springer

Preface

The curriculum of most undergraduate programs in computer science includes a course titled Discrete Mathematics. These days, given that many students who grad- uate with a degree in computer science end up with jobs where mathematical skills seem basically of no use, 1 one may ask why these students should take such a course. And if they do, what are the most basic notions that they should learn? As to the first question, I strongly believe that all computer science students should take such a course and I will try justifying this assertion below. The main reason is that, based on my experience of more than twenty-five years of teaching, I have found that the majority of the students find it very difficult to present an argument in a rigorous fashion. The notion of a proof is something very fuzzy for most students and even the need for the rigorous justification of a claim is not so clear to most of them. Yet, they will all write complex computer programs and it seems rather crucial that they should understand the basic issues of program correctness. It also seems rather crucial that they should possess some basic mathe- matical skills to analyze, even in a crude way, the complexity of the programs they will write. Don Knuth has argued these points more eloquently than I can in his beautiful book, Concrete Mathematics, and I do not elaborate on this any further. On a scholarly level, I argue that some basic mathematical knowledge should be part of the scientific culture of any computer science student and more broadly, of any engineering student. Now, if we believe that computer science students should have some basic math- ematical knowledge, what should it be? There is no simple answer. Indeed, students with an interest in algorithms and complexity will need some discrete mathematics such as combinatorics and graph theory but students interested in computer graphics or computer vision will need some geometry and some continuous mathematics. Students interested in databases will need to know some mathematical logic and students interested in computer architecture will need yet a different brand of mathematics. So, what’s the common core?

(^1) In fact, some people would even argue that such skills constitute a handicap!

vii

Preface ix

As applications of the material on elementary number theory presented in Sec- tion 5.4, in Section 5.8 we give an introduction to Fibonacci and Lucas numbers as well as Mersenne numbers and in Sections 5.9, 5.10, and 5.11, we present some ba- sics of public key cryptography and the RSA system. These sections contain some beautiful material and they should be viewed as an incentive for the reader to take a deeper look into the fascinating and mysterious world of prime numbers and more generally, number theory. This material is also a gold mine of programming assign- ments and of problems involving proofs by induction. We have included some material on lattices, Tarski’s fixed point theorem, dis- tributive lattices, Boolean algebras, and Heyting algebras. These topics are some- what more advanced and can be omitted from the “core”. The last topic that we consider crucial is graph theory. We give a fairly complete presentation of the basic concepts of graph theory: directed and undirected graphs, paths, cycles, spanning trees, cocycles, cotrees, flows, and tensions, Eulerian and Hamiltonian cycles, matchings, coverings, and planar graphs. We also discuss the network flow problem and prove the max-flow min-cut theorem in an original way due to M. Sakarovitch. These notes grew out of lectures I gave in 2005 while teaching CIS260, Math- ematical Foundations of Computer Science. There is more material than can be covered in one semester and some choices have to be made regarding what to omit. Unfortunately, when I taught this course, I was unable to cover any graph theory. I also did not cover lattices and Boolean algebras. Beause the notion of a graph is so fundamental in computer science (and else- where), I have restructured these notes by splitting the material on graphs into two parts and by including the introductory part on graphs (Chapter 3) before the in- troduction to combinatorics (Chapter 4). The only small inconvenience in doing so is that this causes a forward reference to the notion of an equivalence relation which only appears in Chapter 5. This is not a serious problem. In fact, this gives us a chance to introduce the important concept of an equivalence relation early on, without any proof, and then to revisit this notion more rigorously later on. Some readers may be disappointed by the absence of an introduction to prob- ability theory. There is no question that probability theory plays a crucial role in computing, for example, in the design of randomized algorithms and in the proba- bilistic analysis of algorithms. Our feeling is that to do justice to the subject would require too much space. Unfortunately, omitting probability theory is one of the tough choices that we decided to make in order to keep the manuscript of manage- able size. Fortunately, probability and its applications to computing are presented in a beautiful book by Mitzenmacher and Upfal [4] so we don’t feel too bad about our decision to omit these topics. There are quite a few books covering discrete mathematics. According to my personal taste, I feel that two books complement and extend the material presented here particularly well: Discrete Mathematics, by Lov´asz, Pelik´an, and Vesztergombi [3], a very elegant text at a slightly higher level but still very accessible, and Discrete Mathematics, by Graham, Knuth, and Patashnik [2], a great book at a significantly higher level.

x Preface

My unconventional approach of starting with logic may not work for everybody, as some individuals find such material too abstract. It is possible to skip the chapter on logic and proceed directly with sets, functions, and so on. I admit that I have raised the bar perhaps higher than the average compared to other books on discrete maths. However, my experience when teaching CIS260 was that 70% of the students enjoyed the logic material, as it reminded them of programming. I hope this book will inspire and will be useful to motivated students. A final word to the teacher regarding foundational issues: I tried to show that there is a natural progression starting from logic, next a precise statement of the axioms of set theory, and then to basic objects such as the natural numbers, func- tions, graphs, trees, and the like. I tried to be as rigorous and honest as possible regarding some of the logical difficulties that one encounters along the way but I decided to avoid some of the most subtle issues, in particular a rigorous definition of the notion of cardinal number and a detailed discussion of the axiom of choice. Rather than giving a flawed definition of a cardinal in terms of the equivalence class of all sets equinumerous to a set, which is not a set, I only defined the notions of domination and equinumerosity. Also, I stated precisely two versions of the axiom of choice, one of which (the graph version) comes up naturally when seeking a right inverse to a surjection, but I did not attempt to state and prove the equivalence of this formulation with other formulations of the axiom of choice (such as Zermelo’s well- ordering theorem). Such foundational issues are beyond the scope of this book; they belong to a course on set theory and are treated extensively in texts such as Enderton [1] and Suppes [5].

Acknowledgments: I would like to thank Mickey Brautbar, Kostas Daniilidis, Max Mintz, Joseph Pacheco, Steve Shatz, Jianbo Shi, Marcelo Siqueira, and Val Tannen for their advice, encouragement, and inspiration.

References

  1. Herbert B. Enderton. Elements of Set Theory. New York: Academic Press, first edition, 1977.
  2. Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. Concrete Mathematics: A Foun- dation For Computer Science. Reading, MA: Addison Wesley, second edition, 1994.
  3. L. Lov´asz, J. Pelik´an, and K. Vesztergombi. Discrete Mathematics. Elementary and Beyond. Undergraduate Texts in Mathematics. New York: Springer, first edition, 2003.
  4. Michael Mitzenmacher and Eli Upfal. Probability and Computing. Randomized Algorithms and Probabilistic Analysis. Cambridge, UK: Cambridge University Press, first edition, 2005.
  5. Patrick Suppes. Axiomatic Set Theory. New York: Dover, first edition, 1972.
  6. D. van Dalen. Logic and Structure. Universitext. New York: Springer Verlag, second edition,

Philadelphia, November 2010 Jean Gallier

  • 1 Mathematical Reasoning, Proof Principles, and Logic
    • 1.1 Introduction
    • 1.2 Inference Rules, Deductions, Proof Systems N m⇒ and N G ⇒ m
    • 1.3 Adding ∧, ∨, ⊥; The Proof Systems N c ⇒,∧,∨,⊥and N G ⇒ c ,∧,∨,⊥.
    • 1.4 Clearing Up Differences Among Rules Involving ⊥
    • 1.5 De Morgan Laws and Other Rules of Classical Logic
    • 1.6 Formal Versus Informal Proofs; Some Examples
    • 1.7 Truth Values Semantics for Classical Logic
    • 1.8 Kripke Models for Intuitionistic Logic
      • N G ⇒ c ,∧,∨,∀,∃,⊥. 1.9 Adding Quantifiers; The Proof Systems N c⇒ ,∧,∨,∀,∃,⊥,
    • 1.10 First-Order Theories
    • 1.11 Decision Procedures, Proof Normalization, Counterexamples
    • 1.12 Basics Concepts of Set Theory
    • 1.13 Summary
    • Problems
    • References
  • 2 Relations, Functions, Partial Functions
    • 2.1 What is a Function?
    • 2.2 Ordered Pairs, Cartesian Products, Relations, etc.
    • 2.3 Induction Principles on N
    • 2.4 Composition of Relations and Functions
    • 2.5 Recursion on N
    • 2.6 Inverses of Functions and Relations
    • 2.7 Injections, Surjections, Bijections, Permutations
    • 2.8 Direct Image and Inverse Image
    • 2.9 Equinumerosity; Pigeonhole Principle; Schr¨oder–Bernstein
    • 2.10 An Amazing Surjection: Hilbert’s Space-Filling Curve
    • 2.11 Strings, Multisets, Indexed Families
    • 2.12 Summary
    • Problems xii Contents
    • References
  • 3 Graphs, Part I: Basic Notions
    • 3.1 Why Graphs? Some Motivations
    • 3.2 Directed Graphs
    • 3.3 Path in Digraphs; Strongly Connected Components
    • 3.4 Undirected Graphs, Chains, Cycles, Connectivity
    • 3.5 Trees and Arborescences
    • 3.6 Minimum (or Maximum) Weight Spanning Trees
    • 3.7 Summary
    • Problems
    • References
  • 4 Some Counting Problems; Multinomial Coefficients
    • 4.1 Counting Permutations and Functions
    • 4.2 Counting Subsets of Size k; Multinomial Coefficients
    • 4.3 Some Properties of the Binomial Coefficients
    • 4.4 The Principle of Inclusion–Exclusion
    • 4.5 Summary
    • Problems
    • References
  • 5 Partial Orders, GCDs, RSA, Lattices
    • 5.1 Partial Orders
    • 5.2 Lattices and Tarski’s Fixed-Point Theorem
    • 5.3 Well-Founded Orderings and Complete Induction
    • 5.4 Unique Prime Factorization in Z and GCDs
    • 5.5 Dirichlet’s Diophantine Approximation Theorem
    • 5.6 Equivalence Relations and Partitions
    • 5.7 Transitive Closure, Reflexive and Transitive Closure
    • 5.8 Fibonacci and Lucas Numbers; Mersenne Primes
    • 5.9 Public Key Cryptography; The RSA System
    • 5.10 Correctness of The RSA System
    • 5.11 Algorithms for Computing Powers and Inverses Modulo m
    • 5.12 Finding Large Primes; Signatures; Safety of RSA
    • 5.13 Distributive Lattices, Boolean Algebras, Heyting Algebras
    • 5.14 Summary
    • Problems
    • References
  • 6 Graphs, Part II: More Advanced Notions
    • 6.1 Γ -Cycles, Cocycles, Cotrees, Flows, and Tensions
    • 6.2 Incidence and Adjacency Matrices of a Graph
    • 6.3 Eulerian and Hamiltonian Cycles
    • 6.4 Network Flow Problems; The Max-Flow Min-Cut Theorem
    • 6.5 Matchings, Coverings, Bipartite Graphs Contents xiii
    • 6.6 Planar Graphs
    • 6.7 Summary
    • Problems
    • References
  • Symbol Index
  • Index