Coding and Computation
As we have mentioned in the introduction to Chapter 5 , there are two standard approaches to the definition of the amount of information: one initiated by Shannon, which applies probability, and another proposed by Kolmogorov, which uses algorithms. It turns out that in both approaches, the amount of information contained in an object is roughly equal to the minimal number of binary digits that we need to describe the object. In fact, we have not touched this interpretation yet and we would like to discuss it in this chapter. In a single package, we will present the coding interpretation of the Shannon entropy and its close links with Kolmogorov's algorithmic complexity, which implements the idea of the minimal coding in a direct way. This chapter develops formally ideas sketched in the half‐formal Sections 1.7 and 1.10.
The general idea of coding, an ingenious invention of the twentieth century, is to represent arbitrary objects from a countable set – such as letters, words, sentences, or whole finite texts – as unique finite sequences of binary digits. With the advent of personal computers and mobile devices, this idea seems as obvious as the idea of the alphabet, but it took some effort to discover profound implications of this idea for foundations of mathematics, computer science, and statistics. In particular, the idea of coding led to discovery of unprovable statements in mathematics by Gödel ( 1931 ), which was further strengthened by Chaitin ( 1975b ) as unprovability of randomness.
Of course, the abstract idea of coding without computation would not be so important for the general public. As computers have become ubiquitous and indispensable for human civilization, scientists have started applying the metaphor of computation everywhere: to living organisms, to laws of physics, and to human brain. However, it is not obvious whether the most popular mathematical model of computation such as Turing machines is directly applicable and relevant to all these cases. The natural computation may differ to the mathematical computation in many important details and be more complicated. But simple mathematical models are always a good starting point to learn to imagine what else could be possible. For this reason, it may be good to get a primer in basic formal models of coding and computation.
The organization of this chapter is as follows. Section 7.1 reports basic ideas of coding. Codes are functions that represent countably many distinct objects as code words, i.e. finite sequences of fixed symbols such as binary digits. It is a desirable property that if we concatenate code words, then we can decipher the corresponding sequence of encoded objects. Codes that possess this property are called uniquely decodable and they satisfy a simple albeit important inequality, called the Kraft inequality. By the Kraft inequality, for a random variable assuming values in the objects to be encoded, its Shannon entropy is roughly equal to the minimal expected length of a uniquely decodable code. The minimum is roughly achieved by the Shannon–Fano code.
In Section 7.2 , we make first steps toward algorithmic information theory. We introduce Turing machines, a traditional mathematical model of a general‐purpose computer. Subsequently, we define the Kolmogorov complexity of an object as the length of the shortest binary program for a universal Turing machine that computes a binary representation of this object. We provide some simple bounds for Kolmogorov complexity but, as we also show, Kolmogorov complexity is uncomputable, i.e. there is no finite program that computes it for all arguments.
Section 7.3 is devoted to presenting parallels between Kolmogorov complexity and Shannon entropy. The respective results vary in their difficulty, but all of them rest on the idea of Shannon–Fano coding introduced in the first section. We show that Kolmogorov complexity not only satisfies the chain rule in a clear analogy to Shannon entropy but also its expectation is roughly equal to Shannon entropy if the compressed random variable has a computable probability distribution. The latter result is generalized to stochastic processes in a simple fashion.
Algorithmic information theory also sheds some light onto the limits of mathematics, the topic of Section 7.4 . We discuss the Chaitin incompleteness theorem which complements the famous incompleteness theorem by Gödel. This proposition states that it is not possible to prove in any sound formal inference system that the Kolmogorov complexity of any particular object is substantially larger than the Kolmogorov complexity of the inference system itself. On the other hand, we know from the simple bounds discussed in Section 7.2 that all but finitely many objects have so large Kolmogorov complexity. Moreover, we can demonstrate that there exists a simply defined real number, called the halting probability
, whose binary approximations have the maximal Kolmogorov complexity. Number
is a source of many paradoxes. Not only its binary expansion cannot be computed but it also constitutes philosophers' stone, i.e. the validity of any mathematical statement can be simply computed given as many binary digits of number
as the statement length.
is a special case of a much more common object called algorithmically random sequences. In Section 7.5 , we will study the definition and some properties thereof. An infinite sequence is called algorithmically random (in the Martin‐Löf sense) with respect to a probability measure on sequences when the Kolmogorov complexity of its prefixes is close to the probability of the respective cylinder sets. This property holds for almost all sequences, so there are really uncountably many different algorithmically random sequences. There are a few other characterizations of algorithmically random sequences, which are equivalent by the Schnorr theorem, also discussed in Section 7.5 .
7.1 Elements of Coding
The object of interest of coding theory are functions, called codes, that map elements of a countable set
into finite sequences over a countable set
. The set of these sequences is denoted as
, where
,
, and
is the empty sequence. Within the context of coding theory, sets
and
are called alphabets, whereas finite sequences are preferably called strings. Of a special interest are binary codes, i.e. codes for which the output alphabet
is the set
. On the other hand, the input alphabet
consists typically of letters, digits, or even strings of symbols, such as words in natural language.
The first definition formalizes what we have said so far.
Definition 7.1 (Code)
For two countable alphabets
and
, a function
is called a code.
Strings
will be called code words. Since codes are mostly used to represent individual symbols of an input alphabet as distinct strings over the output alphabet, the following property is desired in the first step.
Definition 7.2 (Nonsingular code)
A code
is called nonsingular if for
and
, we have
.
To recall, more generally, an injection
is a mapping such that
for any
such that
.
Moreover, since we would like to use codes to represent sequences of input symbols as sequences of output symbols, it is convenient to define also this concept.
Definition 7.3 (Code extensions)
Consider one‐sided infinite sequences, written as
, and two‐sided infinite sequences, written as
– mind the bold‐face dot between the zeroth as concatenations
(7.1)
(7.2)
(7.3)
where
.
As we have indicated, the main practical purpose of coding is to transmit some representations of strings written with symbols from an input alphabet through a communication channel which passes only strings consisting of symbols from a smaller output alphabet. Thus, the idea of a particularly good code is that we should be able to reconstruct coded symbols
from the concatenation of their code words
. Formally speaking, the following property is desired.
Definition 7.4 (Uniquely decodable code)
A code
is called uniquely decodable if its finite extension
is nonsingular.
The first class of examples of uniquely decodable codes is the class of comma‐separated codes. The right metaphor for this construct is that there is a special symbol which like a comma separates the concatenated code words.
Definition 7.5 (Comma‐separated code)
A code
is called a comma‐separated code if
, where
and
is a nonsingular code.
Theorem 7.1
Any comma‐separated code is uniquely decodable.
Proof:
For a comma‐separated code
, let us decompose
. We first observe that
holds only if
(we have the same number of
's on both sides of the equality) and
for
. Since
is a nonsingular code, hence string
is the only image of sequence
under the mapping
. Hence, code
is uniquely decodable.
The second recipe for producing a uniquely decodable code is to fix the length of code words. In this way, we obtain fixed length codes.
Definition 7.6 (Fixed‐length code)
Let
be a natural number. A code
is called a fixed‐length code if it is nonsingular.
Theorem 7.2
Any fixed‐length code is uniquely decodable.
Proof:
Consider a fixed‐length code
. We observe that
(7.4)
holds only if
(we have the same length of strings on both sides of the equality) and
for
. Because code
is nonsingular, hence string
is the only image of
under the mapping
. Hence, code
is uniquely decodable.
The third recipe for producing a uniquely decodable code makes use of the concept of a prefix‐free set. A prefix‐free set is such a set of strings that none of its elements is a prefix of any other element.
Definition 7.7 (Prefix‐free set)
A prefix‐free set
is a set of strings such that for any
condition
implies
for any string
.
A prefix‐free code is a nonsingular code with code words forming a prefix‐free set. It turns out that these codes are also uniquely decodable.
Definition 7.8 (Prefix‐free code)
A code
is called a prefix‐free code if the image
is a prefix‐free set and
is nonsingular.
Theorem 7.3
Any prefix‐free code is uniquely decodable.
Proof:
Let
be a prefix‐free code. We observe that
holds if and only if
and
. Hence, equality
holds if and only if
and
. Thus, code
is uniquely decodable.
Now, we will present two useful codes for the set of natural numbers (
). First, we will consider the ordinary binary expansions
of natural numbers, an example given in Table 7.1 . Code
is nonsingular but is not uniquely decodable. In particular, it is not comma‐separated, fixed‐length, or prefix‐free.
There exists, however, a pretty good prefix‐free, hence uniquely decodable, code for natural numbers called the Elias omega code (Elias, 1975 ). The algorithm for the Elias omega encoding is as follows:
- (1) Put 0 at the end of the code.
-
(2) If the coded number is 1, stop. Otherwise, write the binary expansion
, where
is the coded number, before the code. - (3) Repeat the previous step with the coded number equal to the number of digits written in the previous step minus 1.
is prefix‐free.
Table 7.1 Examples of code words
and
.
|
Binary expansion
|
Elias omega code word
|
|---|---|---|
| 1 | 1 | 0 |
| 2 | 10 | 10 0 |
| 3 | 11 | 11 0 |
| 4 | 100 | 10 100 0 |
| 5 | 101 | 10 101 0 |
| 6 | 110 | 10 110 0 |
| 7 | 111 | 10 111 0 |
| 8 | 1000 | 11 1000 0 |
|
|
|
Subsequently, let us estimate the lengths of codes
and
. We have
, whereas
(7.5)
We may define the iterated binary logarithm
(7.6)
Then
. We also have inequality
for all but finitely many natural numbers
.
It is of a practical importance to ask what is the shortest code on average to encode a given set of symbols, where the symbols appear with some given probabilities. Thus, for a probability distribution
, we will be interested in the expected code length
. Specifically, we want to minimize this quantity for a given probability distribution. We note that both comma‐separated codes and fixed‐length codes have some advantages and drawbacks. If certain symbols appear more often than the other then comma‐separated codes allow to code them as shorter strings and thus to spare space. On the other hand, if all symbols are equally probable then a fixed‐length code without a comma occupies less space than the same code with a comma added. In contrast, as we will see, prefix‐free codes allow us to encode a given random variable optimally.
There are two important results on our way, which we will state for binary codes to fix our attention. The first result says that each uniquely decodable code corresponds to some incomplete distribution – this correspondence is called the Kraft inequality. The subsequent proof of the first result is due to Brockway McMillan.
Theorem 7.4 (Kraft inequality)
For any uniquely decodable code
we have the inequality
(7.7)
Proof:
Consider an arbitrary
. Let
denote the number of sequences
such that
and the length of
equals
. We have
(7.8)
Because the code is uniquely decodable, we have
. Therefore
(7.9)
Letting
, we obtain ( 7.7 ).
The second result states that each incomplete distribution of form
where
are natural numbers corresponds to some prefix‐free code. The proof of the second result is due to Nicholas J. Pippenger.
Theorem 7.5 (Inverse Kraft inequality)
Let
or
. If function
satisfies inequality
(7.10)
then we may construct a prefix‐free code
such that
.
Proof:
For a string
, let us denote the cylinder set
(7.11)
We observe that code
is prefix‐free if and only if cylinder sets
and
are disjoint for
.
In the following we define code
by iteration as follows. First, we denote unions of cylinder sets
excluded before the
th iteration as
and
for
. Next, we define
as the first element of set
in the lexicographic order
such that sets
and
are disjoint. It is obvious with the requested property exist.
Now we will show that string
with the requested property exists if inequality ( 7.10 ) is satisfied. The proof of existence rests on this fact, which can be shown easily by induction on
:
-
(*) The difference
is a finite union
of cylinder sets such that
,
, and
for
.
Let
for the above representation of
. By property (*), we obtain strict inequality
(7.12)
On the other hand, by the Kraft inequality ( 7.10 ), we have
(7.13)
Hence, we obtain that
, i.e. we have
. Thus, string
with the requested property exists.
By the above two results and the Gibbs inequality ( Theorem 3.18 ), we may relate the problem of coding to Shannon entropy.
Theorem 7.6 (Source coding inequality)
For any uniquely decodable code
, the expected length of the code satisfies inequality
(7.14)
where
is the Shannon entropy of the probability distribution
.
Proof:
Let us introduce function
. By the Kraft inequality ( Theorem 7.4 ), function
is a semidistribution. Hence, by positivity of the Kullback–Leibler divergence ( Theorem 3.18 ) we obtain the claim.
It turns out as well that the equality in the source coding inequality may be approximately satisfied. The respective code is called the Shannon–Fano code.
Definition 7.9 (Shannon–Fano code)
A prefix‐free code
is called a Shannon–Fano code for a probability distribution
if
(7.15)
Theorem 7.7
The Shannon–Fano code exists for any discrete random variable and satisfies
(7.16)
Proof:
We have
(7.17)
Hence, Shannon–Fano codes exist by the inverse Kraft inequality ( Theorem 7.5 ) – when we choose some one‐to‐one mapping
or
. Consequently, inequality ( 7.16 ) follows by
(7.18)
There is a code construction for a finite input alphabet, called the Huffman code, which is slightly better than the Shannon–Fano code. We will not discuss it here. An interested reader is referred to Csiszár and Körner ( 2011 ) and Cover and Thomas ( 2006 ). In Section 7.3 , we will see an application of the above results to the prefix‐free Kolmogorov complexity. However, first we have to define the latter concept.
7.2 Kolmogorov Complexity
In plain words, the Kolmogorov complexity of a string is defined as the length of the shortest program that computes the string. As such, the Kolmogorov complexity constitutes an algorithmic analogue of the Shannon entropy. The respective theory, called the algorithmic information theory, was founded by Solomonoff ( 1964 ) and Kolmogorov ( 1965 ) and later pursued among others by Zvonkin and Levin ( 1970 ), Gács ( 1974 ), and Chaitin ( 1975a , b ). A modern introduction to the algorithmic information theory was written by Li and Vitányi ( 2008 ). Although the Kolmogorov complexity is not computable, it sets limits to what can be computed and gives rise to quite illuminating conceptual considerations.
Speaking slightly more formally, the Kolmogorov complexity of a string is usually defined as the length of the shortest program for a Turing machine such that the machine prints out the string and halts, after a finite number of computation steps. The Turing machine, which constitutes a standard mathematical model of the all‐purpose computer, is defined as a deterministic finite‐state automaton which moves along one or more infinite tapes filled with symbols from a fixed finite alphabet and which may read and write individual symbols. The finite‐state automaton has a distinct start state, from which the computation begins, and a distinct halt state, at which the computation ends (Turing, 1936a , b ).
The concrete value of the Kolmogorov complexity depends on the used Turing machine but many properties of the Kolmogorov complexity are universal. Some particular definition of the Kolmogorov complexity, called the prefix‐free Kolmogorov complexity, is convenient to discuss links with the Shannon entropy. This sort of Kolmogorov complexity applies a particular class of Turing machines, called prefix‐free Turing machines. The fundamental idea is to force that the accepted programs form a prefix‐free set, so that they naturally form a prefix‐free code for the described objects. This construction can be carried out in a few equivalent ways. Here we will use slightly nonstandard constructions motivated by our later convenience, see Chaitin ( 1975a ).
The first definition is short but kind of opaque.
Definition 7.10 (Prefix‐free Turing machine)
A prefix‐free Turing machine (with three binary tapes) is defined as a 4‐tuple
, where
-
(1)
is a finite, nonempty set of states, -
(2)
is the start state, -
(3)
is the halt state, -
is a function called the transition function.
The set of such prefix‐free Turing machines is denoted
.
The above formal description translates to the machine operation in the following way. The machine is given three infinite tapes:
-
(1) A unidirectional read‐only tape
filled with symbols 0 and 1. -
(2) A bidirectional read‐only tape
filled with symbols 0, 1, and
. -
(3) A bidirectional read‐write tape
filled with symbols 0, 1, and
.
The machine moves in discrete steps along these tapes in the way prescribed by the transition function. The initial machine state is the start state
and the machine reads symbols
,
, and
. The further machine operations are specified as follows: if the machine is in state
and reads symbol
from tape
, symbol
from tape
, and symbol
from tape
then for
(7.19)
the machine does these operations:
-
(1) The machine moves along tape
one symbol to the right if
or it does not move if
. - .
-
(3) The machine writes symbol
instead of symbol
on tape
. -
(4) The machine moves along tape
one symbol to the left if
or one symbol to the right if
or it does not move if
. -
(5) The machine assumes state
in the next step.
The above steps are undertaken until the machine reaches the halt state
. Then the computation stops.
Let us write the set of both finite and infinite sequences as
. In the second definition, we make it formally precise how the machine computes a particular string and halts.
Definition 7.11 (Halting)
We say that machine
halts in a finite time
on a program
with an oracle
and returns a string
if:
-
(A)The machine in the start state reads symbols
,
, and
, and the initial state of the tapes is:
,
for
,
and
for
if
is a string or
if
is an infinite sequence, and
for all
. -
(B)The machine reaches the halt state after
steps and the machine in the halt state reads symbol
, whereas the final state of the tape
is
, with
for
and
for some
.
Assuming that condition (A) is satisfied, we write
(7.20)
(7.21)
When
, we say that the machine does not halt on input
.
The name “prefix‐free Turing machine” is justified by the following property that the set of programs on which the machine halts is prefix‐free.
Theorem 7.8
For any machine
and an oracle
, set
(7.22)
is prefix‐free.
Proof:
A prefix‐free Turing machine can move along the tape
only in one direction. Hence, if it halts on a program
, then it cannot read the tape any further and halt on a program
, where
.
will be called admissible or self‐delimiting programs.
Subsequently, we will define the Kolmogorov complexity of a string as the length of the shortest program that computes the string.
Definition 7.12 (Prefix‐free Kolmogorov complexity)
The prefix‐free Kolmogorov complexity
of a string
given an oracle
and a machine
is defined as
(7.23)
We also use notation
.
In parallel, we will introduce universal machines, which are machines that, given a special simulation program, can simulate any other machine.
Definition 7.13 (Universal machine)
A machine
is called universal if for each machine
there exists a string
such that
(7.24)
for all
and
.
Theorem 7.9
There exist universal machines.
Proof:
The formal proof is not complicated but tedious. Using a higher level language of description, the string
can be chosen as a machine‐readable formal description of the machine
. Given such a string
, machine
compiles a model of machine
and afterwards simulates the actions of machine
on input
.
One of reasons for considering universal machines is that the Kolmogorov complexity for a universal machine is determined up to an additive constant. In the following, we will write
and
if there exists a constant
such that
and
holds respectively for all arguments
. We will write
when we have both
and
.
Theorem 7.10 (Invariance theorem)
For any universal machine
and any machine
, we have
(7.25)
In particular, for any two universal machines
, we have
(7.26)
Proof:
We have
for a certain string
. Hence,
. The second bound is a special case of the first bound.
Thus, for further considerations we will choose a certain universal machine as a reference to determine the prefix‐free Kolmogorov complexity.
Definition 7.14 (Prefix‐free Kolmogorov complexity)
Let
be a certain reference universal machine. We will write
(7.27)
We also use notation
.
For the vast majority of strings, their Kolmogorov complexity is quite large since there are not so many short programs. A string
will be called
‐incompressible if
. In view of the following result, at least a half of strings of length
is
‐incompressible.
Theorem 7.11
There exist at least
distinct
‐incompressible strings of length
.
Proof:
The number of
‐incompressible strings of length
is greater than the difference between the number of all strings of length
and the number of distinct programs of length strictly smaller than
. There exist at most
distinct programs of length strictly smaller than
and there exists
distinct strings of length
. Hence follows the claim.
From the above result, we can see that compressibility is a property of only quite special strings. As we will see in Section 7.4 , however, it is not possible to give a constructive example of a particular incompressible string.
Subsequently, analogously to the Kolmogorov complexity of strings conditioned on arbitrary sequences, we would like to discuss also the Kolmogorov complexity of some discrete objects conditioned on some nondiscrete objects. Examples of the discrete objects are natural numbers, strings over finite alphabets, and tuples thereof, such as rational numbers. Examples of nondiscrete objects are infinite sequences, real numbers, and tuples thereof, such as vectors, complex numbers, or real‐valued functions of discrete objects. The distinction between the considered discrete objects and the nondiscrete objects is that the discrete objects are countably many and can be mapped one‐to‐one to finite sequences, whereas the considered nondiscrete objects are uncountably many but can be mapped one‐to‐one to infinite sequences.
.
Definition 7.15 (Object encoding)
Let
be the binary expansion of the natural number
. For a string
, we also denote
, where
and
is the Elias omega code word for number
. For
, we also write
. We adopt these definitions:
-
(1)For strings
, we use identity function
. -
(2)For natural numbers
, we use the binary expansion stripped of the redundant initial symbol,
. -
(3)For rational numbers
, we use (7.28)
where
,
,
, and
. -
(4)For tuples
, we use (7.29)
where
. -
(5)For discrete tuples treated as nondiscrete objects
, we use (7.30)
-
(6)For infinite sequences,
, we use identity function
. -
(7)For real numbers
, we use (7.31)
where
,
,
,
, and
are the least binary digits that satisfy this relationship. -
(8)For finite nondiscrete tuples
, we use (7.32)
where
,
and
if
for some
and
, whereas
otherwise. -
, we use
(7.33)
where
,
and
if
for some
, where as
otherwise.
We stress that under any reasonable convention the undefined value
remains a special type of an object which is never encoded, i.e.
and
.
Definition 7.16 (Halting)
For some fixed one‐to‐one mappings
and
we will say that machine
halts on a program
with an oracle
and returns an object
if
. Overloading the notation, we will write this fact as
(7.34)
When
, we will say that the machine does not halt on input
and we will write it as
(7.35)
Analogously, we will adjust all previous definitions and notations in this section, admitting writing
instead of
and
instead of
.
Now we can give some simple bounds for the prefix‐free Kolmogorov complexity of discrete objects.
Theorem 7.12
For any discrete object,
(7.36)
Proof:
Let
and
. There is a machine
which satisfies
, where
is the Elias omega code word for number
, with length
. The machine generates
as follows. First it reads the Elias omega code word for number
from the unidirectional tape. Then it copies string
from the unidirectional tape to the output tape. After copying the last symbol of
, the machine halts because it knows the length of
from reading the code word
. Hence, we obtain the desired claim by
.
Theorem 7.13
For discrete objects
and
we have inequalities:
-
(1)
. -
(2)
.
Proof:
-
(1) We have
because a certain program that computes
given
and
has form: Ignore
and execute the shortest program that computes
. Moreover,
because a certain program that computes
has form: Execute the shortest program that computes pair
and then compute
from
. -
(2) We have
because a certain program that computes pair
has form: Execute the shortest program that computes
given
and the shortest program that computes
given
and
and from that compute pair
. The second inequality follows from
.
Now we define recursive discrete functions. A discrete function
is called total, whereas a discrete function
is called partial.
Definition 7.17 (Recursive partial discrete function)
A partial discrete function
is called recursive if there exists a program
for the reference universal Turing machine
such that
for all
.
Theorem 7.14 (Argument raising)
For a recursive partial discrete function
there exist a string
for the reference universal Turing machine
such that
for all
and
.
Proof:
There is a machine
which reads the self‐delimiting program
from the unidirectional tape and then simulates machine
given program
and oracle
, where
is some program from Definition 7.17 . Thus,
. Since machine
is universal, there also exists a string
such that
for all
and
. Hence,
holds in particular.
Recursive partial discrete functions can be also treated as discrete objects.
Definition 7.18 (Object encoding)
For a recursive partial discrete function
, we use encoding
, where
is some program from Definition 7.17 . Subsequently, we extend the definitions of functions
and
as well as sets
and
appropriately.
Having adopted this convention, we may demonstrate this bound.
Theorem 7.15
For a recursive partial discrete function
and a discrete object
, we have
(7.37)
Proof:
The inequality follows from the fact that some program that computes
has form: Execute the shortest program that computes object
, compile function
from its shortest description, and apply function
to object
.
There exists also nonrecursive functions. A celebrated example of a nonrecursive function is the solution of the halting problem.
Theorem 7.16 (Halting problem)
Total function
(7.38)
is not recursive.
Proof:
Suppose that function
is recursive. Then we may define the recursive partial function
(7.39)
Since the partial function
is recursive, there exists a program
such that
for all
. Let us inspect the value of
. On the one hand, if
then
and so
. On the other hand, if
then
so
. Since we have obtained a contradiction then
cannot be recursive.
When dealing with computability of real‐valued functions, it is convenient to distinguish three important cases.
Definition 7.19 (Computable real numbers and real functions)
We adopt these definitions:
-
(1)A real number
is called lower semicomputable if there is a recursive function
which satisfies
and
. -
(2)A real number
is called upper semicomputable if there is a recursive function
which satisfies
and
. -
(3)A real number
is called computable if there is a recursive function
which satisfies
.
Analogously, we define:
-
(1)A real function
is called lower semicomputable if there is a recursive function
which satisfies
and
for all
. -
(2)A real function
is called upper semicomputable if there is a recursive function
which satisfies
and
for all
. -
(3)A real function
is called computable if there is a recursive function
which satisfies
for all
.
We have the following results.
Theorem 7.17
A recursive function
or a rational number
considered as a real function or a real number respectively are computable.
Proof:
We put
or
respectively.
Theorem 7.18
A real function or a real number which is both upper and lower semicomputable is computable.
Proof:
We present a proof for the real function. The proof for the real number is analogous. Given the recursive functions
and a number
, there is a Turing machine which computes the approximations
and
for increasing
successively until
and then outputs
.
Finally, it can be shown that Kolmogorov complexity can be approximated from above but cannot be known exactly.
Theorem 7.19
Function
considered as a real function is upper semicomputable but it is not recursive.
Proof:
-
(1) By Theorem 7.12 , we have
for some constant
. Let
be the reference universal machine. We may define the time‐bounded Kolmogorov complexity (7.40)
Function
is recursive since there exists a Turing machine, which given
simulates the operation of machine
in parallel on all programs
shorter than
and from this simulation it computes
. Moreover, is upper semicomputable. -
(2) Assume that function
is recursive. Then we may define the total recursive function (7.41)
Since function
is recursive, there exists a string
such that
for all natural numbers
for the reference universal machine
. Hence, we obtain (7.42)
whenever
. Hence, we obtain a contradiction since inequality
holds for sufficiently large
. Thus, function
is not recursive.
In the following three sections, we will prove more advanced results. First, we will exhibit some correspondences between Kolmogorov complexity and Shannon entropy. Second, we will shed some light onto limits of mathematics. Third, we will analyze the phenomenon of randomness from an algorithmic perspective.
7.3 Algorithmic Coding Theorems
The prefix‐free Kolmogorov complexity resembles the pointwise Shannon entropy both in terms of its algebraic properties and its numerical value. The fundamental reason for these analogies is that the Shannon–Fano code for a given probability semidistribution is effectively computable if the semidistribution is effectively computable, even in the limit, or if the semidistribution is given by the oracle. This section will be devoted to a series of such results.
First of all, by an analogy to the chain rule for Shannon entropy
(7.43)
which follows for any random variables
,
, and
by Theorems 5.7 and 5.29, we may formulate this theorem, expressing a chain rule for Kolmogorov complexity.
Theorem 7.20 (Chain rule)
For discrete objects
and
, we have
(7.44)
We will use Theorem 7.20 to demonstrate theorems about facts and words in Section 8.4 . In Theorem 7.20 , independently due to Gács ( 1974 ) and Chaitin ( 1975a ), it is easy to show that the left hand side is smaller than the right hand side. The proof of the converse inequality is harder but it rests on an interesting series of auxiliary theoretical concepts and results. In the following, we will demonstrate the entire reasoning. We will begin with the concept of recursively enumerable sets, or rather more generally, recursively enumerable set functions.
Definition 7.20 (Recursively enumerable set function)
A set function
is called recursively enumerable if there exists a total recursive function
such that
for all
.
We will say informally that function
from the above definition enumerates set function
. This phrasing motivates the following more precise construction.
Definition 7.21 (Uniquely enumerating function)
A partial recursive function
is called a uniquely enumerating function if for each
there exists a set
or
such that:
-
(1)
and
for
and
. -
(2)
for
.
It is quite obvious that any recursively enumerable set function can be enumerated by a uniquely enumerating function.
Theorem 7.21
If a set function
is recursively enumerable then there exists a uniquely enumerating function
such that
for all
.
Proof:
Let
such that
for all
be a total recursive function. For a fixed
, let us define
and let
be the smallest number such
that
is different from
if such a number exists or
else. Then an example of a uniquely enumerating function is
if
and
if
.
These simple observations have a surprising consequence. Namely, we can introduce a generalization of the inverse Kraft inequality ( Theorem 7.5 ) for codes that can be both effectively encoded and decoded.
Theorem 7.22 (Effective inverse Kraft inequality)
Suppose that a uniquely enumerating function
satisfies inequality
(7.45)
for each
. Then there exist:
-
(1)A partial recursive code
such that the partial code
is prefix‐free for each
and satisfies
for all
and
else. -
(2) A prefix‐free Turing machine
such that (7.46)
Proof:
The existence of the partial recursive code
follows from Theorem 7.5 , since the construction in its proof is effective. Subsequently, the machine
may operate in the following way. Given a program
and an oracle
, it constructs code words
for increasing numbers
until it encounters a code word equal to program
and then it returns number
. An important technical detail of this algorithm is that program
can be read from the unidirectional tape
incrementally while checking against code words
. Namely, if
for some
then the machine
reads the tape
until position
such that
and
or, if there is no such position, the machine
reads the tape
until position
, detects the end of code word
, returns number
, and halts.
As a corollary, we can bound Kolmogorov complexity in terms of apparently obscure recursively enumerable set functions that satisfy the Kraft inequality.
Theorem 7.23 (Chaitin bound)
Fix some
. Suppose that a set function
is recursively enumerable and satisfies
(7.47)
Then the prefix‐free Kolmogorov complexity is bounded by the inequality
(7.48)
Proof:
Let
be a uniquely enumerating function for the set function
. Subsequently, let
for
and
for
. In view of Theorem 7.22 , there exists a prefix‐free Turing machine
such that for all
where
there exists exactly one program
such that
and
. Moreover, since function
is recursive, there exists a prefix‐free Turing machine
that outputs
instead of
, i.e. for
such that
there exists exactly one program
such that
and
. Hence, for the reference Turing machine we obtain the bound
(7.49)
Now we will introduce another ingredient for the proof of Theorem 7.20 , which is the algorithmic probability. Strictly speaking, the algorithmic probability is a semidistribution over discrete objects, whose normalizing constant is called the halting probability.
Definition 7.22 (Algorithmic and halting probabilities)
For a machine
, we define algorithmic probability as
(7.50)
and the halting probability as
(7.51)
If
is the reference machine, we will write
(7.52)
(7.53)
Theorem 7.24
We have
(7.54)
Proof:
Set
is prefix‐free by Theorem 7.8 . Hence, the claim follows by the Kraft inequality ( Theorem 7.4 ).
It can be also shown that the algorithmic and the halting probabilities for a universal machine are not computable but are lower semicomputable. This result will be developed in the next section.
As for now, there are three important results for the algorithmic probabilities. The first one, called the coding theorem, applies the Chaitin bound ( Theorem 7.23 ). The coding theorem asserts that the Kolmogorov complexity for the reference universal machine is bounded above by the pointwise entropy of the algorithmic probability for any prefix‐free Turing machine.
Theorem 7.25 (Coding theorem)
For any machine
we have
(7.55)
Proof:
Consider the set function
(7.56)
, we obtain
(7.57)
Thus, in view of Theorem 7.23 , we obtain
(7.58)
In the following, we will write
and
if there exists a constant
such that
and
holds respectively for all arguments
. We will write
when we have both
and
. It turns out that the algorithmic probability with respect to a reference universal machine roughly dominates algorithmic probabilities with respect to other machines.
Theorem 7.26 (Coding theorem)
For any machine
we have
(7.59)
Proof:
By the definition of algorithmic probabilities, we have
. Hence, the claim follows by Theorem 7.25 .
The last important fact for the proof of Theorem 7.20 is that the algorithmic probability behaves almost like a complete probability distribution, namely, it is additive up to a multiplicative constant.
Theorem 7.27
We have
(7.60)
Proof:
By
we will denote the reference machine. On the one hand, there exists a machine
such that
if
. Hence, by Theorem 7.26 ,
(7.61)
. Hence, by Theorem 7.26 ,
(7.62)
Now we may prove the chain rule for Kolmogorov complexity.
Proof of Theorem 7.20 :
By
we will denote the reference machine. First we will prove the easier inequality
(7.63)
Let
be the shortest program that satisfies
and let
be the shortest program that satisfies
. Given
and
we may compute both
and
and whereas given
and
we may compute
. Thus, there exists a machine
that satisfies
. Hence, we obtain the claim.
Next, we will show the harder inequality
(7.64)
By Theorems 7.26 and 7.27 we know that there exists a constant
such that for all
and
we have
(7.65)
Consider now the set function
(7.66)
This set function is recursively enumerable, by the argument similar as in the proof of Theorem 7.25 . Moreover, by inequality ( 7.65 ), we obtain
(7.67)
Thus, in view of Theorems 7.23 and 7.26 , we obtain
(7.68)
Commenting upon Theorem 7.20 , let us remark that the parallels between the chain rules ( 7.43 ) and ( 7.44 ) remain incomplete because in the algorithmic are approximately equal.
Theorem 7.28
We have
(7.69)
Proof:
From the shortest program that computes
given
, we may compute both
and
. Hence,
. On the hand, we have
since given pair
we may compute
.
We may also define an algorithmic analogue of mutual information.
Definition 7.23 (Algorithmic mutual information)
We define the algorithmic mutual information between discrete objects
and
given an object
as
(7.70)
Theorem 7.29
We have
(7.71)
Proof:
We have
since given pair
we may compute pair
and converse. Moreover, we have
since given
and
, computed independently, we may compute the pair
.
Theorem 7.30
We have
(7.72)
Proof:
The claim follows by Theorem 7.20 .
Now we will derive some different links between Kolmogorov complexity and Shannon entropy. Let us recall that the coding theorem ( Theorem 7.25 ) shows that the Kolmogorov complexity is bounded above by the pointwise entropy of the algorithmic probability. Using much simpler technique which applies the Shannon–Fano coding, we will show that the Kolmogorov complexity of a string given a semidistribution is bounded above by the pointwise Shannon entropy of the string for any semidistribution, see Gács et al. ( 2001 ).
Theorem 7.31
Let
be a semidistribution on discrete objects, i.e.
for
and
. We have
(7.73)
Proof:
For a semidistribution
, by Theorem 7.5 there exists a prefix‐free Shannon–Fano code
such that
. This code is effectively computable. Therefore, a certain machine
may operate in the following way. Given a program
and the oracle
, it enumerates objects
and constructs code words
until it encounters a code word equal to program
and then it returns object
. As in the proof of Theorem 7.22 , program
can be read from the unidirectional tape
incrementally while checking against code words
. In view of the above, we obtain inequalities
(7.74)
The above theorem combined with Theorem 7.24 and the general properties of semidistributions has the following corollary, which states that the Kolmogorov complexity of a string given a probability measure is close to the pointwise entropy of the string with a high probability.
Theorem 7.32
Consider a stochastic process
on a probability space
, where
for some countable set
. Let be the distribution of the process. We have a nonprobabilistic upper bound
(7.75)
for all
, and probabilistic lower bounds
(7.76)
(7.77)
(7.78)
Proof:
W observe that
and
where
are semidistributions on strings of arbitrary length. Thus, the claims follow by Theorems 7.31 and 7.24 combined with Theorems 3.18–3.20.
Similarly, if we are interested in the unconditional Kolmogorov complexity, we note the following result for recursive measures.
Theorem 7.33
Consider a stochastic process
on a probability space
, where
for some countable set
. Let
be the distribution of the process. If
is a recursive function then we have a nonprobabilistic upper bound
(7.79)
for all
. Moreover, for an arbitrary
we have probabilistic lower bounds
(7.80)
(7.81)
(7.82)
Proof:
W observe that
and
where
are semidistributions on strings of arbitrary length, whereas
(7.83)
since a recursive measure is a discrete object. Thus, the claims follow by Theorems 7.31 and 7.24 combined with Theorems 3.18–3.20.
7.4 Limits of Mathematics
An important achievement of the twentieth century mathematics was the incompleteness theorem by Kurt Gödel. The Gödel incompleteness theorem sets some limits on the power of formal inference systems. A formal inference system is a finite collection of axioms and inference rules, which can be encoded as a tuple of strings – a discrete object. A formal inference system is called consistent if, within this system, i.e. using the axioms and inference rules of the system, it is not possible to prove both a statement and its negation. The system is called sound if only true propositions can be proved. Thus, a sound system is consistent, provided mathematics is consistent as a whole. According to the Gödel incompleteness theorem, for any sound formal inference system which is sufficiently expressible, there exist statements expressible in this system which are true but not provable within this system (Gödel, 1931 ).
An interesting version of the Gödel incompleteness theorem was proved by Gregory Chaitin. According to this version of the Gödel theorem, in any sound formal inference system it is not possible to prove that the Kolmogorov complexity of any particular string is substantially larger than the Kolmogorov complexity of this formal system (Chaitin, 1975b ). This result reveals that unprovability of true propositions is a much more common phenomenon than suggested by the original proof of the incompleteness theorem by Gödel. Let us state our version of Chaitin's theorem formally.
Theorem 7.34 (Chaitin incompleteness theorem)
There exists a constant
such that for any sound formal inference system
propositions
are unprovable in system
for any particular string
– if these statements are expressible in system
.
Gregory Chaitin commented on the results in this vein as follows:
I would like to able to say that if one has 10 pounds of axioms and a 20‐pound theorem, then that theorem cannot be derived from those axioms. And I will argue that this approach to Gödel's theorem does suggest a change in the daily habits of mathematicians, and that Gödel's theorem cannot be shrugged away.
(Chaitin, 1982 )
In fact, as we have seen in Section 7.2 , we have
. Thus, by Theorem 7.34 there exists a constant
such that for any sound formal inference system
statements
are unprovable in
– if they are expressible in system
. Thus, there is something in the air about comparing the weights of formal systems and of provable propositions but we will not pursue this metaphor further.
Theorem 7.34 should be contrasted with Theorem 7.11 , which states that there are
distinct strings
of length
such that
. Although we can prove that there are so many incompressible strings, in view of Theorem 7.34 , it is not possible to prove incompressibility of any explicitly given sufficiently long string. Thus, the only way to assert incompressibility of any explicitly given long string is to assume it as a new axiom in the inference system. To prove Theorem 7.34 we will apply a method similar to the proof of Theorem 7.19 , i.e. uncomputability of Kolmogorov complexity.
Proof of Theorem 7.34 :
We observe that for a given formal inference system
we may effectively enumerate all proofs in the system and check their conclusions. In particular, there is a total recursive function
such that
(7.84)
In consequence there exists a partial recursive function
(7.85)
Assume that the formal inference system is sound. Then function
(7.86)
is also a partial recursive function and returns some string
such that
, if there exists a proof of
. Since function
is recursive, there exists a string
such that
for all natural numbers
for the reference universal machine
. Hence, we obtain
(7.87)
whenever
. Thus, propositions
must be unprovable in system
where
is the smallest number such that
.
Let us stress that the Chaitin incompleteness theorem ( Theorem 7.34 ) holds only for strings
that we may write down explicitly. It is still possible to prove incompressibility of certain special strings that cannot be written down explicitly, such as the binary expansion of the halting probability, introduced in the previous section.
Definition 7.24 (Halting probability)
Let
be the reference universal Turing machine. The unconditional halting probability is defined as
(7.88)
As shown in Theorem 7.24 , we have
. Subsequently, we will define the binary expansion of
.
Definition 7.25 (Halting probability)
We define the binary digits
of the halting probability
via equality
(7.89)
Digits
are given uniquely since the halting probability
is incompressible and thus uncomputable and irrational. Before we state this result, we will show a simpler fact, namely, that
can be approximated from below with an uncontrolled precision.
Theorem 7.35
Number
is lower semicomputable.
Proof:
Let us simulate the execution on machine
of all programs of arbitrary lengths in parallel. This parallel simulation can be carried out for example in this Ω is lower semicomputable.
In the next step, we will introduce the concept of algorithmically incompressible sequences and real numbers.
Definition 7.26 (Algorithmically incompressible sequence)
An infinite sequence
or a real number
, where
, is called algorithmically incompressible if inequality
holds for any
and some
.
It is easy to see that an algorithmically incompressible sequence or, equivalently, an algorithmically incompressible real number are not computable.
Theorem 7.36
If a real number is algorithmically incompressible then it is not computable.
Proof:
Suppose that a real number
is computable. Then, by computability, there exists a recursive function
such that
. Hence, there exists a recursive function
such that
. Hence, by Theorem 7.15 , we obtain
(7.90)
which implies that
is not algorithmically incompressible.
Subsequently, we will show that halting probability
is algorithmically incompressible despite it is lower semicomputable. As an important auxiliary result, we will demonstrate first that given
we may decide whether the reference universal machine halts on any program of length up to
.
Theorem 7.37 (Halting problem)
There exists a partial recursive function
such that
(7.91)
for any program
such that
.
Proof:
Let us simulate the execution of machine
in parallel on all programs of length up to
. In the beginning of the simulations, we set the approximation of number
as
. When the simulated machine
halts for a certain program
, we improve the approximation by setting
. At any instant, we have
. But at a certain instant, the approximation
becomes greater than
. Since then we have
, then it becomes evident that machine
will not halt on any other program
of length
. Hence, we obtain a finite list of programs of lengths up to
with an information which of them halts and which does not. From this we may compute function
.
Some simple corollary of the above result is that given
we may also decide which mathematical statements of length up to
are true or false. This property is metaphorically called philosophers' stone.
Theorem 7.38 (Philosophers' stone)
There exist a constant
and a partial recursive function
such that
(7.92)
for any recursive predicate of natural numbers
such that
.
Proof:
There is a recursive partial function
which given the program for computing predicate
searches for the smallest
such that
does not hold. Namely, we have
(7.93)
For the reference machine
, we have
for a certain string
. Hence, by Theorem 7.37 , there exists a partial recursive function
that satisfies ( 7.92 ) if
.
In the sequel, we will show that the halting probability is algorithmically incompressible – and thus not computable and irrational.
Theorem 7.39
Number
is algorithmically incompressible.
Proof:
By Theorem 7.37 , we can enumerate, given string
, all programs of length up to
for which the reference universal machine
halts. For any string
which is not computed by these programs, we have
. Thus, we can construct a recursive function
which returns the first such string
given an . Hence, by Theorem 7.15 , we obtain
(7.94)
which is tantamount to
being algorithmically incompressible.
In the next section, we will see that halting probability
is a special case of a much more common object, namely, algorithmically random sequences.
7.5 Algorithmic Randomness
Considering preformal conceptions about a random infinite sequence (with respect to a given probability measure), it is intuitive to require that the set of random sequences have probability one and consist only of those sequences that cannot be differentiated from any set of sequences typical of that measure by any effective statistical means. In particular, sequences such as
,
, or
should not be considered random with respect to the Lebesgue measure, i.e. the uniform measure on infinite sequences, since they can be generated by simple deterministic algorithms. Beforehand, it is not obvious that the concept of a random infinite sequence can be successfully formalized and that this can be done for an arbitrary probability measure.
Historically, the formal concept of an algorithmically random sequence was developed by Per Martin‐Löf by means of algorithmic statistical tests (Martin‐Löf, 1966 ). It was proved later by Claus‐Peter Schnorr (in 1974, unpublished) that this approach is equivalent to a definition which applies Kolmogorov complexity like in Theorem 7.32 . Since we want to demonstrate the Schnorr theorem – in a version for general probability measures, we will discuss the algorithmic tests first.
To state necessary preliminaries, let us return to the setting of Theorem 7.32 . Consider a stochastic process
on a probability space
, where
for some countable set
. To make the notation shorter, in the following, we will write infinite sequences as
, where
. For strings
and subsets
, called formal languages, will also write generalized cylinder sets as
(7.95)
(7.96)
and abbreviate the notation
(7.97)
(7.98)
.
Having made these remarks, we may introduce Martin‐Löf and Solovay tests.
Definition 7.27 (Martin‐Löf and Solovay tests)
Let
be a recursively enumerable set function. We write
(7.99)
The set function
is called a Martin‐Löf test for a probability measure
if for all
sets
are prefix‐free and
(7.100)
In contrast, the set function
is called a Solovay test for a probability measure
if for all
sets
are prefix‐free and
(7.101)
Borrowing names from mathematical statistics, formal languages
and their cylinder sets
will be called critical regions, whereas numbers
will be called significance levels. Thus, we may say that a Martin‐Löf test
for measure
is an arbitrary sequence of significance levels
and critical regions
that are jointly recursively enumerable. For a Solovay test, we relax the requirement that significance levels be of form
.
The above definition requires a certain illustration. Consider the following example. Let
be the probability measure of the Bernoulli
process, i.e.
where
and
. By the Hoeffding inequality (3.99), we have
(7.102)
Putting
, we obtain
for
(7.103)
Hence,
(7.104)
in the particular form in which we represent it on the tape of the Turing machine. We leave this problem as an exercise.
Let us observe that, for a given measure
, critical regions
are sets of approximately nonrandom sequences. In particular, if condition ( 7.100 ) is satisfied then the set of sequences
that are not contained in the intersection
of all critical regions has full measure
, whereas if condition ( 7.101 ) is satisfied then the set of sequences
that are contained in only finitely many critical regions
has also full measure
– by the Borel–Cantelli lemma ( Theorem 3.12 ). This motivates the following definition.
Definition 7.28 (Passing Martin‐Löf and Solovay tests)
We will say that:
-
(1)Sequence
passes a Martin‐Löf test
for measure
if sequence
is not contained in the intersection
of all critical regions; -
(2)Sequence
passes a Solovay test
for measure
if sequence
is contained in only finitely many critical regions
.
For example, for the Solovay test ( 7.103 ) and the Bernoulli measure
, a sequence
passes the test if
(7.105)
for all but finitely many
. Since the set of such sequences
has full measure
, we may suppose that a proper subset of these sequences can be naturally called algorithmically random sequences with respect to
. Intuitively these algorithmically random sequences should pass any imaginable Solovay or Martin‐Löf test. Since there are only countably many Solovay or Martin‐Löf tests, the set of sequences that pass all the tests still has full measure
.
In fact, passing any Martin‐Löf or Solovay test corresponds to a very natural property. The following Schnorr theorem states that a sequence
passes any imaginable Solovay or Martin‐Löf test for measure
if and only if the conditional Kolmogorov complexity of prefixes
is essentially larger than
. The Schnorr theorem is usually presented for recursive probability measures. Here we present a version for general measures, also uncomputable ones.
Theorem 7.40 (Schnorr theorem)
Let
be a probability measure. The following conditions are equivalent:
-
1. Sequence
satisfies
. - .
-
3. Sequence
passes any Martin‐Löf test
for probability measure
. -
4.Sequence
satisfies
.
Proof:
We will demonstrate implications (1)
(4)
(3)
(2)
(1), which is sufficient to show the equivalence.
-
(1)
(4): Obviously, statistic
is bounded below if it tends to infinity. (In that case we have
for all
.) -
(4)
(3): Suppose by contradiction that
for a certain Martin‐Löf test
. We will show that
satisfies
. We obtain (7.106)
Since set function
is recursively enumerable, in view of Theorem 7.23 , we obtain (7.107)
for any
and
. Since
, there exists a sequence of prefixes
such that
. This yields (7.108)
for an arbitrary
. -
(3)
(2): Suppose by contradiction that
is contained in infinitely many critical regions
for a certain Solovay test
. We will show that
for a certain Martin‐Löf test
. For
, the test
is constructed via (7.109)
Then
belongs to all sets
. To show that
of this form is a Martin‐Löf test, we notice the following. We can choose some prefix‐free sets
generating the sets
in such a way that set function
is recursively enumerable. Moreover, we notice that (7.110)
Hence,
and
is a Martin‐Löf test. -
(2)
(1): Suppose by contradiction that
satisfies (7.111)
We will show that
belongs to infinitely many critical regions
for a certain Solovay test
. We observe that if
then sequence
belongs to infinitely many sets
if we put (7.112)
where
is a certain finite number. For this choice of
, set function
is recursively enumerable and sets
are prefix‐free. Thus, it remains to prove the second condition for the Solovay test. Denote (7.113)
Then by the Markov inequality ( Theorem 3.11 ) and by the Kraft inequality for Kolmogorov complexity ( Theorem 7.24 ), we obtain
(7.114)
Thus, algorithmically random sequences in the Martin‐Löf sense, also called 1‐random sequences, can be defined in the following way.
Definition 7.29 (Algorithmically random sequences)
We say that a sequence
is 1‐random or algorithmically random in the Martin‐Löf sense with respect to a probability measure
when it satisfies conditions enumerated in Theorem 7.40 . The set of such sequences is denoted as
.
There are also stronger concepts of algorithmic randomness such as
‐randomness (Downey and Hirschfeldt, 2010 ).
It follows easily that the set of Martin‐Löf random sequences has the full measure.
Theorem 7.41
We have
.
Proof:
Follows by Theorem 7.32 .
by the relationship ( 7.105 ).
Algorithmic randomness is a subject of intense research in recent years. Some fundamental problem is strengthening various theorems of form “
for
‐almost all
” to claims of form “
for all
,” where
is the set of 1‐random sequences for a relevant measure
. Interesting examples include the Birkhoff ergodic theorem (Bienvenu et al., 2012 ; Franklin et al., 2012 ), ergodic decomposition (Hoyrup, 2013 ), the problem of superefficient estimators (Vovk, 2009 ), and the Lambalgen theorem about decomposition of the set of jointly random sequences (van Lambalgen, 1987 ; Vovk and V'yugin, 1993 , 1994 ; V'yugin, 2007 ; Takahashi, 2008 , 2011 ), which is of a substantial importance for foundations of Bayesian statistics.
Problems
-
7.1 Let
be a uniquely decodable code for natural numbers. Show that
for infinitely many
. -
7.2 Show that there exists a uniquely decodable code
such that (7.115)
-
7.3 Consider the entropy
of a two‐point distribution defined in (5.111). Let
be a Bernoulli process. Show that (7.116)
for certain constants
and
. What are the optimal
and
? -
7.4 In this task we will consider a certain restricted minimal grammar‐based code. The general idea of a minimal grammar‐based code is to encode a given string as the minimal context‐free grammar that generates the string as its only production. This can be done when imposing various constraints on the shape of admissible context‐free grammars. Here we will assume that the admissible grammars are flat, i.e. nonterminal symbols can appear only in the definition of the start symbol. The respective minimal flat grammars correspond to parsing the given string into a sequence of some optimal words. In the task, you will be requested to show that the minimal flat grammar‐based code is universal and satisfies an analogue of inequality (6.86) for the prediction by partial matching (PPM) probability.
Consider the set strings
over a finite alphabet
. Denote the set of finite sequences of strings as
, i.e. for each
there exist a number
and strings
such that
. Let
and
be prefix‐free codes such that
,
, and
. Define codes (7.117)
(7.118)
Subsequently, for
and
we define mappings (7.119)
(7.120)
Now for
we define code (7.121)
where
and
are chosen in such a way that the length of code word
is minimal given constraint (7.122)
For these optimal
and
we will write
and
. -
Show that
is a prefix‐free code. -
Can we choose code
such that
is a universal semidistribution? -
Let
be the maximal repetition of string
. Show that (7.123)
applying local minimization, see Kieffer and Yang ( 2000 ), Charikar et al. ( 2005 ), and Ochoa and Navarro ( 2019 ).
-
-
7.5 Show that all computable functions
are continuous. -
7.6 Show that for natural numbers
and
we have (7.124)
-
7.7 Let
for a string
. Show that: -
; -
.
-
-
7.8 For a natural number
define
. Show that
. -
7.9 Consider strings
. Assume that
for a fixed number
. Show that
. -
7.10 Having pair
we may effectively enumerate all programs of the smallest length that compute a discrete object
. Let
be the first such program in some fixed enumeration. Prove that: -
; -
.
-
-
7.11 Show that
. -
7.12 by the Kraft inequality. Show that
(7.125)
-
7.13 Consider the Lebesgue measure over binary sequences, i.e.
where
. Show that sequence
is algorithmically random with respect to
if and only if
is algorithmically random for any
. -
7.14 Let a probability measure
satisfy
, where
is a countable set of infinite sequences. Show that
. -
7.15 Show that for a stationary process
over a finite alphabet and positive growing sequences
and
of natural numbers such that
, we have (7.126)
where
is the Shannon entropy rate of the random ergodic measure of the process and object
is fixed. For
,
, and
, this result was shown by Brudno ( 1982 ). -
7.16 Many theorems in probability can be stated as “
holds for
‐almost all
,” where
is a random proposition and
is a probability measure. As we have discussed in Section 7.5 , there are related stronger statements “
for all
,” where
is the set of Martin‐Löf random points for measure
. Of course, we have
, which implies
for
‐almost all
if
holds for all
. Does
for
‐almost all
imply
for all
automatically if we assume some sort of generalized computability of random proposition
and measure
? How general notions of computability can we consider?