author | Christian Urban <christian.urban@kcl.ac.uk> |
Mon, 27 Jul 2020 01:55:05 +0100 | |
changeset 740 | 923b946347e6 |
parent 704 | 6d9c960a2b26 |
child 744 | 99c5916d9a8f |
permissions | -rw-r--r-- |
704 | 1 |
% !TEX program = xelatex |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\documentclass[dvipsnames,14pt,t]{beamer} |
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
3 |
\usepackage{../slides} |
215
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
4 |
\usepackage{../langs} |
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
5 |
\usepackage{../data} |
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
6 |
\usepackage{../graphics} |
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
7 |
\usepackage{soul} |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
223
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
9 |
\tikzset{onslide/.code args={<#1>#2}{% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
10 |
\only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
11 |
}} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
12 |
|
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
13 |
\makeatletter |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
14 |
\newenvironment<>{btHighlight}[1][] |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
15 |
{\begin{onlyenv}#2\begingroup\tikzset{bt@Highlight@par/.style={#1}}\begin{lrbox}{\@tempboxa}} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
16 |
{\end{lrbox}\bt@HL@box[bt@Highlight@par]{\@tempboxa}\endgroup\end{onlyenv}} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
17 |
|
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
18 |
\newcommand<>\btHL[1][]{% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
19 |
\only#2{\begin{btHighlight}[#1]\bgroup\aftergroup\bt@HL@endenv}% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
20 |
} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
21 |
\def\bt@HL@endenv{% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
22 |
\end{btHighlight}% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
23 |
\egroup |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
24 |
} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
25 |
\newcommand{\bt@HL@box}[2][]{% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
26 |
\tikz[#1]{% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
27 |
\pgfpathrectangle{\pgfpoint{1pt}{0pt}}{\pgfpoint{\wd #2}{\ht #2}}% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
28 |
\pgfusepath{use as bounding box}% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
29 |
\node[anchor=base west, fill=orange!30,outer sep=0pt,inner xsep=1pt, inner ysep=0pt, rounded corners=3pt, minimum height=\ht\strutbox+1pt,#1]{\raisebox{1pt}{\strut}\strut\usebox{#2}}; |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
30 |
}% |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
31 |
} |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
32 |
\makeatother |
e4b29b57f6a3
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
33 |
|
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
34 |
|
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
35 |
% beamer stuff |
459 | 36 |
\renewcommand{\slidecaption}{CFL 10, King's College London} |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
37 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
38 |
|
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
39 |
|
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
\begin{document} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
41 |
|
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
43 |
\begin{frame}[t] |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
\frametitle{% |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
\begin{tabular}{@ {}c@ {}} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
\\[-3mm] |
459 | 47 |
\LARGE Compilers and \\[-2mm] |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
\LARGE Formal Languages (10)\\[3mm] |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
\end{tabular}} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
|
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
\normalsize |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
\begin{center} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
\begin{tabular}{ll} |
704 | 54 |
Email: & christian.urban at kcl.ac.uk\\ |
55 |
Office Hours: & Thursdays 12 -- 14\\ |
|
56 |
Location: & N7.07 (North Wing, Bush House)\\ |
|
57 |
Slides \& Progs: & KEATS (also homework is there)\\ |
|
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
\end{tabular} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
\end{center} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
|
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
61 |
\end{frame} |
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
|
704 | 64 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
65 |
\begin{frame}[c,fragile] |
|
66 |
||
67 |
||
68 |
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-6mm] |
|
69 |
def fact(n: Int) : Int = { |
|
70 |
if (n == 0) 1 else n * fact(n - 1) |
|
71 |
} |
|
72 |
||
73 |
||
74 |
def factC(n: Int, ret: Int => Int) : Int = { |
|
75 |
if (n == 0) ret(1) |
|
76 |
else factC(n - 1, x => ret(n * x)) |
|
77 |
} |
|
78 |
||
79 |
fact(10) |
|
80 |
factC(10, identity) |
|
81 |
\end{lstlisting} |
|
82 |
\end{frame} |
|
83 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
84 |
||
85 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
86 |
\begin{frame}[c,fragile] |
|
87 |
||
88 |
||
89 |
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-6mm] |
|
90 |
def fibC(n: Int, ret: Int => Int) : Int = { |
|
91 |
if (n == 0 || n == 1) ret(1) else |
|
92 |
fibC(n - 1, |
|
93 |
r1 => fibC(n - 2, |
|
94 |
r2 => ret(r1 + r2))) |
|
95 |
} |
|
96 |
||
97 |
fibC(10, identity) |
|
98 |
\end{lstlisting} |
|
99 |
\end{frame} |
|
100 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
101 |
||
102 |
||
103 |
||
104 |
||
543 | 105 |
|
106 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
107 |
\begin{frame}[c] |
|
108 |
||
704 | 109 |
\Large\bf Are there more strings in \\ \hfill\bl{$L(a^*)$} or |
617 | 110 |
\bl{$L((a + b)^*)$}? |
543 | 111 |
|
112 |
\end{frame} |
|
113 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
114 |
||
115 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
116 |
\begin{frame}[c] |
|
704 | 117 |
\frametitle{Can you remember this HW?} |
118 |
||
119 |
\begin{itemize} |
|
120 |
\item (1) How many basic regular expressions are there to match |
|
121 |
the string \bl{$abcd$}? |
|
122 |
\item (2) How many if they cannot include |
|
123 |
\bl{$\ONE$} and \bl{$\ZERO$}? |
|
124 |
\item (3) How many if they are also not |
|
125 |
allowed to contain stars? |
|
126 |
\item (4) How many if they are also |
|
127 |
not allowed to contain \bl{$\_ + \_$}? |
|
128 |
\end{itemize} |
|
129 |
||
130 |
\end{frame} |
|
131 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
132 |
||
133 |
||
134 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
135 |
\begin{frame}[c] |
|
543 | 136 |
|
137 |
\Large\bf There are more problems, than there are |
|
138 |
programs.\bigskip\bigskip\pause\\ |
|
139 |
||
140 |
There must be a problem for which there is no program. |
|
141 |
\end{frame} |
|
142 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
143 |
||
144 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
145 |
\begin{frame}[c] |
|
146 |
\frametitle{Subsets} |
|
147 |
||
148 |
\Large |
|
149 |
If \bl{$A \subseteq B$} then \bl{$A$} has fewer or equal elements |
|
150 |
than \bl{$B$}\bigskip\bigskip |
|
151 |
||
152 |
\Large |
|
153 |
\bl{$A \subseteq B$} and \bl{$B \subseteq A$}\bigskip |
|
154 |
||
155 |
then \bl{$A = B$} |
|
156 |
\end{frame} |
|
157 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
158 |
||
159 |
||
160 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
161 |
\begin{frame}[c] |
|
162 |
||
163 |
\begin{center} |
|
164 |
\begin{tikzpicture} |
|
165 |
||
166 |
\draw (-4,2.5) node [scale=2.5] (X) |
|
167 |
{\begin{tabular}{l} |
|
168 |
$\{$ |
|
169 |
\!\includegraphics[scale=0.02]{../pics/o1.jpg}, |
|
170 |
\includegraphics[scale=0.02]{../pics/o2.jpg}, |
|
171 |
\!\includegraphics[scale=0.02]{../pics/o3.jpg}, |
|
172 |
\includegraphics[scale=0.02]{../pics/o4.jpg}, |
|
173 |
\!\includegraphics[scale=0.027]{../pics/o5.jpg} |
|
174 |
$\}$ |
|
175 |
\end{tabular}}; |
|
176 |
||
177 |
\draw (-5.6,-2.5) node [scale=2.5] (Y) |
|
178 |
{\begin{tabular}{l} |
|
179 |
$\{$ |
|
180 |
\!\includegraphics[scale=0.059]{../pics/a1.jpg}, |
|
181 |
\includegraphics[scale=0.048]{../pics/a2.jpg}, |
|
182 |
\includegraphics[scale=0.02]{../pics/a3.jpg} |
|
183 |
$\}$ |
|
184 |
\end{tabular}}; |
|
185 |
||
186 |
\draw (0,1.5) node (X1) {5 elements}; |
|
187 |
\draw (0,-3.5) node (y1) {3 elements}; |
|
188 |
\end{tikzpicture} |
|
189 |
\end{center} |
|
190 |
||
191 |
\end{frame} |
|
192 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
193 |
||
194 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
195 |
\begin{frame}[c] |
|
196 |
\frametitle{Newton vs Feynman} |
|
197 |
||
198 |
\begin{center} |
|
199 |
\begin{tabular}{cc} |
|
200 |
\includegraphics[scale=0.2]{../pics/newton.jpg} & |
|
201 |
\includegraphics[scale=0.2]{../pics/feynman.jpg}\\ |
|
202 |
classical physics & quantum physics |
|
203 |
\end{tabular} |
|
204 |
\end{center} |
|
205 |
\end{frame} |
|
206 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
207 |
||
208 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
209 |
\begin{frame}[c] |
|
210 |
\frametitle{The Goal of the Talk} |
|
211 |
\large |
|
212 |
\begin{itemize} |
|
213 |
\item show you that something very unintuitive happens with very large sets |
|
214 |
\bigskip\bigskip |
|
215 |
||
216 |
\item convince you that there are more {\bf problems} than {\bf programs} |
|
217 |
\end{itemize} |
|
218 |
\end{frame} |
|
219 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
220 |
||
221 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
222 |
\begin{frame}[t] |
|
223 |
% |
|
224 |
\begin{center} |
|
225 |
\begin{tikzpicture} |
|
226 |
||
227 |
\draw (-5,2.5) node [scale=2.3] (X) |
|
228 |
{\begin{tabular}{@ {\hspace{-3mm}}l} |
|
229 |
\bl{$B$ $=$ $\{$ |
|
230 |
\!\includegraphics[scale=0.02]{../pics/o1.jpg}, |
|
231 |
\includegraphics[scale=0.02]{../pics/o2.jpg}, |
|
232 |
\!\includegraphics[scale=0.02]{../pics/o3.jpg}, |
|
233 |
\includegraphics[scale=0.02]{../pics/o4.jpg}, |
|
234 |
\!\includegraphics[scale=0.027]{../pics/o5.jpg} |
|
235 |
$\}$} |
|
236 |
\end{tabular}}; |
|
237 |
||
238 |
\draw (-6.6,-0.5) node [scale=2.3] (Y) |
|
239 |
{\begin{tabular}{@ {\hspace{-3mm}}l} |
|
240 |
\bl{$A$ $=$ $\{$ |
|
241 |
\!\includegraphics[scale=0.059]{../pics/a1.jpg}, |
|
242 |
\includegraphics[scale=0.048]{../pics/a2.jpg}, |
|
243 |
\includegraphics[scale=0.02]{../pics/a3.jpg} |
|
244 |
$\}$} |
|
245 |
\end{tabular}}; |
|
246 |
||
247 |
\only<1>{\draw (-5, -3) node[scale=2] |
|
248 |
{\bl{$|A|$ $=$ $5$}, \bl{$|B|$ $=$ $3$}};} |
|
249 |
\only<2>{ |
|
250 |
\draw [->, line width=1mm, red] (-7.4, 0.2) -- (-6.1, 2.1); |
|
251 |
\draw [->, line width=1mm, red] (-5.8, 0.2) -- (-3.1, 2.1); |
|
252 |
\draw [->, line width=1mm, red] (-4.5, 0.2) -- (-7.6, 2.1); |
|
253 |
\draw (-5, -3) node[scale=2] {then \bl{$|A|$ $\le$ $|B|$}}; |
|
254 |
} |
|
255 |
\only<3>{ |
|
256 |
\draw [<-, line width=1mm, red] (-7.5, 0.2) -- (-6.1, 2.1); |
|
257 |
\draw [<-, line width=1mm, red] (-7.3, 0.2) -- (-3.1, 2.1); |
|
258 |
\draw [<-, line width=1mm, red] (-6, 0.2) -- (-7.5, 2.1); |
|
259 |
\draw [<-, line width=1mm, red] (-4.5, 0.2) -- (-4.5, 2.1); |
|
260 |
\draw [<-, line width=1mm, red] (-4.3, 0.2) -- (-1.3, 2.1); |
|
261 |
||
262 |
\draw (-5, -3) node[scale=1.5] {\small{}for \bl{$=$} |
|
263 |
has to be a {\bf one-to-one} mapping}; |
|
264 |
} |
|
265 |
||
266 |
||
267 |
\end{tikzpicture} |
|
268 |
\end{center} |
|
269 |
||
270 |
\end{frame} |
|
271 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
272 |
||
273 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
274 |
\begin{frame}[c] |
|
275 |
\frametitle{Cardinality} |
|
276 |
||
277 |
\Large |
|
278 |
\bl{$|A|$} $\dn$ ``how many elements''\bigskip\\ |
|
279 |
||
280 |
\bl{$A \subseteq B \Rightarrow |A| \leq |B|$}\bigskip\\\pause |
|
281 |
||
282 |
if there is an injective function \bl{$f: A \rightarrow B$} then \bl{$|A| \leq |B|$}\ |
|
283 |
||
284 |
\begin{center} |
|
285 |
\bl{\large$\forall x y.\; f(x) = f(y) \Rightarrow x = y$} |
|
286 |
\end{center} |
|
287 |
\end{frame} |
|
288 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
289 |
||
290 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
291 |
\begin{frame}[t] |
|
292 |
||
293 |
\begin{center} |
|
294 |
\begin{tikzpicture} |
|
295 |
||
296 |
\draw (-6.6,2.5) node [scale=2.3] (X) |
|
297 |
{\begin{tabular}{@ {\hspace{-3mm}}l} |
|
298 |
$A$ $=$ $\{$ |
|
299 |
\!\includegraphics[scale=0.02]{../pics/o1.jpg}, |
|
300 |
\includegraphics[scale=0.02]{../pics/o2.jpg}, |
|
301 |
\!\includegraphics[scale=0.02]{../pics/o3.jpg} |
|
302 |
$\}$ |
|
303 |
\end{tabular}}; |
|
304 |
||
305 |
\draw (-6.6,-0.5) node [scale=2.3] (Y) |
|
306 |
{\begin{tabular}{@ {\hspace{-3mm}}l} |
|
307 |
$B$ $=$ $\{$ |
|
308 |
\!\includegraphics[scale=0.059]{../pics/a1.jpg}, |
|
309 |
\includegraphics[scale=0.048]{../pics/a2.jpg}, |
|
310 |
\includegraphics[scale=0.02]{../pics/a3.jpg} |
|
311 |
$\}$ |
|
312 |
\end{tabular}}; |
|
313 |
\onslide<3->{\draw (-7, -3) node[scale=1.5] |
|
314 |
{then \bl{$|A|$ \alert{$=$} $|B|$}};} |
|
315 |
\only<1>{ |
|
316 |
\draw [->, line width=1mm, red] (-7.4, 0.2) -- (-6.1, 2.1); |
|
317 |
\draw [->, line width=1mm, red] (-5.8, 0.2) -- (-4.3, 2.1); |
|
318 |
\draw [->, line width=1mm, red] (-4.5, 0.2) -- (-7.6, 2.1); |
|
319 |
} |
|
320 |
\only<2->{ |
|
321 |
\draw [<-, line width=1mm, blue] (-7.5, 0.2) -- (-7.5, 2.1); |
|
322 |
\draw [<-, line width=1mm, blue] (-5.8, 0.2) -- (-4.3, 2.1); |
|
323 |
\draw [<-, line width=1mm, blue] (-4.5, 0.2) -- (-6.1, 2.1); |
|
324 |
} |
|
325 |
||
326 |
||
327 |
\end{tikzpicture} |
|
328 |
\end{center} |
|
329 |
||
330 |
\end{frame} |
|
331 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
315
470922b46a63
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
224
diff
changeset
|
332 |
|
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
333 |
|
543 | 334 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
335 |
\begin{frame}[c] |
|
336 |
\frametitle{Natural Numbers} |
|
337 |
||
338 |
\Large |
|
339 |
\bl{$\mathbb{N}$} \bl{$\dn$} \bl{$\{0, 1, 2, 3, .......\}$}\bigskip\pause |
|
340 |
||
341 |
\bl{$A$} is \alert{countable} iff \bl{$|A| \leq |\mathbb{N}|$} |
|
342 |
||
343 |
\end{frame} |
|
344 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
345 |
||
346 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
347 |
\begin{frame}[c] |
|
348 |
\frametitle{First Question} |
|
349 |
||
350 |
\Large |
|
351 |
\bl{$|\mathbb{N} - \{0\}| \;\;\;\alert{?}\;\;\; |\mathbb{N}| $}\bigskip\bigskip |
|
352 |
||
353 |
\large |
|
354 |
\bl{$\geq$} or \bl{$\leq$} or \bl{$=$} ? |
|
355 |
\bigskip\bigskip\bigskip\pause |
|
356 |
||
357 |
\bl{$x$ $\mapsto$ $x + 1$},\\ \bl{$|\mathbb{N} - \{0\}|$ $=$ |
|
358 |
$|\mathbb{N}|$} |
|
359 |
\end{frame} |
|
360 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
361 |
||
362 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
363 |
\mode<presentation>{ |
|
364 |
\begin{frame}[c] |
|
365 |
||
366 |
\Large |
|
367 |
\bl{$|\mathbb{N} - \{0, 1\}| \;\;\;\alert{?}\;\;\; |\mathbb{N}| $}\bigskip\pause |
|
368 |
||
369 |
\bl{$|\mathbb{N} - \mathbb{O}| \;\;\;\alert{?}\;\;\; |\mathbb{N}| $}\bigskip\bigskip |
|
370 |
||
371 |
\normalsize |
|
372 |
\bl{$\mathbb{O}$} $\dn$ odd numbers\quad \bl{$\{1,3,5......\}$}\\ \pause |
|
373 |
\bl{$\mathbb{E}$} $\dn$ even numbers\quad \bl{$\{0,2,4......\}$}\\ |
|
374 |
\end{frame}} |
|
375 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
376 |
||
377 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
378 |
\mode<presentation>{ |
|
379 |
\begin{frame}[c] |
|
380 |
||
381 |
\Large |
|
382 |
\bl{$|\mathbb{N} \cup \mathbb{-N}| \;\;\;\alert{?}\;\;\; |\mathbb{N}| $}\bigskip\bigskip |
|
383 |
||
384 |
||
385 |
\normalsize |
|
386 |
\bl{$\mathbb{\phantom{-}N}$} $\dn$ positive numbers\quad \bl{$\{0,1,2,3,......\}$}\\ |
|
387 |
\bl{$\mathbb{-N}$} $\dn$ negative numbers\quad \bl{$\{0,-1,-2,-3,......\}$}\\ |
|
388 |
\end{frame}} |
|
389 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
390 |
||
391 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
392 |
\mode<presentation>{ |
|
393 |
\begin{frame}[c] |
|
394 |
||
395 |
\Large |
|
396 |
\bl{$A$} is \alert{countable} if there exists an injective \bl{$f : A \rightarrow \mathbb{N}$}\bigskip |
|
397 |
||
398 |
\bl{$A$} is \alert{uncountable} if there does not exist an injective \bl{$f : A \rightarrow \mathbb{N}$}\bigskip\bigskip |
|
399 |
||
400 |
||
401 |
countable: \bl{$|A| \leq |\mathbb{N}|$}\\ |
|
402 |
uncountable: \bl{$|A| > |\mathbb{N}|$}\pause\bigskip |
|
403 |
||
404 |
||
405 |
Does there exist such an \bl{$A$} ? |
|
406 |
||
407 |
\end{frame}} |
|
408 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
409 |
||
410 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
411 |
\mode<presentation>{ |
|
412 |
\begin{frame}[c] |
|
413 |
\frametitle{Hilbert's Hotel} |
|
414 |
||
415 |
\begin{center} |
|
416 |
\includegraphics[scale=0.8]{../pics/hilberts_hotel.jpg} |
|
417 |
\end{center} |
|
418 |
||
419 |
\begin{itemize} |
|
420 |
\item \ldots has as many rooms as there are natural numbers |
|
421 |
\end{itemize} |
|
422 |
||
423 |
\end{frame}} |
|
424 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
425 |
||
426 |
||
427 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
428 |
\begin{frame}[t] |
|
429 |
\frametitle{\begin{tabular}{c}Real Numbers between\\[-2mm] 0 and 1\end{tabular}} |
|
430 |
||
431 |
\begin{center} |
|
432 |
\begin{tikzpicture} |
|
433 |
\draw [fill, color=black!50] (1,4) rectangle (2, 3); |
|
434 |
\draw [fill, color=black!50] (2,3) rectangle (3, 2); |
|
435 |
\draw [fill, color=black!50] (3,2) rectangle (4, 1); |
|
436 |
\draw [fill, color=black!50] (4,1) rectangle (5, 0); |
|
437 |
\draw (0, 0) grid (8, 5); |
|
438 |
\draw [line width = 1.mm] (1,0) -- (1, 5); |
|
439 |
\draw [line width = 1.mm] (0, 4) -- (8, 4); |
|
440 |
\draw (0.5,3.5) node {$1$}; |
|
441 |
\draw (0.5,2.5) node {$2$}; |
|
442 |
\draw (0.5,1.5) node {$3$}; |
|
443 |
\draw (0.5,0.5) node {$4$}; |
|
444 |
||
445 |
\draw (1.5,3.5) node {\only<1>{$3$}\only<2->{$4$}}; |
|
446 |
\draw (2.5,3.5) node {$3$}; |
|
447 |
\draw (3.5,3.5) node {$3$}; |
|
448 |
\draw (4.5,3.5) node {$3$}; |
|
449 |
\draw (5.5,3.5) node {$3$}; |
|
450 |
\draw (6.5,3.5) node {$3$}; |
|
451 |
\draw (7.5,3.5) node {$\ldots$}; |
|
452 |
||
453 |
\draw (1.5,2.5) node {$1$}; |
|
454 |
\draw (2.5,2.5) node {\only<1-2>{$2$}\only<3->{$3$}}; |
|
455 |
\draw (3.5,2.5) node {$3$}; |
|
456 |
\draw (4.5,2.5) node {$4$}; |
|
457 |
\draw (5.5,2.5) node {$5$}; |
|
458 |
\draw (6.5,2.5) node {$6$}; |
|
459 |
\draw (7.5,2.5) node {$7$}; |
|
460 |
||
461 |
\draw (1.5,1.5) node {$0$}; |
|
462 |
\draw (2.5,1.5) node {$1$}; |
|
463 |
\draw (3.5,1.5) node {\only<1-3>{$0$}\only<4->{$1$}}; |
|
464 |
\draw (4.5,1.5) node {$1$}; |
|
465 |
\draw (5.5,1.5) node {$0$}; |
|
466 |
\draw (6.5,1.5) node {$\ldots$}; |
|
467 |
||
468 |
\draw (1.5,0.5) node {$7$}; |
|
469 |
\draw (2.5,0.5) node {$8$}; |
|
470 |
\draw (3.5,0.5) node {$5$}; |
|
471 |
\draw (4.5,0.5) node {\only<1-4>{$3$}\only<5->{$4$}}; |
|
472 |
\draw (5.5,0.5) node {$9$}; |
|
473 |
\draw (6.5,0.5) node {$\ldots$}; |
|
474 |
||
475 |
\draw (1.5,-0.5) node {$\ldots$}; |
|
476 |
\draw (8.5,3.5) node {$\ldots$}; |
|
477 |
\end{tikzpicture} |
|
478 |
\end{center} |
|
479 |
\mbox{}\\[-20mm]\mbox{} |
|
480 |
||
481 |
\onslide<6->{ |
|
482 |
\begin{center} |
|
483 |
\Large\bl{$|\mathbb{N}| < |R|$} |
|
484 |
\end{center} |
|
485 |
} |
|
486 |
||
487 |
\end{frame} |
|
488 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
489 |
||
490 |
||
491 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
492 |
\mode<presentation>{ |
|
493 |
\begin{frame}[t] |
|
494 |
\frametitle{The Set of Problems} |
|
495 |
||
496 |
$\aleph_0$ |
|
497 |
||
498 |
\begin{center} |
|
499 |
\begin{tikzpicture} |
|
500 |
\draw [fill, color=black!50] (1,4) rectangle (2, 3); |
|
501 |
\draw [fill, color=black!50] (2,3) rectangle (3, 2); |
|
502 |
\draw [fill, color=black!50] (3,2) rectangle (4, 1); |
|
503 |
\draw [fill, color=black!50] (4,1) rectangle (5, 0); |
|
504 |
\draw (0, 0) grid (8, 5); |
|
505 |
\draw [line width = 1.mm] (1,0) -- (1, 5); |
|
506 |
\draw [line width = 1.mm] (0, 4) -- (8, 4); |
|
507 |
\draw (0.5,3.5) node {$1$}; |
|
508 |
\draw (0.5,2.5) node {$2$}; |
|
509 |
\draw (0.5,1.5) node {$3$}; |
|
510 |
\draw (0.5,0.5) node {$4$}; |
|
511 |
||
512 |
\draw (1.5,4.5) node {$0$}; |
|
513 |
\draw (2.5,4.5) node {$1$}; |
|
514 |
\draw (3.5,4.5) node {$2$}; |
|
515 |
\draw (4.5,4.5) node {$3$}; |
|
516 |
\draw (5.5,4.5) node {$4$}; |
|
517 |
\draw (6.5,4.5) node {$5$}; |
|
518 |
\draw (7.5,4.5) node {$\ldots$}; |
|
519 |
||
520 |
\draw (1.5,3.5) node {$0$}; |
|
521 |
\draw (2.5,3.5) node {$1$}; |
|
522 |
\draw (3.5,3.5) node {$0$}; |
|
523 |
\draw (4.5,3.5) node {$1$}; |
|
524 |
\draw (5.5,3.5) node {$0$}; |
|
525 |
\draw (6.5,3.5) node {$1$}; |
|
526 |
\draw (7.5,3.5) node {$\ldots$}; |
|
527 |
||
528 |
\draw (1.5,2.5) node {$0$}; |
|
529 |
\draw (2.5,2.5) node {$0$}; |
|
530 |
\draw (3.5,2.5) node {$0$}; |
|
531 |
\draw (4.5,2.5) node {$1$}; |
|
532 |
\draw (5.5,2.5) node {$1$}; |
|
533 |
\draw (6.5,2.5) node {$0$}; |
|
534 |
\draw (7.5,2.5) node {$0$}; |
|
535 |
||
536 |
\draw (1.5,1.5) node {$0$}; |
|
537 |
\draw (2.5,1.5) node {$0$}; |
|
538 |
\draw (3.5,1.5) node {$0$}; |
|
539 |
\draw (4.5,1.5) node {$0$}; |
|
540 |
\draw (5.5,1.5) node {$0$}; |
|
541 |
\draw (6.5,1.5) node {$\ldots$}; |
|
542 |
||
543 |
\draw (1.5,0.5) node {$1$}; |
|
544 |
\draw (2.5,0.5) node {$1$}; |
|
545 |
\draw (3.5,0.5) node {$0$}; |
|
546 |
\draw (4.5,0.5) node {$1$}; |
|
547 |
\draw (5.5,0.5) node {$1$}; |
|
548 |
\draw (6.5,0.5) node {$\ldots$}; |
|
549 |
||
550 |
\draw (1.5,-0.5) node {$\ldots$}; |
|
551 |
\draw (8.5,3.5) node {$\ldots$}; |
|
552 |
||
553 |
\end{tikzpicture} |
|
554 |
\end{center} |
|
555 |
||
556 |
||
557 |
\onslide<2>{ |
|
558 |
\begin{center} |
|
559 |
\large \bl{|Progs| $=$ $|\mathbb{N}|$ $<$ |Probs|} |
|
560 |
\end{center} |
|
561 |
} |
|
562 |
||
563 |
||
564 |
\end{frame}} |
|
565 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
566 |
||
567 |
||
568 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
569 |
\mode<presentation>{ |
|
570 |
\begin{frame}[c] |
|
571 |
\frametitle{Halting Problem} |
|
572 |
||
573 |
\large |
|
574 |
Assume a program \bl{$H$} that decides for all programs \bl{$A$} and all |
|
575 |
input data \bl{$D$} whether\bigskip |
|
576 |
||
577 |
\begin{itemize} |
|
578 |
\item \bl{$H(A, D) \dn 1$} iff \bl{$A(D)$} terminates |
|
579 |
\item \bl{$H(A, D) \dn 0$} otherwise |
|
580 |
\end{itemize} |
|
581 |
||
582 |
\end{frame}} |
|
583 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
584 |
||
585 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
586 |
\mode<presentation>{ |
|
587 |
\begin{frame}[c] |
|
588 |
\frametitle{Halting Problem (2)} |
|
589 |
||
590 |
\large |
|
591 |
Given such a program \bl{$H$} define the following program \bl{$C$}: |
|
592 |
for all programs \bl{$A$}\bigskip |
|
593 |
||
594 |
\begin{itemize} |
|
595 |
\item \bl{$C(A) \dn 0$} iff \bl{$H(A, A) = 0$} |
|
596 |
\item \bl{$C(A) \dn$ loops} otherwise |
|
597 |
\end{itemize} |
|
598 |
||
599 |
\end{frame}} |
|
600 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
601 |
||
602 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
603 |
\mode<presentation>{ |
|
604 |
\begin{frame}[c] |
|
605 |
\frametitle{Contradiction} |
|
606 |
||
607 |
||
608 |
\bl{$H(C, C)$} is either \bl{$0$} or \bl{$1$}. |
|
609 |
||
610 |
\begin{itemize} |
|
611 |
\item \bl{$H(C, C) = 1$} $\stackrel{\text{def}\,H}{\Rightarrow}$ \bl{$C(C)\downarrow$} $\stackrel{\text{def}\,C}{\Rightarrow}$ \bl{$H(C, C)=0$} |
|
612 |
\item \bl{$H(C, C) = 0$} $\stackrel{\text{def}\,H}{\Rightarrow}$ \bl{$C(C)$} loops $\stackrel{\text{def}\,C}{\Rightarrow}$\\ |
|
613 |
\hspace{7cm}\bl{$H(C, C)=1$} |
|
614 |
\end{itemize} |
|
615 |
||
616 |
Contradiction in both cases. So \bl{$H$} cannot exist. |
|
617 |
||
618 |
\end{frame}} |
|
619 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
620 |
||
621 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
622 |
\mode<presentation>{ |
|
623 |
\begin{frame}[c] |
|
624 |
\frametitle{Take Home Points} |
|
625 |
\large |
|
626 |
||
627 |
\begin{itemize} |
|
628 |
\item there are sets that are more infinite than others\bigskip |
|
629 |
\item even with the most powerful computer we can imagine, there |
|
630 |
are problems that cannot be solved by any program\bigskip\bigskip |
|
631 |
||
632 |
\item in CS we actually hit quite often such problems (halting problem) |
|
633 |
\end{itemize} |
|
634 |
||
635 |
\end{frame}} |
|
636 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
637 |
||
86
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
638 |
\end{document} |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
639 |
|
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
640 |
%%% Local Variables: |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
641 |
%%% mode: latex |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
642 |
%%% TeX-master: t |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
643 |
%%% End: |
6a7fe83820c8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
644 |