summaryrefslogtreecommitdiff
path: root/sheet.tex
blob: 2521c6eee78ba0e7a199db3484d6ba4eb79f3916 (plain)
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
\documentclass[11pt, a4paper, twoside]{article}
\usepackage[
    a4paper,
    headsep=5mm,
    footskip=0mm,
    top=12mm,
    left=10mm,
    right=10mm,
    bottom=10mm
]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{makecell}
\usepackage{multicol}
\usepackage[noend]{algorithm2e}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,positioning, graphs, graphdrawing}
\usegdlibrary {trees} 
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=cyan,
    pdftitle={Overleaf Example},
    pdfpagemode=FullScreen,
    }

\setlength{\algomargin}{0pt}

\begin{document}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{Theoretische Grundlagen der Informatik}
\fancyhead[R]{Gero Beckmann - \url{https://github.com/Geronymos/}}
\fancyfoot{}
\fancyfoot[R]{\thepage}
\newenvironment{definition}[1]{\noindent\textbf{#1:}}{}
\section{Chomsky-Hierarchie}
\hspace*{-.5cm}
\begin{tabular}{ l l l l l }
  Chomsky-Typ & Wortproblem & Definition & Bsp & Maschinenmodell \\

  Typ 0 & 
  semi-entscheidbar &
  \makecell{$G = (\Sigma, V, S, R)$ \\ $R beliebig$ }&
  universelle Sprache &
  NTM/DTM akzeptiert L \\

  Typ 1 & 
  NP-Schwer &
  \makecell{$u \rightarrow v, |u| \leq |v|$ \\ $u \in V^+, S \notin V$ \\ $S \rightarrow \epsilon$ } &
  $L = \{ a^ib^ic^i | i \leq 1 \}$ &
  \makecell{NTM mit Platzbedarf n \\ erkennt Wörter der Länge n in L \\ $\Rightarrow NTAPE(n)$ } \\

  Typ 2 & 
  polynomiell & 
  \makecell{$A \rightarrow v, A \in V$ \\ $v beliebig$} &
  $L = \{ a^ib^i | i \leq 1\}$ &
  CYK-Alg. erkennt L in polynom. Zeit, Chomsky-NF, NPDA \\

  Typ 3 &
  linear &
  \makecell{$A \rightarrow v, A \in V$ \\ $V \in \epsilon \cup \Sigma \cdot V$} &
  $L = \{ a^i | i \leq 1 \}$ &
  NEA/DEA erkennt L \\
\end{tabular}

\subsection{Automaten}
DEA $A = (Q, \Sigma, \delta: Q \times \Sigma \rightarrow Q, s \in Q, F \subseteq Q)$ \\
NEA $A = (Q, \Sigma, \delta: Q \times (\Sigma \cup \{ \epsilon \} \rightarrow 2^Q, s \in Q, F \subseteq Q)$
NPDA \\
DPDA \\
DTM \\
NTM \\

\subsection{Pumping-Lemma}

\begin{multicols}{2}
Erfüllt: 
\begin{itemize}
  \item["$\exists$"] Wähle $n = 2$
  \item["$\forall$"] Betrachte beliebiges $w \in L$ mit $|w| > 2$ 
  \item["$\exists$"] Wähle zerlegung $w = uvx$ mit $u = \epsilon, v = aa, x=a^{2(j-1)}$
  \item["$\forall$"] Für alle $i \in \mathbb{N}_0: uv^ix = a^{2i}a^2(j-1) = a^{2(i+j-1)} \in L$ 
\end{itemize}
Widerlegen: 
\begin{itemize}
  \item["$\exists$"] Wähle $n = 2$
  \item["$\forall$"] Betrachte beliebiges $w \in L$ mit $|w| > 2$ 
  \item["$\exists$"] Wähle zerlegung $w = uvx$ mit $u = \epsilon, v = aa, x=a^{2(j-1)}$
  \item["$\forall$"] Für alle $i \in \mathbb{N}_0: uv^ix = a^{2i}a^2(j-1) = a^{2(i+j-1)} \in L$ 
\end{itemize}
\end{multicols}

\begin{multicols}{2}
Potenzmengenkonstuktion NEA $\rightarrow$ DEA

\begin{tabular}{c | c | c}
  Zustand & a & b \\
  \hline
  $\{\underline{s}\}$ & $\{s, q_1\}$ & $\{f\}$ \\
  $\{\underline{s}, q_1\}$ & $\{s, q_1\}$ & $\{f, q_2\}$ \\
  $\{f\}$ & $\{f\}$ & $\{f\}$ \\
  $\{f, q_2\}$ & $\{f\}$ & $\{f, q_1, q_2\}$ \\
  $\{f, \underline{s}\}$ & $\{f, s, q_1\}$ & $\{f\}$ \\
  $\{f, \underline{s}, q_1\}$ & $\{f, s, q_1\}$ & $\{f, q_2\}$ \\
\end{tabular}

\begin{tikzpicture}[initial text=,shorten >=1pt,node distance=2cm,on grid,auto]

  \node[state,initial,accepting]  (S)                   {$S$};
  \node[state]                    (q_1) [right of=S]    {$q_1$};
  \node[state]                    (q_2) [right of=q_1]  {$q_2$};
  \node[state]                    (f)   [below of=q_1] {$f$};

  \path[->] 
    (S) edge [loop above] node {a} ()
    (S) edge   node [below] {a} (q_1)
    (S) edge              node [left] {b} (f)
    (q_1) edge [bend right] node [above] {a} (S)
    (q_1) edge              node [below] {b} (q_2)
    (q_2) edge [bend right] node [above] {b} (q_1)
    (q_2) edge [loop right] node {b} ()
    (q_2) edge              node {a} (f)
    (f) edge [loop left] node {a,b} ()
  ;

\end{tikzpicture}
\end{multicols}

\begin{multicols}{2}
Entfernen von $\epsilon$-Übergängen

\begin{tabular}{c | c | c}
  Zustand & a & b \\
  \hline
  $S$ & $q_1$ & $S, q_1, q_2, q_3$ \\
  $q_1$ & $q_2, q_3$ & $q_3$ \\
  $q_2$ & $q_1$ & $S, q_2, q_3$ \\
  $q_3$ & $q_1$ & $S, q_2, q_3$ \\
\end{tabular}

\begin{tikzpicture}[initial text=,shorten >=1pt,node distance=2cm,on grid,auto]

  \node[state,initial]   (S)                   {$S$};
  \node[state,accepting] (q_1) [right of=S]    {$q_1$};
  \node[state,accepting] (q_2) [below of=q_1]  {$q_2$};
  \node[state]           (q_3) [below of=S]    {$q_3$};

  \path[->] 
    (S) edge node {b} (q_1)
    (S) edge node [above left] {$\epsilon$} (q_2)
    (q_1) edge node {a} (q_2)
    (q_1) edge [bend left] node [above right] {b} (q_3)
    (q_2) edge node {\epsilon} (q_3)
    (q_3) edge node [below left] {a} (q_1)
    (q_3) edge node {b} (S)
    (q_3) edge [loop left] node {b} ()
  ;

\end{tikzpicture}
\end{multicols}

Minimierung von Automaten
\begin{tikzpicture}[initial text=,shorten >=1pt,node distance=2cm,on grid,auto]

  \node[state,initial]  (S)                   {$S$};
  \node[state]          (p) [right of=S]    {$p$};
  \node[state]          (q) [right of=p]    {$q$};
  \node[state]          (t) [below of=p]    {$t$};
  \node[state,accepting]          (r) [below of=q]    {$r$};
  \node[state]          (v) [below of=t]    {$v$};
  \node[state]          (u) [below of=r]    {$u$};

  \path[->] 
    (S) edge [loop above] node {0} ()
    (S) edge  node {1} (p)
    (p) edge [loop above] node {1} ()
    (p) edge  node {0} (q)
    (q) edge [bend left] node {0} (S)
    (q) edge  node {1} (r)
    (t) edge  node [right] {0} (S)
    (t) edge [bend right] node {1} (r)
    (r) edge [bend right] node [above] {0} (t)
    (r) edge  node {1} (u)
    (v) edge  node {0} (S)
    (v) edge  node[left] {1} (r)
    (u) edge  node {0} (v)
    (u) edge [loop right] node {1} ()
  ;

\end{tikzpicture}

\begin{tikzpicture}[initial text=,shorten >=1pt,node distance=2cm,on grid,auto]

  \node[state,initial]  (S)  {$[S]$};
  \node[state]          (p) [right of=S] {$[p]$};
  \node[state]          (q) [right of=p] {$[q]$};
  \node[state,accepting] (r) [right of=q] {$[r]$};

  \path[->] 
    (S) edge [loop above] node {0} ()
    (S) edge  node {1} (p)
    (p) edge [loop above] node {1} (p)
    (p) edge  node {0} (q)
    (q) edge[bend left] node {0} (S)
    (q) edge node {1} (r)
    (r) edge[bend right] node [above] {1} (p)
  ;

\end{tikzpicture}



\begin{tikzpicture} [binary tree layout]
  \node[align=center] (1) {s,p,q,r,t,a,v \\ $\epsilon$ trennt}
  child { 
    node {r}
  }
  child { node[align=center] {s,p,q,t,u,v \\ 1 trennt}
    child { node[align=center] {s,p,u \\ 0 trennt}
      child { node {s} }
      child { node {p,u} }
    }
    child{
      node {q,t,v}
    }
  };
\end{tikzpicture}

\subsection{Nerode-Relation}

\subsection{Chomsky-NF}

\section{NP-Vollständigkeit}

\section{Kellerautomaten}

\subsection{$4COLOR \in NP$}

\subsection{$3COLOR \propto 4COLOR$}

\subsubsection{Transformation}
\subsubsection{Äquivalenz/Korrektheit}

\section{Approximationsalgorithmen}

\section{Huffman-Kodierung}

\end{document}