Discrete Mathematical Structures [6 ed.] 9780132078450

1,374 233 53MB

English Pages [550] Year 2009

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Discrete Mathematical Structures [6 ed.]
 9780132078450

Table of contents :
img134
img135
2011_10_21_14_27_23
2011_10_21_14_29_38
2011_10_21_14_31_22
2011_10_21_14_33_57
2011_10_21_14_35_56
2011_10_21_14_38_00
2011_10_21_14_40_16
2011_10_21_14_42_39
img136
img137

Citation preview

List of Frequently Used Symbols Chapter 1 0,

b, c, x,

)1, Z

E

Z+

elements of a set, p. 2

the set of nonnegative integers, p. 2

Z

the set of integers, p. 2

Q

the set of rational numbers, p. 2

IR

the set of real numbers, p. 3

p is equivalent to q, p. 58

Chapter 3

lIP,.

the number of permutations of n objects taken r at a time, p. 94 Il-factorial, p. 94

/1 1

lI e,.

the number of combinations of 11 objects taken r at a time, p. 97

the empty set, p. 3

c

is contained in , p. 3

U

the uni versal set, p. 3

IAI peA)

P implies q , p. 57

p=.q

belongs to, p. 2 the set of positive integers, p. 2

N

0, { }

p=}q

the card inality of A, p. 4

peE )

the probability of the even t E, p. 106

!E

the frequency of occurrence of event E, p. 106

the set of all subsets of A, p. 4

AUB

the un ion of sets A and B, p. 5

An B

the intersection of sets A and B, p.6

A x B

the union from J to n of Ab p. 7

R(x)

the R -relative set of x, p. 130

R(A)

the R-relative set of A, p. 130

"

UA k

Chapter 4

k =J

"

nA k k= J

A-B A

A EB B A* /\. 11

1m

GCD(a , b) LCM(a , b)

the intersection from 1 to 11 of Ab p. 7 the complement of B with respect to A, p. 7

MR

the matrix of R, p. 131

ROO

the connectivity relation of R, the transitivity closure of R, p. 136

R*

the complement of A, p. 7 the symmetric difference of sets A and B, p. 7 the set of all fin ite sequences of elements of A, p. 17 the empty sequence or string, p. 17 12

the Cartesian product of A and B , p. 123

!:::,.

=. b (mod /1)

congruent to b mod

b,p.25

the base b expansion, p. 27

AT Av B A /\ B AOB

the transpose of the matrix

a partition of set A determined by the equivalence relation R on A, p. 150

SoR

the composition of Rand S, p. 164

Chapter 5

the join of A and B, p. 37

f- I

the inverse of the function f , p. 185

f ll

the characteri stic function of a set A , p. 190 the largest integer less than or equal to x , p. 190 the smallest integer greater than or equal to x , p. 190

the meet of A and B, p. 37 the Boolean product of A and p. 38

the identity function on A, p. 183

I II

A, p. 35

B,

LxJ rxl

Chapter 2 ,../

p. 148

AIR

divides m , p. 21

((hdk- I . .. d ldo)"

II ,

the equivalence class of a, p. 150

[a )

the greatest common divisor of a and b , p. 22 the least common multiple of a and

the reachabi1ity relation of R, p.139 the relation of equality, p. 141

not p , p. 5 1

o (f)

the order of a function f , p. 200

P /\ q

P and q , p. 52

8(f)

the 8 -c1 ass of a function f , p. 20 I

p Vq V

P or q, p. 52 for all , p. 54

:3

there exi sts, p. 54

~ p

the base 2 log function, p. 202

19 (a, pea,)

a, · ..

a

P (~1) ... p(~,,)

)

permutation of the set A = {a i, a2, ... , a,, }, p. 205

//?

Chapter 6
0, «->)

•1>>

*~

direct derivability, p. 388

L(G)

the language of G, p. 389

and gate, pp. 251-252

fx

inverter (NOT), pp. 251-252

(S, /, T, so, T)

Chapter 7 (7, u()) r(i;)

the set of transition functions of a

the subtree of T with root v, p. 273

a finite-state machine, p. 403 the transition function corresponding to input x, p. 403

