Question

In: Computer Science

write the dfa for Let L={w in {0,1}*| w is a binary number that is a...

write the dfa for Let L={w in {0,1}*| w is a binary number that is a multiple of 4}

Solutions

Expert Solution

// I HOPE I COULD HELP

// IN CASE OF ANY QUERY FEEL FREE TO COMMENT AND ASK

final state=q0

non-final state=q1,q2,q3

The state transition diagram drawn below will accept all strings over {0,1} which when interpreted are multiples of 4.

  1. If any number is not divisible by 4 and leaves 1 as a remainder the control will move on to state q1.
  2. If any number is not divisible by 4 and at the same time on dividing leaves 2 as a remainder the control will move on to state q2.
  3. If any number is not divisible by 4 and leaves 3 as remainder the control moves to q3.
  4. If the number is divisible by 4 that means that the number is a multiple of 4 the control will go to q0.

On testing on the inputs 0 it will get accepted as it is a multiple of 4, 01 will not be accepted by the dfa, 10 will leave remainder as 2 hence again not accepted, 11 will leave remainder as 3 hence not accepted and will end on q3, 100 will be accepted by the dfa at state q0 as it is a multiple of 4.


Related Solutions

- Give state diagram of DFA recognizing L={w | w is 0,1-string, and contains 3k 0s...
- Give state diagram of DFA recognizing L={w | w is 0,1-string, and contains 3k 0s and 2m 1s for some integers k and m at least 0}. For examples, 0010111 is in L, but 010011 is not in L. The first string contains 3 0s and 4=2x2 1s, but the second string has an odd number of 1s.
L= {w belongs to {0,1}* | the number of 0's is a prime number} . Prove...
L= {w belongs to {0,1}* | the number of 0's is a prime number} . Prove that the language L is not regular.
Draw an NFA for the following language then convert to a DFA: L = {w :...
Draw an NFA for the following language then convert to a DFA: L = {w : |w| is odd or |w| is a multiple of 4} where Σ = {0, 1}
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...
Create a DFA for L = {wwR|w ∈ {0, 1}∗}. WR represents the reverse of the...
Create a DFA for L = {wwR|w ∈ {0, 1}∗}. WR represents the reverse of the string. Explain your answer.
Draw DFA C = { w is an element of {a,b}* and #a(w) is even and...
Draw DFA C = { w is an element of {a,b}* and #a(w) is even and #b(w) us a multiple of 3)
Let L ⊆ Σ ∗ and define S(L), the suffix-language of L, as S(L) = {w...
Let L ⊆ Σ ∗ and define S(L), the suffix-language of L, as S(L) = {w ∈ Σ ∗ | x = yw for some x ∈ L, y ∈ Σ ∗ } Show that if L is regular, then S(L) is also regular.
w = 50,000 + 10,000L where w is wages, L is the number of players The...
w = 50,000 + 10,000L where w is wages, L is the number of players The demand for players is given by the Marginal Revenue Product: MRP = 500,000 – 20,000L The Marginal Factor Cost to the club is : MFC = $50,000 + 25,000L If the NFL labor market were competitive, what would be the equilibrium number of players employed? If the NFL labor market were competitive, what would be the equilibrium wage of a player? We know that...
Let ? and ? be two independent uniform random variables such that ?∼????(0,1) and ?∼????(0,1). A)...
Let ? and ? be two independent uniform random variables such that ?∼????(0,1) and ?∼????(0,1). A) Using the convolution formula, find the pdf ??(?) of the random variable ?=?+?, and graph it. B) What is the moment generating function of ??
Let A ∈ L(U, V ) and B ∈ L(V, W). Assume that V is finite-dimensional....
Let A ∈ L(U, V ) and B ∈ L(V, W). Assume that V is finite-dimensional. Let X be a 3 × 5 matrix and Y be a 5 × 2 matrix. What are the largest and smallest possible ranks of X, Y, and XY? Give examples of the matrix to support your answers
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT