COMPSCI350: Quantum Computing, Computability and Complexity

COMPSCI350: Quantum Computing,
Computability and Complexity
Cristian S. Calude
Semester 1, 2017
COMPSCI350: Quantum Computing, Computability and Complexity
1 / 110
Textbook
I
M. Sipser. Introduction to the Theory of Computation,
Cengage Learning, 2013.
COMPSCI350: Quantum Computing, Computability and Complexity
2 / 110
Supplementary bibliography
1
I
C. S. Calude. Incompleteness: A Personal Perspective, Google
Technical Talk, Mountainview, USA, 4 November 2008,
http://www.youtube.com/watch?v=tYjmiT422yQ.
I
J. P. Dowling. To compute or not to compute? Nature 439,
23 February 2006, 919–920.
COMPSCI350: Quantum Computing, Computability and Complexity
3 / 110
Classical vs Quantum Computers
Quantum computing was first introduced by Yuri Manin in 1980
and Richard Feynman in 1982.
A quantum computer is a computation device that makes direct
use of quantum-mechanical phenomena, such as superposition and
entanglement, to perform operations on data.
Classical computer
Quantum computer
bit
qubit
COMPSCI350: Quantum Computing, Computability and Complexity
deterministic
probabilistic
sequential
parallel
4 / 110
The light switch game
Figure 1: Example of light switch game
COMPSCI350: Quantum Computing, Computability and Complexity
5 / 110
The light switch game
Each light switch
1. has a number associated with it called “bias”,
2. and can be in two positions, ON = +1 and OFF = -1.
Adding up all the switches’ bias values multiplied by their
ON/OFF values gives a number.
The objective of the game is to set the switches to get the lowest
number.
COMPSCI350: Quantum Computing, Computability and Complexity
6 / 110
The light switch game
Switches’ biases are: +1, +0.2, +0.5, -0.7, -0.8, and +0.4.
Setting them, in order, to OFF, ON, OFF, OFF, ON, OFF, we get
the number
(−1) ∗ (+1) + (+1) ∗ (+0.2) + (−1) ∗ (+0.5)
+(−1) ∗ (−0.7) + (+1) ∗ (−0.8) + (−1) ∗ (+0.4) = −3.2.
COMPSCI350: Quantum Computing, Computability and Complexity
7 / 110
The light switch game
Did we get the lowest number?
No, but almost. Switches OFF, OFF, OFF, ON, ON, OFF give the
minimal number -3.6.
How did we “guess” it? Are we sure that -3.6 is the minimal
number?
I
Brute force approach: generate all 26 = 64 combinations of
switches and choose the one which produces the lowest
number.
I
Find a better (smarter) algorithm to get the lowest number.
COMPSCI350: Quantum Computing, Computability and Complexity
8 / 110
The light switch game
Why do we need a “better algorithm” when the brute force gives
us the solution?
Number of light switches
Number of combinations
6
26 = 64
10
210 = 1024
100
2100 = 1267650600228229401496703205376
512
2512 >>> number of atoms in the universe
COMPSCI350: Quantum Computing, Computability and Complexity
9 / 110
The light switch game
A simple algorithm for the light switch game:
Set all the switches with positive biases to OFF and all
the switches with negative biases to ON and, finally, add
up the result to get the lowest overall value.
EASY, right?
COMPSCI350: Quantum Computing, Computability and Complexity
10 / 110
The interacting light switch game
A light switch game in which some pairs of switches have biases
too.
Figure 2: Example of interacting light switch
COMPSCI350: Quantum Computing, Computability and Complexity
11 / 110
The interacting light switch game
After setting switches to ON/OFF values, the new game’s number
is obtained by adding
I
the sum of the switches’ bias values multiplied by their
ON/OFF values, and
I
the sum of pair of switches’ biases multiplied by the
corresponding switches ON/OFF values.
The goal is to set the switches to get the lowest number.
COMPSCI350: Quantum Computing, Computability and Complexity
12 / 110
The interacting light switch game
The interaction biases are: +0.2, -1, -0.3, -0.7, -0.7, +0.3, +0.8
and +0.1 (seven pairs have no interaction bias, i.e. their bias is 0).
COMPSCI350: Quantum Computing, Computability and Complexity
13 / 110
The interacting light switch game
Setting switches to OFF, OFF, OFF, ON, ON, OFF (the solution
of the light switch game!) we get the number
(−1) ∗ (+1) + (−1) ∗ (+0.2) + (−1) ∗ (+0.5) + (+1) ∗ (−0.7)
+(+1) ∗ (−0.8) + (−1) ∗ (+0.4) + (−1) ∗ (−1) ∗ (+0.2)
+(−1) ∗ (−1) ∗ (−0.3) + (−1) ∗ (−1) ∗ (−0.7) + (−1) ∗ (+1) ∗ (−0.7)
+(−1) ∗ (+1) ∗ (+0.3) + (−1) ∗ (+1) ∗ (−1) + (+1) ∗ (−1) ∗ (+0.1).
COMPSCI350: Quantum Computing, Computability and Complexity
14 / 110
The interacting light switch game
Here is a simpler instance of the interacting light switch game: we
have two switches with biases +1 and -0.8, respectively, and
interaction bias -1. The brute force analysis shows the following:
Switch 1
ON
ON
OFF
OFF
Switch 2
ON
OFF
ON
OFF
Switches sum
0.2
1.8
-1.8
-0.2
Interaction sum
-1
1
1
-1
Total sum
-0.8
2.8
-0.8
-1.2
The solution of the light switch game is OFF, ON, but this is not a
solution for the interacting light switch game, which is OFF, OFF.
COMPSCI350: Quantum Computing, Computability and Complexity
15 / 110
The interacting light switch game
With the better algorithm not working in this case we are left with
the brute force solution... Any better ideas?
COMPSCI350: Quantum Computing, Computability and Complexity
16 / 110
A quantum approach to the interacting light switch game
Quantum computers can help!
The fundamental idea is to use qubits instead of bits and take
advantage of the fact that a qubit can be into a superposition of
states.
What does superposition mean? A qubit is a two-state
quantum-mechanical system. In contrast with the bit, which has to
be in one state (+1) or the other (-1) of a two-state classical
system, a qubit may be simultaneously in both states. Weird!
Think that the qubit has not yet decided which state it wants to
be in, hence, temporarily, it is in both states at the same time.
COMPSCI350: Quantum Computing, Computability and Complexity
17 / 110
A quantum approach to the interacting light switch game
Switches (with no biases) in Figure 2 can be represented in a
quantum computer as in Figure 3: light switches are ON and OFF
at the same time.
Figure 3: Quantum representation of the interacting light switch
COMPSCI350: Quantum Computing, Computability and Complexity
18 / 110
A quantum solution to the interacting light switch game
I
I
I
I
I
I
I
Start with the representation in Figure 3 (only switches, no
biases).
All light switches are simultaneously ON and OFF, hence the
solution (i.e. the correct ON/OFF settings for each switch) is
represented in there, but temporarily “hidden”.
Slowly turn on (read) all switch bias values.
Simultaneously, slowly the quantum computer turns off the
quantum superposition effect, so all switches slowly choose a
classical state, either ON or OFF.
At the end of the previous operation, each switch has chosen
to be either ON or OFF (a solution is given).
Quantum mechanics guarantees that the light switches settle
into the right states (ON or OFF) to give the lowest overall
number as required (the solution is correct).
Readout the solution.
COMPSCI350: Quantum Computing, Computability and Complexity
19 / 110
Adiabatic quantum computers
The last step in the quantum solution seems like “magic”. How
does this work?
The reason is the adiabatic theorem (M. Born and V. Fock, 1928).
A quantum mechanical system subjected to gradually
changing external conditions—an adiabatic
process—adapts itself such that it retains its initial
character.
COMPSCI350: Quantum Computing, Computability and Complexity
20 / 110
Adiabatic quantum computers
Here is a simple (classical) example. An ideal pendulum in a
vacuum with no friction is oscillating in a vertical plane.
I
If the support is moved suddenly, the mode of oscillation of
the pendulum will change.
I
If the support is moved sufficiently slowly, the motion of the
pendulum relative to the support will remain unchanged.
A gradual change in external conditions allows the system to
adapt, such that it retains its initial character.
COMPSCI350: Quantum Computing, Computability and Complexity
21 / 110
Adiabatic quantum computers
Q: Do adiabatic quantum computers exist?
A: There are three generations of quantum computers, all
produced by D-Wave: one D-Wave One (2011), D-Wave Two
(2013), D-Wave 2X (2015).
Q: How does D-Wave assure that its computation is an adiabatic
process?
A: Among other things, by computing at a temperature below
approximately −273.1◦ C (almost 1◦ C colder than the coldest place
in the universe, Boomerang Nebula).
Q: D-Wave is a probabilistic machine, i.e. it may return wrong
answers. Is this not a very bad thing?
A: Not always. By returning multiple answers one can get
important information about the confidence level of the quantum
computer.
COMPSCI350: Quantum Computing, Computability and Complexity
22 / 110
Adiabatic quantum computers
Q: What type of qubits does D-Wave use?
A: D-Wave uses flux qubits pictured below.
Flux qubit
COMPSCI350: Quantum Computing, Computability and Complexity
23 / 110
Adiabatic quantum computers
Flux qubit
COMPSCI350: Quantum Computing, Computability and Complexity
24 / 110
Adiabatic quantum computers
Q: How many qubits has D-Wave 2X?
A: 1,024.
Q: What is the size of the latest D-Wave quantum chip?
A: 2,048 physical qubits.
Q: Is D-Wave capable of solving other problems except
minimisations of problems where all variables take only 0-1 values?
A: The problem is open.
Q: Where can we find more information about D-Wave?
A: Visit D-Wave.
Q: Is there any research in this area done in the Computer Science
Department?
A: Yes, see Adiabatic Quantum Computing Challenges.
COMPSCI350: Quantum Computing, Computability and Complexity
25 / 110
Church-Turing thesis revisited
1
The Church-Turing thesis (formerly known as Church’s thesis)
says that
every intuitively computable function is computable by
some Turing machine.
There are conflicting points of view about the Church-Turing
thesis. . .
COMPSCI350: Quantum Computing, Computability and Complexity
26 / 110
Church-Turing thesis revisited
2
(1) There has never been a proof for Church-Turing
thesis; in fact it cannot be proven. The evidence for
its validity comes from the fact that every realistic
model of computation, yet discovered, has been
shown to be equivalent.
(2) A device which could answer questions beyond those
that a Turing machine can answer would disprove the
Church-Turing thesis. No such convincing device has
been found (yet). Super-Turing computation, part of
hypercomputation, is searching for such a device.
COMPSCI350: Quantum Computing, Computability and Complexity
27 / 110
Physical Church-Turing thesis
Here are two formulations out of a much larger set:
every real-world computation can be translated into an
equivalent computation involving a Turing machine
or
any physical process can be simulated by some Turing
machine.
Both formulations would be falsified by the existence of genuine
random processes.
A. Turing: a machine with a “random element” can do “more”
than a Turing Machine (see Turing 1950, pp. 438–439). What is
“more”?
COMPSCI350: Quantum Computing, Computability and Complexity
28 / 110
Wolfram’s principle of computational equivalence
Almost all processes that are not obviously simple can be
viewed as computations of equivalent sophistication.
In detail, the principle of computational equivalence says that:
I
the systems found in nature can perform computations up to
a maximal (“universal”) level of computational power, and
I
most systems do in fact attain this maximal level of
computational power, so
I
most systems are computationally equivalent.
For example, the workings of the human brain or the evolution of
weather systems can, in principle, compute the same things as a
computer.
COMPSCI350: Quantum Computing, Computability and Complexity
29 / 110
Recap
ATM = {hM, w i : M is a TM and M accepts w }.
HALTTM = {hM, w i : M is a TM and M halts on input w }.
Theorem 4.11 ATM is undecidable.
Theorem 5.1 HALTTM is undecidable.
COMPSCI350: Quantum Computing, Computability and Complexity
30 / 110
The halting problem revisited
We have proved one of the most philosophically important
theorems of the theory of computation:
There is a specific problem that is algorithmically
unsolvable.
I
What sort of problems are unsolvable by computer?
I
Are they esoteric, dwelling only in the minds of theoreticians?
Even some ordinary problems that people want to solve turn out to
be computationally unsolvable. For example, the general problem
of software verification is unsolvable!
COMPSCI350: Quantum Computing, Computability and Complexity
31 / 110
Can humans solve the halting problem?
It might seem like humans could solve the halting problem. After
all, a programmer can often look at a program and tell whether it
will halt. Let’s understand why this cannot be true in general.
To “solve” the halting problem means to be able to look and study
any program and decide in a finite amount of time whether it
halts. It is not enough to be able to look at some programs and
decide. Even for short programs, it isn’t clear that humans can
always tell whether they halt.
COMPSCI350: Quantum Computing, Computability and Complexity
32 / 110
Solving problems by testing the halting problem
1
“Solving” the halting problem would offer solutions to many open
question in mathematics and computer science:
I
The twin prime conjecture (Euclid around 300 B.C.), there are
infinitely many primes p such that p + 2 is also prime.
I
Goldbach’s conjecture (1742), every even integer greater than
two can be expressed as the sum of two primes.
I
The Riemann hypothesis (1859), the real part of any
non-trivial zero of the Riemann zeta function is 1/2.
I
The correctness problem in software engineering, proving that
a given program meets a given specification.
COMPSCI350: Quantum Computing, Computability and Complexity
33 / 110
Solving problems by testing the halting problem
2
A conjecture is finitely refutable if verifying a finite number of
instances suffices to disprove it. A systematic enumeration (of the
problem’s search domain) will find a counter-example if one exists.
If the search stops, the conjecture is false; if the search does not
halt the conjecture is true.
For a finitely refutable problem Π we can construct a program CΠ
such that
Π is false iff CΠ halts.
Π = Goldbach’s conjecture is finitely refutable and one can
construct a program CΠ of 3,484 bits.
COMPSCI350: Quantum Computing, Computability and Complexity
34 / 110
Solving problems by testing the halting problem
3
For example, Π = the Riemann hypothesis is finitely refutable and
one can construct a program CΠ of 7,780 bits.
The twin prime conjecture
∀n {∃p [p > n & p prime & p + 2 prime]}
is not finitely refutable but can still be solved by testing the halting
status of a small program.
The stronger twin prime conjecture is finitely refutable:
∀n {∃p [n < p < 2n+4 & p prime & p + 2 prime]}.
COMPSCI350: Quantum Computing, Computability and Complexity
35 / 110
Solving problems by testing the halting problem
4
Collatz function is defined by
x/2,
if x is even,
T (x) =
3x + 1, if x is odd ,
The Collatz conjecture states that
for every seed a > 0, there is an iteration N such that
T N (a) = 1.
There is a non-constructive way to prove that there exists a
program CCollatz which never stops iff the conjecture is true.
Open question: Can you find/write such a program?
COMPSCI350: Quantum Computing, Computability and Complexity
36 / 110
Can we solve “approximately” the halting problem?
“Approximately” can mean:
I
probabilistically,
I
graphically,
I
with a “small” error.
References
I
C. S. Calude, M. A. Stay. Most programs stop quickly or
never halt, Advances in Applied Mathematics, (2007), 40
(2008), 295–308.
I
C. S. Calude, M. Dumitrescu. An Anytime Algorithm for the
Halting Problem, CDMTCS Research Report 493, 2015, 18
pp.
COMPSCI350: Quantum Computing, Computability and Complexity
37 / 110
A Turing-unrecognisable language
1
In the proof of Theorem 4.11 we showed that:
I
ATM is Turing-recognisable,
I
ATM is not decidable.
Recall that the complement of a language is the language
consisting of all strings that are not in the language. We say that a
language is co-Turing-recognisable if it is the complement of a
Turing-Recognisable language.
We will show that
I
ATM is not co-Turing-recognisable.
COMPSCI350: Quantum Computing, Computability and Complexity
38 / 110
A Turing-unrecognisable language
2
Theorem 4.22 A language is decidable iff it is Turing-recognisable
and co-Turing-recognisable.
Proof. We have two directions to prove.
Any decidable language is Turing-recognisable, and the
complement of a decidable language also is decidable.
For the other direction, assume A and A are Turing-recognisable.
Let M1 be the recogniser for A and M2 be the recogniser for A.
COMPSCI350: Quantum Computing, Computability and Complexity
39 / 110
A Turing-unrecognisable language
2
The following TM is a decider for A:
D = “On input string w :
1. Run both M1 and M2 on input w in parallel.
2. If M1 accepts, accept; if M2 accepts, reject.”
We show that D decides A: Every string w is either in A or A, but
not in both. Therefore either M1 or M2 must accept w . Because
D halts whenever M1 or M2 accepts, D always halts and so it is a
decider. Furthermore, D accepts all strings in A and rejects all
strings not in A, so it is a decider for A.
COMPSCI350: Quantum Computing, Computability and Complexity
40 / 110
A Turing-unrecognisable language
3
Corollary 4.23 ATM is not Turing-recognisable.
Proof. By the proof of Theorem 4.11, ATM is Turing-recognisable.
If ATM also were Turing-recognisable, ATM would be decidable.
Theorem 4.11 tells us that ATM is not decidable, so ATM must not
be Turing-recognisable.
COMPSCI350: Quantum Computing, Computability and Complexity
41 / 110
Undecidable problems
1
The strategy used in the proof of undecidability of HALTTM was
the following: we assumed that HALTTM is decidable and use that
assumption to show that ATM is decidable, contradicting Theorem
4.11.
We will use this method to prove the undecidability of other
problems.
COMPSCI350: Quantum Computing, Computability and Complexity
42 / 110
Undecidable problems
2
ETM = {hMi : M is a TM and L(M) = ∅}.
Theorem 5.2 ETM is undecidable.
Proof. First we construct the auxiliary TM M1 based on a TM M
and string w :
M1 = “On input string x:
1. If x 6= w , reject.
2. If x = w , run M on input w and accept if M
does.”
COMPSCI350: Quantum Computing, Computability and Complexity
43 / 110
Undecidable problems
3
Proof of Theorem 5.2 continued. Assume that TM R decides
ETM and construct TM S that decides ATM :
S = “On input hM, w i, an encoding of a TM M and a string w :
1. Use the description of M and w to construct the
TM M1 described before.
2. Run R on input hM1 i.
3. If R accepts, reject; if R rejects, accept.”
If R were a decider for ETM , S would be a decider for ATM , a
contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
44 / 110
Undecidable problems
4
EQTM = {hM1 , M2 i : M1 and M2 are TMs and L(M1 ) = L(M2 )}.
Theorem 5.4 EQTM is undecidable.
Proof. Let R decide EQTM and construct TM S to decide ETM :
S = “On input hMi, where M is a TM:
1. Run R on input hM, M1 i, where M1 is a TM that
rejects all inputs.
2. If R accepts, accept; if R rejects, reject.”
If R decides EQTM , S decides ETM , which by Theorem 5.2 is a
contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
45 / 110
Mapping reducibility
1
The notion of reducing one problem to another may be defined
formally in one of several ways. Our choice is a simple type of
reducibility called mapping reducibility or many-one reducibility.
A problem A can be reduced to a problem B by using a mapping
reducibility if there is a computable function that converts
instances of problem A to instances of problem B.
If we have such a conversion function we can solve A with a solver
for B. Reason: any instance of A can be solved by first using the
reduction to convert it to an instance of B and then applying the
solver for B.
COMPSCI350: Quantum Computing, Computability and Complexity
46 / 110
Mapping reducibility
2
A function f : Σ∗ → Σ∗ is called computable if some TM M, on
every input w , halts with f (w ) on its tape.
All usual arithmetic operations on integers are computable
functions.
All usual string operations are computable functions.
Computable functions may be transformations of TM descriptions.
For example, the function that takes an input string w and returns
1 if w = hMi is an encoding of a TM or returns 0 in the opposite
case, is computable.
COMPSCI350: Quantum Computing, Computability and Complexity
47 / 110
Formal definition of mapping reducibility
1
Language A is mapping reducible to language B, written A ≤m B,
if there is a computable function f : Σ∗ → Σ∗ , where for every
w ∈ Σ∗
w ∈ A ⇐⇒ f (w ) ∈ B.
The function f is called the reduction of A to B.
To test whether w ∈ A we use the reduction f to map w to f (w )
and test whether f (w ) ∈ B.
COMPSCI350: Quantum Computing, Computability and Complexity
48 / 110
Formal definition of mapping reducibility
2
Theorem 5.22 If A ≤m B and B is decidable, then A is decidable.
Proof. Let M be the decider for B and f be the reduction from A
to B. Here is a decider N for A:
N = “On input w :
1. Compute f (w ).
2. Run M on input f (w ) and output
whatever M outputs.”
So, w ∈ A iff f (w ) ∈ B because f is a reduction from A to B.
COMPSCI350: Quantum Computing, Computability and Complexity
49 / 110
Formal definition of mapping reducibility
3
Corollary If A ≤m B and A is undecidable, then B is undecidable.
Proof. Assume by contradiction that B is decidable. Then, by
Theorem 5.22, A is decidable, a contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
50 / 110
Formal definition of mapping reducibility
4
Theorem 5.28 If A ≤m B and B is Turing-recognisable, then A is
Turing-recognisable.
Proof. The proof is the same as that of Theorem 5.22, except
that M and N are recognisers instead of deciders. Let M be the
recogniser for B and f be the reduction from A to B. The
recogniser N for A is:
N = “On input w :
1. Compute f (w ).
2. Run M on input f (w ) and output whatever
M outputs.”
So, w ∈ A iff f (w ) ∈ B because f is a reduction from A to B.
COMPSCI350: Quantum Computing, Computability and Complexity
51 / 110
Formal definition of mapping reducibility
5
Corollary 5.29 If A ≤m B and A is not Turing-recognisable, then
B is not Turing-recognisable.
Proof. Assume A ≤m B. If A is not Turing-recognisable then B
cannot be Turing-recognisable because by Theorem 5.28 A would
be Turing-recognisable.
COMPSCI350: Quantum Computing, Computability and Complexity
52 / 110
Example
1
Example 5.24 ATM ≤m HALTTM .
Proof. We will construct a computable function f that takes
inputs of the form hM, w i and returns outputs of the form
hM 0 , w 0 i, where
hM, w i ∈ ATM ⇐⇒ hM 0 , w 0 i ∈ HALTTM .
The following TM F computes f .
F = “On input hM, w i:
1. Construct the following machine M 0 .
M 0 = “On input x:
1. Run M on x.
2. If M accepts, accept.
3. If M rejects, enter a loop.”
2. Output hM 0 , w i.”
COMPSCI350: Quantum Computing, Computability and Complexity
53 / 110
Example continued
1
Improperly formed input strings i.e. inputs not of the form hM, w i
(where M is a TM and w is a string) can be detected and in such
a case F outputs a string not in HALTTM .
How does the proof compare with the proof of Theorem 5.1?
COMPSCI350: Quantum Computing, Computability and Complexity
54 / 110
Example
2
Example 5.26 ETM ≤m EQTM .
Proof. The reduction f maps the input hMi to the output
hM, M1 i, where M1 is the TM that rejects all inputs (revisit the
proof of Theorem 5.4).
COMPSCI350: Quantum Computing, Computability and Complexity
55 / 110
Example
3
Example 5.27 ATM ≤m E TM .
Proof. From the reduction in the proof of Theorem 5.2, we
construct a function f that takes the input hM, w i and produces
the output hM1 i, where M1 is the TM described in that proof.
As
M accepts w iff L(M1 ) 6= ∅,
f is a mapping reduction from ATM to E TM .
COMPSCI350: Quantum Computing, Computability and Complexity
56 / 110
Example
4
Example A If ATM ≤m B, then B is not Turing-recognisable.
Proof. As ATM ≤m B, we have ATM ≤m B = B, so by
Corollary 4.23 ATM is not Turing-recognisable.
and
Corollary 5.29 If A ≤m B and A is not Turing-recognisable, then B
is not Turing-recognisable.
it follows that B is not Turing-recognisable.
Example B ETM is not Turing-recognisable.
Proof. Use Example A and Example 5.27.
COMPSCI350: Quantum Computing, Computability and Complexity
57 / 110
Example
5
Example C If A ≤m B, A ≤m B, and B is Turing-recognisable,
then A is decidable.
Proof. First, from A ≤m B and B is Turing-recognisable we
deduce, using Theorem 5.28, that A is Turing-recognisable.
If A ≤m B, then A ≤m B = B and B is Turing-recognisable we
deduce, using Theorem 5.28, that A is Turing-recognisable.
Since A and A are Turing-recognisable, A is decidable
(Theorem 4.22).
COMPSCI350: Quantum Computing, Computability and Complexity
58 / 110
Example
6
Example D ATM 6≤m ETM .
Proof. In Example C we put: A = ATM , B = E TM .
By Example 5.27, ATM ≤m E TM .
Since the language E TM is Turing-recognisable, if ATM ≤m ETM ,
then by Example C, ATM is decidable, a contradiction
(Theorem 4.9).
COMPSCI350: Quantum Computing, Computability and Complexity
59 / 110
The remarkable language EQTM
1
Recall that
EQTM = {hM1 , M2 i : M1 and M2 are TMs and L(M1 ) = L(M2 )}.
Theorem 5.30 EQTM is not Turing-recognisable nor
co-Turing-recognisable.
Proof. First we show that EQTM is not Turing-recognisable by
showing that ATM ≤m EQTM .
COMPSCI350: Quantum Computing, Computability and Complexity
60 / 110
The remarkable language EQTM
2
The reducing function f works as follows.
F = “On input hM, w i where M is a TM and w a string:
1. Construct the following two machines M1 and M2 .
M1 = “On any input:
1. Reject.”
M2 = ”On any input:
1. Run M on w . If it accepts, accept.”
2. Output hM1 , M2 i.”
Here, M1 accepts nothing. If M accepts w , M2 accepts everything,
and so the two TMs are not equivalent.
Conversely, if M doesn’t accept w , M2 accepts nothing, and the
TMs are equivalent.
COMPSCI350: Quantum Computing, Computability and Complexity
61 / 110
The remarkable language EQTM
3
To show that EQTM is not Turing-Recognisable we give a reduction
from ATM to the complement of EQTM which is simply EQTM .
Hence we show that ATM ≤m EQTM .
The following TM G computes the reducing function g :
G = “The input is hM, w i where M is a TM and w a string:
1. Construct the following two machines M1 and M2 .
M1 = “On any input:
1. Accept.”
M2 = ”On any input:
1. Run M on w . If it accepts, accept.”
2. Output hM1 , M2 i.”
COMPSCI350: Quantum Computing, Computability and Complexity
62 / 110
The remarkable language EQTM
4
The only difference between f and g is in the construction of the
TM machine M1 . In f , machine M1 always rejects, whereas in g it
always accepts.
In both f and g , M accepts w iff M2 always accepts.
In g , M accepts w iff L(M1 ) = L(M2 ) showing that
ATM ≤m EQTM .
COMPSCI350: Quantum Computing, Computability and Complexity
63 / 110
Rice’s theorem
1
Rice’s theorem (Problem 5.28) Let P be a language consisting
of TM descriptions where P fulfils two conditions. First, P is
nontrivial—it contains some, but not all, TM descriptions. Second,
P is a property of the TM’s language—whenever L(M1 ) = L(M2 ),
we have hM1 i ∈ P iff hM2 i ∈ P. Here M1 and M2 are any TMs.
Then, P is undecidable.
Proof. Assume for the sake of a contradiction that P is decidable
and let RP be a TM that decides P. We will show how to use RP
to decide ATM obtaining a contradiction (Theorem 4.11).
COMPSCI350: Quantum Computing, Computability and Complexity
64 / 110
Rice’s theorem
2
Proof of Rice’s theorem continued.
First let T∅ be a TM such that L(T∅ ) = ∅. You may assume that
hT∅ i 6∈ P without loss of generality (otherwise proceed with P
instead of P).
Secondly, because P is not trivial, there exists a TM T with
hT i ∈ P.
COMPSCI350: Quantum Computing, Computability and Complexity
65 / 110
Rice’s theorem
2
Proof of Rice’s theorem continued.
The following TM S decides ATM .
S = “On input hM, w i:
1. Use M and w to construct the following TM Mw .
Mw = “On input x:
1. Simulate M on w . If it halts and rejects,
reject. If it accepts, proceed to stage 2.
2. Simulate T on x. If it accepts, accept.”
2. Use TM RP to determine whether hMw i ∈ P.
If YES, accept. If NO, reject.”
COMPSCI350: Quantum Computing, Computability and Complexity
66 / 110
Rice’s theorem
3
Proof of Rice’s theorem continued.
TM Mw simulates T if M accepts w , hence
L(T ), if M accepts w ,
∅,
if M does not accept w ,
L(T ), if M accepts w ,
L(T∅ ), if M does not accept w .
L(Mw ) =
=
Therefore hMw i ∈ P iff M accepts w .
COMPSCI350: Quantum Computing, Computability and Complexity
67 / 110
Rice’s theorem
4
Corollary to Rice’s Theorem The following languages
1. {hMi : L(M) = ∅},
2. {hMi : L(M) = infinite},
3. {hMi : L(M) = finite},
4. {hMi : L(M) = regular},
5. {hMi : 10 ∈ L(M)},
6. {hMi : L(M) = Σ∗ }.
are undecidable.
Proof. Each property specified in the languages above is a
nontrivial property of the TM’s language—so it satisfies Rice’s
Theorem.
COMPSCI350: Quantum Computing, Computability and Complexity
68 / 110
Turing reducibility
1
The mapping reducibility was introduced to model the idea of
reducing one problem to another one:
if A is reducible to B, and we find a solution to B, we
can obtain a solution to A.
We now test its adequacy for the languages ATM and ATM .
I
Intuitively, ATM and ATM are reducible to one another
because a solution to either could be used to solve the other
by simply reversing the answer.
I
However, we know that ATM 6≤m ATM because ATM is
Turing-recognisable but ATM is not.
COMPSCI350: Quantum Computing, Computability and Complexity
69 / 110
Turing reducibility
2
Definition 6.18
I
An oracle for a language B is an external device that is
capable of reporting whether any string w is a member of B.
According to Turing
We shall not go any further into the nature of this
oracle apart from saying that it cannot be a machine.
I
An oracle Turing machine is a modified TM that has the
additional capability of querying an oracle.
I
We write M B to describe an oracle TM that has an oracle for
language B.
We accept the term oracle as a “magical ability” and consider
oracles for possibly non-decidable languages.
COMPSCI350: Quantum Computing, Computability and Complexity
70 / 110
Turing reducibility
3
Example 6.19 Consider an oracle for ATM . An oracle TM M ATM
can decide undecidable languages languages, for example, ATM
itself, by querying the oracle about the input.
The following oracle TM T ATM decides ETM .
T ATM = “On input hMi, where M is a TM:
1. Construct the following TM N.
N = “On any input:
1. Run M in parallel on all strings in Σ∗ .
2. If M accepts any of these strings,
accept.”
2. Query the oracle to determine whether
hN, 0i ∈ ATM .
3. If the oracle answers NO, accept; if YES, reject.”
COMPSCI350: Quantum Computing, Computability and Complexity
71 / 110
Turing reducibility
4
Example 6.19 continued.
If L(M) 6= ∅, then N will accept every input and, in particular,
input 0.
Hence the oracle will answer YES, and T ATM will reject.
Conversely, if L(M) = ∅, then L(N) = ∅, T ATM will accept.
Thus T ATM decides ETM . We also say that ETM is decidable
relative to ATM .
COMPSCI350: Quantum Computing, Computability and Complexity
72 / 110
Turing reducibility
5
Definition 6.20 Language A is Turing reducible to language B,
written A ≤T B, if A is decidable relative to B.
Example 6.19 shows that ETM is Turing reducible to ATM .
COMPSCI350: Quantum Computing, Computability and Complexity
73 / 110
Turing reducibility
6
Turing reducibility satisfies our intuitive concept of reducibility:
Theorem 6.21 If A ≤T B and B is decidable, then A is decidable.
Proof. If B is decidable, then we may replace the oracle for B by
an actual TM that decides B. Thus we may replace the oracle TM
MB that decides A by an ordinary TM D that decides A.
Fact If A ≤m B, then A ≤T B, because the mapping reduction
may be used to give an oracle TM that decides A relative to B.
COMPSCI350: Quantum Computing, Computability and Complexity
74 / 110
Turing reducibility
7
Theorem HALTTM is Turing-complete, i.e. a) it is
Turing-recognisable and b) it can decide any Turing-recognisable
set.
Proof. The language HALTTM is Turing-recognisable (same type
of proof as in Theorem 4.11). Let B be Turing-recognisable by a
TM M. The following TM, R HALTTM decides B:
R HALTTM = “On input hM, w i:
1. If hM, w i is in HALTTM , then run M on w
and produce the same output;
2. If hM, w i is not in HALTTM , then reject.”
COMPSCI350: Quantum Computing, Computability and Complexity
75 / 110
Berry’s paradox
The least integer not definable by an English sentence
with less than fifteen words.
The sentence above has 14 words!
COMPSCI350: Quantum Computing, Computability and Complexity
76 / 110
Probability theory paradox
If we toss an unbiassed coin 100 times then, according to
probability theory, 100 heads are just as probable as any
other outcome.
Do you really believe this? Probability theory does not explain all
mysteries that are sometimes supposed to do!
COMPSCI350: Quantum Computing, Computability and Complexity
77 / 110
Four strings
Consider the information content of the following strings:
A= 01010101010101010101010101010101010101010101010
10101010101010101
B= 010110101010010101011010101001010101101010100101
0101101010100101
C= 101000100001100011000101011010011010000010001001
0011000010001000
D= 010010001011110100101111010011110100111011110011
1010000010001011
COMPSCI350: Quantum Computing, Computability and Complexity
78 / 110
Minimal length descriptions
1
Try to memorise as many strings in the previous slide as you can.
Which strings contain more information? Why?
COMPSCI350: Quantum Computing, Computability and Complexity
79 / 110
Minimal length descriptions
2
We define the quantity of information contained in an object (=
binary string, for this discussion) to be the size of that object’s
smallest description—a precise and unambiguous characterisation
of the object so that we may recreate it from the description alone.
Why do we consider only the shortest description when
determining a string’s quantity of information?
COMPSCI350: Quantum Computing, Computability and Complexity
80 / 110
Minimal length descriptions
2
We can easily describe a string by placing a copy of itself directly
into the description. Thus we can obviously describe the preceding
string D with a table that is 64 bits long containing a copy of D.
This description does not tell us anything about its information
quantity.
A significantly shorter description implies that the information
contained within it can be compressed into a small volume, and so
the amount of information cannot be very large. Hence the size of
the shortest description determines the amount of information.
COMPSCI350: Quantum Computing, Computability and Complexity
81 / 110
Minimal length descriptions
3
In what follows we use TM computations to describe strings.
We describe a string x with a TM M and a binary input w to M.
The length of the description is the combined length of
representing M and w :
hM, w i = hMiw .
Because we use prefix-free encoding, from hM, w i we can uniquely
extract its components hMi and w , and |hM, w i| = 2|hMi| + |w |.
COMPSCI350: Quantum Computing, Computability and Complexity
82 / 110
Minimal length descriptions
4
Definition 6.3 Let x be a binary string. The minimal description
of x, written
d(x),
is the shortest string hM, w i where TM M on input w halts with x
on its tape. If several such strings exist, select the lexicographically
first among them.
The descriptive complexity or Kolmogorov-Chaitin complexity of x,
written K (x), is
K (x) = |d(x)|.
COMPSCI350: Quantum Computing, Computability and Complexity
83 / 110
Minimal length descriptions
5
Theorem 6.24 ∃c ∀x [K (x) ≤ |x| + c].
Proof. Consider the following description of the string x. Let
M(x)=x be a TM that computes the identity function.
A description of x is simply hM, xi which has the length:
|hM, w i| = 2|hMi| + |x| = |x| + c,
where c = 2|hMi| is a fixed constant depending on the particular
M used (not on x).
COMPSCI350: Quantum Computing, Computability and Complexity
84 / 110
Minimal length descriptions
6
Theorem 6.25 ∃c ∀x [K (xx) ≤ K (x) + c].
Proof. Consider the following TM M, which expects an input of
the form hN, w i, where N is a TM and w is an input for it.
M = “On input hN, w i:
1. Run N on w until it halts and
produces an output string s.
2. Output the string ss.”
A description of xx is hMid(x). As d(x) is a minimal description
of x, the length of this description is
|hMid(x)| = |hMi| + |d(x)| = c + K (x),
where c = |hMi|.
COMPSCI350: Quantum Computing, Computability and Complexity
85 / 110
Minimal length descriptions
7
Theorem 6.26 ∃c ∀x, y [K (xy ) ≤ 2K (x) + K (y ) + c].
Proof. We construct a TM M that breaks its input w into two
separate descriptions. The bits of the first description d(x) are all
doubled, string 01 follows and finally the description d(y ). Once
both descriptions have been obtained, they are run to obtain the
strings x and y and output xy . The length of this description of xy
is the sum 2K (x) + K (y ) + the description for M.
COMPSCI350: Quantum Computing, Computability and Complexity
86 / 110
Minimal length descriptions
8
Theorem (Problem 6.22) The function K is not computable.
Proof. Assume for a contradiction that K is computable. Fix
m ≥ 0 and define
fm = min[x : K (x) > m],
where min is in taken according to the lexicographical order. As K
is unbounded, for every m there exists a string x such that
K (x) > m.
Because K is computable, fm is also computable, say, by a TM R.
Clearly, |hRi| ≤ log2 (m) + constant < (m − 2)/2, for large enough
m and hRiε is a description of a string x with K (x) > m, a
contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
87 / 110
Optimality of the definition
1
K (x) has an “optimality property” among all possible ways of
defining descriptive complexity with algorithms.
A general description language is a computable function
p : Σ∗ → Σ∗ ; the minimal description of x with respect to p,
written dp (x), is the lexicographically shortest string s where
p(s) = x and
Kp (x) = |dp (x)|.
For example, for LISP (encoded into binary) as the description
language, dL1SP (x) is the minimal LISP program that outputs x,
and KL1SP (x) is the length of the minimal program.
COMPSCI350: Quantum Computing, Computability and Complexity
88 / 110
Optimality of the definition
2
Theorem 6.27 For any descriptional language p, a fixed constant
c exists that depends only on p, such that
∀x [K (x) ≤ Kp (x) + c].
Proof. Let p be a description language and consider the following
TM M:
M = “On input w :
1. Output p(w ).”
Then hMidp (x) is a description of x and
|hMidp (x)| = Kp (x) + |hMi| = Kp (x) + c,
where c = |hMi|.
COMPSCI350: Quantum Computing, Computability and Complexity
89 / 110
Incompressible strings and randomness
1
Theorem 6.24 shows that a string’s minimal description is never
much longer than the string itself. Of course for some strings, the
minimal description may be much shorter if the information in the
string appears sparsely or redundantly. But, do some strings lack
short descriptions?
Definition 6.28 A string x is c-compressible (1 ≤ c < |x|) if
K (x) ≤ |x| − c.
If x is not c-compressible, we say that x is incompressible by c.
If x is incompressible by 1, we say that x is incompressible.
Do incompressible strings exist?
COMPSCI350: Quantum Computing, Computability and Complexity
90 / 110
Incompressible strings and randomness
2
Theorem 6.29 Incompressible strings of every length exist.
Proof. Each description is a binary string, so the number of
descriptions of length less than n is at most the sum of the number
of strings length 0, 1, . . . up to n − 1:
1 + 2 + 4 + · · · + 2n−1 = 2n − 1.
The number of short descriptions is less than the number of strings
of length n—which is 2n , so at least one string of length n is
incompressible.
COMPSCI350: Quantum Computing, Computability and Complexity
91 / 110
Incompressible strings and randomness
3
Corollary 6.30 At least 2n − 2n−c+1 + 1 strings of length n are
incompressible by c.
Proof. As in the proof of Theorem 6.29, at most 2n−c+1 − 1
strings of length n are c-compressible (at most that many
descriptions of length at most n − c exist), hence the remaining
2n − (2n−c+1 − 1)
strings of length n are incompressible by c.
Incompressible strings have many properties of “random strings”,
i.e. the set of incompressible strings is not computable, in a long
enough incompressible string the numbers of 0s and 1s are roughly
equal and the length of its longest run of 0s is about the log of the
string’s length.
COMPSCI350: Quantum Computing, Computability and Complexity
92 / 110
Incompressible strings and randomness
4
The probability that a string x of length n is c-compressible is
#{|x| = n : K (x) ≤ n − c} · 2−n ≤ (2n−c+1 − 1) · 2−n < 21−c ,
so the probability that a string x of length n is not c-compressible
is
#{|x| = n : K (x) > n − c} · 2−n ≥ 1 − 21−c .
COMPSCI350: Quantum Computing, Computability and Complexity
93 / 110
Incompressible strings and randomness
5
Example. The probability that a string x of length n is
n/2-compressible is
#{|x| = n | K (x) ≤ n − n/2} · 2−n = #{|x| = n | K (x) ≤ n/2} · 2−n
≤ 21−n/2 −→n→∞ 0,
while the probability that a string x of length n is not
n/2-compressible is
#{|x| = n | K (x) ≥ n − n/2} · 2−n = #{|x| = n | K (x) ≥ n/2} · 2−n
≥ 1 − 21−n/2 −→n→∞ 1.
COMPSCI350: Quantum Computing, Computability and Complexity
94 / 110
Incompressible strings and randomness
6
Theorem. There exist two constants c and C such that for all
n > c:
C · 2n ≤ #{x | K (x) ≤ n} < 2 · 2n .
Proof. On one hand we have:
#{x | K (x) ≤ n} ≤ 1 + 2 + · · · + 2n = 2n+1 − 1 < 2 · 2n .
COMPSCI350: Quantum Computing, Computability and Complexity
95 / 110
Incompressible strings and randomness
7
For the other inequality we use Theorem 6.24 which says that
there exists a constant c such that for all strings x,
K (x) ≤ |x| + c.
We note that
if |x| = n − c, then K (x) ≤ |x| + c = n − c + c = n,
hence if n > c then
#{x | K (x) ≤ n} ≥ #{x | |x| = n − c} = 2n−c ,
so C = 2−c .
Note that 0 < C < 2.
COMPSCI350: Quantum Computing, Computability and Complexity
96 / 110
Probability theory paradox revisited
1
According to probability theory every string of length 100 has the
same probability
2−100 =
1
≈ 7.88861 × 10−31 ,
1267650600228229401496703205376
The probability of getting a 50-compressible string of length 100 is
at most
2100−50+1 − 1
≈ 1.77636 × 10−15 .
2100
COMPSCI350: Quantum Computing, Computability and Complexity
97 / 110
Probability theory paradox revisited
2
The probability of getting a 100-bit string which is not
50-compressible is at least
1−
2100−50+1 − 1
≥ 0.99,
2100
far higher than 2−100 .
COMPSCI350: Quantum Computing, Computability and Complexity
98 / 110
Incompressible strings and randomness
5
Theorem (undecidability). For every b > 0, the set
Rb = {x : K (x) > |x| − b} is not Turing-recognisable, in
particular, undecidable.
Proof. Assume for the sake of a contradiction that Rb is
enumerated by a TM M. Let E be a computable infinite subset of
Rb and define the function (defined on a non-negative integer
represented in binary):
p(n) = min[x ∈ E : |x| > n],
where min is taken according to the fixed enumeration given by M.
COMPSCI350: Quantum Computing, Computability and Complexity
99 / 110
Incompressible strings and randomness
6
Theorem (undecidability) continued.
The function p has the following properties:
1. As E ⊂ Rb is computable and infinite, p is computable.
2. For each n, p(n) ∈ E ⊂ Rb , so
K (p(n)) ≥ |p(n)| − b > n − b.
3. Finally, in view of Theorem 6.27, there exists constant c such
that for all n:
n − b < K (p(n)) ≤ Kp (p(n)) + c ≤ log2 (n) + c + c 0 ,
a contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
100 / 110
Incompressible strings and randomness
7
Corollary (Problem 6.23). The set of incompressible strings is
undecidable.
Proof. Put b = 1 in the above Theorem.
Theorem (Problem 6.24). The set of incompressible strings
contains no infinite Turing-recognisable set.
Proof. Use an infinite Turing-recognisable set D ⊆ Rb instead of
Rb in the proof of the above Theorem.
COMPSCI350: Quantum Computing, Computability and Complexity
101 / 110
Compressible strings
Theorem. For every b ≥ 0, the set
{x : K (x) ≤ |x| − b}
is Turing recognisable.
Proof. Indeed,
K (x) ≤ |x| − b iff there exist M, w and t ≥ 1 such that
|hM, w i| ≤ |x| − b and M(w ) = x in at most t steps,
and note that the predicate
M(w ) = x in at most t steps
is computable.
COMPSCI350: Quantum Computing, Computability and Complexity
102 / 110
Incompressible strings provability
1