Moore machine, p. 405

M/R

quotient machine of machine M, p. 406

l(w)

the length of a string w, p. 411

the tree with root i>o, p. 271

Chapter 8

BNF specification of a grammar, p. 395 finite-state machine, p. 403

or gate, pp. 251-252

(5, /, 5^

-

phrase structure grammar, p. 388

=>

y

:£>

a left coset of H in G, p. 373

Chapter 10

() ::= **

natural homomorphism of S onto S/R, p. 359

Chapter 11 (V, E,y)

the graph with vertices in V and

e

an (m,n) encoding function, p. 430

edges in E, p. 306

£/„

the discrete graph on at vertices, p. 308

Kn

the complete graph on n vertices, p. 308

Ln

the linear graph on n vertices, p. 308

Ge

the subgraph obtained by omitting e from G, p. 308

GR

the quotient graph with respect to R, p. 309

etj

excess capacity of edge (/, j), p. 323

c(K)

the capacity of a cut K, p. 327

X(G)

the chromatic number of C, p. 335

PG

the chromatic polynomial of G, p. 336

S5

the set of all functions from S to 5,

Chapter 9 p. 349

S/R Z„

the quotient semigroup of a semigroup 5, p. 358 the quotient set Z/ = (mod a?), p. 358

8(x, y)

the distance between the words x and >', p. 432

A0 B

the mod 2 sum of A and B, p. 435

A*B

the mod 2 Boolean product of A and B, p. 435

d

an (n, m) decoding function, p. 440

€j

a coset leader, p. 443

x *H

the syndrome of x, p. 446

Discrete Mathematical Structures

Discrete Mathematical Structures Sixth Edition

Bernard Kolman Drexel University

Robert C. Busby Drexel University

Sharon Cutler Ross Georgia Perimeter College

Upper Saddle River, NJ 07458

Library of Congress Cataloging-in-Publication Data Kolman, Bernard

Discrete mathematical structures / Bernard Kolman, Robert C. Busby, Sharon Cutler Ross. — 6th ed. p. cm. Includes index.

I. Computer Science—Mathematics. I. Busby, Robert C. n. Ross, Sharon Cutler m. Title.

QA76.9.M35K64 2009 511.6—dc22

2008010264

President: Greg Tobin Editor-in-Chief: Deirdre Lynch Senior Acquisitions Editor: William Hoffman Associate Editor: Caroline Celano

Project Manager: Kristy S. Mosch Senior Managing Editor: Linda Mihatov Behrens Operations Specialist: Lisa McDowell Senior Operations Supervisor: Alan Fischer Marketing Manager: Katie Winter Marketing Assistant: Jon Connelly Art Director/Cover Designer: Heather Scott Interior Design/Illustrations/Composition: Dennis Kletzing AV Project Manager: Thomas Benfatti

Cover Photo: Swinging (Schaukeln), 1925, Kandinsky, Wassily (1866-1944) ©ARS NY Manager, Cover Visual Research and Permissions: Karen Sanatar Director, Image Resource Center: Melinda Patelli Manager, Rights and Permissions: Zina Arabia Manager, Visual Research: Beth Brenzel Image Permissions Coordinator: Debbie Hewitson Photo Researcher: Beth Anderson Art Studio: Laserwords

© 2009, 2004, 2000, 1996, 1987, 1984 Pearson Prentice Hall

Pearson Education, Inc.

Upper Saddle River, NJ 07458

All rightsreserved. No partof this book may be reproduced, in any form or by any means, without permission in writing from the publisher.

PearsonPrentice Hall™ is a trademark of Pearson Education, Inc.

Printed in the United States of America

10

987654321

ISBN-13:

17fl-a-13-2ecn5:i,-b

ISBN-ID:

O-ia-fiETTSl-S

Pearson Education Ltd., London

Pearson Education Singapore, Pte. Ltd. Pearson Education Canada, Inc.

Pearson Education—Japan Pearson Education Australia PTY, Limited

Pearson Education North Asia, Ltd., Hong Kong Pearson Education de Mexico, S.A. de C.V.

Pearson Education Malaysia, Pte. Ltd. Pearson Education Upper Saddle River, New Jersey

To the memory ofLillie and to Judith B.K.

To my wife, Patricia, and our sons, Robert and Scott R.C.B.

To Bill and bill S.C.R.

Contents Preface

xi

A Word to Students

1

xv

Fundamentals

1

1.1

Sets and Subsets

1.2

1.4

Operations on Sets 5 Sequences 13 Properties of the Integers

1.5

Matrices

1.6

Mathematical Structures

1.3

2

20

32

41

2 Logic 50 2.1

Propositions and Logical Operations

2.2

Conditional Statements

2.3

Methods of Proof

2.4

Mathematical Induction

2.5

Mathematical Statements

2.6

Logic and Problem Solving 78

3 Counting

4

51

57

62

68 75

91

3.1

Permutations

3.2

Combinations

92

3.3 3.4

Pigeonhole Principle 100 Elements of Probability 104

3.5

Recurrence Relations

96

112

Relations and Digraphs

122

4.1

Product Sets and Partitions

123

4.2 4.3 4.4 4.5 4.6 4.7 4.8

Relations and Digraphs 127 Paths in Relations and Digraphs 135 Properties of Relations 141 Equivalence Relations 148 Data Structures for Relations and Digraphs Operations on Relations 159 Transitive Closure and Warshall's Algorithm

152

169 vii

viii

Contents

5

Functions

180

5.1

Functions

5.2

Functions for Computer Science

181

5.3

Growth of Functions

5.4

Permutation Functions

190

200 205

Order Relations and Structures 6.1 6.2

Partially Ordered Sets 218 Extremal Elements of Partially Ordered Sets

6.3

Lattices

6.4 6.5 6.6

Finite Boolean Algebras 243 Functions on Boolean Algebras Circuit Design 254

Trees 7.1

O

217

233

250

270

Trees

271

7.2

Labeled Trees

7.3

Tree Searching

275

7.4

Undirected Trees

7.5

Minimal Spanning Trees

280 288

295

Topics in Graph Theory 8.1

Graphs

8.2

Euler Paths and Circuits

305

306 311

8.3

Hamiltonian Paths and Circuits

8.4 8.5 8.6

Transport Networks 321 Matching Problems 329 Coloring Graphs 334

V Semigroups and Groups

318

344

9.1 9.2 9.3 9.4 9.5

Binary Operations Revisited 345 Semigroups 349 356 Products and Quotients of Semigroups Groups 362 Products and Quotients of Groups 372

9.6

Other Mathematical Structures

377

228

Contents

10

Languages and Finite-State Machines

Languages 387 Representations of Special Grammars and Languages

10.3

Finite-State Machines

10.4 10.5 10.6

Monoids, Machines, and Languages 409 Machines and Regular Languages 414 Simplification of Machines 420

11.1 11.2 11.3

429

Coding of Binary Information and Error Detection Decoding and Error Correction 440 Public Key Cryptology 449

455

Appendix B: Additional Experiments in Discrete Mathematics

467

Appendix C: Coding Exercises 473 Answers to Odd-Numbered Exercises

Answers to Chapter Self-Tests Glossary

G-1 1-1

Photo Credits

P-l

394

403

Appendix A: Algorithms and Pseudocode

Index

386

10.1 10.2

1 1 Groups and Coding

ix

515

477

430

Preface Discrete mathematics is an interesting course both to teach and to study at the freshman and sophomore level for several reasons. Its content is mathematics, but most of its applications and more than half of its students are from computer science or engineering concentrations. Thus, careful motivation of topics and pre views of applications are important and necessary strategies. Moreover, there are a number of substantive and diverse topics covered in the course, so a text must proceed clearly and carefully, emphasizing key ideas with suitable pedagogy. In addition, the student is generally expected to develop an important new skill: the ability to write a mathematical proof. This skill is excellent training for writing computer programs.

This text can be used by students as an introduction to the fundamental ideas of discrete mathematics, and as a foundation for the development of more advanced mathematical concepts. If used in this way, the topics dealing with specific com

puter science applications can be omitted or selected independently as important examples. The text can also be used in a computer science or electrical and com puter engineering curriculum to present the foundations of many basic computer related concepts, and to provide a coherent development and common theme for these ideas. The instructor can easily develop a suitable syllabus by referring to the chapter prerequisites which identify material needed by that chapter.

• Approach First, we have limited both the areas covered and the depth of coverage to what

we deem prudent in afirst course taught at the freshman and sophomore level. We have identified a set of topics that we feel are of genuine use in computer science and elsewhere and that can be presented in a logically coherent fashion. We have

presented an introduction to these topics along with an indication of how they can be pursued in greater depth. This approach makes our text an excellent reference for upper-division courses. Second, the material has been organized and interrelated to minimize the mass of definitions and the abstraction of some of the theory. Relations and digraphs are treated as two aspects of the same fundamental mathematical idea, with a directed graph being a pictorial representation of a relation. This fundamental idea is then used as the basis of virtually all the concepts introduced in the book, including functions, partial orders, graphs, and mathematical structures. Whenever possible, each new idea introduced in the text uses previously encountered material and, in turn, is developed in such a way that it simplifies the more complex ideas that follow.



What Is New in the Sixth Edition

We have been gratified by the wide acceptance of the first five editions of this book throughout the 25 years of its life. Equally pleasing is the confirmation of the orig inal decisions about content and approach for the book from the earliest editions. For example, the Association of Computing Machinery Special Interest Group for Computer Science Education (SIGCSE) and others have recently made recom mendations regarding the structure of a one-semester course in discrete structures that are well supported by this text. In preparing this edition, we have carefully considered these recommendations, as well as many suggestions from faculty and

XI

xii

Preface

students for improving the content and presentation of the material. Although many changes havebeen made to develop this revision, our objective has remained the same as in the first five editions: topresentthe basic notions ofdiscrete math ematics and some of its applications in a clear and concise manner that will be understandable to the student.

Webelieve that this bookworks well in the classroom becauseof the unifying role playedby the twokey concepts: relations and digraphs. Substantial strength ening of the logic material has been made by the addition of two new sections,

Mathematical Statements and Logic andProblem Solving along with accompany ing exercises. New material on fuzzy sets and fuzzy logic introduces students to a topic that is extremely important for modern issues of automated feedback and control of processes. The popular puzzle Sudoku, related puzzles, and their under lying mathematical connections, form a continuing thread in the text connecting set theory, Boolean matrices, algorithms and coding, logic, the general construc tion of proofs, coloring problems and polynomials, and other topics in a way that students will find both interesting and instructive. Other important changes in clude:

• Additional emphasis on how to develop a conjecture and how to prove or disprove it.

• This edition continues to weave the discussion of proofs and proof tech niques throughout the book with comments on most proofs, exercises related to the mechanics of proving statements, and Tips for Proofs sections. Many of the new exercises provide more practice in building proof-reading and -writing skills. • More applications are included. •

More exercises have been added.

• More figures have been included

• A number of explanations have been rewritten for greater clarity and im proved pedagogy. • The End-of-Chapter material from the fifth edition has been rearranged as follows: the conceptual review questions are now folded into the Self-Test at the end of each chapter and the coding exercises have been moved to Appendix C. •

Exercises

The exercises form an integral part of the book. Many are computational in na ture, whereas others are of a theoretical type. Many of the latter and the experi ments, to be further described below, require verbal solutions. Exercises to help develop proof-writing skills ask the student to analyze proofs, amplify arguments, or complete partial proofs. Guidance and practice in recognizing key elements and patterns have been extended in many new exercises. Answers to all oddnumbered exercises and self-test items appear in the back of the book. Solutions to all exercises appear in the Instructor's Solutions Manual, which is available (to instructors only) gratis from the publisher. The Instructor's Solutions Manual also includes notes on the pedagogical ideas underlying each chapter, goals and grading guidelines for the experiments (further described below), and a test bank.

• Experiments Chapters 1 through 10 each end with a student experiment. These provide oppor tunities for discovery and exploration, or a more-in-depth look at topics discussed

Preface

xiii

in the text. They are designed as extended-time, out-of-class experiences and are suitable for group work. Each experiment requires significantly more writing than section exercises do. Some additional experiments are to be found in Appendix B. Content, prerequisites, and goals for each experiment are given in the Instructor's Solutions Manual.

• Coding Exercises A set of coding exercises for each chapter are included in Appendix C.

• End-of-Chapter Material Each chapter contains Tips for Proofs, a summary of Key Ideas, and a Self-Test including a set of conceptual review questions covering the chapter's material.

• Organization Chapter 1 contains material that is fundamental to the course. This includes sets, subsets, and their operations; sequences; properties of the integers including base n representations; matrices; and mathematical structures. A goal of this chapter is to help students develop skills in identifying patterns on many levels. Chapter 2 covers logic and related material, including methods of proof and mathematical induction. Although the discussion of proof is based on this chapter, the commen tary on proofs continues throughout the book. Two new sections, Mathematical Statements and Logic and Problem Solving have been added. This material is used to briefly discuss the currently widely popular puzzle Sudoku and related puzzles. Chapter 3, on counting, deals with permutations, combinations, the pigeonhole principle, elements of discrete probability, and recurrence relations. Chapter 4 presents basic types and properties of relations, along with their rep resentation as directed graphs. Connections with matrices and other data structures are also explored in this chapter. Chapter 5 deals with the notion of a function, and gives important examples of functions, including functions of special interest in computer science. An introduction to the growth of functions is developed. New material on fuzzy sets and fuzzy logic has been added. Chapter 6 covers par tially ordered sets, including lattices and Boolean algebras. A symbolic version for finding a Boolean function for a Boolean expression is developed along with the pictorial Karnaugh method. Chapter 7 introduces directed and undirected trees along with applications of these ideas. Elementary graph theory with applications to transport networks and matching problems is the focus of Chapter 8. In Chapter 9 we return to mathematical structures and present the basic ideas of semigroups, groups, rings, and fields. By building on work in previous chapters, only a few new concepts are needed. Chapter 10 is devoted to finite state machines. It complements and makes effective use of ideas developed in previous chapters. Chapter 11 finishes the discussion of coding for error-detecting and correction and for security purposes. Appendix A discusses Algorithms and Pseudocode. The simplified pseudocode presented here is used in some text examples and exercises; these may be omitted without loss of continuity. Appendix B gives some additional experiments dealing with extensions or previews of topics in various parts of the course. Appendix C contains a set of coding exercises, separated into subsets for each chapter.

• Optional Supplements There is available with this text a 406 page workbook: Practice Problems in Dis crete Mathematics by Boyana Obrenic (ISBN 0-13-045803-1). It consists entirely

xiv

Preface

of problem sets with fully worked out solutions. In addition, there is a 316 page workbook: Discrete Mathematics Workbook by James Bush (ISBN 0-13-0463272). This item has outlines of key ideas, key terms, and sample problem sets (with solutions).

• Acknowledgments We are pleased to express our thanks to the following reviewers of the first four editions: Harold Fredrickson, Naval Postgraduate School; Thomas E. Gerasch, George Mason University; Samuel J. Wiley, La Salle College; Kenneth B. Reid, Louisiana Sate University; Ron Sandstrom, Fort Hays State University; Richard H. Austing, University of Maryland; Nina Edelman, Temple University; Paul Gormley, Villanova University; Herman Gollwitzer and Loren N. Argabright, both at Drexel University; Bill Sands, University of Calgary, who brought to our atten tion a number of errors in the second edition; Moshe Dror, University of Ari zona, Tucson; Lloyd Gavin, California State University at Sacramento; Robert H. Gilman, Stevens Institute of Technology; Earl E. Kymala, California State University at Sacramento; and Art Lew, University of Hawaii, Honolulu; Ashok T. Amin, University of Alabama at Huntsville; Donald S. Hart, Rochester Institute of Technology; Minhua Liu, William Rainey Harper College; Charles Parry, Vir ginia Polytechnic Institute & University; Arthur T. Poe, Temple University; Suk Jai Seo, University of Alabama at Huntsville; Paul Weiner, St. Mary's Univer sity of Minnesota; and of the fifth edition: Edward Boylan, Rutgers University; Akihiro Kanamori, Boston University; Craig Jensen, University of New Orleans; Harold Reiter, University of North Carolina; Charlotte Zhong-Hui Duan, Univer sity of Akron; and of the sixth edition: Danrun Huang, St. Cloud State University; George Davis, Georgia State University; Ted Krovetz, California State Univer sity, Sacramento; Lester McCann, The University of Arizona; Sudipto Ghosh, Colorado State University; Brigitte Servatius, Worcester Polytechnic Institute; Carlo Tomasi, Duke University; Andrzej Czygrinow, Arizona State University; Johan Belinfante, Georgia Institute of Technology; Gary Walker, Pennsylvania State University-Erie. The suggestions, comments, and criticisms of these people greatly improved the manuscript. We thank Dennis R. Kletzing, who carefully typeset the entire manuscript; Lil ian N. Brady for carefully and critically reading page proofs; Blaise de Sesa, who checked the answers and solutions to all the exercises in the book; and instructors

and students from many institutions in the United States and other countries, for sharing with us their experiences with the book and offering helpful suggestions. Finally, a sincere expression of thanks goes to Bill Hoffman, Senior Editor, Caroline Celano, Associate Editor, Linda Behrens, Senior Managing Editor, Kristy Mosch, Production Project Manager, Katie Winter, Marketing Manager, Jon Con nelly, Marketing Assistant, Lisa McDowell, Operations Specialist, Heather Scott, Art Director, Tom Benfatti, Art Editor, and to the entire staff of Pearson for their

enthusiasm, interest, and unfailing cooperation during the conception, design, pro duction, and marketing phases of this edition. B.K.

R.C.B. S.C.R.

A Word to Students This course is likely to be different from your previous mathematics courses in several ways. There are very few equations to solve, even fewer formulas, and just a handful of procedures. Although there will be definitions and theorems to learn, rote memorization alone will not carry you through the course. Understanding concepts well enough to apply them in a variety of settings is essential for success. The good news is that there is a wealth of interesting and useful material in this text. We have chosen topics that form a basis for applications in everyday life, mathematics, computer science, and other fields. We have also chosen the topics so that they fit together and build on each other; this will help you to master the concepts covered. Two distinctive features of this course are a higher level of abstraction and more emphasis on proofs than you have perhaps encountered in earlier mathemat ics courses. Here is an example of what we mean by abstraction. When you studied algebra, you learned the distributive property of multiplication over addition. In this course, you will abstract the concept of a distributive property and investigate this idea for many pairs of operations, not just multiplication and addition. The other feature is proofs. Before you close the book right here, let us tell you something about how proofs are handled in this book. The goals are for you to be able to read proofs intelligently and to produce proofs on your own. The way we help you to these goals may remind you of your composition classes. Learning to write a persuasive essay or a meaningful sonnet or another style composition is a complicated process. First, you read, analyze, and study many examples. Next you try your hand at the specific style. Typically this involves draft versions, revisions, critiques, polishing, and rewriting to produce a strong essay or a good sonnet or whatever form is required. There are no formulas or rote procedures for writing. Proofs, like the products of a composition course, have structures and styles. We give you lots of proofs to read and analyze. Some exercises ask that you outline, analyze, or critique a proof. Other exercises require the completion of partial proofs. And finally, there are many opportunities for you to construct a proof on your own. Believe us, reading and writing proofs are learnable skills. On a larger scale, we hope this text helps you to become an effective commu nicator, a critical thinker, a reflective learner, and an innovative problem solver. Best wishes for a successful and interesting experience.

XV

CHAPTER

1

Fundamentals Prerequisites: There are noformal prerequisitesfor thischapter; the reader is encouraged to read care fully and work through all examples. In this chapter we introduce some of the basic tools of discrete mathematics. We begin with sets, subsets, and their operations, notions with which you may already be familiar. Next we deal with sequences, using both explicit and recursive pat terns. Then we review some of the basic properties of the integers. Finally we introduce matrices and matrix operations. This gives us the background needed to begin our exploration of mathematical structures.

Looking Back: Matrices The origin of matrices goes back to approximately 200 B.C.E., when they were used by the Chinese to solve linear systems of equations. After being in the shadows for nearly two thousand years, matrices came back into mathematics toward the end of the seventeenth century and from then research in this area proceeded at a rapid pace. The term "matrix" (the singular of "matrices") was coined in 1850 by James Joseph Sylvester (1814—

1897), a British mathematician and lawyer. In 1851, Sylvester met Arthur Cayley (1821-1895), also a British lawyer with a strong interest in mathematics. Cayley quickly realized the importance of the notion of a matrix and in 1858 published a book showing the basic operations on matrices. He also discovered a number of important results in matrix theory,

James Joseph Sylvester

Arthur Cayley

2

Chapter 1 Fundamentals 1.1

Sets and Subsets Sets

A set is any well-defined collection of objects called the elements or members of the set. For example, the collection of all wooden chairs, the collection of all one-legged black birds, or the collection of real numbers between zero and one

are all sets. Well-defined just means that it is possible to decide if a given object belongs to the collection or not. Almost all mathematical objects are first of all sets, regardless of any additional properties they may possess. Thus set theory is, in a sense, the foundation on which virtually all of mathematics is constructed. In spite of this, set theory (at least the informal brand we need) is quite easy to learn and use.

One way of describing a set that has a finite number of elements is by listing the elements of the set between braces. Thus the set of all positive integers that are less than 4 can be written as

{1,2,3}.

(1)

The order in which the elements of a set are listed is not important. Thus {1,3, 2}, {3, 2,1}, {3,1,2}, {2, 1, 3}, and {2, 3, 1} are all representations of the set given in (1). Moreover, repeated elements in the listing of the elements of a set can be ignored. Thus, {1, 3, 2, 3,1} is another representation of the set given in (1). We use uppercase letters such as A, B, C to denote sets, and lowercase letters such as ay b, c, x, y, z, t to denote the members (or elements) of sets. We indicate the fact that x is an element of the set A by writing x € A, and we indicate the fact that x is not an element of A by writing x £ A.

Example 1



Let A = {1, 3,5,7}. Then 1 e A, 3 e A,but 2 £ A.

Sometimes it is inconvenient or impossible to describe a set by listing all of its elements. Another useful way to define a set is by specifying a property that the elements of the set have in common. We use the notation P(x) to denote a sentence or statement P concerning the variable object x. The set defined by P(x), written {x \ P(x)}, is just the collection of all objects for which P is sensi ble and true, {x \ P(x)} is read, "the set of all x such that P(x)." For example, {x | x is a positive integer less than 4} is the set {1, 2, 3} described in (1) by listing its elements.

Example 2

The setconsisting ofallthe letters inthe word "byte" canbe denoted by {b, y, t, e} ♦

or by {x \ x is a letter in the word "byte"}.

Example 3

We introduce here several sets and their notations thatwill be used throughout this book.

(a) Z+ = {x | x is a positive integer}. Thus Z+ consists of the numbers used for counting: 1,2,3 (b) N = {x | x is a positive integer or zero} = {x \ x is a natural number}. Thus N consists of the positive integers and zero: 0, 1, 2, (c) Z = {jc | x is an integer}. Thus Z consists of all the integers: ..., -3, -2, -1, 0, 1, 2, 3,.... (d) Q = {x | x is a rational number}. a

Thus Q consists of numbers that can be written as -, where a and b are inte-

gers and b is not 0.

b

1.1

Sets and Subsets

3

(e) R = {x | x is a real number}. (f) The set that has no elements in it is denoted either by { } or the symbol 0 and is called the empty set. ♦

Example 4

Since thesquare of a real number is always nonnegative, {x | x is a real number andx2 = —1} = 0.



Sets are completely known when their members are all known. Thus we say two sets A and B are equal if they have the same elements, and we write A = B.

Example 5

If A = {1, 2, 3} and B = {x \ x is a positive integer and x2 < 12}, then A = B. ♦

Example 6

If A = {JAVA, PASCAL, C++} and B = {C++, JAVA, PASCAL}, then A = B.



Subsets

If every element of A is also an element of B, that is, if whenever x e A then x € B, we say that A is a subset of B or that A is contained in B, and we write

A c B. If A is not a subset of B, we write A