class 5 - set theory and venn diagrams
DESCRIPTION
This class looks at set theory and ways to apply Venn to solving set problems.TRANSCRIPT
THE LOGIC OF COLLECTIONSClass 5 – Set Theory and Venn Diagrams
Introduction
Discrete versus Applied Mathematics Black, White & Grey
Set Theory and Venn Problem: Skilled Resources
24 Programmers 8 Ruby, 10 Java, 12 VB 2=R+J+V 4=R+J-V 3=J+V-R 1=R-V-J ?=V-J-R
Java
RubyVB
Agenda
Review and Debrief Set Theory Set Operators Venn Diagrams Quest: Ruby Math features Quest Topic: Truth Tables Assignment Wrap-up, Questions
Review Debrief
Assignment 2 Observations - Questions
Assignment Three Challenges Learning
Ruby Installation & IDEs Review – Ruby Strings & Variables
Practice handout
Set Theory
The language of Sets Set Element Subset Universe Empty set Cardinality
Set Theory
Notation: Set A={1,2,3,4,5}
Or: A= {x|x, a integer AND 0<x<6 }
A={1,2,3,...,10} A={1,3,5,...,99} A={2,4,6...}
Set Theory
Notation: Element x A Or A x
A={1,2,3,...,10} And x= 12:. x A
Э
Э
Э
Set Theory
Notation: Subset A={1,3,5,7..99} and B =
{21,27,33} B ⊂ A Iff A<>B then B ⊂ A
Notation: empty set = Ø or {} E={Ø}; |E|=1 C= Ø; |C|=0
Set Theory
Notation: Universal Set Universe=U
Java
RubyVB
U
Set Theory
Notation: Cardinality A={1,3,5,...21} |A|=11 N={a,b,c,...z} |N|=26 C={1,2,3,4,...} |C|=∞ Z={all even prime numbers >2} |Z|
=0
Exercise: Basic Set Theory
Please attempt all questions Use appropriate notation
Time: 10 minutes
Set Operations
Union – the set of all elements of both sets
Notation: A ∪ B
T={e,g,b,d,f} B={f,a,c,e} T ∪ B = {a,b,c,d,e,f,g}*
A B
Set Operations
Intersection – the set of common elements of both sets
Notation: A ∩ B
T={e,g,b,d,f} B={f,a,c,e} T ∩ B = {e,f}
A B
A ∩ B
Set Operations
Cardinality principle for two sets = |A ∪ B| = |A| + |B| - | A ∩ B | example
Cardinality principle for three sets = |A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |A
∩ C| - |B ∩ C| + |A ∩ B ∩ C|
example
Set Operations
Complement – all those elements in the universal set which are not part of the defined set Notation A’ or Ac
e.g. U={1,2,3,4,...} A={2,4,6,8,...} A’= {1,3,5,7,...}
Exercise: Set Operations
Please attempt all questions Use appropriate notation
Time: 10 minutes
Venn Diagrams
A visual representation of Sets Each circle is a set or subset The rectangle is
the universal set Overlaps are
intersections The union is the
set of uniqueelements among all sets
Java
RubyVB
U
Venn Diagrams
Using Venn to solve problems Handout & Walkthrough
Group Exercises
Skills Problem Lateral Thinking
ProblemDB
WEBPROG
U
Group Exercises
Skills Problem Plug in what we are given
DB
WEBPROG
U=30
16
16
11
32
58
Group Exercises
Skills Problem Calculate WEB + PROG
DB
WEBPROG
U=30
16
16
11
32
581
Group Exercises
Skills Problem Calculate PROG + DB
DB
WEBPROG
U=30
16
16
11
32
581
4
Group Exercises
Skills Problem Calculate DB
30=x + 4 + 3 + 2+ 1 + 8 + 5
30=x + 23 X=7
DB
WEBPROG
U=30
16
16
11
32
581
4
x
Summary
Set Theory Language and Notation
Set Operations Union, Intersection, Cardinality,
Complement Cardinality of two and three sets
Venn Diagrams Relationship with sets
Questions?
Assignment
Assignment IV: Set Theory and Venn Diagrams
Complete all exercise Venn and calculation required for full
marks Due: Start of next class