Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
\[ \begin{array}{l} f:\Sigma^* \times \Sigma \rightarrow \{\text{true},\text{false}\}\\ f(w,x) = \left\{ \begin{array}{cl} \text{false} & \text{if $w = \lambda$}\\ \text{true} & \text{if $x$ is the first character of $w$}\\ \text{false} & \text{if $x$ isn't the first character of $w$} \end{array} \right. \end{array} \]Give the values of each of the following expressions, or "error" if the function's argument is outside of its domain:
| ![]() |
$ ./hwsol abba reject $ ./hwsol babb accept
submit -c=SI342 -p=hw06 HWSol.cppIf you program in a language other than C++, turn in a screen capture of your program running with the following examples (make sure you get the right answers!)
| a | accept |
| b | reject |
| aa | accept |
| ab | reject |
| ba | accept |
| bb | reject |
| abab | reject |
| babb | accept |
Note: If you're really ambitious, try writing a program that is able to read in a description of a finite automaton from a file (you can make up any file format you like) and simulate that automaton, rather than hardcoding a single machine into the class. It would be really cool if you could read in a JFLAP .jff file. I'll give you extra credit for this.