- A Turing machine (TM) is a 7-tuple , where:
- is a finite set of states
- is the tape alphabet, and is the blank symbol
- is the input alphabet (where )
- is the transition function
- is the start state
- is the accept state
- is the reject state, where
Configuration
- A configuration of a Turing machine is a string , where:
- represent the current state of
- is the contents of the tape
- The current head is positioned over the first symbol of
- A start configuration of on a string (input) is a configuration (indicating that the machine is in the start state and the input is on the tape).
- (halting configuration)
- A accepting configuration of is a configuration
- A rejecting configuration of is a configuration
- The halting configurations do not yield any other configurations.
- A configuration yields a configuration if the TM can go from to in one step, as the following definition for , and :
- (Middle of tape)
- yields if
- yields if
- (Left-hand end)
- yields if
- yields if
- (Right-hand end)
- will be handled as if it were
- (Middle of tape)
Acceptance
- A Turing machine accepts (or reject) a string input if there exists an accepting (or rejecting, resp.) computation history, which is a sequence of configurations such that:
- is the start configuration of on input
- is an accepting (or rejecting, respectively) configuration of
- yields for
- A Turing machine said to halt on input if it either accepts or rejects .
Recursively Enumerable (RE)
- A language is said to be recognized by a Turing machine if:
- For every string , accepts
- For every string , either rejects or loops forever
- A language is said to be Turing-recognizable (or recursively enumerable (RE)) if it is recognized by some Turing machine.
- (4.18) There exists some languages that are not Turing-recognizable.
- A language is said to be co-Turing-recognizable if its complement is Turing-recognizable.
- Every infinite Turing-recognizable language has an infinite decidable subset.
Recursive (Decidable) Languages (R)
- A Turing machine is said to decide a language (and is said to be decided by ) if:
- For every string , accepts
- For every string , rejects
- A Turing machine is called a decider if it halts on all inputs.
- For every language , the following statements are equivalent:
- is decidable (Turing-decidable or recursive)
- is Turing-recognizable and co-Turing-recognizable
- There exists a Turing machine that decides
- (p3.18) There exists an enumerator that enumerates in lexicographic order
- A language is said to be undecidable if it is not decidable.
- (Rice’s Theorem) Let be a language of TM descriptions, such that (i) is nontrivial (not empty and not all TM descriptions) and (ii) for each two TM and , we have . Then is undecidable.
- The set of all Turing machines is countable.
- The set of all languages is uncountable.
- The set of all strings is countable for any alphabet .
- The set of all infinite binary sequences is uncountable.
Examples
Turing-unrecognizable languages
- (5.30)
- (5.30)
Turing-undecidabletodo
todo check which are recognizable and which are not
Turing-recognizable but not decidable languages
Turing-decidable languages
- , ,
- (4.9) Every CFL is decidable.
- Every finite language is decidable.
- (5.9)
- (3.12, Element distinctness problem)
Description
- A description of a Turing machine , denoted by , is a string that encodes the transition function of in some way.
Equivalence Models
Multitape Turing Machine
- A multitape Turing machine is a Turing machine with multiple tapes, each with its own head. Each tape can be read and written to independently.
- The transition function for a multitape Turing machine is of the form , where is the number of tapes.
- means that the machine is in state and heads through are reading symbols . The machine will change to state , write symbols on the tapes, and move the heads in the directions specified by . (where )
- Every multitape Turing machine has an equivalent single-tape Turing machine.
- A language is Turing-recognizable iff some multitape Turing machine recognizes it.
Nondeterministic Turing Machine
- A nondeterministic Turing machine (NTM) is defined as a Turing machine but with a transition function .
- The computation of an NTM is a tree whose branches correspond to different possibilities for the machine’s transitions. If some branch of the computation leads to the accept state, the NTM accepts its input.
- (3.16) Every NTM has an equivalent deterministic Turing machine.
Enumerator
- An enumerator is a 7-tuple , where:
- is the set of states
- is the work tape alphabet, and is the blank symbol
- is the output tape alphabet
- is the transition function
- is the start state
- is the print state
- is the halt state (where )
- The computation of an enumerator is defined as in ordinary TM, except for the following points:
- It has two tapes, a work tape and an output tape. both initially blank.
- At each step,
- If it means that in state , reading , enumerator :
- enters state
- writes on the work tape
- moves the work tape to the direction
- writes on the output tape, and
- moves the output tape head to the right if .
- Whenever state is entered, the string on the output tape is said to be printed by the enumerator, the output tape is reset to blank and the head returns to the left-hand end of the output tape.
- (note: a string may be printed more than once)
- halts when is entered.
- If it means that in state , reading , enumerator :
- The language enumerated by is the set .
- (3.21) A language is Turing-recognizable iff some enumerator enumerates it.
- (p3.18) A language is Turing-decidable iff some enumerator enumerates it in lexicographic order.
Unrestricted Grammar
- An unrestricted grammar (or phrase structure grammar) is a formal grammar , where each production rule is of the form where:
Reducibility
Mapping Reducibility
- A function is called a computable function if there exists a Turing machine such that for every string , halts on input and outputs on its tape.
- A language is mapping reducible (or many-one reducible) to a language (denoted by ), if there exists a computable function such that for every string , we have . Such a function is called the reduction from to .
- (5.22) If and is decidable, then is decidable.
- (5.23) If and is undecidable, then is undecidable.
- (5.28) If and is Turing-recognizable, then is Turing-recognizable.
- (5.29) If and is not Turing-recognizable, then is not Turing-recognizable.
- (e5.6) If and , then .