Вы находитесь на странице: 1из 6

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)

A set is a collection or group of objects or elements or members.


There is universal set called U
Notation for set:
List the elements between braces:
S = {a,b,c,d} = {b,c,a,d,d}
Specification by predicates:
S = {x | P(x)}
S contains all the elements from U which make all the predicate true
Brace notation with ellipses
S = {...., -3, -2, -1},
The negative integers
Notation
:
X is member of S atau X is an element of S: X S.
X is not a member of S: X

Common universal sets


R = Reals
N = Natural Numbers = {0,1,2,3,....}
Z = All integers = {..., -3,-2,-1,0,1,2,3,4,....}
Z+ = is the set of positive integer

Definition

SUBSETS
: The set A is a subsets of the set B, denoted A B if
x x A x B

Definition
Definition
Definition

: The void set, the null set, the Empty set denoted is the set with no members.
: If A B but A B denoted A B
: The set of all subset of a set A , denoted P (A), is called the power set of A
For Example: if A = {a,b} then P (A) = {, {a},{b},{a,b}}
Definition
: The Number of (distinct) elements in A denoted |A| is called the cardinality of A.
If the cardinality of a natural number (in N) then the set is called finite, else infinite.
For Example : A = {a,b} |{a,b}| = 2
|P ({a,b})| = 4
A is finite so is P (A)
|A| = n|P(A)| = 2 n
Sets can be both members and subsets of other sets.
For Example : A = {, {}}
A has two elements and four subsets: , {}, {{}}, {, {}}
is both a member of A and subsets of A.
Definition
: Cartesian Product of A with B , denoted A X B, is the set of ordered pairs
{<a,b>|A a b B}
Notation

: X Ai { a1 , a2 , a3 ,....an ai Ai }
i 1

For example : A = {a,b}, B = {1,2,3}


Syandra Sari

Page 1 of 6

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)


A X B = {<a,1>, <a,2>, <a,3>,<b,1>,b,2>,<b,3>}
SETS OPERATIONS
Definition
: Two sets A and B are equal , denoted A = B
x [ X A X B] A=B if A B and B A
Definition
:
The union of A and B denoted A U B is the set {X | X A X B}

The intersection of A and B, denoted A B is the set {X | X A X B} if the


intersection is void, A and B are said to be disjoint.
(X A )} alternative AC,{X | X A}

The complement of A , denoted

The difference of A and B , or the complement of B relative to A, denoted A-B, is the set
A

is the set { X|

The complement of A is U A
The symmetric difference of A and B, denoted A B is the set (A-B) U (B-A)
For Example : U = {0,1,2,3,4,5,6,7,8,9,10}
A = {1,2,3,4,5},
B = {,5,6,7,8} Then

B=

B=

A=
B=
AB=
B A=

B=

VENN DIAGRAM
A Useful geometric visualization tool (for 3 or less sets).

The universe

Each set is represented by a circle and its interior


All possible combination of the sets must be represented

Syandra Sari

is the rectangular box

Page 2 of 6

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)


FOR TWO SETS

FOR THREE SETS

Shade the appropiate region to represent the given set operation.

SET IDENTITIES
Set identities correspond to the logical equivalences.
For Example : The complement of the union s the intersection of the complements.
A B= A B
=========================
Table Identity
Set Identity
=========================
A
A

=A

Identity Laws

=A

=========================
A

Domination Laws

A
============================================
A

A= A

Idempotent Laws

AA=A
============================================
() = A
Complementation Laws
============================================
A

B=B

Commutative Laws

A B = B A
============================================
A

(B

C) = (A

B)

Associative Laws

A (B C) = (A B) C
=============================================
A

(B

C) = (A B)

(B C) = (A

(A C)

B) (A

Distributive Laws

C)

==================================================
AB=
A

De Morgans Laws

B=B

================================================
Syandra Sari

Page 3 of 6

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)


For Example : Use Builder Notation and Logical Equivalents to show that A I B A U B
Solution
: The following chain of equalities provides a demonstration of this identity.
A B = { x | x A B }
= { x | (x (AB)) }
= { x | (x A x B) }
={x|x

A x B}

={x|x A

x B }

={x|x A B }= A B
Set identities can also proved using membership tables.
For Example : Use a membership table to show that A (B C) = (AB)

To indicate that an element is in a set, a 1 is used .


To indicate that an element is not in a set, a 0 is used.

TABLE 2.

A MEMBERSHIP TABLE FOR DISTRIBUTIVE

B C A(B C)

AB AC (AB) (AC)

1
1
1
1
0
0
0
0

1
1
0
0
1
1
0
0

1
0
1
0
1
0
1
0

1
1
1
0
1
1
1
0

1
1
0
0
0
0
0
0

1
1
1
0
1
0
0
0

1
0
1
0
0
0
0
0

1
1
1
0
0
0
0
0

SAME
It is Proven that the identity is valid.
For Example : let A,B,C be sets show that A U ( B I C ) = ( C U B ) A
Solution
: We have
A U ( B I C ) = ( B I C ) by the first
= (B

C ) by the second

= (B

C )

= (C

B ) by the com. for union

De Morgans
De Morgans

by the com. for intersection

GENERALIZED UNION AND INTERSECTION

Syandra Sari

Page 4 of 6

(AC)

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)


Definition
:
The union of a collection of the sets is the set that contain those elements that are members of at
least one set in the collection.
A1 U A2 U A3 .......An =
Definiton
:
The intersection of a collection of sets is the set that contains those elements that are members
of all sets in the collection.
n

A1A2 A3... An =

Ai

i 1

Example : Ai = {i, i+1, i+2, ......} Then


n

U Ai
i 1

= i1 {i, i+1, i+2,.....} = {1,2,3,4.......} , and

i 1

Ai

= i1 = {i, i+1, i+2,....} = {n, n+1, n+2,....}

Computer Representation Of Set


One way to represant sets using computer is using an arbitrary ordering of the elements of the
universal set.
Assume that the universal set U is finite.
First, specify an arbitrary ordering of the elements of U for instance a1,a2,....an
Represent subset A of U with bit string of length n where the i-th bit in this string is 1 if ai
belongs to A and 0 if ai does not belong to A.
For Example : U= {1,2,3,4,5, 6,7,8,9,10}
What bit strings represent the subset of all odd integers in U , the subset of all even int in U?, the
subset of int not exceeding 5 inU?
Solution
:
Odd integers in U : { 1,3,5,67,9 } 1010101010
Even integers in U; { 2,4,6,8,10 } 0101010101
All integers in U not exceeded 5 : {1,2,3,4,5} 1111100000
How about operation set complement , intersection, and unions?

Syandra Sari

Page 5 of 6

STRUKTUR DISKRIT I-2, SETS (HIMPUNAN)


Complement = negasi
Intersection = AND
Union = OR

Syandra Sari

Page 6 of 6

Вам также может понравиться