Problem 24
Construct a Moore machine that gives an output of 1 whenever the number of symbols in the input string read so far is divisible by 4 and an output of 0 otherwise.
Problem 25
Construct a deterministic finite-state automaton that recognizes the set of all bit strings that contain the string \(101 .\)
Problem 25
Construct a Moore machine that determines whether an input string contains an even or odd number of 1s. The machine should give 1 as output if an even number of 1s are in the string and 0 as output if an odd number of 1s are in the string.
Problem 32
Give production rules in Backus-Naur form for the name of a person if this name consists of a first name, which is a string of letters, where only the first letter is uppercase; a middle initial; and a last name, which can be any string of letters.
Problem 32
Construct a deterministic finite-state automaton that recognizes the set of all bit strings that contain an even number of 1 \(\mathrm{s}\) .
Problem 33
Give production rules in Backus-Naur form that generate all identifiers in the C programming language. In \(\mathrm{C}\) an identifier starts with a letter or an underscore \((-)\) that is followed by one or more lowercase letters, uppercase letters, underscores, and digits.
Problem 33
Construct a deterministic finite-state automaton that recognizes the set of all bit strings that contain an odd number of 0 \(\mathrm{s}\) .
Problem 35
Construct a finite-state automaton that recognizes the set of bit strings consisting of a 0 followed by a string with an odd number of 1 \(\mathrm{s}\) .