Question

In: Computer Science

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.

Solutions

Expert Solution

Consider the given language L = {wwR|w ∈ {0, 1}∗}

L contains the strings of form wwR. where w belongs to {0,1}*.

L is not a regular language and there exist no DFA to accept L.

A Turing machine M can be implemented that accepts L.

The Turing machine M accepts strings wwR, where w belongs to {0,1}*.

For example, M accepts 0110,1001,1111,001100, 10100101etc.

  • Step1:
    • The Turning machine M scans the input string from left to right as soon as it finds ‘0’, it replaces the cell blank and moves to left until a blank is found.
    • Then moves one step left and if input symbol is ‘0’, then it moves to right until a blank is found.

OR

    • The Turning machine M scans the input string from left to right as soon as it finds ‘1’, it replaces the cell blank and moves to left until a blank is found.
    • Then moves one step left and if input symbol is ‘1’, then it moves to right until a blank is found.
  • Step2:
    • Then repeats the above step until all cells become blank.

To implement M first define the states and transition function as follows:

State

Input

a

b

B

q0

(q1,B,R)

(q2,B,R)

(q6,B,R)

q1

(q1,0,R)

(q1,1,R)

(q3,B,L)

q2

(q2,0,R)

(q2,1,R)

(q4,B,L)

q3

(q5,B,L)

-

-

q4

-

(q5,B,L)

-

q5

(q5,0,L)

(q5,1,L)

(q0,B,R)

DFA(state diagram) that represents M is as follows:


Related Solutions

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}
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}
# O W L S f(O,W,L,S) 0 0 0 0 0 0 1 0 0 0...
# O W L S f(O,W,L,S) 0 0 0 0 0 0 1 0 0 0 1 0 2 0 0 1 0 1 3 0 0 1 1 1 4 0 1 0 0 0 5 0 1 0 1 1 6 0 1 1 0 1 7 0 1 1 1 X 8 1 0 0 0 0 9 1 0 0 1 0 10 1 0 1 0 0 11 1 0 1 1 1 12 1...
- 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.
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)
L= {x^a y^b z^c | c=a+b(mod 2)} .Create a DFA and NFA for the language L....
L= {x^a y^b z^c | c=a+b(mod 2)} .Create a DFA and NFA for the language L. Solution and explanation please..
Construct a dfa that accepts strings on {0, 1} if and only if the value of...
Construct a dfa that accepts strings on {0, 1} if and only if the value of the string, interpreted as a binary representation of an integer, is zero modulo five. For example, 0101 and 1111, representing the integers 5 and 15, respectively, are to be accepted.
Q5 [15 pts] a) Convert the following NFA to a DFA: 0 1 ---------------------- -> a...
Q5 [15 pts] a) Convert the following NFA to a DFA: 0 1 ---------------------- -> a || {a} | {a,b} b || {c} | {c} c || {d} | {d} d || {e} | {e} * e || {} | {} b) Informally describe the language that it accepts.
1.True or False: a)If a language L is recognized by a 2^n-state DFA, then it must...
1.True or False: a)If a language L is recognized by a 2^n-state DFA, then it must be recognized by some NFA with no more than n states. b)For every three regular expressions R, S, and T, the languages denoted by R(S∪T) and (RS)∪(RT) are the same. Please explain.
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT