Discrete Mathematical Structures 4 th Edition Kolman Busby
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN 0 -13 -083143 -3
Part 1 Fundamentals
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
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
Operations on Sets • union, A B = {x| x A or x B} • intersection, A B = {x| x A and x B} • disjoint sets: sets have no common elements • complement of B with respect to A, A-B = {x| x A and x B} • U, universal set containing A, then U-A is the complement of A, A={x| x A} • symmetric difference, A B={x| (x A and x B) or (x B and x A)}=(A-B) (BA)
Algebraic Properties of Set Operations Theorem • A B=B A, A B=B A • A (B C)=(A B) C, A (B C)=(A B) C • A (B C)=(A B) (A C), • A A=A, A A=A • (A) =A, A A=U, A A= , =U, U={}, A B=A B (De Morgan’s laws) • A U=U, A U=A • A =A, A =
The Addition Principle (inclusion-exclusion principle) • If A and B are finite sets, then |A B|=|A|+|B|-|A B| • If A, B and C are finite sets, then |A B C| =|A|+|B|+|C|-|A B|-|B C|-|A C|+|A B C |
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) • A U, characteristic function f. A of A is defined for each x U, f. A (x)= 1 if x A; f. A(x)=0 if x A • f. A B= f. A f. B f. A B= f. A+f. B-2 f. A f. B
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 w 1 and w 2 is w 1 w 2 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) RE 1. The symbol is a regular expression. RE 2. If x A, the symbol x is a regular expression. – RE 1 and RE 2 provide initial regular expressions
Strings and Regular Expressions (cont’) RE 3. If and are regular expressions, then the expression is regular. RE 4. If and are regular expressions, then the expression ( ) is regular. RE 5. 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:
Strings and Regular Expressions (cont’) 1. The expression corresponds to the set { }. 2. If x A, 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| s M and t N}. 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 M N. 5. If the regular expression corresponds to the subset M of A*, then ( )* corresponds to the set M*.
- Slides: 11