Question

Can you give me 2 tape turing machine logic for a*nb*ma*nb*m where n,m>=0. Give the turing...

Can you give me 2 tape turing machine logic for a*nb*ma*nb*m where n,m>=0. Give the turing machine also, and explain the logic. Please give the time complexity ?

Homework Answers

Answer #1

Start of Computation :
The tape contains the input string w, the tape head is on the leftmost symbol of w, and the Turing machine is in the start state Q0

Basic Idea :
The tape head reads the leftmost symbol of w, which is a and at start only we will make it Blank. Then we will traverse to make leftmost b a $ and replace rightmost c by a Blank, we will do this zigzag pattern of replacing b by $ and c by Blank till all b are not replaced by $.After this we will traverse back in left direction till we get leftmost a and replacing all $ by b in the traversal. After this we have reduced our string into form an-1bmcnm-m so we can figure if all a’s are replaced by blankand if the string belongs to Language L then there will be no c’s left hence it will get accepted.

Meanings of symbols used:
R, L – direction of movement of one unit on either side.
B-Blank,
a, b, c -symbols whose combination string is to be tested.
$-Temporarily symbol to replace b.

Working Procedure :

  • Step-1:
    We first replace leftmost a by Blank and then traverse to replace leftmost b by $ and rightmost c by Blank.Repeat this step from state Q1 till there is no more b left.
  • Step-2:
    After replacing all b by $ we have also replaced m rightmost c’s with Blanks and then we will traverse back to left most a and replace all $ by b’s.After this step if check the string it is now reduced to an-1bmcnm-m form.Now we will repeat from step 1 till all a’s are not made Blank.
  • Step-3:
    So after all a’s are made blank and if the string belonged to Language L then 0 c’s must be left which we check at state Q0 and Q6 as only b’s will be left and after which if Blank is found then all c’s must have been replace by Blank as we where making c’s Blank from rightmost end of the string.
  • Step-4:
    So if we get a Blank symbol at state Q6 the the string is accepted at final state Q7. Also if the string was empty then it will also be accepted as Blank symbol input at state Q0 then it will got to state Q7 and gets accepted.
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A linear system of equations Ax=b is known, where A is a matrix of m by...
A linear system of equations Ax=b is known, where A is a matrix of m by n size, and the column vectors of A are linearly independent of each other. Please answer the following questions based on this assumption, please explain it, thank you~. (1) To give an example, Ax=b is the only solution. (2) According to the previous question, what kind of inference can be made to the size of A at this time? (What is the size of...
please be neat and fully explain all steps. will vote. can you give me a double...
please be neat and fully explain all steps. will vote. can you give me a double integral where its more optimal to integrate using rectangular coord dy dx. rather than using polar coord. dr dtheta
Can you Please explain me this Question? Thanks! a) Find z a/2 (two tailed) for the...
Can you Please explain me this Question? Thanks! a) Find z a/2 (two tailed) for the 78% confidence interval. b) Find t a/2 when n=22 for the 99.5% confidence interval for the mean.
Would you please give me step by step instruction on the following. What is the major...
Would you please give me step by step instruction on the following. What is the major product of the reaction of 1 mol of propyne with the Br2 CH2Cl2.Does the information "1 mol" make the problem different than if we just said Br2. The text book shows the answer as the Br ending up on the 1st C. but that's the least substituted so I 'm unclear as to why it's there versus C # 2. You have already answered...
**Can you guys tell me the logic behind finding the sequence patterns of each oligonucleotide... 2)...
**Can you guys tell me the logic behind finding the sequence patterns of each oligonucleotide... 2) Two sample tubes each contain about 100 nanograms (ng) of a 25-bp single-stranded oligonucleotide and 100 picograms (pg) of double-stranded genomic DNA (gDNA) from the same species. The tubes are heated to 95o C to allow the genomic DNA to denature and then cooled to allow the oligonucleotides to bind directly to the gDNA. The sequences of each oligonucleotide are shown below. Oligo 1...
Philosophy Can you give me a concrete example to express its actual definition 1) alienation 2)...
Philosophy Can you give me a concrete example to express its actual definition 1) alienation 2) capitalist 3) episteme 4) usevalue 5) surplus value
Can you please give me these answer with refrence Ovarian Cysts: 1) What are ovarian cysts?...
Can you please give me these answer with refrence Ovarian Cysts: 1) What are ovarian cysts? (You do not need to name the various types.) 2) What are the signs and symptoms associated with ovarian cysts? 3) How are ovarian cysts diagnosed? 4) How are ovarian cysts treated? References:
solve the non-homogenous recurrence relation for an = 2an-1+an-2-2an-3+8.3n-3 where   a0 = 2, a1 = 6...
solve the non-homogenous recurrence relation for an = 2an-1+an-2-2an-3+8.3n-3 where   a0 = 2, a1 = 6 ve a2=13 Find characteric equation by plugging in  an = rn try to solve general solution and solve nonhomogeneous particular solution and find total final answer please.. My book anwer is A(1)n+B(-1)n+C(2)n+k3n , A=1/2, B=-1/2, C=1 ve k=1. can you give me more explain about this please..?
Exercise: F(n)= F(n-1) + F(n-2) where: F(0)=0 F(1)=1 How do you make this exercise with all...
Exercise: F(n)= F(n-1) + F(n-2) where: F(0)=0 F(1)=1 How do you make this exercise with all constants expressed?
Can someone please explain this in steps? 2. Determine the output k = 4 m =...
Can someone please explain this in steps? 2. Determine the output k = 4 m = 0 n = 7 While j < k m = 5 While m < n Ouput “X” m = m + 1 Endwhile j = j + 1 Endwhile Output j, k, m, n
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT