Question

In: Computer Science

Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*,...

Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*, #a(w) = #b(w) } over the alphabet Σ = {a, b}.

IMPLEMENT USING JFLAP NO PAPER SOLUTION

Solutions

Expert Solution

We know that JFLAP defines a Turing Machine M as the septuple M = (Q, Σ, Γ, δ, qs, □, F) where

● Q is the set of internal states {qi | i is a nonnegative integer}

● Σ is the input alphabet

● Γ is the finite set of symbols in the tape alphabet ● δ : Q × Γ → Q × Γ × {L,R} is the transition function

● □ is the blank symbol.

● qs (is member of Q) is the initial state

● F (is a subset of Q) is the set of final state

One approach to defining this Turing Machine (TM) takes advantage of the existence of a single symbol, c, marking the end of the first occurrence of w and the beginning of the second occurrence of w. The TM can determine if the initial symbol and the first symbol following c are identical. If so, they can be removed from further consideration and each subsequent character checked for a match. If the symbols are ever different, the string is not in language L. If the symbol c is reached before the end of the input string, then the string is not in language L. If the end of string is reached before c, then the string is not in language L. Otherwise, because all symbols have been matched and the c symbol marks the exact center of the string, the string is in language L

Let me know if you have any doubts or if you need anything to change. 

If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions.

Thank You!
===========================================================================

Related Solutions

Define a PDA that accepts language L3 = { anbm | n > 0 and n...
Define a PDA that accepts language L3 = { anbm | n > 0 and n > m }. Implement that PDA in JFLAP. Must use JFLAP
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.
Prove that the language L={(M, N): M is a Turing machine and N is a DFA...
Prove that the language L={(M, N): M is a Turing machine and N is a DFA with L(M) =L(N)} is undecidable. You need to derive a reduction from Atm={(M, w)|Turing machine M accepts w} to L. (In layman's terms please, no other theorems involved)
Show that the language F={M| M is a Turing machine , and L(M) contains infinite elements}...
Show that the language F={M| M is a Turing machine , and L(M) contains infinite elements} is not Turing recognizable.
Can you give me a turing machine for the language c* n b*2n a* n+2 for...
Can you give me a turing machine for the language c* n b*2n a* n+2 for n>=0 . Please give the entire diagram with states, transition function, alphabet. Can use either one-tape or two-tape (both infinite). Describe the logic used to build the machine. Run the TM that accepts for any string of length > 1. Also run for string cbba.
Explain how a Turing Machine can simulate an arbitrary DFA. Use a 2-tape Turing Machine. It...
Explain how a Turing Machine can simulate an arbitrary DFA. Use a 2-tape Turing Machine. It can be done with a 1-Tape Turing Machine, but 2-tape will likely make the explanation more intuitive.
Given a regular language A, define L2 = { xz | there exists y Σ*, xyz...
Given a regular language A, define L2 = { xz | there exists y Σ*, xyz A, |x|=|z|, |y| = 2 }. Decide with a formal proof if L2 is (a) regular; or (b) not regular but context-free; or (c) not context-free.
prove or disprove A Turing machine with two tapes is no more powerful than a Turing...
prove or disprove A Turing machine with two tapes is no more powerful than a Turing machine with one tape. (That is, both types of machines can compute the same set of functions.) The cardinality of the set of irrational numbers is greater than the cardinality of the set of all rational numbers. The cardinality of the set of all algebraic numbers is exactly the same as the cardinality of all real numbers.
Consider the following languages over {0, 1}: L3 = {w : does not begin and end...
Consider the following languages over {0, 1}: L3 = {w : does not begin and end with same symbol and |w| £ 3} L4 = {w : w = wR, |w| £ 3} Enumerate the first 8 strings in the L-ordering of the following: L3 L4 L3 – L4 L4 – L3 L3L4 L4L3 L33 L4*
For a given language L = { w | na(w) + nb(w) = nc(w) } where...
For a given language L = { w | na(w) + nb(w) = nc(w) } where S = G = {a, b, c} Looking for answer to 3 Construct a PDA M that accepts L with S = G = {a, b, c} Show the sequence of instantaneous descriptions for the acceptance of acacbcbc by M in 1). Give a CFG G that generates L, L(G) = L.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT