You are on page 1of 49

Set Theory

A B

C
SETS
MEMBERSHIP
Defining Sets CONTAINMENT/SUBSET

VENN DIAGRAMS
UNION COMPLEMENT
INTERSECTION
difference
POWER SETS
Sets
A set is a collection of objects, called elements
of the set.

• A set can be represented by listing its


elements between braces: A = {1, 2, 3, 4, 5}.

• The symbol  is used to express that an


element is belongs to a set, for instance
3A.

• Its negation is represented by, e.g. 7A.


Examples of common notation to represent
numbers:

• Z ={x|x is integer number} / Z +


Z consists of all integers: …….-2,-1,0,1,2,…….
• Q = { x| x is rational number}
Q consists of numbers can be written a/b, b is not 0
• N = { x | x is a Natural number}
• N consist of positive integers and zero : 0,1,2,3,….
• R = the set of Real numbers or the set f numbers
written with a decimal point such as 3.14159
• empty set, , { }.
Defining Sets
• Sets can be defined directly:
Roster
e.g. {1,2,4,8,16,32,…}, form

{BIT1113 , BIT1073,…………}

{ 1 , 3 , 5, ……….., 21 }
The ordering of the elements is not important and
repetition of elements is ignored, for example

{1, 3, 1, 2, 2, 1} = {1, 2, 3}.


{A,B,C} = {C,B,A} = {A,A,B,C,B}

• A set can be an element of another set.


{1,{2},{3,{4}}}
Defining Sets by Predicates

An alternative way to define a set is by Set-builder form


when the roster method is cumbersome or impossible.

Set-builder form, is by stating a property (predicate)


P(x) verified by exactly its elements:
The set of elements, x, in A such that P (x) is true.

In general:
A = {xU | P(x)}, where U is the universe of discourse in
which the predicate P(x) must be interpreted,
or
A = {x | P(x)} if the universe of discourse for P(x) is
implicitly understood.
for instance,
A = {x  Z | 1  x  5} = “set of integers x
such that 1  x  5” which is

A = {1, 2, 3, 4, 5}.

Example 2:
Set B = {1,3,5,……..,21}
= { x | 1 ≤ x ≤ 21 and x is odd }
Principle of Extension

Two sets are equal if and only if they


have the same elements, i.e.:
A = B  x (xA  x  B) .



Symbol Meaning Example Read as

“x is an element of A” or “x
 element of xA
in A”
“A is a subset of B” ,
 Or  subset A B all elements of A are in B,

 union A B “ A union B”

 intersection A B “A intersect B”

` complement A` or Ac “A complement”
Membership , 
x  A ; x is an element of A or x is in A

Examples:
Given a set as { 7, “Ahmad”, /2 , T }

/2  {7, “Ahmad”, /2, T }

/3  {7, “Ahmad”, /2, T }

14/2  {7, “Ahmad”, /2, T }

7 

2/3  
improper subset Subset / Containment

AB
A is a subset of B
A is contained in B

We say that A is a subset of B if and only if


every element of A is also an element of B.

Examples:   every set,


AA
Containment / Subset
A is a proper subset of B, represented “A  B”, if
A  B but A  B, i.e., there is some element in B
which is not in A.

Example:
Let A ={1,2,3,4,5}, B={1,2,3,4,5,6,7} and
C={1,2,3,4,5}
Thus,
A  B , C  B, and A  C
A  B (wrong)
exercise
1. Suppose that A={2,4,6}, B={2,6} and C={4,6}.
Determine which of these sets are subset of
which other of these sets.
B A
CA

2. Determine whether the following pairs of sets are equal.


a. {1,3,5} and {5,1,3}. {1,3,5} = {5,1,3}
b. {{1}} and {1,{1}}. {{1}}  {1,{1}}
Basic Operations on Sets

For any two sets A and B, the following set operations


are defined:

union: A  B = {x (x  A)  (x  B) }

