Set Theory: Week 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Module in Discrete Mathematics

Chapter 2
Set Theory

Week 5

Ways of defining sets


Types of sets and Cardinality
Set operations, and Venn diagram

Intended Learning Outcome:


 Define and describe sets in our daily life.
 Perform set operations
 Analyze sets using a Venn diagram.

Acquire

Set theory is the mathematical theory of well-defined collections, called sets, that is
completely described by its elements or members. Its application is utilized mostly in the field of
math and science. We use set theory in our daily life like the collection of songs in our playlist, the
goods in stores are categorized according to the type of items and even ln planning, managing and
operating business.

A Set is a collection of distinct objects.


Sets are often specified by curly brace
notation { }
The set of even integers can be written:
{ 2n: n is an integer}
The colon means “such that” or “where”
The given set is read as
The set of twice n where n is an integer.

Example.
Let X be the set of all students at a university.
Let A be the set of students who are first year students,
B the set of students who are second year students,
C the set of students who are in a discrete mathematics course,
D the set of students who are international relations majors,
E the set of students who went to a concert on Monday night
and F the set of students who studied until 2 A.M. on Tuesday.
Express in set theoretic notation the following sets of students:
1. All second year students in the discrete mathematics course.
2. All first year students who studied until 2 A.M. on Tuesday.
3. All students who are international relations majors and went to
the concert on Monday night.
4. All students who studied until 2 A.M. on Tuesday, are second
year students and are not international relations majors.
5. All first and second year students who did not go to the concert
on Monday night but are international relations majors.
6. All students who are first year international relations majors or
who studied until 2 A.M. on Tuesday.
7. All students who are first year or second year who went to a concert on Monday
night .
8. All first year students who are international relations majors or went to a concert on
Monday night.

Write three descriptions of the elements of the set {2, 5, 8, 11, 14}.
{2, 5, 8, 11, 14}
2. { n Є N : n=3 k−1 for some k Є N such that 1 ≤ k ≤ 5 }
3. { n Є Z : n=3 k +2 for some k Є Z such that−1<k <5 }

Definition 1: The empty set is a set containing no objects.


It is written as a pair of curly braces { } or using the symbol Ø.

Definition 2:
The set membership symbol Є is used if it is a member of the set
Otherwise , Ɇ which means not a member of the set.
Example

If Q = {1,2,3} then 3 is ∈ Q and 4 ∈/ of Q .

Definition 3. The set are equal sets if they have exactly the same
members.

Example

If Q = {1,2,3} and R ={2,3,1}

Then sets Q and R are equal sets.

Definition 4: The cardinality of a set is its size. In symbolic notation , the size of a set
S is written |S|.

Example.

If Q={1,2,3}
Then the set cardinality is 3 written as |Q| = 3
Set Operations
Definition 5: The intersection of two sets is the collection of all objects that are in both
sets The notation used is ∩.

Example
If Q = {1,2,3,5}, R= {1,3,4,5}, S= {2,3,4,5}
Then,
Q ∩ R= {1,3,5},

Q ∩ S= {2,3,5},

R ∩ S = {3,4,5}

Definition 6: The union of sets is the collection of all objects that are in either set.
The notation used is ∪ .

Example

Q= {1, 2, 3}, R= {1, 3, 5}, and S ={2, 3, 4, 5}.


Then: Q ∪ R= {1, 2, 3, 5},

Q ∪ S = {1, 2, 3, 4, 5}, and

R ∪ S = {1, 2, 3, 4, 5}

Definition 7: The universal set, at least for a given collection of set theoretic
computations, is the set of all possible objects.

Definition 8: The compliment of a set Q is the collection of objects in the universal set
that are not in Q.
The notation for set Q is Qc .
Qc = {x : ¬(x ∈ Q)}

Example.

Let the universal set be {1, 2, 3, 4, 5},

If Q= {1,2,3} then, the compliment of Q is Qc ={4, 5}

the compliment of R = {1, 3, 5} is Rc = {2, 4}.

Definition 9: The difference of two sets is the collection of objects in the set that is
not found in the other set.
The difference of set Q to set R is written as Q−R .
Q − R = {x : x ∈ (Q ∩ (Rc))},

Or
Q − R = {x : (x ∈ Q) ∧ (x /∈ R)}

Example:
Let Q = {a, b, c, d} and R = {b, d, e}. Then Q – R = {a, c} and R– Q = {e}.

Definition 10: The symmetric difference of two sets is the set of objects that are in
one and only one of the sets. The symmetric difference of sets Q and R is written as
Q∆ R

Example.
If Q = {1,2,3,4,5} and R = {2,4,6}. The symmetric difference between these sets is
Q ∆ R ={1,3,5,6}.

Definition 11: For two sets Q and R we say that Q is a subset of R if each element of
Q is also an element of R.
notation, Q ⊆ R if for all x Q we have x ∈ R .
Example
If M = {a, b, c} then M has eight different subsets:
∅ {a} {b} {c}
{a, b} {a, c} {b, c} {a, b, c}
Notice that M ⊆ M and in fact each set is a subset of
itself. The empty set ∅ is a subset of every set.

Venn Diagram

A Venn diagram uses figures like overlapping circles to illustrate all the possible logical
relations between two or more sets. It is convenient for a learner to visualize information
about similarities and differences of the given sets.
Venn diagram was created by john Venn in
1880 and Clarence Lewis published it in his
book in1918. Venn diagram shows all the
possible relations betweensets even it does
not exist in reality while Euler diagram only
shows the relationship that exists in real life.

