\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}
