-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlecture2.tex
231 lines (162 loc) · 10.5 KB
/
lecture2.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
\chapter{Set Theory II}
\epigraph{Algebra is the offer made by the devil to the mathematician. The devil says: I will give you this powerful machine, it will answer any question you like. All you need to do is give me your soul: give up geometry and you will have this marvelous machine.}{Michael Francis Atiyah}
Watch the Art of Problem Solving: Venn Diagrams with \href{https://www.youtube.com/watch?v=c8VHzEFVmLA}{two categories} and \href{https://www.youtube.com/watch?v=LIzIhmKlYPk}{three categories}!
We will use {\bf Venn diagrams} to visualise operations between sets. I think they are pretty self explanitory, so I will mostly go through a few examples here and move on. For example, below the left circle represents the $A$ set, and the right circle represents the $B$ set. The coloured portion of the graphic represents the intersection (shared elements) between $A$ and $B$. So for $A \cap B$:
\begin{venndiagram2sets}[shade=skyblue,showframe=false]
\fillACapB
\end{venndiagram2sets}
\begin{boxexample}{}{}
Suppose $A=\{a,b,c\}$ and $B=\{a,b,x,y\}$, then $A \cap B=\{a,b\}$ is visualised with:
\begin{venndiagram2sets}[shade=skyblue,showframe=false,labelOnlyA={c},labelOnlyB={x,y},labelAB={a,b}]
\fillACapB
\end{venndiagram2sets}
\end{boxexample}
This time we will visualise the union of two sets. Again, the coloured area represents everything withing the union. So for $A \cup B$:
\begin{venndiagram2sets}[shade=skyblue,showframe=false]
\fillA \fillB
\end{venndiagram2sets}
\begin{boxexample}{}{}
Suppose $A=\{a,b,c\}$ and $B=\{a,b,x,y\}$, then $A \cup B=\{a,b,c,x,y\}$ is visualised with:
\begin{venndiagram2sets}[shade=skyblue,showframe=false,labelOnlyA={c},labelOnlyB={x,y},labelAB={a,b}]
\fillA \fillB
\end{venndiagram2sets}
\end{boxexample}
And now we look at the complement of the set. So everything within the \emph{universe of discourse} that is not in the set is coloured. Consider the Venn Diagram for $A^\complement$:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillNotA
\end{venndiagram2sets}
\begin{boxexample}{}{}
Suppose $A=\{a,b,c\}$ and $\mathcal{U}=\{a,b,c,d,e,f,g\}$, then $A^\complement=\{d,e,f,g\}$ can be visualised with:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={\quad $d,e,f,g$},labelOnlyA={$a,b,c$}]
\fillNotA
\end{venndiagram2sets}
\end{boxexample}
And when we have two disjoint sets (two sets that do not share elements), no elements are coloured in their intersection. So for $A \cap B = \varnothing$:
\begin{venndiagram2sets}[shade=skyblue,showframe=false,overlap=-.5cm]
\end{venndiagram2sets}
\begin{boxexample}{}{}
For example, given the two sets $A=\{a,b,c\}$, and $B=\{1,2,3\}$, we can see that they share no elements and are disjoint.
\begin{venndiagram2sets}[shade=skyblue,showframe=false,overlap=-.5cm,labelOnlyA={a,b,c},labelOnlyB={1,2,3}]
\end{venndiagram2sets}
\end{boxexample}
Now for the set-difference. We colour in the area that is in $A$, but not in $B$ So for $A \setminus B$:
\begin{venndiagram2sets}[shade=skyblue,showframe=false]
\fillOnlyA
\end{venndiagram2sets}
\begin{boxexample}{}{}
For example, if $A=\{a,b,c,d\}$ and $B=\{c,d\}$, than $A \setminus B=\{c,d\}$.
\begin{venndiagram2sets}[shade=skyblue,showframe=false,labelOnlyA={c,d},labelAB={a,b}]
\fillOnlyA
\end{venndiagram2sets}
\end{boxexample}
\section{Applications for Venn Diagrams}
We'll go over some examples of filling out more complicated Venn Diagrams. In general, you can use simpler Venn Diagrams to build more complicated ones. You'll see that in the below examples.
\begin{boxexample}{}{}
Suppose we want to visualise $(A \cap B)^\complement \cup B$. Thats a little long so lets break it up. Recall what $A \cap B$ looks like.
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillACapB
\end{venndiagram2sets}
Now, we'll invert that to get $(A \cap B)^\complement$:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillNotAorNotB
\end{venndiagram2sets}
And now lets add $B$. So, $(A \cap B)^\complement \cup B$ is:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillAll
\end{venndiagram2sets}
And we see that $(A \cap B)^\complement \cup B$ is acutally the universal set $\mathcal{U}$!
\end{boxexample}
\begin{boxexample}{}{}
Let's try another one. $(A \cap B) \cup (A \cup B^\complement)^\complement$. Again, let's break this down. $A \cap B$ is simple enough.
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillACapB
\end{venndiagram2sets}
The next one is $A \cup B^\complement$, a little bit more tricky. That can be read as the area of A, plus the area of not B. Think about it for a bit, its a logic puzzle.
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillA \fillNotAorB
\end{venndiagram2sets}
We take the complement of above (inverting it) to get $(A \cup B^\complement)^\complement$:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillOnlyB
\end{venndiagram2sets}
And now we glue them together to get to get our union $(A \cap B) \cup (A \cup B^\complement)^\complement$:
\begin{venndiagram2sets}[shade=skyblue,labelNotAB={$\mathcal{U}$}]
\fillB
\end{venndiagram2sets}
From this digram, we can see there is another way of writting $(A \cap B) \cup (A \cup B^\complement)^\complement$. It's just the set $B$!
\end{boxexample}
\section{Applications for Sets}
Now we'll look at how sets and Venn Diagrams can be used to solve problems. In this class, we solve these intuitively. Algebra is another way to solve these problem though. These feel like Suduko puzzles to me.
\begin{boxexample}{}{}
Suppose we surveyed 25 farms. 18 farms had potatoes, and 12 farms had corn. How many farms grow both potatoes and corn?\\
If we add the number of farms with potatoes to the number of farms with corn, then the farms that grow both will be counted twice. In other words,
\[
|P|+|C|=|P \cup C| + |P \cap C|
\]
Now, if we slightly rearrange this equation, we get
\[
|P|+|C| - |P \cup C|=|P \cap C|
\]
So, we can find the intercept by plugging in the values that we know.
\[
18+12-25=|P \cap C| \implies |P \cap C|=5
\]
Our answer is 5, and this is our Venn Diagram:
\begin{venndiagram2sets}[shade=skyblue,showframe=false,labelA={P},labelB={C},labelOnlyA={13},labelOnlyB={7},labelAB={5}]
\fillACapB
\end{venndiagram2sets}
\end{boxexample}
\begin{boxexample}{}{}
Suppose 150 children were surveyed. It was found that 35 played hockey, 71 played baseball, 30 played soccer, 10 played all three, 3 played only soccer, 17 played only hockey, 6 played only soccer and hockey, 48 played only baseball, and 53 played no sports.\\
First, lets draw the Venn Diagram. Start by drawing the three sets.
\begin{venndiagram3sets}[shade=skyblue,labelA={H},labelB={B},labelC={S},labelNotABC={$\mathcal{U}$}]
\end{venndiagram3sets}
Now, let's fill some of this in. Since 53 didn't play anything, they are outside of the three sets. 3 Played only soccer, 17 played only hockey and 48 played only baseball. 10 Played all three, and 6 played only soccer and hockey. So we have:
\begin{venndiagram3sets}[shade=skyblue,labelA={H},labelB={B},labelC={S},labelNotABC={\quad $\mathcal{U} \quad 53$},labelOnlyA={17},labelOnlyB={48},labelOnlyC={3},labelABC={10},labelOnlyAC={6}]
\end{venndiagram3sets}
We'll fill in some more intersections now. How many played only hockey and baseball? There are 35 hockey players, take away 17 who played only hockey, take away 10 who played all three, and take away 6 who played hockey and soccer. So $35-17-10-6=2$. How many played only soccer and baseball? 71 baseball players, take away 48 who played baseball only, take away 10 who played all three, take away 2 who played hockey and baseball. So, $71-48-10-2=11$. The diagram looks like:
\begin{venndiagram3sets}[shade=skyblue,labelA={H},labelB={B},labelC={S},labelNotABC={\quad $\mathcal{U} \quad 53$},labelOnlyA={17},labelOnlyB={48},labelOnlyC={3},labelABC={10},labelOnlyAB={2},labelOnlyBC={11},labelOnlyAC={6}]
\end{venndiagram3sets}
Now we can use this to answer some questions.
\begin{enumerate}
\item How many played soccer and baseball only? $11$
\item How many played hockey and baseball only? $2$
\item How many played soccer and baseball? $10+11=21$
\item How many played soccer {\bf or} baseball but not hockey? $48+11+3=62$
\item How many played exactly 2 games? $6+2+11=19$
\item How many played exactly 1 game? $17+48+3=68$
\item How many played only soccer? $3$
\item How many played soccer {\bf and} baseball but not hockey? $3+48=51$
\end{enumerate}
\end{boxexample}
\begin{boxexample}{}{}
Fourty students who play board games was surveyed.
\medskip
\begin{tabular}{r|l}
\hline
Number of students & Game(s) played\\
\hline
18 & Chess\\
20 & Scrabble\\
27 & Carrom\\
7 & Chess \& Scrabble\\
12 & Scrabble \& Carrom\\
4 & Chess \& Carrom \& Scrabble\\
\hline
\multicolumn{2}{c}{40 Total}\\
\hline
\end{tabular}
\medskip
What is the number of people who play both Chess \& Carrom? What is the number of people who play Chess and Carrom but not Scrabble?\\
We begin by drawing our Venn diagram. We are given the Chess \& Carrom \& Scrabble intersection as $4$. We can use that to find our Chess \& Scrabble only ($7-4=3$) and Scrabble \& Charrom only ($12-4=8$) intersections. Finally, we can calculate our scrabble-only section ($20-3-4-8=5$).
\begin{venndiagram3sets}[shade=skyblue,showframe=false,labelA={Chess},labelB={Scrabble},labelC={Carrom},labelABC={4},labelOnlyAB={3},labelOnlyBC={8},labelOnlyB={5}]
\end{venndiagram3sets}
Now it gets slightly more tricky. Consider the following highlighted section ($\text{Chess} \cup \text{Carrom}$):
\begin{venndiagram3sets}[shade=skyblue,showframe=false,labelA={Chess},labelB={Scrabble},labelC={Carrom},labelABC={4},labelOnlyAB={3},labelOnlyBC={8},labelOnlyB={5}]
\fillA \fillC
\end{venndiagram3sets}
There must be $40-5=35$ students in there. We know that $27$ of them play Carrom, and that $18$ of them play chess. So the Chess \& Carrom intersection must be $27+18-35=10$, and the Chess \& Carrom intersection is $10-4=6$. Thus the chess-only section is $18-6-4-3=5$, and the carrom-only section is $27-6-4-8=9$.
\begin{venndiagram3sets}[shade=skyblue,showframe=false,labelA={Chess},labelB={Scrabble},labelC={Carrom},labelABC={4},labelOnlyAB={3},labelOnlyBC={8},labelOnlyB={5},labelOnlyAC={6},labelOnlyA={5},labelOnlyC={9}]
\end{venndiagram3sets}
The number of people who play both Chess \& Carrom is $6+4=10$, and the number of people who play Chess and Carrom but not Scrabble is $6$.
\end{boxexample}