68
Sets Discrete Mathematics (MA 2333) Faculty of Science Telkom Institute of Technology Bandung - Indonesia

Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Sets

Discrete Mathematics (MA 2333)Faculty of Science Telkom Institute of TechnologyBandung - Indonesia

Page 2: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Definition

A set is an unordered collection of objects. The objects in a set are also called the elements, or members, of the set. A set is said to contain its elements.

Page 3: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

By enumerating the elementsThe set is described by listing all its members between bracesExamples :

The set of all vowels in the alphabet: V={a,i,u,e,o}The set of odd positive integers less than 10:

O = {13,5,7,9} The set of positive integers less than 100 can be denoted by {1,2,3,...,99}R = { a, b, {a, b, c}, {a, c} }C = {a, {a}, {{a}} }K = { {} }

Set Representations

Page 4: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set RepresentationsBy enumerating the elements (cont)

MembershipMembership described using notation ∈x ∈ A : x is the element of set A; x ∉ A : x is not the element of set A

ExampleA = {1, 2, 3, 4, 5}, R = { a, b, {a, b, c}, {c} }K = {{}}

maka

{c} ∈ R{} ∈ K{} ∉ R

3 ∈ A7 ∉ A{a, b, c} ∈ Rc ∉ R

Page 5: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set RepresentationsBy using standard symbols

A set can be expressed using standard symbols that is usually used by academicians

N = the set of natural numbers = { 1, 2, ...}Z = the set of integers ={...,-2, -1, 0, 1, 2,...}Z+ = the set of positive integers = { 1, 2, 3, ...}Q = the set of rational numbersR = the set of real numbersC = the set of complex numbers

Page 6: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Representations

By property of the setA set can be described by property of all elements in the set{ x ⎥ property or properties of x }Examples

The set A of positive integers less than 6A = { x | x ∈ Z+, x < 6 } which equivalent with A = {1, 2, 3, 4, 5}

Page 7: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set RepresentationsBy using Venn Diagram

A set can also represented by listing all its members in a Venn diagramExample

U = {1, 2, …, 7, 8}, A = {1, 2, 3, 5} and

B = {2, 5, 6, 8}.

Venn Diagram :U

1 25

3 6

8

4

7A B

Page 8: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

CardinalityThe number of elements in a set A is called

the cardinality of the set ADenoted by : n(A) or ⎢A ⎢

ContohB = { x | x is prime numbers less than 10 }, or B = {2, 3, 5, 7} then ⏐B⏐ = 4 A = {a, {a}, {{a}} }, maka ⏐A⏐ = 3

Page 9: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Null SetIf a set does not have any elements, in other words cardinality of the set is zero, the set is called null set

Notation : ∅ or {}

Example E = { x | x < x }, then n(E) = 0A ={x | x is square root of x2 + 1 = 0, and x ∈ R}, n(A)=0

Page 10: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Null Set

Set {{ }} can also be written as {∅}{∅} is not null set because it has one element, that is null set

Page 11: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Subset

The set A is said to be a subset of Bif and only if every element of A is also an element of B. B is said to be superset of A.Notation: A ⊆ BVenn Diagram : U

AB

Page 12: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Subset

Example{ 2, 3, 4} ⊆ {1, 2, 3, 4, 5}{1, 2, 3,44} ⊆ {1, 2, 3, 4}N ⊆ Z ⊆ R ⊆ C

Page 13: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Subset

TEOREMA 1. For any set AA ⊆ A∅ ⊆ Aif A ⊆ B and B ⊆ C, then A ⊆ C

Page 14: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

∅ ⊆ A and A ⊆ A, then ∅ and A is called the improper subset of A.

Example :A = {1, 2, 3}, then {1, 2, 3} and ∅ are improper

subset of A.

Statement A ⊆ B is different with A ⊂ B

A ⊂ B : A is subset of B, but A ≠ B.A is proper subset of B.

Example:{1} and {2, 3} are proper subset of {1, 2, 3}

A = B if and only if A ⊆ B and B ⊆ A,

Subset

Page 15: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Equivalent SetsTwo sets are called equivalent if each set has the same cardinality.Notation : A ~ B ↔ ⏐A⏐ = ⏐B⏐

