You are on page 1of 30

MTH1114 Computer Mathematics

UNIT 4
SET THEORY
Zaharin Yusoff (Prof Dr)

SCHOOL
UNIT 4 – Set Theory
UNIT 4 – Set Theory

 Sets and Subsets

 Set Operations and the Laws of Set Theory


ATA
D
 Double complement
 DeMorgan’s Law
 Commutative
 …

(1) Expressing sets

(2) Set operators


(3) Using Laws of Set Theory

(4) Use of Venn Diagrams


4.1 Sets and Subsets
(pg. 123 136)
Sets and Subsets

A set can be designated by listing its elements within set braces. The elements are
from a universe, or universe of discourse for, usually denoted by U.

An element a of a set A is written a ∈ A,


An element b of the universe U which is not in A is written b ∉ A.

Example
Let the universe be integers, i.e. U = Z.
if A is the set consisting of the first five positive integers, then we write
A = {1, 2, 3, 4, 5}.
Here 2 ∈ A, but 6 ∉ A.

Another standard notation for this set provides us with


A = { x ½x ∈ Z and 1 £ x £ 5}
 The vertical line | within the set braces is read “such that”.
 The symbols {x |… } are read “the set of all x such that …”.
 The properties following | help us determine the elements of the set that are
being described.
Example
For U = {1, 2, 3, …}, the set of positive integers, we consider the following sets.
a) A = {1, 4, 9, …, 64, 81}
= {x²½x Î U, x² < 100}
= {x²½x Î U Ù x² < 82}

b) B = {1, 4, 9, 16} = {y²½y Î U, y² < 20}


= {y²½y Î U, y² < 23}
= {y²½y Î U Ù y² ≤ 16}

c) C= {2, 4, 6, 8, …} = {2k½k Î U}

Sets A and B are examples of finite sets, whereas C is an infinite set. For any
finite set A, |A| denotes the number of elements in A and is referred to as the
cardinality, or size, of A. In this example, we find that |A| = 9 and |B| = 4.

Here, the sets B and A are such that every element of B is also an element of A.
This important relationship occurs throughout set theory and its applications, and it
leads to the following definition.
If C, D are sets from a universe U, we can say that C is a subset of D and write
C Í D, or D  C, if every element of C is an element of D.
If, in addition, D contains an element that is not in C, then C is called a proper
subset of D, and this is denoted by C Ì D or D É C.

Note that for all sets C, D from a universe U, then


CÍD ⇔ "x [ x Î C Þ x Î D],

Also, we find that for all subsets C, D of U,


CÌDÞCÍD
[But in general, we do not find that C Í D Þ C Ì D]

When C, D are finite,


C Í D Þ ½C½£½D½, and
C Ì D Þ ½C½<½D½

For a given universe U, the sets C and D (taken from U) are said to be equal,
and we write C = D, when C Í D and D Í C.

We note that for any sets C, D Í U, (that is, C Í U and D Í U ),


C Ì D Û C Í D Ù C ¹ D.
For a given universe U, let A, B be sets taken from U. Then we may write
A Í B Û "x [ x Î A Þ x Î B ].
So A Í B Û Ø"x [ x Î A Þ x Î B ]
Û $x Ø[ x Î A Þ x Î B ]
Û $x Ø[Ø(x Î A) Ú x Î B ]
Û $x [x Î A Ù Ø(x Î B ) ]
Û $x [x Î A Ù x ÏB].
Hence, A Í B if there is at least one element x in the universe where x is a
member of A but x is not a member of B.

In a similar way, because


A = B Û A Í B Ù B Í A, then
A ¹ B Û Ø(A Í B Ù B Í A)
Û Ø(A Í B) Ú Ø(B Í A)
Û A Í B Ú B Í A.
Two sets A and B are not equal if and only if
a) there exists at least one element x in U where x Î A but x ÏB, or
b) there exists at least one element y in U where y Î B and y Ï A. or
c) perhaps both (a) and (b) occur.
Example
Let U = {1, 2, 3, 4, 5, 6, x, y, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}} Then ½U½ = 11.
a) If A = {1, 2, 3, 4} then ½A½= 4 and
i) A ÍU ii) A ÌU iii) A Î U
iv) {A} Í U v) {A} Ì U but vi) {A} ÏU
b) Let B = {5, 6, x, y, A} = {5, 6, x, y, {1, 2, 3, 4}}. Then ⎮B⎮ = 5 not 8. And

i) A Î B ii) {A} Í B and iii) {A} Ì B.


But
iv) {A} Ï B v) A Í B and vi) A Ë B

Let A, B, C Í U.
a) If A Í B and B Í C, then A Í C.
b) If A Ì B and B Í C, then A Ì C.
c) If A Í B and B Ì C, then A Ì C.
d) If A Ì B and B Ì C, then A Ì C.
The null set, or empty set, is the (unique) set containing no elements. It is
denoted by Æ or {}.
½Æ½= 0 but {0} ¹ Æ. Also Æ ¹{Æ} because {Æ} is a set with one element,
namely, the null set.

