Question

COMPUTER SCIENCE -- THEORY OF COMPUTATION Please write a Turing-machine style of algorithm to decide the...

COMPUTER SCIENCE -- THEORY OF COMPUTATION

Please write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise, step-by-step English.

Describe how to test whether or not an input string is in the language L1 in finite time. A state diagram is not necessary at all -- but optional and helpful.

L1 = {w : every ‘a’ within w is to the left of every ‘b’ within w} over the following alphabet
Σ = {a, b, c}. In other words, you’re not allowed to have any ‘b’ symbol to the left of any ‘a’.

Example strings: aaacbb ∈ L1 but cabca ∉ L1.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

+

Input symbols = { a, b, c }

Tape symbols = { a, b, c, bl } (bl denotes blank)

The algorithm starts off with the head on the first letter of input w and state is q0 (initial state).

Algorithm:

  • If the tape symbol is a or c and state is q0, move head/control to the right and don't change any state.
  • If the tape symbol is b and the state is q0, move head to the right and change state to q1.
  • If the tape symbol is b or c and the state is q1, move head right and don't change state.
  • If the tape symbol is a and the state is q1, halt/stop executing as the input is not acceptable.
  • If the tape symbol is bl and the state is q1, don't move head and change state to q2.
  • If the tape symbol is bl and the state is q2, halt.
  • After halting, if the state is q2 or q0, the string is accepted by the machine else not.

State diagram:

a->a,R C->C,R b->b,R C->C,R b -> b,R bl -> bl,R 90 91

Here, a -> a,R means if a is encountered in tape, put a in it's place and move head Right.

In case of any doubt, drop a comment and I'll surely get back to you.

Please give a like if you're satisfied with the answer. Thank you.

Add a comment
Know the answer?
Add Answer to:
COMPUTER SCIENCE -- THEORY OF COMPUTATION Please write a Turing-machine style of algorithm to decide the...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please answer a,b, and c Consider the following Turing Machine. M = “On input hA,Bi where...

    please answer a,b, and c Consider the following Turing Machine. M = “On input hA,Bi where A and B are DFAs: 1. Iterate through strings in Σ∗ in shortlex order; where Σ represents the common symbols of their input alphabets. For each string iterated, simulate both A and B on it. 2. If a string is ever encountered that both A and B accept, then accept.” (a) (2 points) Give a description, in English, of the language that M recognizes....

  • 3.(4 4+20-36 points Formal Definition of a Turing Machine (TM) ATM M is expressed as a...

    3.(4 4+20-36 points Formal Definition of a Turing Machine (TM) ATM M is expressed as a 7-tuple (Q, T, B, ? ?, q0,B,F) where: . Q is a finite set of states T is the tape alphabet (symbols which can be written on Tape) .B is blank symbol (every cell is filled with B except input alphabet initially .2 is the input alphabet (symbols which are part of input alphabet) is a transition function which maps QxTQxTx (L, R :...

  • Word Bank: a) python b) computer science c) algorithm d) program e) interpreter f) compiler g)...

    Word Bank: a) python b) computer science c) algorithm d) program e) interpreter f) compiler g) syntax h) semantics i) value J) variable k) operator l) operand m) expression n) statement o) input p)output q)call r) arguments s) library t) bug u) variable scope v) local variable w)global variable x) variable lifetime y) relational operators z) logical operators 1) Compares operands and results in a bool: 2) The duration of a variable's existence: 3) A list of instructions to solve...

  • microbiology help TOT Zoo Add Page Insert Table Chart Text Shape Media Comment These questions will...

    microbiology help TOT Zoo Add Page Insert Table Chart Text Shape Media Comment These questions will serve in lieu of a lab report for Exercise 15, 16, and 17 You will find the answer to these questions in the background, procedure, results and interpretation sections of manual Exercise 15, 16, and 17, videos, Actions of Selective and Differential Media Chart, and the Principle/Theory article in homework section.) General Questions 1. What is the purpose (function) of selective media? (How does...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT