Discrete Mathematics and Its Applications Lecture 2: Basic - - PowerPoint PPT Presentation

discrete mathematics and its applications
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics and Its Applications Lecture 2: Basic - - PowerPoint PPT Presentation

Discrete Mathematics and Its Applications Lecture 2: Basic Structures: Set Theory MING GAO DaSE@ ECNU (for course related communications) mgao@dase.ecnu.edu.cn Mar. 27, 2020 Outline Set Concepts 1 Set Operations 2 Application 3


slide-1
SLIDE 1

Discrete Mathematics and Its Applications

Lecture 2: Basic Structures: Set Theory MING GAO

DaSE@ ECNU (for course related communications) mgao@dase.ecnu.edu.cn

  • Mar. 27, 2020
slide-2
SLIDE 2

Outline

1

Set Concepts

2

Set Operations

3

Application

4

Take-aways

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

2 / 16

slide-3
SLIDE 3

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 = {a1, a2, · · · , an} : A contains a1, a2, · · · , an; Order of elements is meaningless; It does not matter how often the same element is listed.

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

3 / 16

slide-4
SLIDE 4

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 = {a1, a2, · · · , an} : A contains a1, a2, · · · , an; 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 and Its Applications

  • Mar. 27, 2020

3 / 16

slide-5
SLIDE 5

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 and Its Applications

  • Mar. 27, 2020

4 / 16

slide-6
SLIDE 6

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 and Its Applications

  • Mar. 27, 2020

4 / 16

slide-7
SLIDE 7

Set Concepts

Representation of sets

Tabular form A = {1, 2, 3, 4, 5}; B = {−2, 0, 2};

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

5 / 16

slide-8
SLIDE 8

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 and Its Applications

  • Mar. 27, 2020

5 / 16

slide-9
SLIDE 9

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 and Its Applications

  • Mar. 27, 2020

5 / 16

slide-10
SLIDE 10

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 and Its Applications

  • Mar. 27, 2020

6 / 16

slide-11
SLIDE 11

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 and Its Applications

  • Mar. 27, 2020

6 / 16

slide-12
SLIDE 12

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.

slide-13
SLIDE 13

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);

slide-14
SLIDE 14

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;

slide-15
SLIDE 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

  • f B, i.e., ∀x(x ∈ A → x ∈ B) ∧ ∃(x ∈ B ∧ x ∈ A);
slide-16
SLIDE 16

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

  • f 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);

slide-17
SLIDE 17

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

  • f 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);

slide-18
SLIDE 18

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

  • f 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 and Its Applications

  • Mar. 27, 2020

7 / 16

slide-19
SLIDE 19

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

  • rdered 2-tuples, called ordered pairs.
slide-20
SLIDE 20

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

  • rdered 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)};

slide-21
SLIDE 21

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

  • rdered 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 A1, A2, · · · , An is denoted as A1 × A2 × · · · × An A1 × A2 × · · · × An = {(a1, a2, · · · , an) : ∀i ai ∈ Ai};

slide-22
SLIDE 22

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

  • rdered 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 A1, A2, · · · , An is denoted as A1 × A2 × · · · × An A1 × A2 × · · · × An = {(a1, a2, · · · , an) : ∀i ai ∈ Ai}; A subset R of the Cartesian product A × B is called a relation from A to B.

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

8 / 16

slide-23
SLIDE 23

Set Operations

Set operations

Operators Let A and B be two sets, and U be the universal set

slide-24
SLIDE 24

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};

slide-25
SLIDE 25

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};

slide-26
SLIDE 26

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 and Its Applications

  • Mar. 27, 2020

9 / 16

slide-27
SLIDE 27

Set Operations

Set identities

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 and Its Applications

  • Mar. 27, 2020

10 / 16

slide-28
SLIDE 28

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 and Its Applications

  • Mar. 27, 2020

11 / 16

slide-29
SLIDE 29

Set Operations

Proof of De Morgan law

Proof Use set builder notation and logical equivalences to establish the first De Morgan law Steps Reasons A ∩ B primise

slide-30
SLIDE 30

Set Operations

Proof of De Morgan law

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

slide-31
SLIDE 31

Set Operations

Proof of De Morgan law

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

slide-32
SLIDE 32

Set Operations

Proof of De Morgan law

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

slide-33
SLIDE 33

Set Operations

Proof of De Morgan law

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

slide-34
SLIDE 34

Set Operations

Proof of De Morgan law

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

slide-35
SLIDE 35

Set Operations

Proof of De Morgan law

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

slide-36
SLIDE 36

Set Operations

Proof of De Morgan law

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

slide-37
SLIDE 37

Set Operations

Proof of De Morgan law

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 and Its Applications

  • Mar. 27, 2020

12 / 16

slide-38
SLIDE 38

Set Operations

Generalized unions and intersections

Union A1 ∪ A2 ∪ · · · ∪ An = n

i=1 Ai;

A1 ∪ A2 ∪ · · · ∪ An ∪ · · · = ∞

i=1 Ai;

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

13 / 16

slide-39
SLIDE 39

Set Operations

Generalized unions and intersections

Union A1 ∪ A2 ∪ · · · ∪ An = n

i=1 Ai;

A1 ∪ A2 ∪ · · · ∪ An ∪ · · · = ∞

i=1 Ai;

Intersection A1 ∩ A2 ∩ · · · ∩ An = n

i=1 Ai;

A1 ∩ A2 ∩ · · · ∩ An ∩ · · · = ∞

i=1 Ai;

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

13 / 16

slide-40
SLIDE 40

Application

Set covering problem

Input Universal set U = {u1, u2, · · · , un} Subsets S1, S2, · · · , Sm ⊆ U Cost c1, c2, · · · , cm

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

14 / 16

slide-41
SLIDE 41

Application

Set covering problem

Input Universal set U = {u1, u2, · · · , un} Subsets S1, S2, · · · , Sm ⊆ U Cost c1, c2, · · · , cm Goal Find a set I ⊆ {1, 2, · · · , m} that minimizes

i∈I ci,

such that

i∈I Si = U

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

14 / 16

slide-42
SLIDE 42

Application

Set covering problem

Input Universal set U = {u1, u2, · · · , un} Subsets S1, S2, · · · , Sm ⊆ U Cost c1, c2, · · · , cm Goal Find a set I ⊆ {1, 2, · · · , m} that minimizes

i∈I ci,

such that

i∈I Si = U

Applications Document summarization Natural language generation Information cascade

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

14 / 16

slide-43
SLIDE 43

Take-aways

Take-aways

Set Concepts; Set Operations; Applications.

MING GAO (DaSE@ecnu) Discrete Mathematics and Its Applications

  • Mar. 27, 2020

15 / 16