For any universe U, let A Í U. Then


Æ Í A, and if A ¹ Æ, then Æ Ì A

If A is a set from universe U, the power set of A, denoted P(A), is the collection
(or set) of all subsets of A.

C = {1, 2, 3, 4}.
P(C) = {Æ, {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3},
{1, 2, 4}, {1, 3, 4}, {2, 3, 4}, C}.

In general, for any finite set A with ½A½= n ³ 0, we find that A has 2n subsets and
½P (A)½= 2n.
For any 0 £ k £ n, there are subsets of size k. Counting the subsets of A,
Sets of Numbers

Z = the set of integers = {0, 1, -1, 2, -2, 3, -3, …}


N = the set of nonnegative integers or natural numbers =
{0, 1, 2, 3, …}
Z+ = the set of positive integers = {1, 2, 3, …} = {x ∈ Z ⎮ x >
0}
Q = the set of rational numbers = {a/b⎮a, b ∈ Z, b ≠ 0}
Q+ = the set of positive rational numbers = {r ∈ Q ⎮ r > 0}
Q* = the set of nonzero rational numbers
R = the set of real numbers
R+ = the set of positive real numbers
R* = the set of nonzero real numbers
C = the set of complex numbers = {x + yi ⎮ x, y ∈ R, i2 = -
1}
C* = the set of nonzero complex numbers
4.2 Set Operations and the Laws of Set Theory
(pg. 136  147)
For A, B Í U, we define the following: U

a) A È B (the union of A and B) = {x½x Î A Ú x Î B }. A

b) A Ç B (the intersection of A and B) = {x½x Î A Ù x Î B }.


c) A Δ B (the symmetric difference of A and B) AÇB
= {x½(x Î A Ú x Î B) Ù x Ï A Ç B}
= {x½x Î A È B Ù x Ï A Ç B}.
B
If A, B Í U then A Ç B, A È B, A Δ B Í U.

Example U = {1, 2, 3, …, 9, 10} A = {1, 2, 3, 4, 5}


B = {3, 4, 5, 6, 7} C = {7, 8, 9}

a) A Ç B = {3, 4, 5 } b) A È B = {1, 2, 3, 4, 5, 6, 7}
c) B Ç C = {7} d) A Ç C = Æ
e) A Δ B = {1, 2, 6, 7} f) A È C = {1, 2, 3, 4, 5, 7, 8, 9}
g) A Δ C = {1, 2, 3, 4, 5, 7, 8, 9} U

Let S, T, Í U. Then sets S and T are called disjoint, or S


mutually disjoint, when S Ç T = Æ.

If S, T Í U, then S and T are disjoint if and only if S È T = S Δ T. T


For a set A Í U, the complement of A, denoted U – A, or A,
is given by {x½x Î U Ù x Ï A } U

U = {1, 2, 3, …, 9, 10},
A
A = {1, 2, 3, 4, 5}, B = {3, 4, 5, 6, 7} C = {7, 8, 9}. A

A = {6, 7, 8, 9, 10}, B = {1, 2, 8, 9, 10}, C = {1, 2, 3, 4, 5, 6, 10}.

For A, B Í U, the (relative) complement of A in B, denoted U


B – A, is given by {x½x Î B Ù x Ï A}. B
B−A
For the same sets as above,
a) B – A = {6, 7} b) A – B = {1, 2} A
c) A – C = A d) C – A =
C
e) A – A = Æ f) U – A = A
For any universe U and any sets A, B Í U, the following statements are equivalent:
a) A Í B b) A È B = B
c) A Ç B = A d) B Í A
[Best proven (a) Þ (b), (b) Þ (c), (c) Þ (d), (d) Þ (a).]
Laws of Set Theory

As with logic and its operators (AND, OR, etc.), where we could establish the
Laws of Logic, to establish:

• truth values
• equality of expressions
•…

… for sets and its operators (intersection, union, etc.), we can also establish
the Laws of Set Theory, to:

• simplify expressions
• establish equality of expressions
•…
Example

Simplify the expression (A ÈB ) Ç C È B.

(A È B) Ç C È B Reasons

= ((A È B) Ç C) Ç B DeMorgan’s Law


= ((A È B) Ç C) Ç B Law of Double Complement
= (A È B) Ç (C Ç B) Associative Law of Intersection
= (A È B) Ç (B Ç C) Communicative Law of Intersection
= [(A È B) Ç B] Ç C Associative Law of Intersection
=BÇC Absorption Law

The steps and reasons in this example are the same as those for simplifying
the statement

Ø[Ø [(p Ú q) Ù r] Ú Øq] to the statement q Ù r


Example

Using the Laws of Set Theory, simplify the following expression.


State the laws used for each step.


= ∩
=
=
=
=
Venn Diagrams & Membership Tables

Note that equality of set expressions may also be established using the
following – which can be used to establish the Laws of Set Theory:

