\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 3}
\centerline{\bf My name}
%\end{large}
\vskip .5cm

%\begin{Large}
\bf Due: beginning of class, Thursday, 9/26/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 {[5 points each]} Let $\Sigma=\{a, b\}$. 
Draw state diagrams for NFAs that accept the following regular languages (given in the forms of regular expressions).
Your NFAs should use as few states as possible. 
Note that ``+'' means one or more repetitions of a pattern.

\begin{enumerate}
\item $b(bab)^*\cup b$ (no more than 5 states)
\item $b^+\cup (aa)^+$ (no more than 4 states)
\item $(a\cup b^+)a^+b^+$ (no more than 5 states)
\end{enumerate}

Collaborators:

\item {[3 points each]}  Let $R_1$ and $R_2$ be any regular expressions. For each equivalence below, state whether it is True or False.  No explanation necessary.
\begin{enumerate}
\item $(R_1\cup R_2)^* = R_1^*\cup R_2^*$
\item $(R_1R_2\cup R_1)^*R_1 = R_1(R_2R_1\cup R_1)^*$ 
\item $R_1^*(R_2 R_1^*)^* = (R_2^*R_1)^*R_2^*$
\item $(R_1\cup R_2)^*R_2 = R_1^*R_2^+$ 
\item $R_2(R_1R_2\cup R_2)^*R_1 = R_2R_1R_2^*(R_1R_1^*R_2)^*$

\end{enumerate}

Collaborators:

\item {[6 points each]} For the languages given below, state whether each regular expression correctly defines the language.
If the regular expression is incorrect, provide a counterexample of either a string that is generated by the regular expression but 
not in the language, or a string that is in the language but not generated by the regular expression.
\begin{enumerate}
\item Let $L_1=\{w\in\{0,1\}^* | w{\rm\ has\ no\ substring\ of\ 00}\}$. 

\begin{enumerate}
\item $(01^+)^*\cup (1^+0)^*$
\item $(1\cup\epsilon)(01^+)^*(0\cup\epsilon)$ 
\item $(1\cup 01)^*(0\cup \epsilon)$
\end{enumerate}

\item Let $L_2=\{w\in\{0,1\}^* | w{\rm\ does\ not\ have\ 101\ as\ a\ substring}\}$.

\begin{enumerate}
\item $(\epsilon\cup 01)(1\cup 000^*)^*(\epsilon\cup 10)$
\item $0^*(1^*\cup 1000^*1)^*0^*$
\item $(1\cup 100^+1)^*\cup 0^*$
\end{enumerate}

\end{enumerate}

Collaborators:


\item {[4 points each]} Let $D$ be a language of strings that contains an even number of $a$'s and an odd number of $b$'s and does not contain the substring $ab$.

\begin{enumerate}
\item Give a simple regular expression for $D$.
\item Draw the state diagram for the DFA with no more than five states.
\end{enumerate}

Collaborators:

\end{enumerate}

\end{document}
