Due Date: Feb 19, 2016
Be sure to follow the homework guidelines.
We will assume ASCII encoding for characters. Write two python functions shortlex_less and dict_less, each taking two parameters, such that
shortlex_less(s, t)returnsTrueif stringsprecedes stringtin shortlex order and returnsFalseotherwise.
dict_less(s, t)returnsTrueif stringsprecedes stringtin dictionary order and returnsFalseotherwise.
Email the source code for your functions as one text file to .
Do Exercise 1.3 on page 83.
Do Exercise 1.4(c) on page 83 as follows.
- Draw a transition diagram of a DFA that recognizes the language
{
w:whas an even number ofa's }.
- Draw a transition diagram of a DFA that recognizes the language
{
w:whas one or twob's }.
- Use product construction to combine the two machines above into one that recognizes the language
{
w:whas an even number ofa's and one or twob's }.
Do Exercise 1.5(c) on page 84.
Do Exercise 1.6 (e) on page 84.
Do Exercise 1.6 (j) on page 84.
(Extra credit) Do Problems 1.32 and 1.33 on page 88 and 89, or Problem 1.37 on page 89.