From a98616e798d3e3279b2a3da6af2e7ba9e4f90bbf Mon Sep 17 00:00:00 2001 From: Christian Kremitzl Date: Wed, 30 May 2018 18:26:06 +0200 Subject: [PATCH] Add GdI-GTI SS17 exam --- GdI-GTI-B/.gitignore | 1 + GdI-GTI-B/SS17_GTI.tex | 85 ++++++++ GdI-GTI-B/SS17_GTI_Figure.pdf | Bin 0 -> 3256 bytes GdI-GTI-B/SS17_GTI_Figure.pdf_tex | 66 +++++++ GdI-GTI-B/SS17_GTI_Figure.svg | 315 ++++++++++++++++++++++++++++++ 5 files changed, 467 insertions(+) create mode 100644 GdI-GTI-B/.gitignore create mode 100644 GdI-GTI-B/SS17_GTI.tex create mode 100644 GdI-GTI-B/SS17_GTI_Figure.pdf create mode 100644 GdI-GTI-B/SS17_GTI_Figure.pdf_tex create mode 100644 GdI-GTI-B/SS17_GTI_Figure.svg diff --git a/GdI-GTI-B/.gitignore b/GdI-GTI-B/.gitignore new file mode 100644 index 0000000..6a6e4e5 --- /dev/null +++ b/GdI-GTI-B/.gitignore @@ -0,0 +1 @@ +!*Figure.pdf diff --git a/GdI-GTI-B/SS17_GTI.tex b/GdI-GTI-B/SS17_GTI.tex new file mode 100644 index 0000000..baee66a --- /dev/null +++ b/GdI-GTI-B/SS17_GTI.tex @@ -0,0 +1,85 @@ +\input{../settings/settings} + +\usepackage{amsmath,amssymb} +\usepackage{tikz} +\usetikzlibrary{shapes,arrows} + +\begin{document} + +\klausur{GdI-GTI-B} + {Prof. Dr. M. Mendler} + {Sommersemester 2017} + {90} + {Wörterbuch Englisch-Deutsch\,/\,Deutsch-Englisch} + +\begin{enumerate} + + \item + Consider the context-free grammar $G = (\{S, A, B\}, \{a, b\}, S, P)$ with production rules $P$ given as + \begin{align*} + S &\rightarrow AB \\ + A &\rightarrow aAa~|~\Lambda \\ + B &\rightarrow bbbB~|~\Lambda + \end{align*} + + \begin{enumerate} + \item Give a formal (or an informal but precise) definition of $L(G)$ that describes the general structure of the words which are produced by $G$. + \item Show that $L(G)$ is a \emph{regular} language by constructing an adequate automaton $M$ such that $L(M) = L(G)$. + \end{enumerate} + + (15 marks) + + \item + Consider the language $L = \{0^i1^j2^k ~|~ i, j, k \geq 0 ~\textrm{and}~ k \geq 2i+j\}$. + + \begin{enumerate} + \item Construct a \emph{pushdown automaton} (PDA) $M$ which accepts exactly the words of $L$. (15~marks) + \item Use the \emph{Pumping Lemma for regular languages} to prove that $L$ is \emph{not} a \emph{regular} language. (15~marks) + \end{enumerate} + + \item + Remember the definition of $\mathcal{O}$: + $$\mathcal{O}(f) =_{df} \{g \in \Omega ~|~ \exists c.\: \exists n_0.\: \forall n > n_0.\: g(n) \leq cf(n)\}$$ + for $\Omega$ being the set of all functions with type $\mathbb{N} \rightarrow \mathbb{N}$, and $f \in \Omega$. + + Consider the function $f^\prime(n) =_{df} 12n^3 + 7n^2$. + + Use the definitions from above to show formally that $f^\prime\in\mathcal{O}(n^3)$. (10~marks) + + \item + Answer both of the following questions: + + \begin{enumerate} + \item Consider arbitrary languages $L_1$, $L_2$, and $L = L_1 \cap L_2$. Assume that $L_1$ and $L_2$ are both \emph{Turing-decidable.} + + Explain briefly why $L$ is then also \emph{Turing-decidable.} You do \emph{not} need to construct machines explicitly. + + \item Consider an arbitrary language $L$ and assume that $L$ is \emph{polytime acceptable.} Explain briefly why $L$ is then also \emph{polytime decidable.} You do \emph{not} need to construct machines explicitly. + \end{enumerate} + + (15 marks) + + \newpage\item + Let $M$ be the following single tape Turing machine with input alphabet $\Sigma = \{x, y\}$ and tape alphabet $\Gamma = \{x, y, \#, \Delta\}$: + + \begin{center} + \input{SS17_GTI_Figure.pdf_tex} + \end{center} + + $M$ uses the building block Turing machines introduced in the lectures and tutorials (where $a \in \Gamma$): + + \begin{itemize} + \item left move $L$, right move $R$, halt $stop$, and print $a$; + \item the searching machines $R_a$, $R_{\neg a}$, $L_a$, and $L_{\neg a}$; and + \item the shifting machines $S_R$ and $S_L$. + \end{itemize} + + Describe the behaviour of $M$ starting from an arbitrary initial tape configuration $\underline{\Delta}w\Delta\Delta\dots$, where $w \in \Sigma^*$. What does the final tape look like when $M$ halts and how does the result depend on $w$? In other words, what computation does $M$ perform? (20 marks) + +% \item{ +% Hier könnte dein Bild stehen: +% %\image{1}{Capture3.PNG}{DNS-Anfrage}{DNS-Anfrage} +% } + +\end{enumerate} +\end{document} diff --git a/GdI-GTI-B/SS17_GTI_Figure.pdf b/GdI-GTI-B/SS17_GTI_Figure.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a05b53e4e838cef4d45a75bbf2af55bb75cd148c GIT binary patch literal 3256 zcmcgv2~ZPf6t03tQsmS)is+9uhzLn`b1OJNIErToXc4rsgax8NaI;txyf{LOMdWg5 zwFp{z$lyUyu__iBZ=r}<5wVp@5m5)NQxQ?@zZ()Gai)$P-N|ILZ~yoHcYObQU)XXV zKR1LUWU>$3-_ytB10GOEEN8mA1MXZrKAMaH0w_{20RUV-RV;}U@E(hixDT#WN8-#` zvzQu^z_B=H()PH``iY8Cg}byEpG9A3He1*)cu6 zy{}1HYn|z~b*$HO@`TM^!Hu$%>PzEJq;3mpyXo<`v!pjwyR+-s>B%k3tG}s2U4%R3 zEZK*n?ktMyvY!w*@8_CRr)M%{ewWVl`{u7X@A`Gyw=8K#K=>u}p^DWM`;3zz^iNxn z@S?88wJEwV*=)*eK^+s1j~s9m{-Q#p;-c;_GDIk$-cwJgApvyAzDcBi5DCKt?(UQT zUR;a^9{^Y81rWehV(=R#0lt9W@H1dXXs`pg!K)K+z?EasIBipo5qLZa)%1CthexU~ zZ*>v~gCZW_izFN&k1yqm0fO*3e2GwkiojA@SEi09p|S>0h0;~UpHL?z7`dn0jh5;? z4uU=qSiB~I+F7|;FAe}Ckx2VQg(ZWleDGB&C9d%Irk3cU;wo^BI+0M~8bIYnVHBen zJ`Vzm#NgI{fu(SZ*Bmo1i;V6^(+QTyDL=qT^N+&XJvir2uhA}*9#s>c_SDZkx~ z2!bzG3?p`LF8jD3Ldml1YS%`j1lDg_UNAb_)%X6bLn}WMul>vB?0VZqt=s3f%_H`0 zUfMs`lgr>u=(akIF;*;+*EMD?YZx_WUsZ{pwk^BNZv;25cS>%}82+S+Pk$ZfclD0_ zUdxykQy5Yi8-O7yFu+h`NG)CVw}zqAVCUVykb=Pbh9Q+3V;CaTNg9MhM2A%h*Z&2? zvK-j8c-Gn;_mlPB4Xx~XhORZt_nzD#Wo^D7+uOmM;rKw)+uyea2gUWa9V5(cXQIvz zEbh3pmbcumE!mhqIjtcyL}pd6uJeiY;wl9rS+Xi?dgdsGJmXYy=Z2G|juX@DV@vBZ zdiVt$rA_SWiJd{!9W7IfI8UsR*;(d?EmJ&1U5Z}B$GK*aDL6Ab zEp}-^qAby}zu>^?W2shwk7FdUxAQ{xTrPX$!5$J`esNXmoP!l>hO9dmS!)U~Iu&|^ z@eBw%wsou_qrU*DLp zk8V`vTu-hN$}&y ztM}-$Bc#=i9Ckykct+Ozz=yUDCv)<@x!m++cgB+z^jWB)_Q${1IqgOk-AJ4kE%YEw(h!{_)cLGle81EgPI#%|QZy5K$mr-iyqdi9zse#;r z_7hMOK>_GP3vYD)HgJnXNJ|7p10K;2Cz|g-mPe`y;H<<{gc=|mM8FXN=NOVqn8AfS z2nwSKEFngv)Ns^9^t5U8-f}`6nW%)U@y*qYf-)UnGK|Dx)zLcJkWpy{c+^X!Bm$3O z@&L+X@(dRc359$ihynvLRLFw~q%IJzm+??B92$dUJOpNKkPIrD$oK+Ndr}0tKS)>j znmr^^ScO6Bq*7SWS7nG0HL-`Frh6bl9z0TmbVWRq*iaNkKX{#l54-uRx+o$x@ef7C zrt5?f6aP>#g)qH6lE754I6?op2vWgG3Ts65PK8.pdf_tex} +%% instead of +%% \includegraphics{.pdf} +%% To scale the image, write +%% \def\svgwidth{} +%% \input{.pdf_tex} +%% instead of +%% \includegraphics[width=]{.pdf} +%% +%% Images with a different path to the parent latex file can +%% be accessed with the `import' package (which may need to be +%% installed) using +%% \usepackage{import} +%% in the preamble, and then including the image with +%% \import{}{.pdf_tex} +%% Alternatively, one can specify +%% \graphicspath{{/}} +%% +%% For more information, please see info/svg-inkscape on CTAN: +%% http://tug.ctan.org/tex-archive/info/svg-inkscape +%% +\begingroup% + \makeatletter% + \providecommand\color[2][]{% + \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}% + \renewcommand\color[2][]{}% + }% + \providecommand\transparent[1]{% + \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}% + \renewcommand\transparent[1]{}% + }% + \providecommand\rotatebox[2]{#2}% + \ifx\svgwidth\undefined% + \setlength{\unitlength}{368.50393701bp}% + \ifx\svgscale\undefined% + \relax% + \else% + \setlength{\unitlength}{\unitlength * \real{\svgscale}}% + \fi% + \else% + \setlength{\unitlength}{\svgwidth}% + \fi% + \global\let\svgwidth\undefined% + \global\let\svgscale\undefined% + \makeatother% + \begin{picture}(1,0.30769231)% + \put(0.11302259,0.16293377){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$R_\Delta\:\#\:R\:S_R\:L_\Delta$}}}% + \put(0,0){\includegraphics[width=\unitlength,page=1]{SS17_GTI_Figure.pdf}}% + \put(0.3995867,0.16293377){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\#\:R$}}}% + \put(0,0){\includegraphics[width=\unitlength,page=2]{SS17_GTI_Figure.pdf}}% + \put(0.4604408,0.22534552){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\#$}}}% + \put(0.44177898,0.09694761){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$x, y$}}}% + \put(0.54668452,0.25964383){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$S_L\:L\:\Delta\:L_\Delta$}}}% + \put(0.54668452,0.05727574){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\}$}}}% + \put(0.7941717,0.25964383){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\mathrm{stop}$}}}% + \put(0,0){\includegraphics[width=\unitlength,page=3]{SS17_GTI_Figure.pdf}}% + \put(0.68996657,0.05727574){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$R_\Delta\:\omega\:R\:\omega\:L_\#\:L_\#\:\omega\:R$}}}% + \put(0,0){\includegraphics[width=\unitlength,page=4]{SS17_GTI_Figure.pdf}}% + \put(0.59796159,0.07399188){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\omega$}}}% + \end{picture}% +\endgroup% diff --git a/GdI-GTI-B/SS17_GTI_Figure.svg b/GdI-GTI-B/SS17_GTI_Figure.svg new file mode 100644 index 0000000..974f4c9 --- /dev/null +++ b/GdI-GTI-B/SS17_GTI_Figure.svg @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + $R_\Delta\:\#\:R\:S_R\:L_\Delta$ + + $\#\:R$ + + + $\#$ + $x, y$ + $S_L\:L\:\Delta\:L_\Delta$ + $\}$ + $\mathrm{stop}$ + + + $R_\Delta\:\omega\:R\:\omega\:L_\#\:L_\#\:\omega\:R$ + + + $\omega$ + + +