Foundations: Alphabets, Strings & Languages

the theory of computation

Imagine you want to know not just whether a particular computer can solve a problem, but whether ANY machine could ever solve it, no matter how fast or how much memory it has. The theory of computation is the part of computer science that asks this kind of question. It steps back from real laptops and phones, ignores the brand of chip and the programming language, and studies computation as a pure idea: given a problem, can it be solved at all, and if so, how much time or memory must any solution use?

To make this precise, the theory does something clever and at first surprising: it treats every problem as a question about strings of symbols. The input to a computation is written as a string (like 1011 or aabba), and a problem becomes the job of deciding which strings belong to a special set called a language. A machine then either accepts or rejects each string. By choosing simple, idealized machines (finite automata, pushdown automata, Turing machines) we can prove exactly what each kind of machine can and cannot recognize. Because the machines are abstract, the proofs hold for all time and all hardware.

Three big themes run through the whole subject. Automata and languages classify problems by the simplest machine that can recognize them. Computability asks which problems can be solved by any machine at all (some, like the halting problem, provably cannot). Complexity asks, among the solvable problems, which can be solved efficiently. The honest headline is that this theory does not make your code faster; it tells you where the hard walls are, so you do not waste your life trying to climb a wall that mathematics has proven cannot be climbed.

Question: is 12 a prime number? Encode it as the string "12" and define the language PRIMES = { strings that name a prime }. "7" is in PRIMES, "12" is not. Asking the computer "is 12 prime?" becomes "is the string 12 in the language PRIMES?"

Every yes/no problem can be recast as membership in a language of strings.

Studying abstract machines is not a retreat from reality: precisely because the machines are simple, the limits we prove are absolute and apply to every real computer, present and future.

Also called
theory of computingautomata theory計算理論自動機理論