Applied 40SCh 3: Set Theory and Logic Chapter 3: Set Theory and

Applied 40S
Ch 3: Set Theory and Logic
Chapter 3: Set Theory and Logic
3.1
Types of Sets and Notation
3.2
Exploring Relationships between Sets
3.3
Intersection and Union of Two Sets
3.4
Applications of Set Theory
3.5
Conditional Statements and Their Converse
3.6
The Inverse and Contrapositive of Conditional Statements
Page 1 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.1 Types of Sets and Set Notation
A set is a collection of distinguishable objects, known as elements.
A set can be represented as:a list,
e.g.
A = {1, 2, 3, 4}
words
e.g.
A = { integers between 1 and 4 inclusive}
set notation
e.g.
A = { x| 1 ≤ x ≤ 4, x Є I }
Note the use of “curly brackets” in each case.
U is usually used to denote the Universal Set, and includes all the elements being considered in a given
context.
Example: The integers from 1 to 10 are the only numbers under consideration so
U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
A subset is a set whose elements all belong to another set.
We can define:
E is a subset of U consisting of even numbers. i.e. E = {2, 4, 6, 8, 10}
O is a subset of U consisting of odd numbers i.e. O = {1, 3, 5, 7, 9}
E and O are disjoint sets - they have no elements in common.
Venn Diagrams can be used to illustrate how sets and their subsets are related.
The Venn Diagram representing this is shown below.
The symbol ⊂ is used to say “is a subset of” so E ⊂ U and O ⊂ U
Page 2 of 29
Applied 40S
Ch 3: Set Theory and Logic
The order that elements are listed in does not matter.
If we define
E = {2, 4, 6, 8, 10} and F = {10, 8, 6, 4, 2}
Then E = F because they contain the same elements.
The Number of Elements in a set is denoted as n(“set”)
So, from our example above
n(E) = 5
n(O) = 5 and
n(U) = 10
It is not always possible to count the number of elements in a set.
Eg. U = {x| x > 5; x Є R}
The Complement of a set, denoted with a single apostrophe or prime sign (i.e. A’ is the complement of
A), is all elements that are not in that set.
So E’ = {1, 3, 5, 7, 9}
It should also be noted that the number of elements in a set and its complement equals the number of
elements in the universal set.
n(E) + n(E’) = n(U)
in our example
n(E) = 5, n(E’) = 5, n(U) = 10
An empty set is a set with no elements and is denoted as { } or ᴓ. Eg. The set of odd numbers that are
divisible by 2.
Page 3 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example: U = {x| 1 ≤ x ≤ 30; x Є I}
F = {multiples of 5}
and
i.e. all integers from 1 to 30 inclusive
T = {multiples of 10}
Representing this in a Venn Diagram
We can see that the elements of T are all in F so T is a subset of F as well as a subset of U.
We can write this using set notation as
T⊂F⊂U
We can also see that
n(T) = 3
n(F) = 6 and
n(U) = 30
T’ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29}
So n(T’) = 27 and n(T) + n(T’) = 3 + 27 = 30
i.e.
n(T) + n(T’) = n(U)
F’ = {1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29}
So n(F’) = 24 and n(F) + n(F’) = 6 + 24 = 30
i.e.
n(F) + n(F’) = n(U)
Page 4 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example: Consider the universal set of Canadian provinces and territories.
The universal set:
C = {YK, NWT, NV, BC. AB, SK, MB, ON, QU, NB, NS, NFL, PEI}
Subset Western provinces and territories:
W = {BC, AB, SK, YK, NWT}
So W’ = {NV, MB, ON, QU, NB, NS, NFL, PEI}
Subset Eastern Provinces:
E = {NFL, PEI, ON, QU, NB, NS}
E and W are disjoint sets because they have no elements in common with each other.
E ≠ W’ because the central provinces/territories MB and NV are not in E but are in W’
Territories:
T = {YK, NWT, NV} so T ⊂ C
(i.e. T is a subset of C)
T is not a subset of set W because NV is not in set W
The provinces of Canada that are south of Mexico: S = { } i.e. it is an empty set because Canada is
north of Mexico.
Page 5 of 29
Applied 40S
Ch 3: Set Theory and Logic
A Venn Diagram of this situation looks like:
A Venn diagram helps us to see the relationship between the different sets.
We can also see that
N(C) = 13,
n(W) = 5,
n(T) = 3
and
n(E) = 6
There are many other ways that the provinces/territories could be organised.
Summary of Notation
Sets are defined using "curly" brackets { and }
eg if a universal set has elements 1, 2 and 3 in it, it can be written as
 U = {1, 2, 3}
