Write out the transition tables for the FAs on pp. 56, 58 both, 63, 64, and 69 that were Build an FA that accepts only the language of all words with b as the second letter. Build an FA that accepts only the words baa, ab, and abb and no other strings lon

If we are in state 2 and we read an a, we go to state 3. If we read another c, we stay in state 2 because this other c may be the beginning of the substring cat. If we read anything else, we go back to state 1. If we are in state 3 and we read a t, then we go to state 4. If we read any other letter ex- cept c, we have to go back to state 1 and start all over again, but if we read a c, then we go to state 2 because this could be the start of something interesting. The machine looks like this: 12479r CohenWiley Problems 71 The input Boccaccio will go through the sequence of states 1-1-1-2-2-3-2-2-1-1 and the input will not be accepted. The input desiccate will go through the states: 1-1-1-1-1-2-3-4-4 and terminate which in this example is some form of acceptance before reading the final e. ■ PROBLEMS

1. Write out the transition tables for the FAs on pp. 56, 58 both, 63, 64, and 69 that were

defined by pictures.

2. Build an FA that accepts only the language of all words with b as the second letter.

Show both the picture and the transition table for this machine and find a regular expres- sion for the language.

3. Build an FA that accepts only the words baa, ab, and abb and no other strings longer or

shorter.

4. i Build an FA with three states that accepts all strings.

ii Show that given any FA with three states and three 1’s, it accepts all input strings. iii If an FA has three states and only one 1, must it reject some inputs?

5. i Build an FA that accepts only those words that have more than four letters.

ii Build an FA that accepts only those words that have fewer than four letters. iii Build an FA that accepts only those words with exactly four letters.

6. Build an FA that accepts only those words that do not end with ba.

7. Build an FA that accepts only those words that begin or end with a double letter.

8. Build an FA that accepts only those words that have an even number of substrings ab.

9. i Recall from Chapter 4 the language of all words over the alphabet {a

b} that have both the letter a and the letter b in them, but not necessarily in that order. Build an FA that accepts this language. ii Build an FA that accepts the language of all words with only a’s or only b’s in them. Give a regular expression for this language. 1 0 . Consider all the possible FAs over the alphabet {a b} that have ex a c t ly two stat e s . An FA must have a designated start stat e, but there are four possible ways to place the 1’s : 12479r CohenWiley short CHAPTER 5 Finite Automata 72 Each FA needs four edges two from each state, each of which can lead to either of the states. There are 2 4 516 ways to ar range the labeled edges for each of the four types of FAs. Therefore, in total there are 64 different FAs of two states. However, they do not represent 64 nonequivalent FAs because they are not all associated with different lan- guages. All type 1 FAs do not accept any words at all, whereas all FAs of type 4 accept all strings of a’s and b’s. i Draw the remaining FAs of type 2. ii Draw the remaining FAs of type 3. iii Recalculate the total number of two-state machines using the transition table defin- ition.

11. Show that there are exactly 5832 different finite automata with three states x, y, z over