• Venn diagrams
• Membership tables (similar to truth tables in logic)
•…
In the four Venn diagrams above, the shaded region in (a) represents the set A,
whereas A is represented by the unshaded area. The shaded region in (b) comprises
A È B; the set A Ç B is represented by the shaded region in (c). The Venn diagram for
A – B is given in (d).

In the above, Venn diagrams are used to establish the second of DeMorgan’s Laws.
(a) has everything except A Ç B shaded, so the shaded portion represents A Ç B.
We now develop a Venn diagram to depict A È B. In (b), A is the shaded region
(outside the circle representing set A). Likewise, B is the shaded region shown in (c).
When the results from (b) and (c) are put together, we get the Venn diagram for their
union in d). Since the shaded region in part (d) is the same as that in part (a), it
follow that A Ç B = A È B.
One more technique for establishing set equalities is the membership table
A, B Î U, an element x Î U satisfies exactly one of the following four situations:
a) x Ï A, x Ï B b) x Ï A, x Î B
c) x Î A, x Ï B d) x Î A, x Î B

Referring to the tables, the third row


in table (a) shows that x Î A, x Ï B.
So, x Ï A Ç B but x is in A È B.

The table below demonstrates the Distributive Law of union over intersection.

Since these columns are identical, we conclude that


A È (B Ç C) = (A È B) Ç(AÈC).
Note that each of the eight rows corresponds with exactly one of the eight regions
in the Venn diagrams earlier
Example
Using the membership table, determine whether both expressions
below are equal or not.
4.3 Counting and Venn Diagrams
(pg. 148  150)
The following are some counting for cardinalities of sets, which are
probably easiest viewed using Venn diagrams.

A È A = U and A Ç A = Æ, then ½A½+½A½= ½U½ or ½A½=½U½-½A½.


If ½A Ç B½= 0, then ½A È B½= ½A½+½B½.
If A and B are finite sets, then ½A È B½ = ½A½+½B½- ½ A Ç B ½.
Finite sets A and B are (mutually) disjoint if and only if ½A È B½ = ½A½+½B½.

For finite sets A, B and C


½A È B È C½ = ½A½+½B½+½C½-½A Ç B½-½A Ç C½ -½B Ç C½+ ½A Ç B Ç C½.

From the formula for ½A È B È C½ and DeMorgan’s Law, we find that if the
universe U is finite, then

½A Ç B Ç C½

= ½A È B È C½

= ½U ½- ½A È B È C½ (expand this one by one)

= ½U ½-½A½-½B½-½C½+ ½A Ç B½+ ½A Ç C½ + ½B Ç C½- ½A Ç B Ç C½.


The following are other instances of counting, using Venn diagrams.

Example
In a class of 50 college freshmen, 30 are studying BASIC, 25 studying PASCAL, and
10 are studying both. How many freshmen are studying either computer language?

= 30 + 25 – 10 = 40

How many are are studying exactly


one of the computer languages?
20 + 15 = 35
Exercise
During freshmen orientation at a small liberal arts college, two showings of the latest
James Bond movie were presented. Among the 600 freshmen, 80 attended the first
showing and the 125 attended the second showing, while 450 didn’t make it to
either. Showing. How many of the 600 freshmen attended twice?
There is a boarding school with 30 students, and part of their activities is
to play sports, the most popular of which are Badminton, Hockey and
Volleyball (and no other games will be considered). It is found that the
following are true:

− 15 students play Hockey


− 15 students play Badminton
− 12 students play Volleyball
− 3 students play all three games
− 7 play Hockey and Badminton
− 6 play Hockey and Volleyball
− 5 play Badminton and Volleyball

Given the Venn diagram

a) Total number of distinct situations = 8

b) Plays exactly one game = 15

c) No games at all = 3
A group of 200 people are asked which of these grand slam tournaments
that they have attended. The tournaments inquired about are the Malaysian
Open, the Wimbledon and the Australian Open. A total of 10 people have
been to all three tournaments, 25 people have been to the Wimbledon and
the Australian Open, 30 people have been to the Malaysian Open and the
Australian Open, 40 people have been to the Malaysian Open and the
Wimbledon, 110 people have been to the Malaysian Open, 95 people have
been to the Wimbledon and 50 people have been to the Australian Open.

a) Venn diagram
M W
b) Exactly two tournaments?
50 30 40
30 + 20 + 15 = 65 200
10
c) Wimbledon or Australian Open
20 15
30+40+10+15+20+5 = 120
d) No tournament at all 30 5
A
30
THANK YOU TERIMA KASIH

MERCI ARIGATO/ OKINI

GRAZZIE GO MA SSEUM NI DA

GRACIAS SHUKRIYA

SPASIBA XIE-XIE NI

DANKE KAMSIAH / MMKOI

MANGE TAK JABAI INAU

NAN DHRI NGGO BUTE KABU

CAM ON KOP KUN KAH

You might also like