Discrete Mathematics Lecture 2: Basic Structures: Set Theory MING GAO DaSE@ ECNU (for course related communications) mgao@dase.ecnu.edu.cn Sep. 18, 2017
Outline 1 Set Concepts 2 Set Operations 3 Application 4 Take-aways MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 2 / 15
Set Concepts Set Definition Set A is a collection of objects (or elements). a A : a is an element of A or a is a member of A ; a A : a is not an element of A ; A = {a 1, a 2,, a n } : A contains a 1, a 2,, a n ; Order of elements is meaningless; It does not matter how often the same element is listed. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 3 / 15
Set Concepts Set Definition Set A is a collection of objects (or elements). a A : a is an element of A or a is a member of A ; a A : a is not an element of A ; A = {a 1, a 2,, a n } : A contains a 1, a 2,, a n ; Order of elements is meaningless; It does not matter how often the same element is listed. Set equality Sets A and B are equal if and only if they contain exactly the same elements. If A = {9, 2, 7, 3} and B = {7, 9, 2, 3}, then A = B. If A = {9, 2, 7} and B = {7, 9, 2, 3}, then A B.; If A = {9, 2, 3, 9, 7, 3} and B = {7, 9, 2, 3}, then A = B. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 3 / 15
Set Concepts Applications Examples Bag of words model: documents, reviews, tweets, news, etc; Transactions: shopping list, app downloading, book reading, video watching, music listening, etc; Records in a DB, data item in a data streaming, etc; Neighbors of a vertex in a graph; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 4 / 15
Set Concepts Applications Examples Bag of words model: documents, reviews, tweets, news, etc; Transactions: shopping list, app downloading, book reading, video watching, music listening, etc; Records in a DB, data item in a data streaming, etc; Neighbors of a vertex in a graph; Standard sets Natural numbers: N = {0, 1, 2, 3, } Integers: Z = {, 2, 1, 0, 1, 2, } Positive integers: Z + = {1, 2, 3, 4, } Real Numbers: R = {47.3, 12, 0.3, } Rational Numbers: Q = {1.5, 2.6, 3.8, 15, } MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 4 / 15
Set Concepts Representation of sets Tabular form A = {1, 2, 3, 4, 5}; B = { 2, 0, 2}; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 5 / 15
Set Concepts Representation of sets Tabular form A = {1, 2, 3, 4, 5}; B = { 2, 0, 2}; Descriptive form A = set of first five natural numbers; B = set of positive odd integers; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 5 / 15
Set Concepts Representation of sets Tabular form A = {1, 2, 3, 4, 5}; B = { 2, 0, 2}; Descriptive form A = set of first five natural numbers; B = set of positive odd integers; Set builder form Q = {a/b : a Z b Z b 0}; B = {y : P(y)}, where P(Y ) : y E 0 < y 50; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 5 / 15
Set Concepts Representation of sets Remarks A = : empty set, or null set; Universal set U: contains all the objects under consideration. A = {{a, b}, {b, c, d}}; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 6 / 15
Set Concepts Representation of sets Remarks A = : empty set, or null set; Universal set U: contains all the objects under consideration. A = {{a, b}, {b, c, d}}; Venn diagrams In general, a universal set is represented by a rectangle. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 6 / 15
Set Concepts Subsets Definition Set A is a subset of B iff every element of A is also an element of B, denoted as A B. A B = x(x A x B); For every set S, we have: (1) S; and (2) S S; When we wish to emphasize that set A is a subset of set B but that A B, we write A B and say that A is a proper subset of B, i.e., x(x A x B) (x B x A); Two useful rules: (1) A = B (A B) (B A); (2) (A B) (B C) (A C);
Set Concepts Subsets Definition Set A is a subset of B iff every element of A is also an element of B, denoted as A B. A B = x(x A x B); For every set S, we have: (1) S; and (2) S S; When we wish to emphasize that set A is a subset of set B but that A B, we write A B and say that A is a proper subset of B, i.e., x(x A x B) (x B x A); Two useful rules: (1) A = B (A B) (B A); (2) (A B) (B C) (A C); Given a set S, the power set of S is the set of all subsets of S, denoted as P(S). The size of 2 S, where S is the size of S. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 7 / 15
Set Concepts Cartesian product Definition Let A and B be sets. The Cartesian product of A and B, denoted by A B, is set A B = {(a, b) : a A b B}, where (a, b) is a ordered 2-tuples, called ordered pairs. Let A = {1, 2} and B = {a, b, c}, the Cartesian product A B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}; The Cartesian product of A 1, A 2,, A n is denoted as A 1 A 2 A n A 1 A 2 A n = {(a 1, a 2,, a n ) : i a i A i }; A subset R of the Cartesian product A B is called a relation from A to B. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 8 / 15
Set Operations Set operations Operators Let A and B be two sets, and U be the universal set Union: A B = {x : x A x B}; Intersection: A B = {x : x A x B}; Difference: A B = {x : x A x B} (sometimes denoted as A \ B); Complement: A = U A = {x U : x A};
Set Operations Set operations Operators Let A and B be two sets, and U be the universal set Union: A B = {x : x A x B}; Intersection: A B = {x : x A x B}; Difference: A B = {x : x A x B} (sometimes denoted as A \ B); Complement: A = U A = {x U : x A}; A B = A B; A B = A + B A B. MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 9 / 15
Set identities Set Operations Table of logical equivalence equivalence name A U = A Identity laws A = A A A = A Idempotent laws A A = A (A B) C = A (B C) Associative laws (A B) C = A (B C) A (A B) = A Absorption laws A (A B) = A A A = Complement laws A A = U MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 10 / 15
Set Operations Logical equivalence Cont d Table of logical equivalence equivalence name A U = U Domination laws A = A B = B A Commutative laws A B = B A (A B) C = (A C) (B C) Distributive laws (A B) C = (A C) (B C) (A B) = A B De Morgan s laws (A B) = A B MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 11 / 15
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection = {x : (x A) (x B)} De Morgan law for logic
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection = {x : (x A) (x B)} De Morgan law for logic = {x : (x A) (x B)} definition of does not belong symbol
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection = {x : (x A) (x B)} De Morgan law for logic = {x : (x A) (x B)} definition of does not belong symbol = {x : (x A) (x B)} definition of complement
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection = {x : (x A) (x B)} De Morgan law for logic = {x : (x A) (x B)} definition of does not belong symbol = {x : (x A) (x B)} definition of complement = {x : x (A B)} definition of union
Proof of De Morgan law Set Operations Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A B primise = {x : x A B} definition of complement = {x : (x A B)} definition of does not belong symbol = {x : (x A x B)} definition of intersection = {x : (x A) (x B)} De Morgan law for logic = {x : (x A) (x B)} definition of does not belong symbol = {x : (x A) (x B)} definition of complement = {x : x (A B)} definition of union = A B meaning of set builder notation MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 12 / 15
Set Operations Generalized unions and intersections Union A 1 A 2 A n = n i=1 A i; A 1 A 2 A n = i=1 A i; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 13 / 15
Set Operations Generalized unions and intersections Union A 1 A 2 A n = n i=1 A i; A 1 A 2 A n = i=1 A i; Intersection A 1 A 2 A n = n i=1 A i; A 1 A 2 A n = i=1 A i; MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 13 / 15
Set covering problem Application Input Universal set U = {u 1, u 2,, u n } Subsets S 1, S 2,, S m U Cost c 1, c 2,, c m MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 14 / 15
Set covering problem Application Input Universal set U = {u 1, u 2,, u n } Subsets S 1, S 2,, S m U Cost c 1, c 2,, c m Goal Find a set I {1, 2,, m} that minimizes i I c i, such that i I S i = U MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 14 / 15
Application Set covering problem Input Universal set U = {u 1, u 2,, u n } Subsets S 1, S 2,, S m U Cost c 1, c 2,, c m Goal Find a set I {1, 2,, m} that minimizes i I c i, such that i I S i = U Applications Document summarization Natural language generation Information cascade MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 14 / 15
Take-aways Take-aways Course homepage http://dase.ecnu.edu.cn/mgao/teaching/dm_2017_fall/dm.html Advices to learning DM Not a reading course. More than a mathematics course, though it is workload-heavy MING GAO (DaSE@ecnu) Discrete Mathematics Sep. 18, 2017 15 / 15