\documentclass[a4paper,12pt]{article}

\usepackage[croatian]{babel}
\usepackage[pdftex]{graphicx}
%\usepackage{graphicx}

\pagestyle{empty}

\newcommand{\zad}[1]{\textbf{Zadatak {#1}. }}
\newcommand{\rj}[1]{\emph{#1}}


\begin{document}

\zad{8} Napi\v{s}i regularne izraze za sljede\'{c}e jezike
\\
\rj{a)} $L = \{w\in(0+1)^{*}|\ nakon\ svake\ nule\ u\
rije\check{c}i\ w\ nalaze\ se\ dvije\ jedinice\}$ \rj{b)} $L =
\{w\in(a+b+c)^{*}|\ c\ se\ mora\ barem\ jednom\ pojaviti\ izmedu\
svakog\ pojavljivanja\ a\ i\ b \}$ \rj{c)} $L = \{w\in(a+b+c)^{*}|\
izraz\ abc\ mora\ se\ barem\ jednom\ pojaviti\ u\ rije\check{c}i\
w\}$
\\ \\ \textbf{Rje\v{s}enje: }
\\
\rj{a)} $L = 1^{*}(011)^{*}1^{*}$.
\\
\rj{b)} $L = (a+c)^{*}(ac^{+}b)^{*}(b+c)^{*}$.
\\
\rj{c)} $L = (a+b+c)^{*}(abc)^{+}(a+b+c)^{*}$.
\\ \\

\zad{1} Za jezik \ $L = a + (aba)^{*}b$ \ treba prona\'{c}i najmanji
DKA koji ga prepoznaje.
\\ \\ \textbf{Rje\v{s}enje: }
\\
$a^{-1}L = \varepsilon + ba(aba)^{*}b =: L_{1} $ \\
$b^{-1}L = \varepsilon =: L_{2}$ \\
$a^{-1}L_{1} = \emptyset$ \\
$b^{-1}L_{1} = a(aba)^{*}b =: L_{3}$ \\
$a^{-1}L_{2} = \emptyset$ \\
$b^{-1}L_{2} = \emptyset$ \\
$a^{-1}L_{3} = (aba)^{*}b =: L_{4}$ \\
$b^{-1}L_{3} = \emptyset$ \\
$a^{-1}L_{4} = ba(aba)^{*}b =: L_{5}$ \\
$b^{-1}L_{4} = \emptyset$ \\
$a^{-1}L_{5} = \emptyset$ \\
$b^{-1}L_{5} = a(aba)^{*}b = L_{3}$
\begin{center}
\includegraphics[scale=2]{automatPrviE.png}
\end{center}
\newpage
\zad{2} Zadani NKA prebaciti u ekvivalentni DKA.
\begin{center}
\includegraphics[scale=2]{NKAdrugiE.png}
\end{center}

\textbf{Rje\v{s}enje: }
\\
NKA: \ $Q = \{A, B, C\}$, \ $\sum = \{a, b, c\}$, \ $\delta$, \ $F =
\{A\}$, \
$Q_{0} = \{A, C\}$ \\
DKA: \ $Q' = 2^{Q}$, \ $\sum = \{a, b, c\}$, \ $F' = \{\{A\}, \{A,
B\}, \{A, C\}, \{A, B, C\}\}$, \ $Q_{0}' = \{AC\}$
\begin{center}
\begin{tabular}{c||c|c|c|c|c|c|c}  $\delta'$ & $A$ & $B$ & $C$ & $AB$ & $AC$ & $BC$ & $ABC$\\
\hline $a$ & $ABC$ & $C$ & $\emptyset$ & $ABC$ & $ABC$ & $C$ & $ABC$\\ \hline $b$ & $\emptyset$ & $ABC$ & $\emptyset$ & $ABC$ & $\emptyset$ & $ABC$ & $ABC$\\
\hline $c$ & $C$ & $B$ & $BC$ & $BC$ & $BC$ & $BC$ & $BC$\\
\hline
\end{tabular}
\end{center}
\begin{center}
\includegraphics[scale=2]{DKAdrugiE.png}
\end{center}

\zad{3} Konstruiraj DKA koji prepoznaje jezik \ $L = a^{*}bab^{*}$,
zatim pronadi DKA koji prepoznaje jezik \ $L^{c}$ \ te pronadi
regularan izraz za \ $L^{c}$.
\\ \\ \textbf{Rje\v{s}enje: }
\\
\begin{center}
\includegraphics[scale=2]{treciE.png}
\end{center}
$L^{c} = a^{*}(\varepsilon + b + bb(a + b)^{*} + bab^{*}a(a +
b)^{*})$
\begin{center}
\includegraphics[scale=2]{treciKomplementE.png}
\end{center}

\end{document}
