
CSE 1400 Applied Discrete Mathematics Sets Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Set Basics 1 Common Sets 3 Operations On Sets 3 Precedence of Set Operations 4 Cartesian Products 4 Subset of a Set 5 Cardinality of a Set 6 Power Set of a Set 6 Binomial Coefficients 7 Counting Bit Strings 8 Boolean Laws 8 Partition of a Set 11 Venn and Euler Diagrams 12 Problems on Sets 15 Abstract Finite and countable sets are fundamental primitives of discrete math- ematics. Operations can be defined on sets creating an “algebra.” Counting the number of elements in a set and counting subsets with a certain property are fundamental in computing probabilities and statistics. Partitioning a set describes equivalences among its elementss. Set Basics A set is an unordered collection of things . The things in a set A are said to be elements or members of A. The natural If a is an element in A write a 2 A. Of course, it can occur that a particular element a is not a member of set A, in which case write a 62 A. cse 1400 applied discrete mathematics sets 2 number 7 is a member of the set O of octal numerals 7 2 O = f0, 1, 2, 3, 4, 5, 6, 7g The natural number 8 is not a member of the set O of octal numerals 8 62 O = f0, 1, 2, 3, 4, 5, 6, 7g A can be described by listing its members as a comma separated list enclosed in curly braces fg. No element is duplicated in a set: A thing in a set is listed once and only once. A can be also described For instance, B = f0, 1g, is the set of by comprehension. For instance, bits. B = fb : b is a bitg More generally, A can be comprehended by a description For instance, the set of even natural numbers is comprehended by the A = fa : p(a) is Trueg description 2N = fa : a = 2n ^ n 2 Ng where p(a) is a proposition about variable a. Even more generally, A can be comprehended by a description For instance, the set of even natural numbers is comprehended by the A = f f (a) : p(a) is Trueg description 2N = f2a : a 2 Ng where f is a function and p(a) is a proposition about the variable a. In computing practice, set comprehen- When context demands it, the set of all possible things, called sion requires the proposition p(a) to the universal set and denoted U, can be named. Sets can be be computable, that is, there must be X an algorithm that returns True when represented by diagrams, for instance, a single set is drawn as a a 2 A and False when a 62 A. circle inside a rectangle. For instance, the set of natural numbers is the universal set for many computing U problems. Strings over an alphabet could be U in other applications. X Two sets X and Y can be drawn in several relationships, called Euler diagrams. For instance, when no members of X are in Y the sets are disjoint. U U U Contrapositively, no members of Y are X X Y in . Similarly, when some in are in Y Y Y then some members of Y are in X X X and the sets intersect. Lastly, when X all members of X are in Y, X is said to be a subset of Y. X and Y are disjoint. X and Y intersect. X is a subset of Y. Characteristic functions describe these three scenarios. cse 1400 applied discrete mathematics sets 3 Definition 1 (Characteristic Function). The characteristic function of A is denoted cA and computed by the conditional statement 8 <False if a 62 A cA(a) = :True if a 2 A When X and Y are disjoint, the values cX(a) and cY(a) cannot both be True simultaneously. That is, (8a)(cX(a) ^ cY(a) = False) When X and Y intersect, their is some element a where cX(a) and cY(a) are simultaneously True. That is, (9a)(cX(a) ^ cY(a) = True) And when X is a subset of Y, every element in X also belongs to Y. That is, cX(a) ! cY(a) Common Sets In mathematics, the name of a set is usually written in a font called blackboard bold. Thus, for instance, we have • The bits or Boolean values • The integers mod n B = f0, 1g = f1, 0g Zn = f0, 1, 2, . , (n − 1)g • The digits • The rational numbers D = f0, 1, . , 9g Q = fa/b : a, b 2 Z, b 6= 0g • The hexadecimal digits H = f0, 1, . , 9, A,..., Fg • The English alphabet • The natural numbers A = fa, b, c,..., x, y, zg N = f0, 1, 2, . .g • The Unicode character set • The integers Z = f0, ±1, ±2, . .g U = fc : 0 ≤ c ≤ (10FFFF)16g Operations On Sets Sets can be combined in simple ways to create complex expressions. Let X and Y name two sets. The union operator It could be that X = Y, so that two names refer to the same value. cse 1400 applied discrete mathematics sets 4 X [ Y returns the set of all elements in either set: X or Y. X [ Y = fz : z is in X or z is in Yg U The intersection operator X \ Y returns only the set of ele- ments that are in both sets X and Y. Y X X \ Y = fz : z is in X and z is in Yg X [ Y is set union. Set complement, X, operates on a single set and returns the U elements not in X. X = fz : z is not in Xg Y X For instance, let X = f g Y = f g V = f g 1, 5, 9 , 2, 3, 5, 7 , and 4, 6, 8, 9 X \ Y is the intersection operator. be three subsets of the universe of decimal digits. D = f0, 1, 2, 3, 4, 5, 6, 7, 8, 9g Then X \ V = f9g U X = f0, 2, 3, 4, 6, 7, 8g X [ Y = f1, 2, 3, 5, 7, 9g X (X \ Y) [ V = f0, 1, 2, 3, 5, 7g Precedence of Set Operations X is the set complement operator. Precedence and associativity determine the order in which oper- ations are performed. For sets, complement is computed before In arithmetic you learn that exponentia- intersection, which is before union. All operations are computed left- tion is performed before multiplication, which are performed before addition. to-right unless parenthesis or other brackets are used to specify order. Furthermore, the associativity of addi- tion and multiplication is left-to-right, but exponentiation is right-to-left. For instance, 3 Cartesian Products 6 + 5 · 22 = 6 + 5 · 28 = 6 + 5 · 256 For instance, when A = f0g, B = f0, 1g and C = f1, 2g compute Cartesian products provides the foundation for building A [ B \ C = f0g [ f1g relations and functions. = f0, 1g The Cartesian product of X and Y is the set of ordered (x, y) that (A [ B) \ C = f0, 1g \ f1, 2g 2 X 2 Y relates every value x with every value y . The Cartesian = f1g product of X and Y is written X × Y = f(x, y) : x 2 X ^ y 2 Yg cse 1400 applied discrete mathematics sets 5 College algebra teaches how to draw The Cartesian product X × Y is two dimensional: It can be functions and relations on the real numbers. represented as a set of ordered pairs, for instance, y x2 y = 2 + 1 B × D = f(0, 0), (0, 1),..., (0, 9), (1, 0), (1, 1),..., (1, 9)g The Cartesian product can be represented as a table, for instance B × D is the table where each entry is True, represented by1. This is the incestuous relation,x2 + (y where− 1)2 = 1 each element b 2 B is related to every element d 2 D. x 1 B × D y = x + 2 0 1 2 3 4 5 6 7 8 9 0 1111111111 1 1111111111 Subsets of B × D are called relations from B to D. For instance, the the even-odd relation can be represented by the table where row 0 picks out the even digits as True row 1 picks out the odd digits as True Even-Odd Relation 0 1 2 3 4 5 6 7 8 9 0 1010101010 1 0101010101 A Cartesian product can be represented as a node-edge graph. Sub-graphs of a complete graph arise in computing practice. For instance, the even-odd relation 9 Subset of a Set 8 7 6 Often it is useful to talk about a collection of some ele- 1 5 ments, but perhaps not all elements, of a set. Such a collec- 0 4 tion is called a subset. The set of composite digits C = f4, 6, 8, 9g is 3 a subset of the digits D. 2 The subset relation between two sets is very much like the less 1 than relation between two integers. A proper subset is strictly smaller 0 than its super-set, just as 5 is strictly less than 7. C = f4, 6, 8, 9g ⊂ f0, 1, 2, 3, 4, 5, 6, 7, 8, 9g = D To allow for the possibility of equality, write a ≤ b for integers and A ⊆ X for sets. cse 1400 applied discrete mathematics sets 6 If there is some element in A that is not in X, then A is not a subset of X. Stated contra-positively, if A ⊆ X, then every member If A is not a subset of X, write A 6⊆ X of A is a member of X.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages18 Page
-
File Size-