Example Suppose A = { 1, 4, 8, 7 } and B ={ a, b, c, d}, then A ~ B, because ⏐A⏐ = ⏐B⏐ = 4

Page 16: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

DisjointA and B are called disjoint if both sets do not have similar elementsNotation : A // B

Venn Diagram : U

A B

Example If A = { x | x ∈ Z+, x < 5 } dan B = {20, 30, 40 ... }, then A // B.

Page 17: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Power SetPower set of A is the set of all subsets of the set A, Notation : P(A) or 2A

If ⏐A⏐ = m, then ⏐P(A)⏐ = 2m.

ExampleIf A = { a, b }, makaP(A) = {∅ , { a }, { b }, { a, b }}P(∅) = {∅} {∅} adalah P({∅}) = {∅, {∅}}.

Page 18: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Operations

a. Intersectionb. Unionc. Complementd. Differencee. Symmetric Differencef. Cartesian product

Page 19: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

IntersectionNotation : A ∩ B = { x | x ∈ A and x ∈ B }

Page 20: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Intersection

ExamplesIf A = {2, 4, 7, 9, 10} dan B = {4, 10, 9, 18}, maka A ∩ B = {4, 9,10}Jika A = { 3, 5, 7 } dan B = { -4, 8 }, maka

A ∩ B = ∅.

It means: A // B

Page 21: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Union

Notation : A ∪ B = { x | x ∈ A or x ∈ B }

Contoh• If A = { 2, 5, 7 } and B = { 7, 5, 20 }, then

A ∪ B = { 2, 5, 7, 20 }• A ∪ ∅ = A

Page 22: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Complementor Ac = { x | x ∈ U, x ∉ A }A

ExamplesSuppose universe U = { 1, 2, 3, ..., 9 },•If A = {1, 3, 7, 9}, then Ac = {2, 4, 5, 6, 8}•If A = { x | x/2 ∈ P, x < 9 }, then Ac= { 1, 3, 5, 7, 9 }

Notation :

Page 23: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

DifferenceNotation : A – B = { x | x ∈ A and x ∉ B } = A ∩ Bc

Examples • if A = { 1, 2, 3, ..., 10 } and B = { 2, 4, 6, 8, 10 }, thenA – B = { 1, 3, 5, 7, 9 } and B – A = ∅

• {1, 3, 5} – {1, 2, 3} = {5}, but {1, 2, 3} – {1, 3, 5} = {2}

Page 24: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Symmetric Difference

Notation: A ⊕ B = (A ∪ B) – (A ∩ B) = (A – B) ∪ (B – A)

Example If A = { 2, 4, 6 } and B = { 2, 3, 5 }, then A ⊕ B = { 3, 4, 5, 6 }

Page 25: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Symmetric Difference

TEOREMA

Symmetric Difference meet the following properties:

A ⊕ B = B ⊕ A (commutative law)(A ⊕ B ) ⊕ C = A ⊕ (B ⊕ C )

(associative law)

Page 26: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Notation: A × B = {(a, b) ⏐ a ∈ A and b ∈ B }

Examples

C = { 1, 2, 3 }, D = { a, b }, then C × D = { (1, a), (1, b), (2, a), (2, b), (3, a), (3, b) }

A = B = set of real numbers, then A × B = set of all dots in a planar shape

CARTESIAN PRODUCT

Page 27: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

If A and B are finite sets, then: ⏐A ×B⏐ = ⏐A⏐ . ⏐B⏐Ordered pair (a, b) is different with (b, a), so that (a, b) ≠ (b, a)A × B ≠ B × A, for A or B is not null setIf A = ∅ or B = ∅, then A × B = B × A= ∅

CARTESIAN PRODUCT

Page 28: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

CARTESIAN PRODUCTExample : Enumerate all elements of these sets :(a) P(∅) (b) ∅ × P(∅) (c) {∅}× P(∅) (d) P(P({3}))

Answer:(a) P(∅) = {∅}(b) ∅ × P(∅) = ∅(c) {∅}× P(∅) = {∅}× {∅} = {(∅,∅))(d) P(P({4})) = P({ ∅, {4} }) = {∅, {∅}, {{4}}, {∅,

{4}} }

Page 29: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Identities

Identity laws:A ∪ Ø = AA ∩ U = A

