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
4
votes
1 answer

Can a Turing complete language ever have a CFG?

Does turing completeness preclude a language from having a CFG? I couldn't find any paper saying that. I found this: "TeX can only be parsed by a complete Turing machine (modulo the finite space available), which precludes it from having a BNF."
4
votes
1 answer

Build enumerator (printer) for { 0 ^ (3 ^ n) | n >=0} with at most 10 states including print and halt, limited alphabet?

I have a task to build an enumerator (a turing machine which also prints to the output tape and outputs it by going to the print state) for the language {0 ^ (3 ^ n) | n >= 0} where: 1) The number of states must be at most 10 (including print and…
4
votes
2 answers

A turing machine that decides {0^2^n; n>0} that's not the commonly accepted one

We're being asked to create a Turing Machine that accepts {0^(2^n); n>0} that is not the commonly accepted one published by Michael Sipser. Instead, we are being asked to create one for the algorithm as follows: On the first pass of the head, the…
4
votes
1 answer

Single tape turing machine for converting binary number to unary?

I'm stuck on a problem I've been trying to solve, namely converting a binary number with no leading zeros to a unary representation on the same tape. E.g. 110 -> xxxxxx I found markov's algorithm as a potential solution, but am unable to implement…
Ahmed Jahan
  • 41
  • 1
  • 4
4
votes
2 answers

Explanation of the Turing Machine Halting Problem

I'm looking for a simple explanation of the halting problem for Turing machines. I know the basis of how TMs work, how they enumerate things, machine configurations, etc., but I don't have a good handle on the halting problem. Can someone provide a…
user2440665
  • 101
  • 5
4
votes
2 answers

Are there any Recursively Enumerable problems that are not RE-hard?

The computability class that I'm taking explains several languages that are in RE - REC (recursively enumerable but not recursive, i.e. solvable by a non-halting turing machine). It first shows how one of them (L_d, language of turing machines…
4
votes
4 answers

Time complexity of random access of an array

When analyzing the time complexity of an algorithm, we normally considered the time of random access of an array is a constant (the size n of the array is not a constant), but why? Consider the Turing machine model in which an array is stored in the…
xskxzr
  • 12,442
  • 12
  • 37
  • 77
4
votes
2 answers

Can a Turing machine perform Quicksort?

As far as I know, a Turing machine can be made to execute loops or iterations of instructions encoded on a Tape. This can be done by identifying Line separators and making the Turing machine go back until a specific count of Line separators is…
4
votes
4 answers

Mapping of natural and recognizable languages in a finite Turing Machine

I have been struggling to find an answer to this theoretical question, even tho it is not directly a programming question, I believe it is really related. Assume a type of Turing machine which cannot have more than 1000 squares. What would be the…
Hellnar
  • 62,315
  • 79
  • 204
  • 279
4
votes
1 answer

Time complexity of a Turing machine for repeat strings

I'm trying to figure out the time-complexity of a turing machine that accepts repeat strings (ww) in three cases: a 1-tape deterministic machine, a 2-tape deterministic machine, and 1-tape nondeterministic machine. Right now my thoughts are that…
4
votes
1 answer

Universal turing machine examples

I'm looking for a well explained implementation of a universal turing machine, using a binary alphabet. Particularly, I'm looking for an action table for such a UTM with explanations. Can anyone point me in the right direction?
user924731
  • 95
  • 1
  • 5
4
votes
2 answers

Turing Machine to accept strings of prime lengths

I have a homework problem that asks me to describe a program for a non deterministic Turing Machine that accepts L = {a^n: n is prime}. I'm not sure on how to go about this. do i know n? do i use the as as unary digits and count them? can i just…
calccrypto
  • 8,583
  • 21
  • 68
  • 99
3
votes
3 answers

relationship between countability and turing machine halting

Hi i have a doubt over countability. Why is it necessary to find out whether certain things are countable. Is there a use over finding it? And also if some thing is uncountable does it mean that there is no Turing machine to solve it ?
user602774
  • 1,093
  • 7
  • 19
  • 31
3
votes
3 answers

Turing Machine Implementation in C

I'm studying Turing machines for my course in formal languages ​​theory, the professor recommended a run on the following algorithm to see in detail the logic behind of a "TM", but doesn't work, when trying to compile tells me the following…
franvergara66
  • 10,524
  • 20
  • 59
  • 101
3
votes
1 answer

Is this language decidable?

I'm struggling with whether or not this is decidable: A = {x is an element of the set of Natural Numbers | for every y greater than x, 2y is the sum of two primes} I'm inclined to think that this is decidable given the fact that when fed into a…
user1171851
  • 31
  • 1
  • 2