Create a small deterministic finite automaton (DFA) for each of the following languages over the alphabet S = {a, b}, unless otherwise specified. Write all your solutions with plain English descriptions of how each automaton works. In addition to the finite state diagram and the English descriptions, also paste a snapshot of the multiple-inputs output, using some well-chosen input strings. For example, see Figure 1 below. Problems / Languages. Note: Try to come up with the correct DFA with the least number of states. [1] L = { x : x is a string over S, and x has a triple-’a’ substring anywhere in the string }, e.g., “abbaabaaab” [2] L = { x : x is a string over S, and x contains at least one double-‘a’ but no triple-’a’ substring }, e.g.,“abbabaab” [3] L = { x : x is a string over S’, and x has an even number of a’s, an odd number of b’s, and any number of c’s, all shuffled in random order }, where S’ = {a, b, c}. For example we should accept “caabbabcca”. Note: Zero is even, so the number of a’s can be zero.
Create a small deterministic finite automaton (DFA) for each of the following
languages over the alphabet S = {a, b}, unless otherwise specified. Write all your solutions with plain English descriptions of how each automaton works. In addition to the finite state diagram and the English descriptions, also paste a snapshot of the multiple-inputs output, using some well-chosen input strings. For example, see Figure 1 below.
Problems / Languages.
Note: Try to come up with the correct DFA with the least number of states.
[1] L = { x : x is a string over S, and x has a triple-’a’ substring anywhere in the string }, e.g., “abbaabaaab”
[2] L = { x : x is a string over S, and x contains at least one double-‘a’ but no triple-’a’ substring }, e.g.,“abbabaab”
[3] L = { x : x is a string over S’, and x has an even number of a’s, an odd number of b’s, and any number of c’s, all shuffled in random order }, where S’ = {a, b, c}. For example we should accept “caabbabcca”. Note: Zero is even, so the number of a’s can be zero.
[4] L = { x : x is a string over S’, and x is any bitstring which when evaluated as a binary number is divisible by 4 but not by 8 }, where S’ = {0, 1}. For example we should accept “01100” since it is equivalent to 12 in decimal and 12 is divisible by 4 but not by 8. Note: Leading zeroes are allowed.
[5] L = { x : x is a string over S’, and x is an even number written in the ternary (base 3) system }, where S’ = {0, 1, 2}. Note: Counting in the ternary system proceeds as follows: 0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, ... The even numbers are shown in bold. Note: Leading zeroes are allowed, e.g., “00101” is accepted.
Step by step
Solved in 3 steps with 3 images