Re: Question about Programming a Turing Machine




Chris Smith wrote:
frame <v.srikar@xxxxxxxxx> wrote:
I don't know whether this might be of help to you, but I thought of the

following "Context-sensitive grammar" for the language
(a^n)(b^2n)(c^n):

The construction of a Turing machine from a context-free grammar is
possible, but far more difficult than just building the machine
intuitively from the original problem description. I doubt this would
be the correct way for rhaazy to proceed. Rick Decker's response gives
an easy approach to the problem.


Take a close look at my grammar (especially at the example derivation),
it indirectly suggests a way to construct the Turing Machine(TM).

Incidentally,

You said that you have a program that works for palindromes, whose
Context-free grammar should have been as follows: -

S -> aSa | bSb | cSc | a | b | c | e

Now figure out how the transition table is implementing the above
grammar, then adopt the table to work for the grammar devised for
(a^n)(b^2n)(c^n). You can do it!


Consider, construction of a TM for palindromes over the alphabet {a,b}
It's CFG, S -> aSa | bSb | a | b | e

Example: - Derivation of sentence "ababa"

S => aSa
=> abSba
=> ababa

Don't you think that the way in which a TM crosses off the symbols for
palindrome "ababa" is related to the way in which the sentence is being
generated by the grammar?

No, he probably can't do it. Many problems involving Turing machines
are inherently undecidable, and among them is the problem of deciding
whether a Turing machines accepts the language generated by a given CFG
(insert trivial proof by reference to Rice's theorem here). In other
words, the relationship between a given Turing machine and a given
context-free grammar can be so complex that there exists no algorithm
that can determine if they are related at all. It is possible to
construct an arbitrary phrase-structured grammar from a Turing machine,
but I guarantee that it will look nothing like the simple grammar for
palindromes that you've given above. This approach is a dead-end.


Don't you think that you went slightly off-topic from suggestion of
transition table for language (a^n)(b^2n)(c^n) to Rice Theorem,
Undecidability ...??

.



Relevant Pages

  • Re: Question about Programming a Turing Machine
    ... translate an arbitrary grammar to a Turing machine. ... You didn't suggest a transition table. ... way to build a Turing machine for this nearly trivial language was to ...
    (sci.math)
  • Re: Question about Programming a Turing Machine
    ... translate an arbitrary grammar to a Turing machine. ... context of A and determine whether A can be replaced with γ ... Then help yourself/rhazzy in building one! ...
    (sci.math)
  • Re: rules to generate a context free grammar
    ... generated by a context free grammar. ... but not by a context-free grammar. ... instructions, such as a small Turing machine, it might not be so bad. ...
    (comp.compilers)
  • Re: OT: 2nd Amendment case
    ... Different nominative absolute sentences can have different ... The construction is a descendent of a similar Latin ... relationship got lost because our grammar is less definitive. ... There is no textual context for the 2nd. ...
    (rec.crafts.metalworking)
  • Re: OT: 2nd Amendment case
    ... The construction is a descendent of a similar Latin ... relationship got lost because our grammar is less definitive. ... we plan to go to the beach tomorrow." ... There is no textual context for the 2nd. ...
    (rec.crafts.metalworking)