Is a set A is defined as A = {1, 2} then set A is a subset of U which can
be written as
 A ⊂ U
The compliment of A, written as A' is thus defined as
 A' = {3}
If the set B is defined as a subset of U containing the number 4, then
 B = {} or B = ∅
Page 6 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example:
a) Indicate the multiples of 5 and 10 from 1 to 500 using set notation
b) Represent these sets in a Venn Diagram
Solution
First define the Universal set.
S = {1, 2, 3, ... 498, 499, 500}
listing all the elements in this set is impossible so it is better to write it
S = {x | 1 ≤ x ≤ 500, x∈N}
Let F be the set of multiples of 5 from 1 to 500
F = {5, 10, 15, ... 490, 495, 500}
which is better written as
F = { f | f = 5x, 1 ≤ x ≤ 100, x∈N}
so F⊂S
Let T be the set of multiples of 10 from 1 to 500
T = {10, 20, 30, ... 480, 490, 500}
which is better written as
T = { t | t = 10x, 1 ≤ x ≤ 50, x∈N}
so T ⊂ F ⊂S
F' = {non-multiples of 5 from 1 to 500}
Page 7 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example
Billy recorded the possible sums that can occur when you roll a four sided die in an outcome
table
a) Display the following sets in one diagram
- rolls that produce a sum less than 5
- rolls that produce a sum greater than 5
b) record the number of elements in each set
c) Determine a formula for the number of ways that a sum less than or greater than 5 can
occur. Verify your formula
Solution
First set up your sets
S = {all possible sums}
L = {all sums less than 5}
G = {all sums greater than 5}
n(S) = 16,
n(L) = 6,
n(G) = 6
n(L or G) = n(L) + n(G) = 6 + 6 = 12
Page 8 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.2 Exploring Relationships Between Sets
Sets that are not disjoint must have elements in common.
When drawing a Venn diagram remember that any element in the Universal set only appears once in the
Venn diagram.
Each region in the Venn diagram represents something different.
When an element is in more than one set it appears in the region where the sets containing that
element overlap.
Page 9 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example. U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
A = {1, 2, 3, 4, 5}
B = {2, 4, 6, 8}
Can be represented in a Venn Diagram as
We can see that





