Sunteți pe pagina 1din 37

Computer Science 56 Discrete Mathematical Structures in Computer Science I

Georg Cantor (1845-1918)


A Russian-born mathematician who pioneered the study of set theory and its role in the foundation of mathematics. He is known Father of Set Theory because of his work.

A Set is an unordered collection of objects. The objects in the set are also called the elements or members of the set.
Elements of the set must be: Distinct a set should not contain duplicates. Unordered the ordering of elements in the set is
insignificant. Well-defined one should be able to determine if a certain element belongs to the set.

Elements of the set are enclosed in braces {} and each element is separated by comma.
Examples:
1. The set of vowels in English alphabet can be written as V = {a, e, i, o, u} 2. The sets {1, 1, 2, 3}, {1, 2, 3, 3}, and {2, 3, 1, 3} can simply be written as {1, 2, 3}

A set may be finite or infinite.

A set is finite if its elements can be counted or enumerated. A set is infinite if its elements cannot be counted or enumerated.
Examples: Tell whether each set is finite or infinite.
1. Set of capital letters in English alphabet 2. Set of real numbers 3. {1, 2, 3, }

Cardinality of a set
it is the number of elements in a finite set A denoted by |A|.

Example:
If A = {a, b, c, d, e}, then |A| = 5.

Roster Method
List down or enumerate the elements of the set. This method can only be used to represent finite sets.

Rule Method
give a rule which states the property satisfied by all of the elements in the set. It is usually in the form of {x|x has the property} which reads, the set of all elements x such that x

has the property

Example: Represent the set of all counting numbers between 1 and 10, inclusive. Let the set be A. Roster Method:
A = {1, 2, 3, 4, 5, 6, 7, 8, 9 ,10} A = {1, 2, , 10}
A = {x | 1 x 10 and x is a counting number}

1.

2.

Rule Method:

Symbol
N Z
Q R C

Set Denoted
Set of Natural numbers Set of integers
Set of rational numbers Set of real numbers Set of complex numbers

Superscript symbols such as +, -, represent positive, negative, and nonnegative values respectively.

Universal Set
The totality of all elements under consideration. Denoted by the symbol U.

Empty Set

set containing no element and is also called a null set. Denoted by or {}. || = 0

Note: {} is not an empty set, but a set containing the empty set.

The symbol is used to denote set membership. x A (x is an element of set A) if and only if x is an element of set A or x is in A. x A if x is not an element of set A.

Example: Tell whether the each of the ff. is an element of A = {1, 2, 3, {1}}
1. 2. 3. 4. 4 1 {1} {2}

The symbol is used to denote set containment. A B (set A is a subset of set B) if and only if every element of set A is an element of set B. A B if A is not a subset of B.

Example: Let A = {1}, B = {{1}}, C = {1, {1}}


A C and B C A B since 1 {{1}}

Set A is said to be a proper subset of B (denoted by A B) if and only if A B and A B. Thus, A B (A B A B)


Example: Let A = {1}, B = {{1}}, C = {1, {1}}
A C and B C A B since A B and A A since A = A

Set A is equal to set B, denoted by A = B, if and only if sets A and B have the same elements.
Example: if A = {1, 3, 2} and B = {1, 2, 3} then A = B

Also, (A = B) (A B) (B A)

Let A, B and C be any set,


1. A 2. A A 3. A B (A B) 4. (A B) (B C) A C

The empty set is a subset of every set


Every set is a subset of itself If A is a proper subset of B, then A is a subset of B Transitive Rules

5. (A B) (B C) A C

Remark: Every set is a subset of itself but not set is a n element of itself.

The implicit definition of sets does not allow a set to be an element of itself since without this restriction, we are led to Russells Paradox.
Let R be the set of all sets that are not elements of themselves: R = {S | S S}

To prove that R does no exist:


a) Assume R R
By definition, since R is not an element of itself, then R must be a member of our given set R, that is R R. Therefore, R R implies R R, which is contradiction.