intersection: A  B = {x (x  A)  (x  B) }

difference: A-B = {x  (x  A)  (x  B) }

complement: Á = {x  U x  A} = U-A
where U be a universal set and A,B be two
subsets of U . The set of elements (in the
universal set) that do not belong to a given set.
Symmetric Difference: AB
Given two sets, their symmetric difference
is the set of elements that belong to either
one of the set but not both.

AB = {x | (x  A)  (x  B)} .
It can be expressed also in the following way:
AB = A  B − A  B = (A − B)  (B − A) .

Example 1:
Find AB if A = {1, 3, 5} and B = {1, 2, 3}.

Example 2:
Find SJ if S = {c, d, f, g} and J = {d, b, a, c}.
Example 1:
Find AB if A = {1, 3, 5} and B = {1, 2, 3}.

AB= { 5, 2}
A-B = {5}
B-A={2}

Example 2:
Find SJ if S = {c, d, f, g} and J = {d, b, a, c}.

SJ = {f, g, b, a}
J-S = {b,a}
S – J={f, g}
Venn diagrams

A Venn diagram is a graphical representation of sets as


enclose area in the plane. In the diagram shown in the
following page, the universal set U is represented by
the interior of a rectangle, and the other sets are
represented by disks lying inside the rectangle.
U U U
B A B A A B

Figure 1 Figure 2 Figure 3

Figure 1 represents A  B and A  B.


Figure 2 shows that A and B are disjoint.
Figure 3 shows that A and B are (intersection)
not disjoint.
Union 

The union of two sets A and B, denoted by A  B, is the


set of all elements which belong to A or B or both i.e.
A  B = {x : x  A or x  B}

Figure 4 A  B is shaded.
Intersection 
The intersection of two sets A and B, denoted by
A  B, is the set of elements common to both
A and B, i.e.
A  B = {x : x  A and x  B} U

A B

Figure 5 A  B is shaded.

Note : If A  B =  then A and B are disjoint.


Example
Let A = { a, b, c, d, e }, B = { c, d, e, f, g }
and C = { a, e, i, o, u }.

then A  B = { c, d, e }

BC ={e}

C  A = { a, e }
Complement Á
The complement of a set A, denoted by Á (or A c ) , is
the set of elements which do not belong to A. It is the
same as the difference of the universal set U and A.

Á = {x: x  U, x  A}

Figure 7: Á is shaded.
Example
Let U = R. Consider the sets A = {xR|x < −1
or x > 1} and
B = {xR|x  0}. Find A c ?

Solution:
Ac = [−1, 1].
Difference
The difference of set A and B, denoted by A – B (A\B) is the
set of elements which belong to A but not to B, i.e.
A - B = {x : x  A , x  B}.
A - B is also called the
complement of B with respect
to A.

Figure 6 : (A – B) is shaded.
Example
Let S = { a, b, c, d } and
T = { c, d, e, f },

then S - T = { a, b }
T - S = { e, f }
Á
n(A- B) = n(A) – n(AB)
n(AUB) = n(A) +n(B) – n(AB)
n(AB) = n(A) + n(B) – n(AB)

If we have 3 finite sets A, B, C then

n(AUBUC) = n(A)+n(B)+n(C) – n(AB) –


n(AC) – n(BC)+ n(ABC)
exercise
If A = {1, 2, 3, 4, 5} and B = {0, 2, 4, 6} then fin
d
A  B
A  B
A - B
B - A
A  B
If A = {1, 2, 3, 4, 5} and B = {0, 2, 4, 6} then fin
d
A  B = {0, 1, 2, 3, 4, 5, 6}
A  B = {2, 4}
A - B = {1, 3, 5}
B - A = {0, 6}
A  B = {0, 1, 3, 5, 6}
Partitions of Sets (symbol: S)

Two sets are disjoint if their intersection is empty.