Sets A and B are not disjoint and there are 2 elements (2 and 4) that are in both sets A
and B
3 elements in set A (1, 3 and 5) are not in set B
2 elements in set B (6 and 8) are not in set A
3 elements (7, 9 and 10) are not in Set A or Set B
n(A) = 5, n(B) = 4, n(U) = 10
We can use Venn diagrams to help us solve problems.
Page 10 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example: Diana asked 40 students about what TV shows they watched with the following results.
Type
Drama
Comedy
Neither
Number of People
who Like
22
19
4
This type of information can be represented in a Venn diagram.
First set up the sets involved:
U = {All students asked}
D = {all students who watched drama}
C = {all students who watched comedies}
Is there an overlap between sets D and C?
22 + 19 + 4 = 45 so there must be an overlap since 45 is more than 40, the number of students
asked.
Set up a rectangle for the Universal set with two circles that overlap to represent the sets D and C
Now we add in the numbers.
4 students watched neither so
the number 4 is written inside
the rectangle but NOT in either
circle.
Page 11 of 29
Applied 40S
Ch 3: Set Theory and Logic
This means that we have 36 students (40 – 4) left to fit into the circles.
There has to be a total of 22 students in set D and a total of 19 students in set C but 22 + 19 = 41.
This means that 5 students (41 – 36 )
have been counted twice and must be
in both sets C and D, so 5 should be
written in the intersection area.
This leaves 17 students (22 – 5) in the
area representing just set D
And 14 students (19 – 5) in the area
representing just set C
As a final check, add up all the numbers and make sure that they add up to 40.
From the Venn diagram we can easily see that
36 students watch dramas, comedies or both
17 students only watch drama while 14 students only watch comedies.
Page 12 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.3 Intersection and Union of Two Sets
When two (or more) sets are combined we call it a union and use the symbol ᴜ to represent this.
i.e. if A = {1, 2, 3, 4} and B = { 4, 5, 6, 7} then A ᴜ B = {1, 2, 3, 4, 5, 6, 7}
The shaded area in the Venn diagram below represents A ᴜ B
C
The set of elements that are common to two or more sets is called the intersection of the sets and we
use the sign ∩ to represent this.
i.e. if A = {1, 2, 3, 4} and B = { 4, 5, 6, 7} then A ∩ B = { 4 }
An element that is in set A or in set B is in the union of sets A and B
An element that is in set A and in Set B is in the intersection of sets A and B
Page 13 of 29
Applied 40S
Ch 3: Set Theory and Logic
The notation A \ B is used to represent set A minus set B. i.e. it is the set of elements that are in set A
but not in set B.
A\B = {1, 2, 3}
If set C = {1, 2, 3, 4, 5, 6 } and set D =
{2, 4, 6} so D ⊂ C
C \ D = {1, 3, 5}
If C = {1, 2, 3, 4, 5, 6} and E = {7, 8, 9}, so C and D are disjoint sets
C \ E = {1, 2, 3, 4, 5, 6}
Page 14 of 29
Applied 40S
Ch 3: Set Theory and Logic
The Principle of Inclusion and Exclusion states
n(A ᴜ B) = n(A) + n(B) − n(A ∩ B)
n(A)=4, n(B) = 4 n(A∩B) = 1
so n(A ᴜ B) = 4 + 4 – 1 = 7
or
n(A ᴜ B) = n(A\B) + n(B\A) + n(A ∩ B)
n(A\B) = 3, n(B\A) = 3, n(A ∩ B) = 1
so n(A ᴜ B) = 3 + 3 + 1 = 7
Note that for disjoint sets C and E,
n(C ∩ E) = 0 because there are no
common elements
and
n(C ᴜ E) = n(C) + n(E)
Page 15 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example: The integers from 1 to 10 are the only numbers under consideration so
U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
If we define:
E = {2, 4, 6, 8, 10}
T = {3, 6, 9}
(even numbers)
(multiples of three)
We can represent this as a Venn Diagram
So
n(U) = 10,
n(E) = 5,
n(T) = 3
E∩T={6}
and
n(E ∩ T) = 1
E \ T = {2, 4, 8, 10}
and
n(E \ T) = 4
T \ E = {3, 9}
and
n(T \ E) = 2
E ᴜ T = {2, 3, 4, 6, 8, 9, 10}
so
n(E ᴜ T) = 7
Or
n(E ᴜ T ) = n(E) + n(T) – n(E ∩ T) = 5 + 3 – 1 = 7
Or
n(E ᴜ T ) = n(E\T) + n(T\E) + n(E ∩ T) = 4 + 2 + 1 = 7
Page 16 of 29
Applied 40S
Ch 3: Set Theory and Logic
Example: Tucker surveyed 100 people at a local doughnut shop. He found that



65 people ordered coffee
45 people ordered a doughnut
10 people ordered something else
Tucker wants to know how many people ordered coffee and a doughnut.
Model this situation with sets by identifying the universal set and the subsets being used
Draw a Venn diagram that models this situation.
Use your Venn diagram to find how many people ordered coffee and a doughnut.
U = {100 people at doughnut shop}
C = {65 people who ordered coffee}
D = {45 people who ordered doughnuts}
Check that all numbers add to 100.
From the Venn diagram, we can see 20 people ordered coffee and doughnuts. (i.e. we want C∩D)
Page 17 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.4 Applications of Set Theory
We can use sets and Venn diagrams to model and solve problems
With 3 sets
A ∩ B ∩ C = area h
A ∩ B = union of areas e and h
B ∩ C = union of areas h and i
A ∩ C = union of areas g and h
You can use the Principle of Inclusion and Exclusion to determine the number of elements in the union
of all 3 sets.
n(A ᴜ B ᴜ C) = n(A) + n(B) + n (C) – n(A ∩ B) – n(A ∩ C) – n(B ∩ C) + n(A ∩ B ∩ C)
Example: Rachel surveyed grade 12 students about how they communicated with each other.







