\documentclass[11pt]{article}

\usepackage{exscale}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{times,mathptm}
\usepackage{epsfig}
\usepackage{amsmath}

\textwidth 6.5truein          
\textheight 9.0truein
\oddsidemargin 0.0in
\topmargin -0.8in

\parindent 0pt          
\parskip 0pt
%\def\baselinestretch{1.1}

\begin{document}

\begin{large}
\centerline {\bf Computer Science 423}
\centerline {\bf Fall 2024}
\centerline {\bf Homework 2}
\centerline{\bf My name}
%\end{large}
\vskip .5cm

%\begin{Large}
\bf Due: beginning of class, Thursday, 9/19/2024
\end{large}
\vskip 0.3cm
Answer the following questions and submit typeset solutions by the due date.  As stated on the syllabus, any collaborators or 
outside sources must be listed under the corresponding problem.  Further, your final submission must be completely your own work.
Note: Draw state diagrams with no crossing arcs.
\begin{enumerate}

\item {[2 points each]}  True or False.  No explanation necessary.
\begin{enumerate}
\item Every NFA is guaranteed to have an equivalent DFA.
\item Every DFA is guaranteed to have an equivalent NFA.
\item When converting an NFA to a DFA, the $\emptyset$ state will always be included in the final simplified DFA.
\item A string is accepted by an NFA if the last state the string enters is an accept state.
\item For an NFA with a set of states $Q$ and a set of accept states $F$,  $\lvert F \rvert$  $<$ $\lvert Q \rvert$.

\end{enumerate}

Collaborators:

\item {[5 points each]} Draw NFA state diagrams that recognize the following languages:
\begin{enumerate}
\item $L_1$=\{$w \in \{a,b\}^* \ |$ $w$ = $a^+b^*a^*$\} (Use no more than 3 states)
\item $L_2$=\{$w \in \{0,1\}^* \ |$ $w$ begins and ends with the same symbol\} (Use no more than 4 states)
\end{enumerate}

Collaborators:

\item {[22 points]} Consider the NFA defined by the following transition table:

\begin{tabular}{r||c|c|c}
& $0$ & $1$ & $\epsilon$\\\hline\hline
$\rightarrow q_0$ & $\{q_2\}$  & $\emptyset$ & $\{q_1\}$\\\hline
$*q_1$ & $\{q_0\}$ & $\emptyset$ & $\emptyset$\\\hline
$q_2$ & $\{q_1\}$ &  $\{q_1,q_2\}$ & $\emptyset$\\
\end{tabular}

\begin{enumerate}
\item {[4]} Draw the state diagram of the NFA.
\item {[10]} Convert the NFA to an equivalent DFA using the subsets (without the braces) to name the states in your DFA for easy grading.  Do not include
any states that are not needed.
\item {[4]} write the 5-tuple formal definition of the DFA in (b) (if any of the components represents a set, list the entire set; you do not have to expand $\delta$)
\item {[4]} Describe the language recognized by the NFA with a statement or formal definition. 
\end{enumerate}

Collaborators:

\newpage

\item  {[23 points]} Consider the following language:

$L=\{w\in\{0,1\}^*\ |\ w {\rm\ is\ not\ a\ string\ that\ begins\ and\ ends\ with\ 1s\ that\ are\ separated\ by\ an\ odd\ number\ of\ symbols}\}$.
\begin{enumerate}
\item {[2]} Complete the definition of ${\overline L}=\{ w\in \{0, 1\}^* |\ w$ is a string that \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ that are separated by \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_$\}$
\item {[8]} Draw the state diagram of an NFA with four states that accepts $\overline L$ based on the definition in (a).
\item {[8]} Convert the NFA in (b) to an equivalent DFA with the subset method, using subsets (without braces) to name the states in your DFA for easy grading.
                 Draw the simplified DFA, with unnecessary states removed.
\item {[5]} Simplify the DFA in (c) to a DFA that accepts $L$. (Hint: Switch non-final states to final states, and vice versa. Combine dead-end states into one.)
\end{enumerate}

Collaborators:

\end{enumerate}

\end{document}