Examples of Venn diagrams


Venn Diagaram for intersection of sets union of sets

Chapter 2 – Set Theory

Week 6
Application of Set theory

Intended Learning Outcome:


 Compare sets of algorithm using logical operations
 Prove that a proposition is true for all natural numbers using Mathematical
induction.

Acquire

Mathematical induction
Mathematical induction is a proof technique used to prove that a proposition is true for
all natural numbers.
The Principle of Mathematical Induction:
If Q is a subset of N (Q⊆N)such that
1. 1∈Q, and
2. For every k∈N, if k∈Q, then (k+1)∈Q.
3. Then Q=N.
Example:
Prove that
1+2+···+n= (½) n(n + 1) for all integer n ≥ 1 .
n
We can rewrite the sum using summation notation ∑i
i=1
The equation becomes,
n

∑ i=¿(½) n(n + 1)
i=1

We begin with the basic step:


You just have to
show that it is true for n=1
n

∑ i=¿(½) n(n + 1)
i=1
1

∑ i=¿(½) 1(1 + 1)
i=1
1= 1
We have shown that it is true if n=1.

Next is the inductive step:

We assume that it is true if n=k then n=k+1 is also true.

If n= k , the equation
n

∑ i=¿(½) n(n + 1) becomes


i=1

∑ i=¿(½) k(k + 1) similarly


i=1

1+2+···+k= (½) k(k + 1)

Then n= k+1 is also true


k +1

∑ i=¿(½) k+1((k+1)+ 1)
i=1

k +1

∑ i=¿(½) k+1(k+1+ 1)
i=1

k +1

∑ i=¿(½)( k+1)(k+2)
i=1

Proof:
k +1

∑ i=¿1 + 2 + · · · + k + (k+1)
i=1

We can rewrite the right side using the equation if n=k,


1+2+···+k= (½) k(k + 1)
The equation
k +1

∑ i=¿1 + 2 + · · · + k + (k+1)
i=1

Becomes
k +1

∑ i=¿(½) k(k + 1) + (k+1)


i=1
k +1

∑ i=¿1/2(k 2 + k )+(k+1)
i=1

k +1

∑ i=¿(k 2 + k )/2+(k+1)
i=1

k +1

∑ i=¿(k 2 + k )+2(k+1)]/2
i=1

k +1

∑ i=¿(k 2 + k +2k+2)]/2
i=1

k +1

∑ i=¿(k 2 + 3k+2)]/2
i=1

k +1

∑ i=¿(k +1)(k+2)]/2 or
i=1

k +1

∑ i=¿(½)( k+1)(k+2)
i=1

Thus n= k+1 is true.

Conclusion:
Therefore, by mathematical induction the equation
n

∑ i=¿(½) n(n + 1)
i=1
Holds true for all integer n ≥ 1 .

Practically, in mathematical induction we


1. Show something that works
2. Assume it works for the first time
3. Show it will work next time
4. And then we conclude it works all the time.
More applications of set theory

A group of students are working on a project that involves writing a sort program.
Gino and Sarah have each written an algorithm for a function that takes two lists.
List1 and List2 , of length p and q and merges them into a third list, List3.

Part of Sarah’s algorithm is the following:


(1)if( (i+ j≤ p +q ) ∧¿ ( i≤ p )∧¿ ( ( j ≥ q ) ∨¿ ( List 1[i]≤ List 2[ j] ) ) )
(2) List 3 [ k ] =List 1[i]
(3) i=i +1
(4) else
(5) List 3 [ k ] =List 2[i]
(6) j= j+1
(7) k =k +1
(8) Return List3

The corresponding Part of Gino’s algorithm is the following:

(1) if ( (i+ j≤ p +q )∧¿ ( i≤ p )∧¿ ( j ≥ q ) )


¿∨¿ ( i+ j ≤ p+ q )∧¿ ( i ≤ p ) ∧¿ ( List 1[i] ≤ List 2[ j] )))
(2) List 3 [ k ] =List 1[i]
(3) i=i +1
(4) else
(5) List 3 [ k ] =List 2[ j]
(6) j= j+1
(7) k =k +1
(8) Return List3

Do Gino and Sarah’s algorithm do the same thing?


Let us name the constituent parts and rewrite the statements.
We use
• s to stand for i+ j ≤ p+ q
• t to stand for i≤ p
• u to stand for j ≥ q
v to stand for List 1 [ i ] ≤ List 2 [ j ]
In Sarah’s algorithm we put entry I of List1 into position k of List3 if
i+ j ≤ p+ q∧i ≤ p∧( j ≥ q∨List 1[i ]≤ List 2[ j])
While in Gino’s algorithm we put entry I of List1 into position k of List3 If
(  i+ j≤ p +q∧i≤ p∧ j≥ q ) ∨¿
( i+ j ≤ p+ q∧i ≤ p∧List 1 [i]≤ List 2[ j] )

To analyze when statements mean the same thing,


We can explain precisely by using the symbolic versions
of compound statements.
We shall use the symbol ∧ to stand for “and”
and V to stand for “or”.
Using the notation,
Sarah’s Condition becomes
w ∧ ( u∨ v )
And Gino’s Condition becomes
( w ∧ u) ∨ (w ∧ v )

We use the distributive rule of equivalence.


Your turn, try to compare the set of algorithm using Venn diagram.

You might also like