April 14, 2026
Given a context-free grammar G,
Given a context-free grammar G, and a word w,
Theorem 1 (Leslie G. Valiant ’75) The CFG parsing problem can be solved in time \mathcal{O}(|G||w|^\omega), where \omega is the exponent of Boolean matrix multiplication1.
Theorem 2 (Lillian Lee ’02) Any CFG parser with time complexity \mathcal{O}(|G||w|^{3-\epsilon}) can be used to multiply m\times m Boolean matrices in time \mathcal{O}(m^{3-\epsilon/3}).
Given context-free grammars G_1, G_2,
There are no algorithms that always terminate and answer the questions above correctly!
We need a formalization of the intuitive notion of algorithm or effective procedure.
This is needed for negative results of the form:
“there is no algorithm that always terminates and solves problem X”.
For example, there is no algorithm that always terminates and
Informally, a Turing machine is a DFA with an infinite tape and a read/write head that can move left and right.
M=({\color{red} Q},{\color{darkblue}\Sigma},{\color{brown}\Gamma},\delta,{\color{red}q_0,q_{accept},q_{reject}})
\color{darkblue}\Sigma=\{0,1\}
\color{brown}\Gamma=\{0,1,\sqcup,\triangleright\}
\delta: Q\setminus \{q_{acc},q_{rej}\} \times \Gamma\to Q\times \Gamma\times \{\pm 1\}
\delta(q_0, 0) = (q_0, 0, R)
\delta(q_0, 1) = (q_0, 1, R)
\delta(q_0, \sqcup) = (q_1, \sqcup, R)
\delta(q_0, \triangleright) = (q_0, \triangleright, R)
How can a DTM simulate a DFA?
More examples of TMs in HW3 (next week) and here: https://turingmachinesimulator.com
M(x)\!\downarrow means that the Turing machine M halts on input x.
M(x)\!\uparrow means that the Turing machine M does not halt on input x (M on input x loops).
tape configuration (u, q, v), where
\mathscr{L}(M) is the language recognized/accepted by the Turing machine M.
A partial function f:\Sigma^*\to \Sigma^* is computed by a Turing machine M if for every x\in \Sigma^* where f(x) is defined
and for every x\in \Sigma^* where f(x) is not defined
Functions f : \mathbb N \to\mathbb N could be computed by a Turing machine: input and output are encoded in binary on the tape.
Theorem 3 The following computational models compute the same class of functions as Turing machines:
Church-Turing Thesis The notion of Turing machine captures the intuitive notion of computability. That is, a function is computable if and only if it is computed by a Turing machine.
Theorem 4 \mathbf{R}=\mathbf{RE}\cap \mathbf{coRE}
Proof.
Theorem 5 There is a TM U s.t. for every TM M and every input x, U(\langle M,x\rangle)=M(x), where \langle M,x\rangle is an encoding of the pair (M,x) as a binary string.
The machine U is called a universal Turing machine and simulates the execution of M on x.
A set is countable if it is finite or if there exists a bijection between it and \mathbb{N}.
Otherwise a set is uncountable.
Theorem 6 If A\subseteq B and B is countable, then A is countable.
Exercise 1 The set of all Turing machines is countable.
Two sets have the same size (or cardinality) if there exists a bijection between them.
Theorem 7 \mathbb{R}, \mathbb{R}\cap (0,1), \mathscr{P}(\mathbb{N}), and \mathscr{P}(\{0,1\}^*) all have the same cardinality.1
Continuum Hypothesis
There is no set whose cardinality is strictly between \aleph_0 (the cardinality of \mathbb{N}) and \mathfrak{c} (the cardinality of \mathbb{R}).2
Theorem 8 \mathscr{P}(\{0,1\}^*) is not countable.
Proof.
Corollary 1 \mathbb{R} and \mathscr{P}(\mathbb{N}) are not countable.
Exercise 2 There are uncountably many languages (say over \{0,1\}) not recognized by any Turing machine.
Any explicit example of such a language? Yes! tomorrow’s class.