b) Assume R R
By definition, since R R, then R must be a set that is not an element of itself, that is R R. Therefore, R R implies R R, which is a contradiction.

We are led to the paradoxical conclusion that R R if and only if R R. Hence, the set R = {S | S S} does not exist.

Analogy:
There was once a barber. Some say that he lived in Seville. Wherever he lived, all of the men in this town either shaved themselves or were shaved by the barber. And the barber only shaved the men who did not shave themselves. Who shaves the barber?

A.

Represent the set of multiples of 3 between 1 to 20 using


1. Roster Method 2. Rule Method

B.

Let A = {{x}}, B = {x, {x}}, C = {x, {x, {x}}} Write T if the statement is true, write F if false.
1. 2. 3. 4. xA AB CA B

Power set of a set


The power set of set A, denoted by p(A), is the set of all subsets of set A. That is,
p(A) = {x | x A} |p(A)| = 2|A|

Example: if A = {1, 2, 3} then p (A) = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} |p (A)| = 8

Operation

Set Representation

Description
Set of all elements that are not in A but in U Set of all elements that are in either sets A or B Set of all elements that are in both sets A and B Set of all elements that are in set A but not in set B Set of all elements that are in either set A or B but not both

Complement of A A' = {x | x U x A}

Union of A and B

A B = {x | x A x B}

Intersection of A and B Difference of A and B (relative complement) Symmetric Difference of A and B

A B = {x | x A x B}

A B = {x | x A x B}

Can also be expressed as:


A B = A B'

A B = {x | (x A x B) (x A x B)}

Can also be expressed as:


A B = (A B) (A B)

Example: Let A = {1, 3, 5, 7}, B = {1, 2, 3, 4} and U = {1, 2,, 10}. Determine:
1. 2. 3. 4. 5. 6. 7. AB AB AB A' B' AB BA

If A B = , or A and B dont have common elements, then they are said to be disjoint. Otherwise, A and B are said to be joint sets.

Consider the ff sets: U = {1, 2,, 10} A = {1, 2, 3, 4, 5} B = {2, 4, 6, 8}

C = {1, 3, 5, 7, 9} D = {1, 2, 9, 10}

Determine:
1. 2. 3. 4. 5.

AB D' A (B - C) p (D) (A B) (A B)'

John Venn (1834-1923)


He presented a systematic development of a method that uses geometric figures, known as Venn Diagrams, in his book Symbolic Logic.
Venn Diagrams are used to analyze logical arguments and to analyze relationships between sets.

Venn Diagram gives a graphical representation of sets.


Rectangle represents the universal set Circles or any closed polygons represents the subsets of universal set.

Venn diagrams may also include elements or cardinality of the sets. Example: |A| = 15, |B| = 25, |A B| = 10, U = 35 What is |(A B)|?

Example: Illustrate the ff sets given that:


1. U = set of all UPLB students A = set of all sophomores B = set of all juniors 2. U = set of all UPLB students C = set of all male students D = set of all female students

Venn diagrams can be used to illustrate set concepts. Venn diagram for some set concepts:

AB

Example: Draw a Venn Diagram for each of the ff:


1. 2. 3. 4. A A A A B B B B

1. 2. 3. 4. 5.

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

Double Negation (Involution Law)


De Morgans Laws Commutative Laws B) B) B) B) C C (A (A Associative Laws C) C) Distributive Laws

A A A 7. A A 8. A A 9. A A 10. A
6.

A=A A=A =A U=A A = U A = U=U = (A B) = A (A B) = A

Idempotency Laws Identity Laws Inverse Laws (Complement Laws) Domination Laws (Bound Laws) Absorption Laws

Let A, B U
1. 2. 3. 4. A - B = A B A B = (A B) - (A B) (A B) A (A B) The following statements are equivalent to each other: a. A B b. A B = B c. A B = A d. B A If A , B U then A and B are disjoint if and only if A B = A B.

5.

S-ar putea să vă placă și