regular language
All finite languages are regular, but not all regular languages are finite
Pumping Lemma
- demon picks
- you pick
- demon picks
- you pick an , and show
context-free grammar
Properties
- L is regular L is context-free
- context-free languages are not closed under complement, and not closed under intersection. ()
We know that is not CF
Pushdown Automata PDA
Properties
Turing machine
Transition function: : when in state scan symbol , write on tape cell, move the head in direction and enter state
transition to or is a halting state and accept/reject respectively.
Properties
- A TM is “total” iff it halts on all input
- L is recognizable:
- L is decidable:
Church-Turing Thesis
Conjecture 1: All reasonable models of computation are equivalent:
- perfect memory
- finite amount of time
Conjecture 2: Anything a modern digital computer can do, a Turing machine can do.
Equivalence model
- TMs with multiple tapes.
- NTMs.
- PDA with two stacks.
Finite Automata from Church-Turing Thesis
Finite automata can be encoded as a string:
Let be a DFA with states, input characters, final states, transitions
M is a “recognizer”
M is a “decider”
Decidability and Recognizability
(1) is deciable: Create a TM such that runs on , therefore is total, or >
(2) is recognizable: Create a TM such that runs on >
Note that all regular language are deciable language
Proof for is undeciable:
Assume is decidable
a decider for , .
Let another TM such that : Call on
Paradox machine: P never loops:
Countability
- A set is countable infinite if a monotonic function (isomorphism)
- A set is uncountable if there is NO injection from
Theorem:
- The set of all PDAs is countably infinite
- is countably infinite (list out all string n in finite time)
- The set of all TMs is countably infinite (, so does REC, DEC, CF, REG
- The set of all languages is uncountable.
Diagonalization and Problems
The set of unrecognizable languages is uncountable. The set of all languages is uncountable.
Proof: I can encode a language with a infinite string. Consider a machine that on input such that is undeciable from the diagonalization. Make sure to use the negation of the dia
Theorem
L is deciable L and are both recognizable
Proof: is deciable is deciable. is deciable L is recognizable
Let be recognizer. Create TM that runs and on concurrently. if accepts accept, accepts reject.
If M never halts, M decides L. If , and .
Reduction on universal TMs
. Which implies is unrecognizable
HP is undeciable, and recognizable.
Proof: Assume HP is deciable.
Build a TM where :
Therefore is total. Since . Therefore . Which means is a decider for (which is a paradox)