Question 2:
Create a DFA D to recognize all strings of 0’s and 1’s representing binary numbers divisible by three.
Assume the binary string 0 represents the number 0, 1 represents 1, 00 represents 0, 01 represents 1, 10 represents 2, 11 represents 3, and so on. Also, assume the empty string represents the number 0.
Also, assume that D has the following properties:
A finite set of states Q = {A, B, C}
The input alphabet Z = {0, 1}
Start state A
The set of final states F = {A}
State ‘A’ represent all prefixes of binary strings that are Congruent to 0 mod 3, State ‘B’ all prefixes congruent to 1 mod 3, and State ‘C’ all prefixes congruent to 2 mod 3.
a) Draw the DFA D (the state diagram for DFA D)
b) Define the transition table for DFA D
c) Show the DFA D processing the string 1001
d) Prove that the language defined by DFA D is the set of all binary strings representing integers divisible by three.
Comments
Leave a comment