Domination laws:A ∩ Ø = ØA ∪ U = U

Complement laws:A ∪ Ā = UA ∩ Ā = Ø

Page 30: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Identities

Idempotent laws:A ∩ A = AA ∪ A = A

Complementation laws:(Ac)c = A

Absorption laws:A ∪ (A ∩ B) = AA ∩ (A ∪ B) = A

Page 31: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Identities

Commutative laws: A ∪ B = B ∪ AA ∩ B = B ∩ A

associative laws:A ∪ (B ∪ C) = (A ∪ B) ∪ CA ∩ (B ∩ C) = (A ∩ B) ∩ C

Page 32: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Identities

Distributive laws:A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)

De Morgan laws:

=∩ BA BA∪

=∪ BA BA∩

Page 33: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Set Identities

0/1 laws

= U= ∅

∅U

Page 34: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Duality Principle

Duality Principle: Two different concepts can be exchangeed. The exchange provides true answerExample :

USA → steering is placed in front–leftIndonesia → steering is placed in front–left

Page 35: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Duality PrincipleRules:

In USAcars must take the right side of the roadin the highways, overtaking is done from the left sidewhen the red light is on, cars are allowed to directly turn right

In Indonesiacars must take the left side of the roadin the highways, overtaking is done from the right sidewhen the red light is on, cars are allowed to directly turn left

Duality PrincipleThe left-right principles can be exchanged. Rules applied in USA is used in Indonesia and vice versa

Page 36: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Duality Principle of Set

Suppose that S is identityinvolving set and operations like ∪, ∩ , and complement. If S* is identity that is the dual of S, by changing ∪ → ∩ , ∩ → ∪ , Ø→ U, U →Ø , while the complement is not changed, when the operations are applied to the identity S*, they provide correct answer

Page 37: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Duality Principle of Set

1. Identity law: A ∪ ∅ = A

Dual : A ∩ U = A

2. Domination law: A ∩ ∅ = ∅

Dual : A ∪ U = U

3. Complement law:

A ∪ A = U

Dual: A ∩ A = ∅

4. Idempotent law:

A ∪ A = A

Dual : A ∩ A = A

5. Absorption law :

A ∪ (A ∩ B) = A

Dual: A ∩ (A ∪ B) = A

Page 38: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Duality Principle of Set6. Commutative law:

A ∪ B = B ∪ A

Dual : A ∩ B = B ∩ A

7. Associative: A ∪ (B ∪ C) = (A ∪ B) ∪ C

Dual: A ∩ (B ∩ C) = (A ∩ B) ∩ C

8. Distributive law: A ∪ (B ∩ C)=(A ∪ B) ∩ (A ∪ C)

Dual: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

9. De Morgan law: BA∪ = A ∩ B

Dual : BA∩ = A ∪ B

10. 0/1 law

∅= U

Dual :

U = ∅

Page 39: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Inclusion-Exclusion Principle

Given two sets A and B:⏐A ∪ B⏐ = ⏐A⏐ + ⏐B⏐ – ⏐A ∩ B⏐⏐A ⊕ B⏐ = ⏐A⏐ +⏐B⏐ – 2⏐A ∩ B⏐

Given tree sets A, B, and C :⏐A ∪ B ∪ C⏐ = ⏐A⏐ + ⏐B⏐ + ⏐C⏐ – ⏐A ∩ B⏐ – A ∩C⏐– ⏐B ∩ C⏐ + ⏐A ∩ B ∩ C⏐

Page 40: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Inclusion-Exclusion Principle

Example: How many integers not exceeding 1000 are divisible by 7 or 11Solution: ⏐A⏐ = ⎣1000/7⎦ = 142, ⏐B⏐ = ⎣1000/11⎦ = 90, ⏐A ∩ B⏐ = ⎣1000/77⎦ = 12⏐A ∪ B⏐ = ⏐A⏐ + ⏐B⏐ – ⏐A ∩ B⏐

= 142 + 90 – 12 = 220

There are 47 integers that divisible by either 7 or 11.

Page 41: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Proving of Statement about Sets

Proving by membership table

Example:Let A, B, and C be sets. Proof that A ∩(B ∪ C) = (A ∩ B) ∪ (A ∩ C).

Page 42: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Proving of Statement about Sets

11111111

10111011

11011101

00000001

00001110

00001010

00001100

00000000(A ∩ B) ∪ (A ∩ C)A ∩ CA ∩ BA ∩ (B ∪ C) B ∪ CCBA

Page 43: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Proving of Statement about Sets

Proving by Venn diagramExampleLet A, B, and C be setsProof that A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) by Venn Diagram

Solution:

A ∩ (B ∪ C) (A ∩ B) ∪ (A ∩ C)

Page 44: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Proving by set algebraGiven sets A and BProof that (A ∩ B) ∪ (A ∩ Bc) = ASolution: (A ∩ B) ∪ (A ∩ Bc) = A ∩ (B ∪ Bc) (Distributive law)

= A ∩ U (Complement law)= A (Identity law)

Proving of Statement about Sets

Page 45: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

MultisetsMultisets are unordered collections of elements where an element can occur as a member more than once examples : A = {1, 1, 2, 2, 2, 3}, B = {3, 3, 3}, C = {2, 3, 4}, D = {}. Multiplicities of an element in a multiset is the number of occurrence of the element in the multiset. Examples: M = { 0, 2, 2, 2, 0, 0, 0, 1 }, multiplicity of 0 is 4, multiplicity of 1 is 1, and multiplicity of 2 is 3

Page 46: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Multisets

Set is a special case of multiset. In this case, the multiplicities of its element are 1 or 0.A set which multiplicities of its elements are 0 is null set

Page 47: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Multisets Operations

Let P and Q be multisets:P U Q is the multiset where the multiplicity of an element is the maximum of its multiplicities in P and Q.

Example: P = {a,a,a,c,d,d} and Q ={a,a,b,c,c}, P ∪ Q = {a,a,a,b,c,c,d,d }P ∩ Q is the multiset where the multiplicity of an element is the minimum of its multiplicities in P and Q.

Example: P = {a,a,a,c,d,d} dan Q = {a,a,b,c,c}

P ∩ Q = {a,a,c}

Page 48: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Multisets Operations

P – Q is the multiset where the multiplicity of an element is the multiplicity of the element in P less its multiplicity in Q unless this difference is negative, in which case the multiplicity is 0Example: P = { a, a, a, b, b, c, d, d, e } Q = { a, a, b, b, b, c, c, d, d, f } P – Q = { a, e }

Page 49: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Multisets Operations

P + Q, is the multiset where the multiplicity of an element is the sum of multiplicities in P and QExample: P = { a, a, b, c, c } Q = { a, b, b, d },P + Q = { a, a, a, b, b, b, c, c, d }

Page 50: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Fuzzy Sets

Page 51: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

Classical set theory requires that a set must have a well-defined property In practical, some sets do not have clear boundaries → fuzzy set theory

Page 52: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

A ={ 1, 2, 3, ….,9}

{ }10 than less xxA +Ζ∈=

{ }number big is xxB +Ζ∈=

B=?

Page 53: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

Fuzzy sets are used in artificial intelligence. Each element in the universal set U has a degree of membership, which is a real number in interval [0,1]In enumeration representation, The fuzzy set denoted by listing the elements with their degrees of membership (element with 0 degree of membership are not listed)

Page 54: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsLet we define a set :

”Big number” can be defined very relatively. For example, 10,000 can be said as ”big” or ”not big” number. Therefore, we need degree to represent how big 10,000 is. If we define membership degree of 10,000 is as much as 0.3, we can also define the degree of other natural number.

{ }number natural big is xxB +Ζ∈=

Page 55: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsLet we define degree for several number :

510=x

210=x410=x

5010=x

degree 0

degree 0,3

degree 1

degree 0,35

