Lec 3 - 6 (SET THEORY)
Lec 3 - 6 (SET THEORY)
Lec 3 - 6 (SET THEORY)
EXAMPLES
In the following examples we write the sets in tabular form.
A = {1, 2, 3, 4, 5}
B = {2, 4, 6, 8, …, 50}
C = {1, 3, 5, 7, 9, …}
NOTE
The symbol “…” is called an ellipsis. It is a short for “and so forth.”
DESCRIPTIVE FORM
EXAMPLES
Now we will write the same examples which we wrote in tabular form ,in the
descriptive form.
REMARK:
Note that the concept of a datatype, or type, in computer science is built
upon the concept of a set. In particular, a datatype or type is the name of a
set, together with a set of operations that can be performed on objects
from that set.
For example, Boolean is the name of the set {0, 1}, together with
operators on one or more elements of this set, such as AND, OR, and
NOT.
SUBSET:
If A & B are two sets, A is called a subset of B, written A B, if, and only if,
any element of A is also an element of B.
Symbolically:
A B if x A then x B
REMARK:
When A B, then B is called a superset of A B ⊇ A.
When A is not subset of B, then there exist at least one x A such
that x B.
Every set is a subset of itself.
EXAMPLE Let
A = {1, 3, 5} B = {1, 2, 3, 4, 5} C = {1, 2, 3, 4} D = {3, 1, 5}
Then
A B ( Because every element of A is in B )
C B ( Because every element of C is also an element of B )
A D ( Because every element of A is also an element of D and that every
element of D is in A so D A, this implies A = D ) and A is not subset of
C . ( Because there is an element 5 of A which is not in C )
PROPER SUBSET:
Let A and B be sets. A is a proper subset of B, if, and only if, every element of
A is in B but there is at least one element of B that is not in A, and is
denoted as A B.
We wish to emphasize that a set A is a subset of a set B but that A ≠ B, For
A ⊂ B to be true, it must be the case that A ⊆ B and there must exist an
element x of B that is not an element of A.
EXAMPLE
Let A = {1, 3, 5} B = {1, 2, 3, 5}
then A B ( Because there is an element 2 of B which is not in A).
EQUAL SETS:
Two sets A and B are equal if, and only if, every element of A is in B and every
element of B is in A and is denoted A = B.
Symbolically:
A = B if A B and B A
EXAMPLE
Let A = {1, 2, 3, 6} B = the set of positive divisors of 6
C = {3, 1, 6, 2} D = {1, 2, 2, 3, 6, 6, 6}
Then A, B, C, and D are all equal sets.
NULL SET:
A set which contains no element is called a NULL SET, or an EMPTY
SET or a VOID SET. It is denoted by the greek letter (phi) or { }.
EXAMPLE
A = {x | x is a person taller than 10 feet} = ( because there does
not exist any human being which is taller then 10 feet ).
B = {x | x2 = 4, x is odd} = (because we know that there does not
exist any odd whose square is 4).
REMARK
is regarded as a subset of every set.
EXERCISE A
Determine whether each of the following statements is true or false.
1. x {x}
2. {x} {x}
Note That every set has necessarily two subsets and the set itself, these
two subset are known as improper subsets and any other subset is called
proper subset)
3. {x} {x}
4. {x} {{x}}
5. {x}
6. {x}
SOLUTION A
.
1. x {x} TRUE( Because x is the member
of the singleton set { x } ).
2. {x} {x} TRUE( Because Every set is the
subset of itself).
Note That every set has necessarily two subsets and the set itself, these
two subset are known as improper subsets and any other subset is called
proper subset)
3. {x} {x} FALSE ( Because { x} is not the
member of {x} ).
4. {x} {{x}} TRUE
5. {x} TRUE
6. {x} FALSE
EXERCISE B
1. List the members of these sets.
a) {x ∣ x is a real number such that x2 = 1}
b) {x ∣ x is a positive integer less than 12}
c) {x ∣ x is the square of an integer and x < 100}
d) {x ∣ x is an integer such that x2 = 2}
2. Use set builder notation to give a description of each of
these sets.
a) {0, 3, 6, 9, 12}
b) {−3,−2,−1, 0, 1, 2, 3}
c) {m, n, o, p}
3. For each of these pairs of sets, determine whether the first is a subset of the
second, the second is a subset of the first, or neither is a subset of the other.
a) the set of airline flights from New York to New Delhi, the set of nonstop airline
flights from New York to New Delhi.
b) the set of people who speak English, the set of people who speak Chinese.
c) the set of flying squirrels, the set of living creatures that can fly.
4. For each of these pairs of sets, determine whether the first is a
subset of the second, the second is a subset of the first, or
neither is a subset of the other.
a) the set of people who speak English, the set of people
who speak English with an Australian accent.
b) the set of fruits, the set of citrus fruits
c) the set of students studying discrete mathematics, the set
of students studying data structures.
SOLUTION B
1.
a) {−1,1}
b) {1,2,3,4,5,6,7,8,9,10,11}
c) {0,1,4, 9, 16,25, 36, 49, 64, 81}
d) ∅
2.
a) {x ∈ N I x is a multiple of 3 and x <= 12}
b) {x ∈ Z I -3<=x<=3 }
c) {x I x is a letter in the alphabet from m to p }
3.
a) The second is a subset of the first, but the first is not a subset of the second.
b) Neither is a subset of the other.
c) The first is a subset of the second, but the second is not a subset of the first.
Venn diagrams, also called set diagrams or logic diagrams, are widely used in
mathematics, statistics, logic, teaching, linguistics, computer science and business.
Venn diagrams allow users to visualize data in clear, powerful ways, and therefore
are commonly used in presentations and reports. They are closely related to Euler
diagrams, which differ by omitting sets if no items exist in them. Venn diagrams
show relationships even if a set is empty.
VENN DIAGRAM
U
U = Set of all positive Integers less than or equal to 10.
A = Set of even numbers.
B = Set of prime numbers
U = {0,1,2,3,4,5,6,7,8,9,10}.
A = {0,2,4,6,8,10}
B = {2,3,5,7}
SET OPERATIONS
1. UNION:
Let A and B be subsets of a universal set U. The union of sets A and B is
the set of all elements in U that belong to A or to B or to both, and is
denoted A B.
Symbolically:
A B = {x U | x A or x B}
EXAMPLE
Let U = {a, b, c, d, e, f, g} A = {a, c, e, g}, B = {d, e, f, g}
Then
A B = {x U | x A or x B} = {a, c, d, e, f, g}
VENN DIAGRAM FOR UNION
A B AB
1 1 1
1 0 1
0 1 1
0 0 0
REMARK:
This membership table is similar to the truth table for logical
connective, disjunction ().
2. INTERSECTION:
Let A and B subsets of a universal set U. The intersection of sets A and B
is the set of all elements in U that belong to both A and B and is denoted
as:
A B.
Symbolically:
A B = {x U | x A and x B}
EXAMPLE
Let U = {a, b, c, d, e, f, g} A = {a, c, e, g}, B = {d, e, f, g}
Then A B = {e, g}
VENN DIAGRAM FOR
INTERSECTION
A B AB
1 1 1
1 0 0
0 1 0
0 0 0
REMARK:
This membership table is similar to the truth table for logical
connective, conjunction ().
3. DIFFERENCE:
Symbolically:
A − B = {x ∣ x ∈ A and x ∉ B}.
EXAMPLE:
Let U = {a, b, c, d, e, f, g} A = {a, c, e, g}, B = {d, e, f, g}
Then ,
A – B = {a, c}
VENN DIAGRAM FOR
DIFFERENCE
A B A–B
1 1 0
1 0 1
0 1 0
0 0 0
COMPLEMENT:
Let A be a subset of universal set U. The complement of A is the set of
all element in U that do not belong to A, and is denoted Ac
Symbolically:
Ac = {x U | x A}
EXAMPLE
Let U = {a, b, c, d, e, f, g], A = {a, c, e, g}
Then Ac = {b, d, f} , this is equivalent to U- A
Therefore, we can say that Ac = U - A
VENN DIAGRAM FOR
COMPLEMENT
1. Ac = U – A
2. A Ac =
3. A Ac = U
MEMBERSHIP TABLE FOR COMPLEMENT:
A Ac
1 0
0 1
REMARK
This membership table is similar to the truth table for logical connective
negation (~)
SET IDENTITIES
EXAMPLE A
A.
Let U = {1, 2, 3, …, 10}, X = {1, 2, 3, 4, 5}
Y = {y | y = 2 x, x X}, Z = {z | z2 – 9 z + 14 = 0}
Enumerate:
NOTE (X – Z)c Xc – Zc
EXAMPLE B
2. Given the following universal set U and its two subsets P and Q,
where
U = {x | x Z, 0 x 10}
P = {x | x is a prime number}
Q = {x | x2 < 70}
Draw a Venn diagram for the above and List the elements in Pc Q.
SOLUTION B
First we write the sets in Tabular form.
U = {x | x Z, 0 x 10}
Since it is the set of integers that are greater then or equal 0 and less or equal to
10. So we have
U= {0, 1, 2, 3, …, 10}
P = {x | x is a prime number}
It is the set of prime numbers between 0 and 10. Remember Prime numbers are
those numbers which have only two distinct divisors.
P = {2, 3, 5, 7}
Q = {x | x2 < 70}
The set Q contains the elements between 0 and 10 which has their square less or
equal to 70.
Q= {0, 1, 2, 3, 4, 5, 6, 7, 8}
Thus we write the sets in Tabular form.
VENN DIAGRAM:
U
Q
2,3,5,7P
0,1,4,6,8
9,10
Pc Q = ?
Let
U = {1, 2, 3, 4, 5}, C = {1, 3}
and A and B are non empty sets. Find A in each of the following:
1. A B = U, A B = and B = {1}.
2. AB and A B = {4, 5}.
3. A B = {3}, A B = {2, 3, 4} and B C = {1,2,3}.
4. A and B are disjoint, B and C are disjoint, and the union of A and B is the
set {1, 2}.
SOLUTION C
1. A B = U, A B = and B = {1}
Since A B = U = {1, 2, 3, 4, 5}
and A B = ,
Therefore A = Bc = {1}c = {2, 3, 4, 5}
U
A B
1 2
C
3 4, 5
A = {1}
EXEXCISE D
Use a Venn diagram to represent the following:
i. (A B) Cc
ii. Ac (B C)
iii. (A – B) C
iv. (A Bc) Cc
U
9 3 B
A 2
6
5
1 1
4 C
7 8
SOLUTION D
i. (A B) Cc
Let us first construct the sets from the given venn diagram.
A = { 1,2,4,5} B = {2,3,5,6} C = {4,5,6,7} U = {1,2,3,4,5,6,7,8,9}
NOW,
B U
9 A 3
2
5 6
1
4
7 C
8
3. (A – B) C
3 B U
9
A 2
5 6
1
4 7
C
8
(A – B) C is shaded
3. (A Bc) Cc
B
9 3
U
2
A 5 6
C
1 4
7
8
SET IDENTITIES
PROVING SET IDENTITIES
Prove the following using Venn Diagrams and membership
tables:
1. (A B)c = A c B c
2. A– B =A Bc
SOLUTION(Proof using Venn Diagram): 1. (A B)c = A c B c
AB (A B)c
Now taking the R.H.S
A B AB (AB)c Ac Bc Ac Bc
1 1 1 0 0 0 0
1 0 0 1 0 1 1
0 1 0 1 1 0 1
0 0 0 1 1 1 1
(A B)c = A c B c
Since the fourth and last columns of the above table are same hence
the corresponding set expressions are same.
That is (A B)c = A c B c
SOLUTION (Proof using Venn Diagram): 2. A – B = A Bc
Let A = {1,2} , B = {2,3} and U = {1,2,3,4} , taking the L.H.S
A B A–B Bc A Bc
1 1 0 0 0
1 0 1 1 1
0 1 0 0 0
0 0 0 1 0
A – B = A Bc
Since the third and last columns of the above table are same hence
the corresponding set expressions are same.
That is A – B = A Bc
USING SET IDENTITIES (EXAMPLE A)
For all subsets A and B of a universal set U, prove that
(A – B) (A B) = A
PROOF:
LHS = (A – B) (A B)
= (A Bc) (A B) (Alternative representation for set difference)
= A (Bc B) Distributive Law
=A U Complement Law
=A Identity Law
= RHS PROVED
The result can also be seen by Venn diagram.
U
A B
A-B AB
USING SET IDENTITIES (EXAMPLE B)
For any two sets A and B prove that A – (A – B) = A B
PROOF:
LHS = A – (A – B)
= A – (A Bc) Alternative representation for set difference
M E
1
0
5
2 4
GIVEN:
M&W=7
M&E=6
ONLY M = 0
E&W=9
M&E&W=5
SOLUTION (ii-a)
Let the number of typists using electronic typewriters (E) only be x, and the
number of typists using word processors (W) only be y.