Professor: Eric Blais | Lecture Content
Introduction
Question
What questions can computers solve?
This is a broad question, but throughout the course we will obtain remarkably definite answers to it.
Definition
Problem: Task where for each possible input to the problem, there is one or more valid outputs that is to be produced.
This idea of a problem is general enough to capture anything we want to do on a computer, but we start with two simplifying restrictions.
Simplifying Restrictions
Simplifying Restriction 1: We only consider problems whose inputs are binary strings.
We use to denote two elements of the binary alphabet, and to denote the set of string that contain exactly binary symbols, we use .
The unique string in is the empty string, which is denoted by .
We can write to denote the set of all possible binary strings.
The first simplifying restriction states that the only problems we will consider are those whose inputs are . This is a basic observation, but will be extremely useful.
Here is a proposition that makes this claim more precise.
Proposition
For every finite set with elements, there is a one-to-one encoding function .
Proof: Fix any ordering of the elements of . Then define the encoding function that maps to the string that gives the binary representation of >
Simplifying Restriction 2: We only consider decision problems, where there is exactly one valid output for each input. This output is either ‘yes’ or ‘no’.
In other words, in a decision problem, the output on every input to the problem is exactly one of the elements in .
This is more restrictive than our first restriction.
Functions and Languages
With the two simplifying restrictions in place, a decision problem where all the inputs are binary strings of length can be described with a Boolean function
where for each , the value represents the valid output for input .
However we want to consider problems where all inputs don’t necessarily have the same length. Such problems can be represented by a family of Boolean functions, or equivalently, by languages that we represent as subsets
Notice that for any , the set of inputs of length in a language can be represented with the Boolean function defined by setting .
Similarly, any family of Boolean functions where for each corresponds to the language .
Cardinality of Languages
Counting arguments are useful in establishing fundamental limits of computers.
Definition
A set is finite if there is a one-to-one mapping between the elements of and the elements in the set for some . Otherwise, is an infinite set (MATH239).
Definition
A set is countable if there is a one-to-one mapping between the elements of and the set of natural numbers . Otherwise is uncountable.
For any fixed value of , the set of binary strings is finite. The set of all binary strings is infinite, and it is countable.
Proposition
The set is countable.
Proof: Consider where for each , we define to be the natural number with binary representation . We use to denote string concatenation, where we add at the front of the string . The mapping is one-to-one .
This implies that the set of strings in any language is countable. The set of all languages is uncountable.
Theorem
The set of all languages is uncountable.
Proof:
This proof is an example of a diagonalization argument.
Assume for contradiction that the set of all languages is countable. Then we can list the set of languages in some order
We can build a table whose columns are labelled by the strings in in lexicographical order and rows are labelled by the languages , in the order we just defined. For each cell in the table, enter a in the cell if and otherwise. The table will look like:
Consider the language that we obtain by looking at the diagonal entries of this table, and using their negation to determine if the corresponding string is in .
Namely, if is in the th string in the lexicographic ordering of , then .
is a language, so by our assumption, there is a value such that is the th language in our list.
Let denote the th string in the lexicographical order of . But then holds if and only if , so . This is a contradiction, so the set of all languages must be uncountable .
First Uncomputability Result
We can use the last two results to obtain a result regarding the limitations of computers.
Proposition
for which there is no program that accepts each input .
Assume for the contrary, there is a program that accepts exactly the set of strings in that language. Then there is a map from the set of all languages to the set of programs. But every program can be represented as a binary string, so there is a mapping from the set of all languages to the set of Boolean string . But since is countable, there is a mapping from the set of all languages to . This is a contradiction to our previous theorem.
As a result, for any fixed machine model, there are decision problems that cannot be computed by algorithms in this model.
However, there are two reasons to be unsatisfied with this result.
First, the result is non-constructive. It tells us that there do exist problems that can’t be solved by computers, but doesn’t tell us anything about what these uncomputable problems might be. It could be that we can’t even describe these uncomputable problems.
Second, this result says nothing about languages that are uncomputable by all machine models simultaneously. It leaves open the possibility that we can solve every problem with computers, as long as we are allowed to build different types of computers for each problem.
Turing Machines
We know that for every fixed machine, a language that cannot be computed by algorithms for that specific machine.
We will identify an explicit language that cannot be computed by algorithms over any machine model.
Deterministic 1-tape Turing machine
Two main components
- Machine with a finite number of possible internal states
- Infinite tape split up into squares
Each square contains exactly one symbol. The machine has a tape head that is always positioned over one of the squares of the tape.
At each step in the execution, the machine uses its internal state along with the symbol on the square of the tape that is under the tape head to determine the next action.
The action consists of the internal state it goes to, the symbol overwritten over the previous symbol on the square of the tape under the tape head, and a movement of left or right to the square adjacent to the current one in the tape.
There are two special actions that it can take to halt, one accepts and one rejects.
This is covered in CS245.
Definition
A deterministic one-tape Turing machine is an abstract machine described by the triple
with , where
- is the set of internal states,
- is the tape alphabet, and
- is the transition function.
The state 1 denotes the initial state of the Turing machine .
We need to keep track of its internal state, the current string on the tape, and the position of the tape head on the tape. We call this information the configuration of a Turing machine. It can be represented conveniently in the following way.
Definition
Configuration of a Turing machine is a string
- is the current string on the tape, and
- the position of the tape head is on the first symbol of .
Two configurations are equivalent when they are identical (up to blank symbols at the beginning of or end at the end of ). In other words, they satisfy
When , the string represents an accepting configuration. When , it represents a rejecting configuration. A configuration is a halting configuration if it is either accepting or rejecting.
A list of configurations obtained during the execution of a Turing machine is called a tableau. We can formally define which configurations follow each other in the execution of a Turing machine in the following way.
Definition
For any strings , symbols , and states and , the configuration of the Turing Machine yields the configuration , denoted
when . Similarly,
when .
By simulating many steps of computation, a Turing machine can reach some other configurations. We say that configuration derives the configuration in the Turing Machine , denoted
when a finite sequence of configurations such that
The Turing Machine accepts an input if the initial configuration derives an accepting configuration. It rejects if derives a rejecting configuration. It halts on it either accepts or rejects .
We can now formally define what it means for a Turing machine to compute a language.
Definition
The Turing machine decides the language if it accepts every and rejects every .
A language is also decidable there is a Turing machine that decides it. There is a closely related notion of recognizability of languages.
Definition
The Turing machine recognizes the language if for every , accepts .