\documentclass[a4paper,12pt]{article}
\usepackage[croatian]{babel}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}

\textbf{Zadatak:}
 Opi\v{s}ite rije\v{c}ima najmanje tri jezika te za njih konstruirajte regularne izraze.\\

\textbf{Rje\v{s}enje:}\\
Prvi jezik:\\
Rije\v{c} jezika L nad abecedom $\Sigma=\lbrace a,b,c \rbrace$ sadr\v{z}i to\v{c}no dva znaka c,nakon svakog c slijedi neparan broj a-ova,nakon svakog b slijedi paran broj a-ova. \\
Regularni izraz:\\
$$a^{\ast}(b(aa)^{+})^{\ast} ca(aa)^{\ast}(b(aa)^{+})^{\ast}ca(aa)^{\ast}(b(aa)^{+})^{\ast}$$\\
Drugi jezik:\\
Rije\v{c} jezika L nad abecedom $\Sigma=\lbrace a,b,c \rbrace$ ne sadr\v{z}i izraz aba.\\
Regularni izraz:\\
$$(a + c + cb + bc +bb^{+})^{\ast}$$\\
Tre\'{c}i jezik:\\
Rije\v{c} jezika L nad abecedom $\Sigma=\lbrace a,b,c \rbrace$ po\v{c}ima s parnim brojem a-ova,zavr\v{s}ava s neparnim brojem b-ova.\\
Regularni izraz:\\
$$(aa)^{+}(b(a + b + c)^{\ast}a + b(a + b + c)^{\ast}c + c(a + b + c)^{\ast}a + c(a + b + c)^{\ast}c)^{\ast}b(bb)^{\ast}$$


\textbf{Zadatak:}\\
a)Pojednostavni regularni izraz:\\
$$a^{\ast}(a^{+} + \varepsilon)ab(b^{+} + \varepsilon)^{\ast}$$
b)Doka\v{z}i ili opovrgni:\\
$$a^{+}(a^{\ast} + b^{+})^{+}b^{+}=a(a + b)^{\ast}b$$
c)Doka\v{z}i ili opovrgni:
$$a^{+}(a^{\ast} + b^{+})^{\ast}b^{+}=a(a + b)^{+}b$$

\textbf{Rje\v{s}enje:}\\
a)\\
$a^{\ast}(a^{+} + \varepsilon)ab(b^{+} + \varepsilon)^{\ast}=a^{\ast}a^{\ast}ab(b^{\ast})^{\ast}=a^{\ast}abb^{\ast}=a^{+}b^{+}$\\
\\
b)\\
$\supseteq$\\
$a\subseteq a^{\ast}\subseteq (a^{\ast} + b^{+})\\
 b\subseteq b^{+}\subseteq (a^{\ast} + b^{+})\\
 \\
 (a + b)\subseteq (a^{\ast} + b^{+})\Rightarrow (a + b)^{\ast}\subseteq (a^{\ast} + b^{+})^{\ast}\\
 \\
 a\subseteq a^{+}\subseteq a^{+}(a^{\ast} + b^{+})\\
 b\subseteq b^{+}\\
 \\
 a(a + b)^{\ast}b\subseteq a^{+}(a^{\ast} + b^{+})(a^{\ast} + b^{+})^{\ast}b^{+}=a^{+}(a^{\ast} + b^{+})^{+}b^{+}$\\
 \\
 $\subseteq$\\
 \\
 $a\subseteq (a + b)\\
 a^{\ast}\subseteq(a + b)^{\ast}\\
 aa^{\ast}\subseteq a(a + b)^{\ast} \Rightarrow a^{+}\subseteq a(a + b)^{\ast}\\
 \\
 b\subseteq (a + b)\\
 b^{\ast}\subseteq (a + b)^{\ast}\\
 b^{\ast}b\subseteq(a + b)^{\ast}b \Rightarrow b^{+}\subseteq(a + b)^{\ast}b\\
 \\
 a\subseteq (a + b)\\
 a^{\ast}\subseteq (a + b)^{\ast}\\
 b\subseteq (a + b)\\
 b^{+}\subseteq (a + b)^{+}\subseteq (a + b)^{\ast}\\
 (a^{\ast} + b^{+})\subseteq (a + b)^{\ast}  \Rightarrow (a^{\ast} + b^{+})^{\ast}\subseteq ((a + b)^{\ast})^{\ast}=(a + b)^{\ast}\\
 \\
 (a^{\ast} + b^{+})(a^{\ast} + b^{+})^{\ast}\subseteq (a + b)^{\ast}(a + b)^{\ast}\\
 (a^{\ast} + b^{+})^{+}\subseteq (a + b)^{\ast}\\
 \\
 a^{+}(a^{\ast} + b^{+})^{+}b^{+}\subseteq a(a + b)^{\ast}(a + b)^{\ast}(a + b)^{\ast}b\subseteq a(a + b)^{\ast}b$\\
 \\
 c)\\
 $L=a^{+}(a^{\ast} + b^{+})^{\ast}b^{+}$\\
 $G=a(a + b)^{+}b$\\
 \\
   Jednakost ne vrijedi.\\
   Kontraprimjer:\\
   \\
   $ab\in L$\\
   $ab\notin G$\\

