Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
Consider the following "mystery algorithm":
Mystery Algorithm II
Input: DFA M = (Q,Σ,δ,s,W) and a character x ∈ Σ
Output: DFA M' such that ... <it's a mystery!>
\[ \begin{array}{l} M' = \left( Q \cup \{\$,\#\},\Sigma,\delta',\$,W\right)\text{, where}\\ \delta:(Q \cup \{\$,\#\}) \times \Sigma \rightarrow Q \cup \{\$,\#\}\\ \delta'(q,y) = \left\{ \begin{array}{cl} s&\text{if $q = \$$ and $y = x$}\\ \#&\text{if $q = \$$ and $y \neq x$}\\ \#&\text{if $q = \#$}\\ \delta(q,y)&\text{otherwise}\\ \end{array} \right. \end{array} \] Note: This is assuming that $ and # are not already states in the machine. In fact, any two new states would do, whatever their names. They just need to be new!
| M = | ( | {q0,q1},{a,b}, | | a b --+------- q0| q1 q1 q1| q0 q0 |
,q0,{q0} | ) |