A collection of nonempty sets {A1, A2, …, An} is a


partition of a set A if and only if

1)

2) A1, A2, …, An are mutually disjoint.


Conditions of partition of set:

1. S is nonempty set


2. every element of S is in
exactly one of the subset
For
Application of Venn diagrams in counting

Example
In a class of 50 college students, 30 study Pascal, 25
study C and 10 study both computer languages. How
many students do not study computer language ?
U=50

Pascal C
20 10 15

No. of students who do not study computer language is


 50 – 20 – 10 – 15 = 5 students
Exercise
In a survey of 160 passengers, an airline found that 48
preferred grape with their meals, 78 preferred mixed
drinks, and 66 preferred ice tea. In addition, 12
enjoyed grape and mixed drinks, 18 enjoyed mixed
drinks and ice tea, and 16 enjoyed ice tea and grape,
and 4 passengers enjoyed them all.
a) How many passengers want only iced tea
with their meals?
b) How many passengers do not like any of them?
a) No. of passengers = 36
b) No. of passengers
= 160 – 24 – 52 – 36 – 12 – 8 – 14 – 4
= 10
Algebra of sets
Sets, under the operations of union, intersection
and complement, satisfy the laws listed in the
following table. We can use these laws of
algebra of sets to simplify complicated set
expressions.
Properties of Sets

Identity laws A  A A U  A


Idempotent laws A A  A A A  A
Inverse laws A A U A A  
Complement laws ( A)  A
Domination/ Bound laws A U  U A  
Commutative laws A B B A A B B A
Associative laws A  ( B  C)  ( A  B)  C A  ( B  C )  ( A  B)  C
Distributive laws A  ( B  C)  ( A  B)  ( A  C) A  ( B  C)  ( A  B)  ( A  C)

Absorption laws A  ( A  B)  A A  ( A  B)  A
De Morgan’s laws A B  A B A B  A B
Algebra of sets
The following identities can be verified by
drawing Venn diagrams.
Example
Use Venn diagrams to represent the following set expressions.
(a)
( A B)(B C)

A B
A B

C C

( A  B) (BC)
A B

C ( A B)(B C)
(b) A  ( B  C )  ( A  B   C )

(B  C ) ( A  B  C )

A B

A  ( B  C )  ( A  B  C )
Exercise:

Use Venn diagrams to represent the following


set expressions.
ORDERED PAIRS

(a1, …,an) and (b1, …,bn) are equal if and only

If a1 = b1, a2 = b2 , …., an = bn.


CARTESIAN PRODUCT

Example:
Let A={x,y}, B={1,2,3}, and C={a,b}.
Find
a. A x B x C
b. (A x B ) x C
answers
a. A × B × C =
{(x, 1, a), (x, 2, a), (x, 3, a), (y, 1, a), (y, 2, a), (y, 3, a), (x, 1
, b), (x, 2, b), (x, 3, b), (y, 1, b), (y, 2, b), (y, 3, b)}

b. (A × B) × C =
{((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a), ((y, 2), a), ((y,
3), a), ((x, 1), b), ((x, 2), b), ((x, 3), b), ((y, 1), b), ((y, 2),
b), ((y, 3), b)}
Power Set & Cardinality
The power set of a set A, written P(A), is the set
whose elements are all the subsets of A. For example
A = {1, 2} has a total of 4 subsets: {1}, {2}, , and A
itself. So for this example P(A) = {, {1}, {2}, A}.

The cardinality of a set A is the number of elements in


A, denoted by |A|.
Thus A=26 , where A is the letters English
alphabet,

D  =7, where D is the days of the week.

Also   = 0 since the empty set has no


elements.

If A and B are finite disjoint sets then


A U B is finite and A B  = A + B .
Example 1:
EXAMPLE 2 :

A = { 1,2,3} . Get P(A) ?

Solution:

A = n(A) = 3

P(A) = { { }, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3} }

You might also like