0% found this document useful (0 votes)
84 views18 pages

CSC 205 Lecture Notes

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

TEACHING SCHEDULE

COURSE: CSC 205 – DISCRETE COMPUTATION (3 Units)

DAYS – Wednesdays
VENUE: MP03/04
TIME: 11-1 PM
LECTURE TYPE – Theory

1 SETS
A “set” is a collection of objects. For example, the collection of four letters a, b, c and d is a set,
which is written as L = {a, b, c, d}

The objects comprising a set are called its “elements” or “members”.


A set having only one element is called a “singleton”. A set with no element at all is called the
“empty set”, which is denoted by ∅.
It is essential to have a criterion for determining, for any given thing, whether it is or is not a
member of the given set. This criterion is called the “Membership criterion” of the set.
There are two common ways to indicate the members of a set:
(i) List all the elements, e.g., {a, e, i, o, u}.
(ii) Provide some kind of an algorithm or a rule, such as a grammar.
Let us now take a look at the notation that is being used to denote sets.
(a) To indicate that x is a member of the set S, we write x ∈ S.
(b) If every element of set A is also an element of set B, we say that A is a “subset” of B, and
write A ⊆ B.
(c) If every element of set A is also an element of set B, but B also has some elements not
contained in A, we say that A is a “proper subset” of B and write A ⊂ B.
(d) We denote the “empty set” as {} or ∅.
The set operations are as described below.
(a) Union
The “union” of two sets is the set that has objects that are elements of at least one of the two
given sets, and possibly both

That is, the union of sets A and B, written A ∪ B, is a set that contains everything in A, or in B,
or in both.
A ∪ B = x {:x ∈ A or x ∈ B}
Example: A = {1, 3, 9} B = {3, 5}
Therefore, A ∪ B = {1 ,3 ,5, 9}
b) Intersection
The “intersection” of sets A and B, written A ∩ B, is a set that contains exactly those
elements that are in both A and B.
A ∩ B = x {: x ∈ A and x ∈ B}
Example: Given A = {1, 3, 9}, B = {3, 5}, C = {a, b, c}
A ∩ B = {3}
A ∩ C = {}
(c) Set Difference
The “set difference” of set A and set B, written as A–B, is the set that contains everything that is
in A but not in B.
A − B = x {: x ∈ A and x ∉ B}
Given A = {1 ,3, 9}, B = {3, 5}
A − B = {1, 9}
(d) Complement
The “complement” of set A, written as A is the set containing everything that is not in A.
Properties of set operations
Some of the properties of the set operations follow from their definitions. The following laws
hold for the three given sets A, B and C.
Idempotency
A∪A=A
A∩A=A
Commutativity
A∪B=B∪A
A∩B=B∩A

Asso cia tiv ity:


( A ∪ B ) ∪ C = A ∪ (B ∪ C )( A ∩ B ) ∩ C = A ∩ (B ∩ C )
Exercise: Student should solve (b) and (c)

You might also like