B Set A

LIN1032 Formal Foundations
for Linguistics
Lecture 2
Albert Gatt
Reminder from last lecture (I)
 A set can be defined in two ways:
 by enumeration
 L = {Stephanie, Lidwina, Ċensu}
 by description
 L = {x|x is a student of Linguistics}
LIN1032 -- Formal Foundations for
Linguistics
Reminder from last lecture (II)
 A, B, … : uppercase letters used for
sets
 a ∈ B: “a is an element of B”
 A ⊆ B: “A is a subset of B”
 (A may also be equal to B)
 A ⊇ B: “A is a superset of B”
 (Again, A may also be equal to B)
 A ⊂ B: “A is a proper subset of B”
 (A is NOT equal to B)
LIN1032 -- Formal Foundations for
Linguistics
Reminder from last lecture (III)
 A set with only one element is called
a singleton set
 There is one empty set
 Symbol: ∅
 it is a subset of every set
 cf. the Principle of Extensionality
LIN1032 -- Formal Foundations for
Linguistics
Reminder from last lecture (IV)
 |S| (read “the cardinality of S”) is a
measure of how many different
elements S has.
 The power set P(S) of a set S is the
set of all subsets of S.
 P(S) = {x | x⊆S}.
LIN1032 -- Formal Foundations for
Linguistics
Goals of this lecture
 We introduce some crucial operations
on sets.
 We discuss some of the important
properties of these operations.
LIN1032 -- Formal Foundations for
Linguistics
Part 1
Union, intersection,
complementation…
The Universe of Discourse
 Although we can define sets of
anything, it is often useful to refer to
a universe of discourse or universal
set
 the set of “anything and everything”
which is relevant to our inquiry
 denoted U
 many operations are defined in relation
to U
LIN1032 -- Formal Foundations for
Linguistics
The Union Operator
 For sets A, B, their Union A∪B is the
set containing all elements that are
either in A, or in B (or, of course, in
both).
 Note: union is the set-theoretic
equivalent of logical disjunction (“or”)
 Note that A∪B is a superset of both
A and B (in fact, it is the smallest
such superset)
LIN1032 -- Formal Foundations for
Linguistics
Union Examples
 {a,b,c} ∪ {2,3} = {a,b,c,2,3}
 {2,3,5} ∪ {3,5,7} = {2,3,5,3,5,7}
= {2,3,5,7}
LIN1032 -- Formal Foundations for
Linguistics
The Intersection Operator
 For sets A, B, their intersection A∩B
is the set containing all elements that
are simultaneously in A and in B.
 Observe that intersection is the settheoretic equivalent of logical
conjunction (“and”)
 Note that A∩B is a subset of both A
and B (in fact it is the largest such
subset).
LIN1032 -- Formal Foundations for
Linguistics
Intersection Examples
 {a,b,c}∩{2,3} = ∅
 {2,4,6}∩{3,4,5} = {4}
Think “The
intersection of two
streets is just that
part of the road
surface that lies on
both streets.”
LIN1032 -- Formal Foundations for
Linguistics
Disjointness
 Two sets A, B are called disjoint (i.e.,
not joined) iff their intersection is
empty. (A∩B=∅)
 Example: the set of even integers is
disjoint with the set of odd integers.
LIN1032 -- Formal Foundations for
Linguistics
Inclusion-Exclusion Principle
 How many elements are in A∪B?
Can you think of a general formula?
(Express in terms of |A| and |B| and
whatever else you need.)
LIN1032 -- Formal Foundations for
Linguistics
Inclusion-Exclusion Principle
 How many elements are in A∪B?
|A∪B| = |A| + |B| − |A∩B|
 Example: How many students are on
our class email list?
 Consider set E = I ∪ M
I = {s | s registered for LIN1032}
M = {s | s sent the tutors their email}
 Some students may have done both!
|E| = |I∪M| = |I| + |M| − |I∩M|
LIN1032 -- Formal Foundations for
Linguistics
Exercise 1
 Suppose our universe of discourse is
made up of all people in the world.
 U = {x | x is a person}
 assume that we have exactly 5 such
entities
 U = {Mary, John, Bill, Louiselle, Steve}
LIN1032 -- Formal Foundations for
Linguistics
Exercise 1
 U = {Mary, John, Bill, Louiselle, Steve}
 Let:
 F = {x | x is female}
 M = {y | y is male}
 What is:
 F∩M
 =∅
 F∪M
 =U
LIN1032 -- Formal Foundations for
Linguistics
Exercise 2 (from last lecture)
L(inguistics)
Stephanie
M(athematics)
Lidwina
Steve
Ċensu
P(hilosophy)
Olga
Express, in notation:
• “students who study maths and
linguistics”
• “ students who study linguistics or
philosophy (or both)”
• students who study linguistics and
philosophy and mathematics
LIN1032 -- Formal Foundations for
Linguistics
Exercise 2 (solution)
 students who study maths and
linguistics
 M∩L
 students who study linguistics or
philosophy (or both)
 L∪P
 students who study linguistics and
philosophy and mathematics
 M∩L ∩P
LIN1032 -- Formal Foundations for
Linguistics
A note about set operations
 The intersection and union operators
aren’t restricted to two sets!
 I.e. you can define the
intersection/union of as many sets as
you like.
LIN1032 -- Formal Foundations for
Linguistics
Intersection/Union of several sets
 Let:
 A = {1,2,3,4}
 B = {a,2,b,c}
 C = {j,k,l,2,4}
 What is A ∩ B ∩ C?
 (things which are common to all three sets)
 = {2}
 What is A ∪ B ∪ C?
 (everything which is in A, B, or C)
 = {1,2,3,4,a,b,c,j,k,l}
LIN1032 -- Formal Foundations for
Linguistics
Set Difference
 For sets A, B, the difference of A and
B, written A−B, is the set of all
elements that are in A but not B.
 Also called the complement of B with
respect to A.
LIN1032 -- Formal Foundations for
Linguistics
Set Difference - Venn Diagram
 A−B is what’s left after B
“takes a bite out of A”
Set
A−B
Set A
Set B
LIN1032 -- Formal Foundations for
Linguistics
Chomp!
Set complements
 The complement of a set A is defined
as:
 whatever is in the universe of discourse
but not in A
 i.e. everything in the universe except
what is in A
LIN1032 -- Formal Foundations for
Linguistics
Set Complements
 The universe of discourse can itself
be considered a set, call it U.
 When the context clearly defines U,
we say that:
 for any set A⊆U
 the complement of A, written A , is the
complement of A w.r.t. U, i.e., it is U−A.
LIN1032 -- Formal Foundations for
Linguistics
Exercise 3
L(inguistics)
Stephanie
M(athematics)
Lidwina
Steve
Ċensu
P(hilosophy)
Olga
Enumerate
•L-M
= {Stephanie)
•M–L
= {Steve}
• P
= {Steph, Lidwina, Steve}
LIN1032 -- Formal Foundations for
Linguistics
Online exercise
 Log onto a machine
 Go to:
http://nlvm.usu.edu/en/nav/frames_
asid_153_g_3_t_1.html
 To start, click Show Problem
 click on areas of the Venn diagram that
correspond to the set-theoretic formula
 click check to check correctness
 click show solution in case of difficulty
LIN1032 -- Formal Foundations for
Linguistics
Part 2
Laws of set theory
A few important identities
 A∪∅ = A
 unifying the empty set makes no difference…
 A∩∅ = ∅
 no set has anything in common with the empty
set
 A∪U = U
 since A ⊆ U, the union of A and U is just U!
 A∩U = A
 the elements that A has in common with U are
just those in A
LIN1032 -- Formal Foundations for
Linguistics
Idempotent laws
 A∪A = A
 A∩A = A
 We say that union and intersection
are idempotent.
 Performing the operation between a set
and itself has no effect at all!
LIN1032 -- Formal Foundations for
Linguistics
Commutative laws
 A∪B = B∪A
 A∩B = A∩B
 Union and intersection can
“commute”. The order in which we
apply them makes no difference.
LIN1032 -- Formal Foundations for
Linguistics
Associative laws
 (A∪B) ∪C = A∪(B ∪C)
 if we unify more than 2 sets, it doesn’t matter
which pairs we unify first
 A = {1,2,3,4}
 B = {2,3,4,5}
 C = {3,4,5,6}
 (A∪B) ∪C = {1,2,3,4,5,6} = A∪(B ∪C)
 (A∩B)∩C = A∩(B∩C)
 again, the order in which we intersect pairs
doesn’t matter
LIN1032 -- Formal Foundations for
Linguistics
Complement laws
 Observe that if we have a set A defined
over a universe U, then U could be
characterised as:
 what is in A
 what is not in A
 i.e. A ∪ A = U
 Since A and its complement have nothing in
common by definition, we have:
A∩ A = φ
LIN1032 -- Formal Foundations for
Linguistics
Complement laws (continued)
 The complement of the complement of A is A
itself:
A= A
 Suppose





U = {1,2,3,4,5,6} (the universe)
A = {1,2,3,4}
B = {3,4}
Then A – B = {1,2}
Note that this is equal to A ∩ B
 In general:
A− B = A∩ B
LIN1032 -- Formal Foundations for
Linguistics
De Morgan’s Laws I
U
M
L
Lidwina
Stephanie
Steve
Ċensu
P
Olga
L ∪ M = {Stephanie,
Lidwina,Ċensu,Steve}
(L ∪ M) = {Olga}
L = {Steve, Olga}
M = {Stephanie, Olga}
L ∩ M = {Olga}
(L ∪ M) = L ∩ M
In general:
A∪ B = A∩ B
LIN1032 -- Formal Foundations for
Linguistics
De Morgan’s Laws II
U
M
L
Lidwina
Stephanie
Steve
Ċensu
L∩M=
{Stephanie,Ċensu}
(L ∩ M) = {Stephanie,
Steve, Olga}
L = {Steve, Olga}
M = {Stephanie, Olga}
P
Olga
L ∪ M = {Stephanie,
Steve, Olga}
(L ∩ M) = L ∪ M
In general:
A∩ B = A∪ B
LIN1032 -- Formal Foundations for
Linguistics
Summary
 We’ve now introduced the basic
machinery of set theory.
 Focus today on union, intersection,
complementation.
 Some crucial equalities (the “laws” of
set theory)
LIN1032 -- Formal Foundations for
Linguistics