66% called on a cell phone
76% texted
34% used social networking sites
56% called on a cell phone and texted
18% celled on a cell phone and used a social networking site
19% texted and used a social networking site
12% used all 3 forms of communication.
Page 18 of 29
Applied 40S
Ch 3: Set Theory and Logic
What percentage of students used at least one of these forms of communication?
Solution: Let
U = {all grade 12 students surveyed}
C = {students calling on a cell phone}
T = {students texting on a cell phone}
S = {students using a social networking site}
Draw a Venn Diagram of the situation and put 12% that use all 3 forms of communications into
the centre where all three circles overlap
We also know that 56% of students called on a cell phone and texted so this number should go
into the section where the C circle and T circle overlap but 12% is already there, where all three
circles overlap, so there must be 56% - 12% = 44% should be entered into the area where just C
and T overlap.
Similarly we can add 18% - 12% = 6% into the area where C and S only overlap, and 19% - 12% =
7% into the area where S and T overlap.
Page 19 of 29
Applied 40S
Ch 3: Set Theory and Logic
66% of students call on a cell phone but we already have 62% (44% + 12% + 6%) in the C circle so
4% (66% - 62%) of students only use a cell phone.
Similarly, 13% text only (76% – 44% - 12% - 7%) and 9% only use social networking sites (19% 6% - 12% - 7%)
Page 20 of 29
Applied 40S
Ch 3: Set Theory and Logic
If we add all these numbers together we get 95% so 5% of students didn’t use any of the 3
methods of communications.
By looking at the completed Venn diagram we can answer the original question, 95% of students
used at least one of the three forms of communication.
Example: Use the following clues to answer the questions below.
28 children have a dog,a cat or a bird.
13 children have a dog
13 children have a cat
13 children have a bird
4 children have only a dog and a cat
3 children have only a dog and a bird
2 children have only a bird and a cat
No child has 2 of each type of pet.
1. How many children have a dog, a cat and a bird?
2. How many children have only one pet?
Solution:
Let
U = {children with pets}
D = {children with dogs}
C = {children with cats}
B = {children with birds}
Page 21 of 29
Applied 40S
Ch 3: Set Theory and Logic
We don’t know how many children have all three
animals so we let that be x and put x in the
centre where all three sets overlap.
We can enter the values of the children with
two pets.
We know
n(dogs) = 13 so n(dogs only) = 13 – 4 – 3 – x = 6 – x
n(cats) = 13 so n(cats only) = 13 – 4 – 2 – x = 7 – x
and
n(birds) = 13 so n(birds only) = 13 – 3 – 2 – x = 8 – x
Page 22 of 29
Applied 40S
Ch 3: Set Theory and Logic
We also know that 28 children have a pet so the numbers in the Venn Diagram must add up to 28
i.e.
(6 – x ) + 4 + (7 – x) + 3 + x + 2 + (8-x) = 28
30 – 2x = 28
30 – 28 = 2x
2 = 2x
x=1
substituting this value into the
Venn Diagram we get.
From the Venn Diagram we can now answer the questions
1. How many children have a dog, a cat and a bird?
2. How many children have only one pet?
Answer
Answer
1
5 + 6 + 7 = 18
Page 23 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.5 Conditional Statements and their Converse.
A conditional statement is a statement that involves an
if … then …
e.g. If it is raining outside then we will practice indoor.
The statement following the if but before the then is called the hypothesis.
In the statement above
the hypothesis is “it is raining outside”
t
and the statement following the then is called the conclusion
In the statement above
The conclusion us “we will practice indoors”
In order to verify a Conditional Statement we have to consider 4 possibilities:Case 1: Hypothesis is true, Conclusion is true
Case 2: Hypothesis is false, Conclusion is false
Case 3: Hypothesis is false, Conclusion is true
Case 4: Hypothesis is true, Conclusion is false
Conditional Statement is true
Conditional Statement is true
Conditional Statement is true
Conditional Statement is false
Consider the cases for our example:
Case 1. It is raining outside and we practice indoors, the coach kept his promise, the conditional
statement is true.
Case 2: It is not raining outside and we practice outdoor . Since it didn’t rain the coach isn’t obliged to
keep his promise so we can practice indoors or outdoors, the conditional statement is true.
Case 3:. it is not raining outside and we practice indoors . Since it didn’t rain the coach isn’t obliged to
keep his promise so we can practice indoors or outdoors, the conditional statement is true.
Case 4: It is raining outside and we practice outdoors . The coach has broken his promise, it is raining
and we are practicing outdoors so the conditional statement is false.
Page 24 of 29
Applied 40S
Ch 3: Set Theory and Logic
Disproving a Conditional Statement - you only need one counter-example to disprove a statement.
A counter example is an example that disproves a statement.
Eg. The conditional statement
If it is Monday then it is a school day
can be disproved by stating that there is no school on Thanksgiving Monday.
Truth Table for a Conditional Statement.
Let p represent the hypothesis
Let q represent the conclusion.
p
T
F
F
T
q
T
F
T
F
P⇒q
T
T
T
F
From the truth table we can see that the only time a conditional statement is false is when the
hypothesis is true but the conclusion is false.
This means that when I assume that the hypothesis of a conditional statement is true I can determine
whether the conditional statement is true or false based on whether the conclusion is true or false.
We can use set theory to represent a conditional statement. Let’s go back to coaches statement
If it is raining outside then we will practice indoors.
Let
U = {all practice times}
P = {times when it is raining}
Q = {times when we practice indoors}
Let p represent the hypothesis “ it is raining outside”
And
Let q represent the hypothesis “we will practice indoors”
If t is a practice time then t is a member of set U.
If t is a time when it is raining, i.e. t ԑ P, then since we practice indoors when it is raining t must also be a
member of Q, i.e. t ԑ Q . So this means that P ⊂ Q
Page 25 of 29
Applied 40S
Ch 3: Set Theory and Logic
We can also represent this
with a Venn Diagram
From the Venn Diagram, we can see that the conditional statement will be true when