Consider a formal theory (like Peano arithmetic or ZFC set theory)
whose theorems can be enumerated by a TM. Assume:
1. All theorems are true.
2. The theory can express all statements of the form
“K (x) > m”, where x is a string and m > 0 is an integer.
COMPSCI350: Quantum Computing, Computability and Complexity
103 / 110
Incompressible strings provability
2

Theorem (Chaitin). There exists a constant c (depending on the
formal system only) such that for every theorem of the form
“K (x) > m” we have m < c.
Proof. Construct the function computable p (defined on
non-negative integers represented in binary) as follows:
p(i) = x if “K (x) > s” is the first theorem (in the order generated
by the formal system) of the form “K (x) > s” with s ≥ i.
Because all theorems are true, K (p(i)) > s ≥ i.
In view of Theorem 6.27, there exists a c such that for all i:
i ≤ s < K (p(i)) ≤ Kp (p(i)) + c ≤ log2 (i) + c + c 0 ,
a contradiction.
COMPSCI350: Quantum Computing, Computability and Complexity
104 / 110
Incompressible strings provability
3

Corollary (Gödel). In the context of the above theorem, there
exist infinitely many true statements (expressible in the formal
theory) which are not theorems (not provable in the formal theory).
Proof. First, as K is unbounded, there are infinitely many true
statements of the form
K (x) > m,
all expressible in the formal theory.
By Chaitin’s Theorem, there exists a constant c such that if
“K (x) > s” is the first theorem generated in the formal theory,
then s ≤ c.
Consequently, no statement in the infinite set
{“K (x) > m” : K (x) > m > c} is a theorem (but each such
statement is true).
COMPSCI350: Quantum Computing, Computability and Complexity
105 / 110
Oracles
Following Definition 6.18 we said:
We accept the term oracle as a “magical ability” and
consider oracles for possibly non-decidable languages.
Are Turing oracles “real” or just pure theoretical mathematical
notions?
COMPSCI350: Quantum Computing, Computability and Complexity
106 / 110
Quantum mechanics
Quantum mechanics is a world that appears to behave randomly
and is essentially non-deterministic. The failures of a deterministic
viewpoint to account for the predictions of quantum mechanics are
exemplified by “no-go” theorems which exclude the possibility of
assigning “hidden variables” that predict the outcome of quantum
measurements.
COMPSCI350: Quantum Computing, Computability and Complexity
107 / 110
Quantum random number generators
Can be easily and reliably produced: A photon generated by a
source beamed to a semitransparent mirror is reflected or
transmitted with 50 per cent chance, and these measurements can
be translated into a string of quantum random bits.
Optical system for generating quantum random bits
COMPSCI350: Quantum Computing, Computability and Complexity
108 / 110
Quantum random oracles
Let x be the sequence of bits obtained from the concatenation of
repeated state preparations and non-trivial measurements.
If the experiment is “certified” by value-indefiniteness—roughly
speaking, the variable measured has no definite value 0 or 1 before
measurement—then the sequence x is bi-immune, i.e. no Turing
machine can compute more than finitely many bits of it.
Such experiments exist, so it follows that x is a “real” oracle!
COMPSCI350: Quantum Computing, Computability and Complexity
109 / 110
Quantum random oracle Turing machines
I
A Turing machine working with the oracle x trespasses the
Turing barrier. Does this fact challenge the Church-Turing
thesis?
I
Open problem: Does a Turing machine working with the
oracle x solve the halting problem?
Reference
I
A. A. Abbott, C. S. Calude, K. Svozil. A quantum random
oracle, in S. B. Cooper, J. van Leeuwen (eds.). Alan Turing,
His Work and Impact, Elsevier, Amsterdam, 2013, 206–209.
COMPSCI350: Quantum Computing, Computability and Complexity
110 / 110