discrete mathematical structures 4 th edition kolman, busby, ross © 2000 by prentice-hall, inc....

11
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Upload: shanon-horton

Post on 17-Jan-2016

294 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Discrete Mathematical Structures 4th Edition

Kolman, Busby, Ross

© 2000 by Prentice-Hall, Inc.

ISBN 0-13-083143-3

Page 2: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Part 1

Fundamentals

Page 3: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Sets• a collection of elements or members• listing elements between braces• use uppercase to denote sets, lowercase to denote

members• empty set { } or • equal sets A=B• 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 the collection of all objects for which P is sensible and true

• x A if x is an element of the set A

Page 4: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Subsets

• A B i.e. whenever x A then x B

• Venn diagrams are used to show relationships between sets.

• finite, infinite set

• |A|, cardinality of A

• P(A), power set of A, the set of all subsets of A

Page 5: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Operations on Sets

• union, AB = {x| xA or xB}• intersection, AB = {x| xA and xB}• disjoint sets: sets have no common

elements• complement of B with respect to A, A-B

= {x| xA and xB}• U, universal set containing A, then U-A

is the complement of A, A={x| xA}• symmetric difference, AB={x| (xA and

xB) or (xB and xA)}=(A-B)(B-A)

Page 6: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Algebraic Properties of Set Operations

Theorem • AB=BA, AB=BA• A(BC)=(AB)C, A(BC)=(AB)C• A(BC)=(AB)(AC),

A(BC)=(AB)(AC), • AA=A, AA=A• (A) =A, AA=U, AA=, =U, U={},

AB=AB, AB=AB (De Morgan’s laws)• AU=U, AU=A• A=A, A=

Page 7: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

The Addition Principle (inclusion-exclusion principle)

• If A and B are finite sets, then

|AB|=|A|+|B|-|AB|

• If A, B and C are finite sets, then

|ABC|

=|A|+|B|+|C|-|AB|-|BC|-|AC|+|ABC |

Page 8: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Sequences• a list of objects arranged in a definite order• finite or infinite, explicit or recursive• some elements may be repeated in a sequence• set corresponding to a sequence – set of all distinct

elements in the sequence; • A set is called countable if it is the set corresponding

to some sequence– All finite sets are countable– Not all infinite sets are countable (e.g. the set of all real

numbers)• AU, characteristic function fA of A is defined for

each xU, fA (x)= 1 if xA; fA(x)=0 if xA

• fAB= fA fB fAB= fA+fB- fA fB

fAB= fA+fB-2fA fB

Page 9: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Strings and Regular Expressions

• alphabet A: a set of symbols• string: a finite sequence of symbols in A• A* consists of all finite strings from A• empty string : contains no symbols• catenation of w1 and w2 is w1 w2

• a regular expression over A is a string constructed from the elements of A and the symbols (, ), , *, , according to the following definition: (a recursive definition)

RE1. The symbol is a regular expression.RE2. If x A, the symbol x is a regular expression.

– RE1 and RE2 provide initial regular expressions

Page 10: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Strings and Regular Expressions (cont’)

RE3. If and are regular expressions, then the expression is regular.

RE4. If and are regular expressions, then the expression () is regular.

RE5. If is a regular expression, then the expression ()* is regular.

• each regular expression corresponds to a regular subsets of A*, or regular set if no reference to A is needed

• the concept of regular expressions is important for the study of the syntax of programming languages

• To compute the regular set corresponding to a regular expression, use the following correspondence rules:

Page 11: Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0-13-083143-3

Strings and Regular Expressions (cont’)1. The expression corresponds to the set {}.2. If xA, then the regular expression x corresponds

to the set {x}.3. If and are regular expressions corresponding

to the subsets M and N of A*, then corresponds to MN={st| sM and tN}. Thus MN is the set of all catenations of strings in M with strings in N.

4. If the regular expressions and correspond to the subsets M and N of A*, then () corresponds to MN.

5. If the regular expression corresponds to the subset M of A*, then ()* corresponds to the set M*.