The hypothesis is true and the conclusion is true
The hypothesis is false
The Converse of a Conditional Statement
The converse statement is one in which the hypothesis and conclusion of a conditional statement are
switched.
Examples
Conditional statement:
Converse statement:
If it is raining outside then we will practice indoors.
If we practice indoors then it is raining outside.
Conditional Statement:
Converse statement:
If it is Monday then it is a school day
If it is a school day then it is Monday
Again to verify whether the converse statement is true, assume the hypothesis is true and then decide
whether the conclusion is always true
Converse statement:
If we practice indoors then it is raining outside.
Assume that we practice indoors but we could be practicing indoors because the soccer field is under
repair rather than because it is raining so the converse statement is false.
Converse statement:
If it is a school day then it is Monday
Assume it is a school day but it could be Tuesday so the converse statement is false.
Page 26 of 29
Applied 40S
Ch 3: Set Theory and Logic
Truth Table for a Converse Statement.
p
T
F
F
T
Let p represent the hypothesis
Let q represent the conclusion.
q
T
F
T
F
q⇒p
T
T
F
T
From the truth table we can see that the converse statement is only
false if the original hypothesis is false but the conclusion is true
Example:
If I live in Winnipeg then I live in Manitoba.
The conditional statement is true - Assuming I live in Winnipeg, then Winnipeg is in Manitoba so I must
live in Manitoba.
The converse statement is
If I live in Manitoba then I live in Winnipeg
The converse statement is false - if I live in Manitoba I could live in Birtle so the converse statement is
false.
Bi-Conditional Statements
A true conditional statement whose converse is true is a bi-conditional statement and can be written in
the form “p if and only if q”
e.g. Consider the conditional statement
If a number is even then it is divisible by 2.
This statement is true – all even numbers are divisible by 2.
The converse statement is
If a number is divisible by 2 then it is an even number.
This statement is also true, numbers that are divisible by two are even numbers.
Because both the conditional statement and the converse statement are true we can write this as a biconditional statement.
A number is divisible by 2 if and only if it is an even number.
In this case, because p ⇒ q is true and q ⇒ p is true then p  q
Page 27 of 29
Applied 40S
Ch 3: Set Theory and Logic
3.6 The Inverse and Contrapositive of Conditional Statements
The inverse of a statement is a statement that is formed by negating both the hypothesis and the
conclusion of a conditional statement.
Given the conditional statement:
If a number is even then it is divisible by 2
The inverse statement would be
If a number is not even then it is not divisible by 2.
The truth table for an Inverse statement
p
T
F
F
T
q
T
F
T
F
¬p
F
T
T
F
¬q
F
T
F
T
¬P ⇒¬ q
T
T
F
T
Example
Consider the conditional statement :
If today is February 29th then this year is a leap year.
This statement is true. Feb 29th only occurs in leap years.
The inverse statement is
If today is not Feb 29th then this year is not a leap year.
This statement is false, today is not Feb 29th (¬p is true ) since it could still be a leap year even if today is
another date such as March 5th. .i.e. ¬p is true and ¬q is false so the statement is
Page 28 of 29
Applied 40S
Ch 3: Set Theory and Logic
The contrapositive statement is formed by negating both the hypothesis and the conclusion of the
converse of a conditional statement.
Given the conditional statement:
The converse statement is
If a number is even then it is divisible by 2
If a number is divisible by 2 then it is even
And the contrapositive statement is
If a number is not divisible by 2 then it is not even.
The truth table for a contrapositive statement is
p
T
F
F
T
q
T
F
T
F
¬p
F
T
T
F
¬q
F
T
F
T
¬q ⇒¬ p
T
T
T
F
Example:
Consider the conditional statement :
The Converse statement is
If today is February 29th then this year is a leap year.
If this year is a leap year then today is February 29th.
And the contrapositive statement is
If this year is not a leap year then today is not February 29th.
This statement is true, it this year is not a leap year then today can not be Feb 29th.
Page 29 of 29