turing-machines

Are all infinite languages undecidable?

落花浮王杯 提交于 2019-12-11 22:40:27
问题 I am wondering are all infinite languages undecidable? They must be right, as the TM trying to decide an infinite language would just loop forever, which makes it a recgonizer, not a decider. Thanks guys. 回答1: No, there are many infinite languages that are decidable. One trivial example is the language {n € N | a^n} , i.e. the language of words that only contain the letter "a". This language can be matched by the regular expression a* . so it is a regular language and thus decidable. 回答2: As

Dutch national flag on a Turing Machine

笑着哭i 提交于 2019-12-11 10:35:40
问题 I have a sequence of characters xxxxxx (with x^k and k > 0) My goal is to transform this sentence into a dutch flag, that is to say : xxxxx -> RRWWBB xxxx -> RWBB with R <= W <= B All solutions that I have found, have a very high complexity. Do you have any hint/clue to help to me build a Turing machine using only one tape and one head/cursor? 回答1: How about dividing the task into subtasks like: Change the last X to B. Change the last X to W. Change the first X to R. Change BW to WB. EDIT:

Can a Turing machine perform Quicksort?

寵の児 提交于 2019-12-10 10:08:31
问题 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 reached (that is, inside the loop). But, can a Turing machine also execute a recursive program? Can someone describe various details for such a Turing Machine? I suppose, if recursion can be executed by a Turing machine, the Quicksort can also be

What are the consequences of saying a non-deterministic Turing Machine can solve NP in polynomial time?

余生颓废 提交于 2019-12-09 04:44:40
问题 these days I have been studying about NP problems, computational complexity and theory. I believe I have finally grasped the concepts of Turing Machine, but I have a couple of doubts. I can accept that a non-deterministic turing machine has several options of what to do for a given state and symbol being read and that it will always pick the best option, as stated by wikipedia How does the NTM "know" which of these actions it should take? There are two ways of looking at it. One is to say

Finite automata, Pushdown automata and Turing machine examples

大兔子大兔子 提交于 2019-12-08 02:56:19
问题 I'm looking for some good source of Finite automata, pushdown automata and Turing machine tasks examples (for solving manually, by hand). I was searching around but didn't find nothing special so I'm wondering if someone's got some good examples. Thanks in advance. 回答1: Your best bet might be to get a book on the subject, such as Introduction to the Theory of Computation, Third Edition by Michael Sipser, and then work through the exercises. For a collection of problem sets on automata, along

Finite automata, Pushdown automata and Turing machine examples

拥有回忆 提交于 2019-12-06 09:33:06
I'm looking for some good source of Finite automata, pushdown automata and Turing machine tasks examples (for solving manually, by hand). I was searching around but didn't find nothing special so I'm wondering if someone's got some good examples. Thanks in advance. Your best bet might be to get a book on the subject, such as Introduction to the Theory of Computation, Third Edition by Michael Sipser, and then work through the exercises. For a collection of problem sets on automata, along with solutions, check out Stanford's introductory course in the theory of computation . Problem Sets 5, 6,

Turing Machine Implementation in C

泄露秘密 提交于 2019-12-06 07:03:27
问题 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 error. C:\Documents and Settings\Melkhiah.EQUIPO01\Mis documentos\Downloads\Tarea3 Discretas\TM.c||In function `Tape* insert_tape(Tape*, Direction, char)':| C:\Documents and Settings\Melkhiah.EQUIPO01\Mis documentos\Downloads\Tarea3 Discretas\TM.c|44|error

Can a Turing machine perform Quicksort?

…衆ロ難τιáo~ 提交于 2019-12-06 01:48:56
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 reached (that is, inside the loop). But, can a Turing machine also execute a recursive program? Can someone describe various details for such a Turing Machine? I suppose, if recursion can be executed by a Turing machine, the Quicksort can also be performed? If the question is if a Turing Machine can execute a sorting algorithm, the answer is yes, since

Looking for languages that are not Turing complete

吃可爱长大的小学妹 提交于 2019-12-04 20:39:13
问题 I know a little about what is a turing-machine and a turing-complete language, but to understand better, could someone give examples of languages that are not Turing complete? (maybe even machines that are not Turing, as well?) 回答1: Regular expressions, in the formal definition, consisting only of: concatenation ( ab ) unbounded repetition ( a* ) alternation ( a|b ) grouping ( (ab)|(cd) ) can only recognise regular languages. A Turing-complete programming language can recognise recursively

Turing Machine Implementation in C

China☆狼群 提交于 2019-12-04 13:52:34
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 error. C:\Documents and Settings\Melkhiah.EQUIPO01\Mis documentos\Downloads\Tarea3 Discretas\TM.c||In function `Tape* insert_tape(Tape*, Direction, char)':| C:\Documents and Settings\Melkhiah.EQUIPO01\Mis documentos\Downloads\Tarea3 Discretas\TM.c|44|error: invalid conversion from `void*' to `Tape*'| C:\Documents and Settings\Melkhiah.EQUIPO01\Mis