A Beginner's Guide to Discrete Mathematics ( PDFDrive.com ).pdf

This preview shows page 1 out of 442 pages.

Unformatted text preview: W.D. Wallis A Beginner’s Guide to Discrete Mathematics Second Edition W.D. Wallis Department of Mathematics Southern Illinois University Carbondale, IL 62901 USA [email protected] ISBN 978-0-8176-8285-9 e-ISBN 978-0-8176-8286-6 DOI 10.1007/978-0-8176-8286-6 Springer New York Dordrecht Heidelberg London Library of Congress Control Number: 2011940047 Mathematics Subject Classification (2010): 05-01, 05Axx, 05Cxx, 60-01, 68Rxx, 97N70 1st edition: © Birkhäuser Boston 2003 2nd edition: © Springer Science+Business Media, LLC 2012 All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed on acid-free paper Springer is part of Springer Science+Business Media ( ) For Nathan Preface This text is a basic introduction to those areas of discrete mathematics of interest to students of mathematics. Introductory courses on this material are now standard at many colleges and universities. Usually these courses are of one semester’s duration, and usually they are offered at the sophomore level. Very often this will be the first course where the students see several real proofs. The preparation of the students is very mixed, and one cannot assume a strong background. In particular, the instructor should not assume that the students have seen a linear algebra course, or any introduction to number systems that goes beyond college algebra. In view of this, I have tried to avoid too much sophistication, while still retaining rigor. I hope I have included enough problems so that the student can reinforce the concepts. Most of the problems are quite easy, with just a few difficult exercises scattered through the text. If the class is weak, a small number of sections will be too hard, while the instructor who has a strong class will need to include some supplementary material. I think this is preferable to a book at a higher mathematical level, one that scares away the weaker students. Readership While the book is primarily directed at mathematics majors and minors, this material is also studied by computer scientists. The face of computer science is changing due to the influence of the internet, and many universities will also require a second course, with more specialized material, but those students also need the basics. Another developing area is the course on mathematical applications in the modern world, aimed at liberal arts majors and others. Much of the material in those courses is discrete. I do not think this book should even be considered as a text for such a course, but it could be a useful reference, and those who end up teaching such a course will also find this text useful. Discrete mathematics is also an elective viii Preface topic for mathematically gifted students in high schools, and I consulted the Indiana suggested syllabus for such courses. Outline of Topics The first two chapters include a brief survey of number systems and elementary set theory. Included are discussions of scientific notation and the representation of numbers in computers; topics that were included at the suggestion of computer science instructors. Mathematical induction is treated at this point although the instructor could defer this until later. (There are a few references to induction later in the text, but the student can omit these in a first reading.) I introduce logic along with set theory. This leads naturally into an introduction to Boolean algebra, which brings out the commonality of logic and set theory. The latter part of Chapter 3 explains the application of Boolean algebra to circuit theory. I follow this with a short chapter on relations and functions. The study of relations is an offshoot of set theory, and also lays the foundation for the study of graph theory later. Functions are mentioned only briefly. The student will see them treated extensively in calculus courses, but in discrete mathematics we mostly need basic definitions. Enumeration, or theoretical counting, is central to discrete mathematics. In Chapter 5 I present the main results on selections and arrangements, and also cover the binomial theorem and derangements. Some of the harder problems here are rather challenging, but I have omitted most of the more sophisticated results. Counting leads naturally to probability theory. I have included the main ideas of discrete probability, up to Bayes’ theorem. There was a conscious decision not to include any real discussion of measures of central tendency (means, medians) or spread (variance, quartiles) because most students will encounter them elsewhere, e.g., in statistics courses. Graph theory is studied, including Euler and Hamilton cycles and trees. This is a vehicle for some (easy) proofs, as well as being an important example of a data structure. Matrices and vectors are defined and discussed briefly. This is not the place for algebraic studies, but matrices are useful for studying other discrete objects, and this is illustrated by a section on adjacency matrices of relations and graphs. A number of students will never study linear algebra, and this chapter will provide some foundation for the use of matrices in programming, mathematical modeling, and statistics. Those who have already seen vectors and matrices can skip most of this chapter, but should read the section on adjacency matrices. Chapter 9 is an introduction to cryptography, including the RSA cryptosystem, together with the necessary elementary number theory (such as modular arithmetic and the Euclidean algorithm). Cryptography is an important application area and is a good place to show students that discrete mathematics has real-world applications. Preface ix Moreover, most computer science majors will later be presented with electives in this area. The level of mathematical sophistication is higher in parts of this chapter than in most of the book. The final chapter is about voting systems. This topic has not been included in very many discrete mathematics texts. However, voting methods are covered in many of the elementary applied mathematics courses for liberal arts majors, and they make a nice optional topic for mathematics and computer science majors. Perhaps I should explain the omissions rather than the inclusions. I thought the study of predicates and quantifiers belonged in a course on logic rather than here. I also thought lattice theory was too deep, although it would fit nicely after the section on Boolean forms. There is no section on recursion and recurrence relations. Again, this is a deep area. I have actually given some problems on recurrences in the induction section, but I thought that a serious study belongs in a combinatorics course. Similarly, the deeper enumeration results, such as counting partitions, belong in higher-level courses. Another area is linear programming. This was once an important part of discrete mathematics courses. But, in recent years, syllabi have changed. Nowadays, somewhat weaker students are using linear programming, and there are user-friendly computer packages available. I do not think that it will be on the syllabus of many of the courses at which this book is aimed. Problems and Exercises The book contains a large selection of exercises, collected at the end of sections. There should be enough for students to practice the concepts involved. Most are straightforward; in some sections there are one or two more sophisticated questions at the end. A number of worked examples, called Sample Problems, are included in the body of each section. Most of these are accompanied by a Practice Exercise, designed primarily to test the reader’s comprehension of the ideas being discussed. It is recommended that students work all the Practice Exercises. Complete solutions are provided for all of them, as well as brief answers to the odd-numbered problems from the sectional exercise sets. Gender In many places a mathematical discussion involves a protagonist—a person who flips a coin or deals a card or traverses a road network. These people used to be exclusively male in older textbooks. In recent years this has rightly been seen to be inappropriate. Unfortunately this has led to frequent repetitions of nouns—“the player’s card” rather than “his card”—and the use of the ugly “he or she.” x Preface I decided to avoid such problems by a method that was highly appropriate to this text: I flipped a coin to decide whether a character was male or female. If the reader detects an imbalance, please blame the coin. There were two exceptions to this rule. Cryptographers traditionally write about messages sent from Alice (A) to Bob (B), so I followed this rule in discussing RSA cryptography. And in the discussion of the Monty Hall problem, the game show host is male, in honor of Monty, and the player is female for balance. Acknowledgments My treatment of discrete mathematics owes a great deal to many colleagues and mathematicians in other institutions with whom I have taught or discussed this material. Among my influences are Roger Eggleton, Ralph Grimaldi, Dawit Haile, Fred Hoffman, Bob McGlynn, Nick Phillips, Bill Sticka, and Anne Street, although some of them may not remember why their names are here. I am grateful for the constant support and encouragement of the staff at Birkhäuser. Carbondale, USA W.D. Wallis Contents 1 2 3 4 Properties of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Sums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3 Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4 Scientific Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.5 Arithmetic in Computers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Sets and Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.1 Propositions and Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.2 Elements of Set Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.3 Proof Methods in Set Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.4 Some Further Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.5 Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Boolean Algebras and Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.1 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.2 Boolean Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.3 Finding Minimal Disjunctive Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 3.4 Digital Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Relations and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.1 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 xii Contents 4.2 Some Special Kinds of Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 5 The Theory of Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 5.1 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 5.2 Unions of Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 5.3 One-to-One Correspondences and Infinite Sets . . . . . . . . . . . . . . . . . . 129 5.4 Arrangement Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 5.5 Selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 5.6 The Binomial Theorem and Its Applications . . . . . . . . . . . . . . . . . . . . 151 5.7 Some Further Counting Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 6 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 6.1 Probability Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 6.2 Repeated Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 6.3 Counting and Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 6.4 Conditional Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 6.5 Bayes’ Formula and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 7 Graph Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 7.1 Introduction to Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 7.2 The Königsberg Bridges; Traversability . . . . . . . . . . . . . . . . . . . . . . . . 222 7.3 Walks, Paths, and Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 7.4 Distances and Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 7.5 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 7.6 Hamiltonian Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 7.7 The Traveling Salesman Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 8 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 8.1 Vectors and Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 8.2 Properties of the Matrix Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 8.3 Systems of Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Contents xiii 8.4 More About Linear Systems and Inverses . . . . . . . . . . . . . . . . . . . . . . 284 8.5 Adjacency Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 9 Number Theory and Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 9.1 Some Elementary Number Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 9.2 Modular Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 9.3 An Introduction to Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 9.4 Substitution Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 9.5 Modern Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 9.6 Other Cryptographic Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 9.7 Attacks on the RSA System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 10 The Theory of Voting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 10.1 Simple Elections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 10.2 Multiple Elections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 10.3 Fair Elections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 10.4 Properties of Electoral Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Solutions to Practice Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 Answers to Selected Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 1 Properties of Numbers When we study numbers, many of the problems involve continuous properties. Much of the earliest serious study of mathematics was in geometry, and one essential property of the real world is that between any two points there is a line segment that is continuous and infinitely divisible. All of calculus depends on the continuous nature of the number line. Some of the most famous difficulties of Greek mathematics involved the existence of irrational numbers and the fact that between any two real numbers one can always find another number. But the discrete properties of numbers are also very important. The decimal notation in which we usually write numbers depends on properties of the number 10, and we can also study the (essentially discrete) features of representations where other positive whole numbers take the role of 10. When we write the exact value of a number, or an approximation to its value, we use only the ten integers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, together with the decimal point. When numbers are represented in a computer, only integers are used. So it is important to understand the discrete properties of numbers to talk about their continuous properties. 1.1 Numbers Sets and Number Systems All of discrete mathematics—and, in fact, all of mathematics—rests on the foundations of set theory and numbers. In this first section we remind you of some basic definitions and notations. Further properties of numbers will be explored in the rest of this chapter; sets will be discussed further in Chapter 2. We use the word set in everyday language: a set of tires, a set of saucepans. In mathematics you have already encountered various sets of numbers. We shall use W.D. Wallis, A Beginner’s Guide to Discrete Mathematics, DOI 10.1007/978-0-8176-8286-6_1, © Springer Science+Business Media, LLC 2012 2 1 Properties of Numbers set to mean any collection of objects, provided only that there is a well-defined rule, called the membership law, for determining whether a given object belongs to the set. The individual objects in the set are called its elements or members and are said to belong to the set. If S is a set and s is one of its elements, we denote this fact by writing s ∈ S, which is read as “s belongs to S” or “s is an element of S.” The notation S ⊆ T means that every member of S is a member of T : x∈S ⇒ x ∈ T. Then S is called a subset of T . This definition allows for the possibility that S = T , and, in fact, a set is considered to be a subset of itself. If S ⊆ T , but S = T we say S is a proper subset of T and write S ⊂ T . One way of defining a set is to list all the elements, usually between braces; thus the set of the first three members of the English alphabet is {a, b, c}. If S is the set consisting of the numbers 0, 1, and 3, we could write S = {0, 1, 3}. We write {1, 2, . . . , 16} to mean the set of all whole numbers from 1 to 16. This use of a string of dots is not precise, but is usually easy to understand. Another method is the use of the membe...
View Full Document

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture