Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS605 – The Mathematics and Theory of Computer Science Turing Machines.

Similar presentations


Presentation on theme: "CS605 – The Mathematics and Theory of Computer Science Turing Machines."— Presentation transcript:

1 CS605 – The Mathematics and Theory of Computer Science Turing Machines

2 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Equivalence In order that we show that two models are equivalent we simply need to show that we can simulate one by the other.

3 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Multitape TMs A multitape TM is like an ordinary TM with several tapes each with its own head for reading and writing. Initially the input appears on one tape with all the others blank. The transition function is changed to allow for reading, writing and moving the heads on some or all of the tapes simultaneously.

4 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Multitape TMs Formally this transition is: –δ: Q × Γ k → Q × Γ k × {L,R,S} k where k is the number of tapes. δ(q i, a 1, …, a k ) = (q j, b 1, …, b k, L, R, …, L) means that, if the machine is in state q i and heads 1 through k are reading symbols a 1 through a k, the machine goes to state q j, writes symbols b 1 through b k, and directs each head to move Left, Right or Stay Put.

5 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Multitape TMs Multitape TM’s are equivalent (recognise the same language) in power to ordinary TM’s. Every multitape TM has an equivalent single-tape TM. Proof?

6 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Turing- Recognisable A language is Turing-Recognisable if and only if some multitape TM recognises it. We stated previously that: “A language is Turing Recognisable if some Turing Machine recognises it”. This new definition does not go against this as a multitape TM can be simulated by an ordinary TM.

7 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Nondeterministic Turing Machines A nondeterministic TM is a generalisation of the standard TM for which every configuration may yield none, or one or more than one next configurations. In contrast to a deterministic TM, for which a computation is a sequence of configurations, a computation of a nondeterministic TM is a tree of configurations that can be reached from the start configuration.

8 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Nondeterministic Turing Machines The transition function for a nondeterministic TM has the form: –δ : Q × Γ → P(Q × Γ × {L,R}) where P refers to the power set. The computation of a nondeterministic TM is a tree whose branches correspond to different possibilities for the machine. If some branch of the computation leads to an accept state the machine accepts the input.

9 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Nondeterministic Turing Machines An input to a NTM is said to be accepted if there exists at least one node of the computation tree which is an accept- configuration. The path from the root to the accept- configuration is said to be non- deterministically selected. A NTM is called a decider if all branches halt on all inputs.

10 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Nondeterministic Turing Machines Every nondeterministic TM has an equivalent deterministic TM.

11 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Do TM always halt? When can a machine not halt? There are a number of possibilities: 1.The machine stops, but not in the halt state. We call this a crash. 2.No transition is specified for the current state and tape symbol – this is also a crash. 3.The machine enters an infinite loop, and so never gets out of this to reach a halt state.

12 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Implications of Non-Halting The first sounds ominous, but it is ok. When machine crashes we know input was invalid. The second is to be expected – when we design the machines we don’t have to specify all the transitions; the ones we don’t specify should naturally lead to the error state, i.e. crash. The third is far more serious: If the machine enters an infinite loop, the user is left waiting for an answer. As time goes on they are wondering “Should I turn the machine odd?” or “If I leave it running maybe it will stop in the next few minutes”. This issue is non-trivial…

13 Dr. A. Mooney, Dept. of Computer Science, NUI Maynooth Implications of Non-Halting This problem is referred to as the “Halting Problem” and we will look at it soon…


Download ppt "CS605 – The Mathematics and Theory of Computer Science Turing Machines."

Similar presentations


Ads by Google