Page 56: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsA fuzzy set in a universe of discourse U is characterized by a membership function )(xAµthat takes values in the interval [0,1]

A fuzzy set is generalization of classical set by allowing the membership function to take any values in the interval [0,1]In other words, the membership function of a classical set can only take two values-zero and one, whereas the membership function of a fuzzy set is a continuous function with range [0,1]

Page 57: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsA fuzzy set A in U may be represented as a set of ordered pairs of a generic element x and its membership value, that is,

( )( ){ }UxxxA A ∈= µ,

ExampleLet F be a fuzzy set named “natural numbers close to six”. Then a possible membership function for F is

={0,1/3 + 0,3/4 + 0,6/5 + 1,0/6 + 0,6/7 + 0,3/8 + 0,1/9}

)(xFµU = set of natural numbers

Where x ∈ U

Page 58: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsExample

Let U be the integers from 1 to 10, that is U = {1,2,3,...,10}. Then the fuzzy set “several”may be defined asB = set of “several”

)(xFµ = {0,5/3 + 0,8/4 + 1/5 + 1/6 + 0,8/7 + 0,5/8}

Page 59: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

How to determine the membership functions?

Using the knowledge of human expertscan only give a rough formula of the membership function – fine tuning is requiredUsing data collected from various sensors to determine the membership functions

Page 60: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy SetsWhen U is continuous, a fuzzy set A is commonly written as

( )∫=U

A xxA /µ

where the integral sign does not denote integration; it denotes the collection of all points x ∈ U with the associated membership function )(xAµ

Page 61: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

Example Let U be interval [0,100] representing the age of ordinary humans. Then we may define fuzzy sets ”old”and ”teenage” as

Page 62: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets

Old Teenage

⎪⎪⎩

⎪⎪⎨

<

≤≤−

>

=

20,0

8020,60

2080,1

)(

x

xxx

xOldµ

⎪⎪⎪

⎪⎪⎪

<<−

<<−

≥≤≤≤

=

3016,14

30

106,4

630atau6,0

1610,1

)(

xx

xxxx

x

xTeenageµ

Page 63: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets OperationsWe assume that A and B are fuzzy set which defined on the same universe

)(1)( xx AAc µµ −=Complement

Intersection ( ))(),(min )( xxx BABA µµµ =∩

Union ( ))(),(max )( xxx BABA µµµ =∪

Page 64: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Fuzzy Sets Operations

U = {1, 2, 3, 4, 5, 6}A = { 0/1 + 0,2/2 + 0,6/3 + 0,9/4 + 1/5 + 0,8/6 }B = { 0,8/1 + 1/2 + 0,7/3 + 0,4/4 + 0,1/5 + 0/6 }

)(1)( xx AAc µµ −=

= { 1/1 + 0,8/2 + 0,4/3 + 0,1/4 + 0/5 + 0,2/6 }

Ac =

BA∩ ( ))(),(min )( xxx BABA µµµ == ∩

= { 0/1 + 0,2/2 + 0,6/3 + 0,4/4 + 0,1/5 + 0/6 } BA∪ ( ))(),(max )( xxx BABA µµµ == ∪

= { 0,8/1 + 1/2 + 0,7/3 + 0,9/4 + 1/5 + 0,8/6 }

Page 65: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Exercises

Determine whether each of these statements is true or false

φ∈0

{ }0∈φ{ } φ⊂0

{ }0⊂φ

{ } { }00 ⊂

{ } { }00 ⊆

{ } { }φφ ⊆a.

e.

b.

f.

c.

g.

d.

Page 66: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Exercises

{ }{ }aa,

{ }{ }a

{ }{ }φφ,

{ } { }{ }{ }aaaa ,,,

{ } { }{ }{ }φφφφ ,,,

a.{a}

b

c

d

e

f

What is the cardinality of each of these sets ?

Page 67: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

Exercises

Given setsU = {1, 2, 3, …., 8, 9} → UniverseA = {1, 2, 3, 4} B = {2, 4, 6, 8}C = {3, 4, 5, 6}

BA∪CA∪CB∪

BB ∪

a. b. c. d.

( ) CBA ∪∪( )CBA ∪∪( )CBA ∪∩

( ) ( )CABA ∩∪∩

e. f. g. h.

( )cBA∪cc BA ∩

h. i. ( ) CBA −∩( )cBA −

j. k.

Page 68: Chapter I Set - SI-35-02 · Bandung - Indonesia. Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology ... A is proper subset of B. Example: {1} and

Discrete Mathematics (MA 2333) – Faculty of Science Telkom Institute of Technology

References

Rosen, Kenneth H., Discrete Mathematics and Its Applications 5th Ed, McGraw-Hill, New York, 2003Munir, Rinaldi., Matematika Diskrit, Edisi Kedua, Penerbit InformatikaBandung, Bandung, 2003