\textbf{Zadatak:}\\
Konstruirajte minimalni DKA koji prepoznaje jezik opisan regularnim izrazom\\
$$a^{+}b^{\ast}(cc)^{+} + b^{+}c(cc)^{\ast} + a^{\ast}(bb)^{\ast}c^{+}$$

\textbf{Rje\v{s}enje:}\\
$L=a^{+}b^{\ast}(cc)^{+} + b^{+}c(cc)^{\ast} + a^{\ast}(bb)^{\ast}c^{+}\\
a^{-1}L=a^{\ast}b^{\ast}(cc)^{+} + a^{\ast}(bb)^{\ast}c^{+}=L_{1}\\
b^{-1}L=b^{\ast}c(cc)^{\ast} + b(bb)^{\ast}c^{+}=L_{2}\\
c^{-1}L=c^{\ast}=L_{3}\\
a^{-1}L_{1}=a^{\ast}b^{\ast}(cc)^{+} + a^{\ast}(bb)^{\ast}c^{+}=L_{1}\\
b^{-1}L_{1}=b^{\ast}(cc)^{+} + b(bb)^{\ast}c^{+}=L_{4}\\
c^{-1}L_{1}=c(cc)^{\ast} + c^{\ast}=L_{5}\\
a^{-1}L_{2}=\oslash\\
b^{-1}L_{2}=b^{\ast}c(cc)^{\ast} + (bb)^{\ast}c^{+}=L_{6}\\
c^{-1}L_{2}=(cc)^{\ast}=L_{7}\\
a^{-1}L_{3}=\oslash\\
b^{-1}L_{3}=\oslash\\
c^{-1}L_{3}=c^{\ast}=L_{3}\\
a^{-1}L_{4}=\oslash\\
b^{-1}L_{4}=b^{\ast}(cc)^{+} + (bb)^{\ast}c^{+}=L_{8}\\
c^{-1}L_{4}=c(cc)^{\ast}=L_{9}\\
a^{-1}L_{5}=\oslash\\
b^{-1}L_{5}=\oslash\\
c^{-1}L_{5}=(cc)^{\ast} + c^{\ast}=L_{10}\\
a^{-1}L_{6}=\oslash\\
b^{-1}L_{6}=b^{\ast}c(cc)^{\ast} + b(bb)^{\ast}c^{+}=L_{2}\\
c^{-1}L_{6}=(cc)^{\ast} + c^{\ast}=L_{10}\\
a^{-1}L_{7}=\oslash\\
b^{-1}L_{7}=\oslash\\
c^{-1}L_{7}=c(cc)^{\ast}=L_{9}\\
a^{-1}L_{8}=\oslash\\
b^{-1}L_{8}=b^{\ast}(cc)^{+} + b(bb)^{\ast}c^{+}=L_{4}\\
c^{-1}L_{8}=c(cc)^{\ast} + c^{\ast}=L_{5}\\
a^{-1}L_{9}=\oslash\\
b^{-1}L_{9}=\oslash\\
c^{-1}L_{9}=(cc)^{\ast}=L_{7}\\
a^{-1}L_{10}=\oslash\\
b^{-1}L_{10}=\oslash\\
c^{-1}L_{10}=c(cc)^{\ast} + c^{\ast}=L_{5}$\\
Praznu rije\v{c} prepoznaju jezici $L_{3}$,$L_{7}$,$L_{10}$ i to \'{c}e biti zavr\v{s}na stanja automata.\\

Minimalni DKA:\\
\includegraphics[width=10cm,height=10cm]{min_dka.jpg}

\textbf{Zadatak:}\\
Dani NDKA prebacite u ekvivalentni DKA te konstruirajte skupovne jedna\dj{}be.\\

\textbf{Rje\v{s}enje:}\\
NDKA:\\
\\
\includegraphics[width=5cm,height=6cm]{ndka.jpg}

NDKA=$(Q=\{A,B,C\},\Sigma=\{a,b,c\},\delta,Q_{0}=\{A\},F=\{B\})$\\
DKA=$(Q=2^{\{A,B,C\}},\Sigma=\{a,b,c\},\delta^{'},Q_{0}=\{A\},F=\{B,AB,BC,ABC\})$ \\
\\
\\
$\delta^{'}$....\\
\\
\begin{tabular}{|l|l|l|l|l|l|l|l|}
\hline
0 & A & B & C & AB & AC & BC & ABC\\
\hline
a & B & C & BC & BC & BC & BC & BC\\
\hline
b & B & A & B & AB & B & AB & AB\\
\hline
c & C & AC & C & AC & C & AC & AC\\
\hline
\end{tabular}
\\
\\
DKA:\\
\\
\includegraphics[width=10cm,height=10cm]{dka.jpg}

Skupovne jedna\dj{}be:\\
\\
$A=aB + bB + cC\\
 B=aC + bA + cAC + \varepsilon \\
 C=aBC + bB + cC\\
 AB=aBC + bAB + cAC + \varepsilon \\
 AC=aBC + bB + cC\\
 BC=aBC + bAB + cAC + \varepsilon \\
 ABC=aBC + bAB + cAC + \varepsilon $\\
\end{document}
 