\documentclass[12pt,ifthen]{article} \usepackage{url} \usepackage{comment} \newif{\ifshowsoln} % \showsolntrue \newcommand{\und}{\_\_\_\_\_\_\_\_\_} \newcommand{\Z}{\mathbb{Z}} \usepackage{amsmath} \usepackage{amssymb} % for \nmid \begin{document} \centerline{\bf HW 02 CMSC 452} \centerline{\bf Morally Due TUES Feb 11 11:00AM} \centerline{\bf Dead-Cat Due THU Feb 13 at 11:00AM} \begin{enumerate} %B1 \item (50 points) For this problem you might want to write a program that will, given $n$, compute $10^0 \pmod n$, $10^1 \pmod n$, $10^2\pmod n$ etc and find a pattern. If you write such a program KEEP IT - you may need it later in the course. Write a nice clean easy-to-grade table for the answer. I give an example later. $\overline{a}$ means $(a,a,\ldots)$. $\overline{a,b}$ means $(a,b,a,b,\ldots)$. For $n=14,15,16,17,18,19,20$ give the following \begin{enumerate} \item The weights needed for a DFA classifier for mod $n$. E.g., If $n=2$ the answer is $(2,\overline{0})$ If $n=3$ the answer is $(\overline{1})$ If $n=4$ the answer is $(1,2,\overline{0})$ If $n=11$ the answer is $(\overline{1,-1})$ \item The size of a DFA classifier for determining what a number is congruent to mod $n$. (For this problem, UNLIKE CLASS, we will count the start state as having input 0 so $\equiv 0\pmod n$. E.g., If $n=2$ the answer is 2. If $n=3$ the answer is 3. If $n=4$ I leave that to you to figure out. If $n=11$ the answer is 22. \end{enumerate} The format for the answer should be like this: \[ \begin{array}{|l|l|l|l} \hline n & \hbox{pattern} & \hbox{Numb of States} \cr \hline 2 & (2,\overline{0}) & 2 \cr 3 & (\overline{1}) & 3 \cr 4 & (1,2,\overline{0}) & 18 \hbox{ NOT the real answer}\cr 11 & (\overline{1,-1}) & 22 \cr \hline \end{array} \] \newpage \item (50 points) In this problem $\Sigma=\{a\}$. \begin{enumerate} \item (10 points) Write a DFA for $$L_1=\{ a^n \colon n\equiv 0 \pmod 6 \}.$$ How many states does it have? \item (10 points) Write a DFA for $$L_2=\{ a^n \colon n\equiv 0 \pmod 9 \}.$$ How many states does it have? \item (10 points) IF you were to use the construction to get a DFA for $L_1\cap L_2$ how many states would it have? (DO NOT do the construction.) \item (20 points) Give a DFA for $L_1\cap L_2$ that uses fewer states then the one from the construction. \item (THOUGHT QUESTION- DO NOT SUBMIT) IF you were to use the construction to get a DFA for $L_1\cup L_2$ how many states would it have? (DO NOT do the construction.) IS THERE a DFA for $L_1\cup L_2$ with fewer states than the one from construction? \end{enumerate} \end{enumerate} \end{document}