Question

In: Computer Science

Create a Deterministic finite automaton that takes in binary strings and accepts them which has both...

Create a Deterministic finite automaton that takes in binary strings and accepts them
which has both an odd number of zeros and a sum that is divisible by
3 (but no others). For example, 0111 should be accepted, but not 011
or 111.

Solutions

Expert Solution

Steps:

  1. Divide the above language into 2 smaller languages.
  2. Design DFA for the 2 languages separately
  3. Use the cross-rule to combine the 2 DFAs.

-------------------------------

1.

Split the given language into two small languages.

L1 accepts binary strings with odd 0's in it

L2 accepts binary strings with sum i.e. divisible by 3.

2.

Design the two DFAs.

3.

Use the cross-rule to find a new transition table

L1 and L2 have 2 and 4 states respectively. So our resulting DFA will have 2x4 = 8 states.

Fill the transition table for every 8 states. (It is easy. Hint: Use the transition of old DFAs)

Our start state will become qAc because qA and qc are the start state of L1 and L2 respectively.

Similarly, the final state will be qBf formed by qB and qf.

-------------------------------

Stay safe. Stay immune.

Thank you.


Related Solutions

DFA Python DFA simulator A deterministic finite automaton (DFA) - also known as deterministic finite state...
DFA Python DFA simulator A deterministic finite automaton (DFA) - also known as deterministic finite state machine - is a finite state machine that accepts/rejects finite strings of symbols and only produces a unique computation (or run) of the automaton for each input string. Write a DFA simulator using the python programming language. Read your DFA from a textfile. First line contains a list of the final states (as integers), separated by a space. Rest of file contains the transitions...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA in which set of all strings can be accepted which end with ‘a’ DFA in which set of all strings can be accepted which start with ab DFA in which set of all strings can be accepted which contain ab DFA in which set of all strings can be accepted which ends with ab
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA for binary number divisible by 2 DFA for binary number divisible by 3 DFA in which set of all strings can be accepted which start with a DFA in which set of all strings can be accepted which contains ‘a’
Design an FA (Finite automaton) and RE to accept the set of all strings over the...
Design an FA (Finite automaton) and RE to accept the set of all strings over the alphabet {0,1} which contains even number of 0's and odd number of 1's.
Design a circuit that takes two strings of binary digits and outputs 1 (True) if the...
Design a circuit that takes two strings of binary digits and outputs 1 (True) if the strings “partially” match, and 0 otherwise. To keep this manageable assume the two strings are three bits long, that is a1a2a3 and b1b2b3 where each ai or bi is a one or a zero. The strings are a perfect match if for all i, ai = bi;. The strings are a partial match if at most one i, ai is not equal to bi....
Recall that the set {0,1}∗ is the set of all finite-length binary strings. Let f:{0,1}∗→{0,1}∗ to...
Recall that the set {0,1}∗ is the set of all finite-length binary strings. Let f:{0,1}∗→{0,1}∗ to be f(x1x2…xk)=x2x3…xkx1. That is, f takes the first bit of a string x and moves it to the end of x, so for example a string 100becomes 001; if |x|≤1, then f(x)=x Also, suppose that g:{0,1}∗→{0,1}∗ is a function such that g(x1…xk)=0x1…xk (that is, gg puts an extra 0 in front of the given string, so for example g(100)=0100. Everywhere in this question we...
Write a function that takes a list of strings and outputs them, one per line, in a rectangular frame.
python:Read the list of strings as separate lines from a text file whose file name is provided at run-time (Dr. Hanna's input file E29.txtPreview the document).Write a function that takes a list of strings and outputs them, one per line, in a rectangular frame. Forexample the list[ "Hello", "World", "in", "a", "frame" ]gets output as********** Hello ** World ** in ** a ** frame **********
Find a recurrence relation for the number of binary strings of length n which do not...
Find a recurrence relation for the number of binary strings of length n which do not contain the substring 010
Write a function (in Javascript) called longestMorseCodeWords which takes in an array of strings. The output...
Write a function (in Javascript) called longestMorseCodeWords which takes in an array of strings. The output of longestMorseCodeWords should be an array of the strings that were passed in, but ordered by the length of their Morse Code equivalent in descending order. If the length of Morse Code is equal, order the words alphabetically.For convenience, the full table for the 26 letters of the English alphabet is given below: [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."] let words = ["gin", "zen", "gig", "msg"] longestMorseCodeWords(words) The Morse...
Which one of the following REs represents the language of all binary strings having two consecutive...
Which one of the following REs represents the language of all binary strings having two consecutive 0s and two consecutive 1s? a. (0 + 1)*00(0 + 1)* + (0 + 1)*11(0 + 1)* b. (0 + 1)*0011(0 + 1)* + (0 + 1)*1100(0 + 1)* c.(0 + 1)*(00(0 + 1)*11 + 11(0 + 1)*00)(0 + 1)* d. 00(0 + 1)*11 + 11(0 + 1)*00
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT