Questions tagged [turing-machines]

A Turing machine is an idealized model of computation consisting of a finite-state control, an infinite tape holding information, and a read head positioned somewhere over the tape. Turing machines are used in computability theory to reason about the limits of computation, to provide a formal definition for an algorithm, and to provide formal models for nondeterminism.

Wiki

A Turing machine is a device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a computer.

Turing machines are not physical objects but mathematical ones. A Turing machine is a kind of state machine. At any time the machine is in any one of a finite number of states. Instructions for a Turing machine consist in specified conditions under which the machine will transition between one state and another.

The tape is used to store data. In addition, it can also store a series of transitions (a small programs) and thus, the head can run sub-programs. By analogy with modern computers, the tape is the memory and the head is the microprocessor.

Tag usage

The tag can be used for programming related problems in implementing features of a turing machine. The tag can also be used for algorithmic problems related to turing machine. Try to avoid theoretical and research based questions on Stack Overflow.

Please note https://cstheory.stackexchange.com is another stack exchange website which you can use to ask theoretical and conceptual problems with tag

Source

487 questions
2
votes
1 answer

O(n*log(n)) Turing Machine with exactly 1 tape for "equal number of a's and b's in a given word"?

I need to build a TM with exactly 1 tape for the language L = {w| w is a word with same number of a's and b's in it, for example: abba, aababb} The TM has to have ONLY 1 tape and it has to run in O(nlog(n)) time. I understand how to do it in…
Caffeine
  • 113
  • 1
  • 1
  • 7
2
votes
2 answers

1^3^n for n>=1 turing machine

I want to make a turing machine which accept strings of 1's of length power of 3. 111, 111111111, 111111111111111111111111111, so on. But I am unable to make algorithm for this. So far I am able to make machine which accepts length of multiple of 3.…
2
votes
1 answer

Turing machine to find most occurring char on tape

So I need to create a literal representation of a TM that finds the most occurring char on the tape and erases everything else. The TM has only one tape and inputs would look like this: #a# => #a# #aaabbaac# => #a# The alphabet is {a,b,c,d}. I…
Dragos Iancu
  • 85
  • 1
  • 5
2
votes
1 answer

Understanding TM Simulator

I was just looking at the turing machine simulator code and came across the following statements "The tape maps time and position to symbols. To calculate the symbol, we have to look at the machine one step earlier. If at that time, the head was at…
2
votes
1 answer

A Turing recognizable language is decidable or not?

Can a Turing recognizable language be decidable if it is possible to enumerate its strings in non-decreasing length? I think it's not because you can go to infinity, and this will make it undecidable right?
PTN
  • 1,658
  • 5
  • 24
  • 54
2
votes
2 answers

How to convert a CFG to a Turing Machine

How do I convert a CFG to a TM? I have a basic idea of how to convert a DFA to a TM, but I can't think of a way to do this one properly. Can I get some general implementation steps on this?
PTN
  • 1,658
  • 5
  • 24
  • 54
2
votes
1 answer

what does regular, Turing-decidable and Turing-recognisable mean?

I know this question has been asked earlier, but I honestly don't understand it clearly. I'm currently undergoing a study about the theory of computation and I'm coming to the terms "Prove that a language is decidable, recognizable or regular". In…
2
votes
3 answers

Turing machine diagram for enumerator

I am supposed to draw an enumerator for the language 0^k1^k (k>=0). I am not sure how that is different from building a Turing machine state diagram for this language: the way I understand it is that I need to build an enumerator that recognizes the…
Noona
  • 643
  • 1
  • 14
  • 30
2
votes
2 answers

Design a Push Down Automata to count the number of characters

The Alphabet: a, b, c I'm trying to define a PDA which accepts a^n b^m c^p : n + p = 2k for some integer k, m = k, and n, m, p, k >= 0 I think some strings that would be accepted are: #abc#; #aabbcc#; #aaabbbccc#; #abbccc#; #aaabbc# etc The number…
Bobby S
  • 4,006
  • 9
  • 42
  • 61
2
votes
0 answers

How to simulate f(1^n)=1^y where y=1+2+...n in Turing Machine Simulator?

I can't even imagine how to create this. I can create a transition function for ` but this looks like N factorial :( Please I'm trying to make this work somehow but I'm not even sure if it's really factorial N or something else. Thank you for your…
2
votes
1 answer

Turing Machine - Learning Skills

It took me the whole month to solve this problem, as I got it from the book one of exercise, and I'd love to know how to write this in a turing machine; I would really love to learn this. Please could anyone offer a help? Consider the last two…
Sabrina
  • 21
  • 1
2
votes
1 answer

Is $E_{LBA}$ a Turing recognizable language?

I know that $E_{LBA}$ = {< M > | L(M) = \emptyset }$ is an undecidable language, but is it also recognizable? It seems that it's complement is recognizable since it could enumerate all strings and see if any belong to the language. If both were…
rich
  • 29
  • 2
2
votes
1 answer

Can someone explain to me this Turing machine code?

I am newbie to Python so I don't really understand this. It's some kind of Turing machine that should write binary number, but I can't figure out what's going on after these rules from collections import defaultdict import operator # Binary…
Lagani
  • 107
  • 1
  • 6
2
votes
1 answer

What is the relation between the classes R, RE coRE, as opposed to P,NP,coNP

I am trying to understand the relation between these classes of languages. Can someone do some order in my way of thinking of this? For example, if i take the language HAMPATH = {: G has a hamiltonion path}. I know this is in NP and also NP hard.…
Eyzuky
  • 1,843
  • 2
  • 22
  • 45
2
votes
3 answers

How do we know NP-complete problems are the hardest in NP?

I get that if you can do a polynomial time reduction from "every" problem then it proves that the problem is at least as hard as every problem in NP. Except, how do we know that we've discovered every problem in NP? Can't there exist problems that…
rb612
  • 5,280
  • 3
  • 30
  • 68