Finite State Automata
Practice Problems

1. A recognizer for binary strings containing the sequence 0111.

2. A recognizer for binary strings containing the sequence 0101.

3. A recognizer for binary strings containing the sequence 01.

4. recognizer for binary strings containing at most 4 consecutive 1's.

5. A recognizer for strings of characters (alphabet is uppercase letters) that include at least one vowel (A,E,I,O,U).

6. A recognizer for strings of characters (alphabet is the ASCII character set) that are valid variable names.  Assume that a variable name must start with an alphabetic character and can contain only letters, digits or underscores.

7. Include the restriction that variable names cannot exceed 20 characters. (consider building a separate FSA for counting string length)

8. A recognizer for strings of characters that can be interpreted as octal numbers (only digits 0 through 7 allowed).

9. A recognizer for binary encoded values that are divisible by 2.

10. A recognizer for binary encoded values that are divisible by 4.

11.A recognizer for binary encoded values that are divisible by 3. (tough, maybe impossible???)

12. A recognizer that accepts binary strings with an even number of 1's.

13. A crecognizer that accepts binary strings with an even number of 1's and an even number of 0's.

14. A recognizer that accepts binary strings with an even number of 1's or an even number of 0's.

15. A recognizer that accepts binary strings with an even number of 1's and an odd number of 0's.

16. A recognizer that accepts binary strings that have at least three 1's in a row.

17. A recognizer that accepts binary strings that have no more than three 1's in a row.

18. A recognizer that accepts binary strings with the same number of 1's as 0's. (impossible)

19. A recognizer that accepts binary strings in which the number of 0's never exeeds the number of 1's in a left-to-right scan. (still impossible???)

20. A serial 2-bit comparator that reads two, 2-bit binary encoded values and outputs true if the second 2-bit number is greater than the first.

21. A Finite State Machine that outputs a random sequence of 1's and 0's.

22. A Finite State Machine that outputs the sequence 01001000100001...

23. A recognizer for binary strings with a repeated (non-overlapping) 4-bit sequence.

24. A recognizer for binary strings that have no repeated 4-bit sequences.

25. A recognizer for binary strings that are palindromes.


This course material has been converted to electronic format for use at
Murray State University, and the
Dept. of Computer Science and Information Systems

Use of this material for educational purposes only is governed by
the definition of Fair Use (Section 107) of the U.S. Copyright Act.
Course material is the property of  R. A. Pilgrim
All Rights Reserved