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 images , whose binary approximations have the maximal Kolmogorov complexity. Number images 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 images 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 images into finite sequences over a countable set images . The set of these sequences is denoted as images , where images , images , and images is the empty sequence. Within the context of coding theory, sets images and images 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 images is the set images . On the other hand, the input alphabet images 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 images and images , a function images is called a code.


Strings images 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 images is called nonsingular if for images and images , we have images .


To recall, more generally, an injection images is a mapping such that images for any images such that images .

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 images , and two‐sided infinite sequences, written as images – mind the bold‐face dot between the zeroth as concatenations

(7.1) equation

(7.2) equation

(7.3) equation

where images .


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 images from the concatenation of their code words images . Formally speaking, the following property is desired.


Definition 7.4 (Uniquely decodable code)

A code images is called uniquely decodable if its finite extension images 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 images is called a comma‐separated code if images , where images and images is a nonsingular code.



Theorem 7.1

Any comma‐separated code is uniquely decodable.



Proof:

For a comma‐separated code images , let us decompose images . We first observe that images holds only if images (we have the same number of images 's on both sides of the equality) and images for images . Since images is a nonsingular code, hence string images is the only image of sequence images under the mapping images . Hence, code images 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 images be a natural number. A code images 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 images . We observe that

(7.4) equation

holds only if images (we have the same length of strings on both sides of the equality) and images for images . Because code images is nonsingular, hence string images is the only image of images under the mapping images . Hence, code images 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 images is a set of strings such that for any images condition images implies images for any string images .


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 images is called a prefix‐free code if the image images is a prefix‐free set and images is nonsingular.



Theorem 7.3

Any prefix‐free code is uniquely decodable.



Proof:

Let images be a prefix‐free code. We observe that images holds if and only if images and images . Hence, equality images holds if and only if images and images . Thus, code images is uniquely decodable.


Now, we will present two useful codes for the set of natural numbers ( images ). First, we will consider the ordinary binary expansions images of natural numbers, an example given in Table 7.1 . Code images 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. (1) Put 0 at the end of the code.
  2. (2) If the coded number is 1, stop. Otherwise, write the binary expansion images , where images is the coded number, before the code.
  3. (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 images and images .

images Binary expansion images Elias omega code word images
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
images images images

Subsequently, let us estimate the lengths of codes images and images . We have images , whereas

(7.5) equation

We may define the iterated binary logarithm

(7.6) equation

Then images . We also have inequality images for all but finitely many natural numbers images .

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 images , we will be interested in the expected code length images . 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 images we have the inequality

(7.7) equation



Proof:

Consider an arbitrary images . Let images denote the number of sequences images such that images and the length of images equals images . We have

(7.8) equation

Because the code is uniquely decodable, we have images . Therefore

(7.9) equation

Letting images , we obtain ( 7.7 ).


The second result states that each incomplete distribution of form images where images 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 images or images . If function images satisfies inequality

(7.10) equation

then we may construct a prefix‐free code images such that images .



Proof:

For a string images , let us denote the cylinder set

(7.11) equation

We observe that code images is prefix‐free if and only if cylinder sets images and images are disjoint for images .

In the following we define code images by iteration as follows. First, we denote unions of cylinder sets images excluded before the images th iteration as images and images for images . Next, we define images as the first element of set images in the lexicographic order images such that sets images and images are disjoint. It is obvious with the requested property exist.

Now we will show that string images 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 images :

  1. (*) The difference images is a finite union images of cylinder sets such that images , images , and images for images .

Let images for the above representation of images . By property (*), we obtain strict inequality

(7.12) equation

On the other hand, by the Kraft inequality ( 7.10 ), we have

(7.13) equation

Hence, we obtain that images , i.e. we have images . Thus, string images 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 images , the expected length of the code satisfies inequality

(7.14) equation

where images is the Shannon entropy of the probability distribution images .



Proof:

Let us introduce function images . By the Kraft inequality ( Theorem 7.4 ), function images 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 images is called a Shannon–Fano code for a probability distribution images if

(7.15) equation



Theorem 7.7

The Shannon–Fano code exists for any discrete random variable and satisfies

(7.16) equation



Proof:

We have

(7.17) equation

Hence, Shannon–Fano codes exist by the inverse Kraft inequality ( Theorem 7.5 ) – when we choose some one‐to‐one mapping images or images . Consequently, inequality ( 7.16 ) follows by

(7.18) equation


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 images , where

  1. (1) images is a finite, nonempty set of states,
  2. (2) images is the start state,
  3. (3) images is the halt state,
  4. images is a function called the transition function.

The set of such prefix‐free Turing machines is denoted images .


The above formal description translates to the machine operation in the following way. The machine is given three infinite tapes:

  1. (1) A unidirectional read‐only tape images filled with symbols 0 and 1.
  2. (2) A bidirectional read‐only tape images filled with symbols 0, 1, and images .
  3. (3) A bidirectional read‐write tape images filled with symbols 0, 1, and images .

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 images and the machine reads symbols images , images , and images . The further machine operations are specified as follows: if the machine is in state images and reads symbol images from tape images , symbol images from tape images , and symbol images from tape images then for

(7.19) equation

the machine does these operations:

  1. (1) The machine moves along tape images one symbol to the right if images or it does not move if images .
  2. .
  3. (3) The machine writes symbol images instead of symbol images on tape images .
  4. (4) The machine moves along tape images one symbol to the left if images or one symbol to the right if images or it does not move if images .
  5. (5) The machine assumes state images in the next step.

The above steps are undertaken until the machine reaches the halt state images . Then the computation stops.

Let us write the set of both finite and infinite sequences as images . 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 images halts in a finite time images on a program images with an oracle images and returns a string images if:

  1. (A)The machine in the start state reads symbols images , images , and images , and the initial state of the tapes is: images , images for images , images and images for images if images is a string or images if images is an infinite sequence, and images for all images .
  2. (B)The machine reaches the halt state after images steps and the machine in the halt state reads symbol images , whereas the final state of the tape images is images , with images for images and images for some images .

Assuming that condition (A) is satisfied, we write

(7.20) equation

(7.21) equation

When images , we say that the machine does not halt on input images .


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 images and an oracle images , set

(7.22) equation

is prefix‐free.



Proof:

A prefix‐free Turing machine can move along the tape images only in one direction. Hence, if it halts on a program images , then it cannot read the tape any further and halt on a program images , where images .


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 images of a string images given an oracle images and a machine images is defined as

(7.23) equation

We also use notation images .


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 images is called universal if for each machine images there exists a string images such that

(7.24) equation

for all images and images .



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 images can be chosen as a machine‐readable formal description of the machine images . Given such a string images , machine images compiles a model of machine images and afterwards simulates the actions of machine images on input images .


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 images and images if there exists a constant images such that images and images holds respectively for all arguments images . We will write images when we have both images and images .


Theorem 7.10 (Invariance theorem)

For any universal machine images and any machine images , we have

(7.25) equation

In particular, for any two universal machines images , we have

(7.26) equation



Proof:

We have images for a certain string images . Hence, images . 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 images be a certain reference universal machine. We will write

(7.27) equation

We also use notation images .


For the vast majority of strings, their Kolmogorov complexity is quite large since there are not so many short programs. A string images will be called images ‐incompressible if images . In view of the following result, at least a half of strings of length images is images ‐incompressible.


Theorem 7.11

There exist at least images distinct images ‐incompressible strings of length images .



Proof:

The number of images ‐incompressible strings of length images is greater than the difference between the number of all strings of length images and the number of distinct programs of length strictly smaller than images . There exist at most images distinct programs of length strictly smaller than images and there exists images distinct strings of length images . 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 images be the binary expansion of the natural number images . For a string images , we also denote images , where images and images is the Elias omega code word for number images . For images , we also write images . We adopt these definitions:

  1. (1)For strings images , we use identity function images .

  2. (2)For natural numbers images , we use the binary expansion stripped of the redundant initial symbol, images .

  3. (3)For rational numbers images , we use

    (7.28) equation

    where images , images , images , and images .

  4. (4)For tuples images , we use

    (7.29) equation

    where images .

  5. (5)For discrete tuples treated as nondiscrete objects images , we use

    (7.30) equation

  6. (6)For infinite sequences, images , we use identity function images .

  7. (7)For real numbers images , we use

    (7.31) equation

    where images , images , images , images , and images are the least binary digits that satisfy this relationship.

  8. (8)For finite nondiscrete tuples images , we use

    (7.32) equation

    where images , images and images if images for some images and images , whereas images otherwise.

  9. , we use

    (7.33) equation

    where images , images and images if images for some images , where as images otherwise.


We stress that under any reasonable convention the undefined value images remains a special type of an object which is never encoded, i.e. images and images .


Definition 7.16 (Halting)

For some fixed one‐to‐one mappings images and images we will say that machine images halts on a program images with an oracle images and returns an object images if images . Overloading the notation, we will write this fact as

(7.34) equation

When images , we will say that the machine does not halt on input images and we will write it as

(7.35) equation


Analogously, we will adjust all previous definitions and notations in this section, admitting writing images instead of images and images instead of images .

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) equation



Proof:

Let images and images . There is a machine images which satisfies images , where images is the Elias omega code word for number images , with length images . The machine generates images as follows. First it reads the Elias omega code word for number images from the unidirectional tape. Then it copies string images from the unidirectional tape to the output tape. After copying the last symbol of images , the machine halts because it knows the length of images from reading the code word images . Hence, we obtain the desired claim by images .



Theorem 7.13

For discrete objects images and images we have inequalities:

  1. (1) images .
  2. (2) images .


Proof:

  1. (1) We have images because a certain program that computes images given images and images has form: Ignore images and execute the shortest program that computes images .

    Moreover, images because a certain program that computes images has form: Execute the shortest program that computes pair images and then compute images from images .

  2. (2) We have images because a certain program that computes pair images has form: Execute the shortest program that computes images given images and the shortest program that computes images given images and images and from that compute pair images .

    The second inequality follows from images .


Now we define recursive discrete functions. A discrete function images is called total, whereas a discrete function images is called partial.


Definition 7.17 (Recursive partial discrete function)

A partial discrete function images is called recursive if there exists a program images for the reference universal Turing machine images such that images for all images .



Theorem 7.14 (Argument raising)

For a recursive partial discrete function images there exist a string images for the reference universal Turing machine images such that images for all images and images .



Proof:

There is a machine images which reads the self‐delimiting program images from the unidirectional tape and then simulates machine images given program images and oracle images , where images is some program from Definition 7.17 . Thus, images . Since machine images is universal, there also exists a string images such that images for all images and images . Hence, images 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 images , we use encoding images , where images is some program from Definition 7.17 . Subsequently, we extend the definitions of functions images and images as well as sets images and images appropriately.


Having adopted this convention, we may demonstrate this bound.


Theorem 7.15

For a recursive partial discrete function images and a discrete object images , we have

(7.37) equation



Proof:

The inequality follows from the fact that some program that computes images has form: Execute the shortest program that computes object images , compile function images from its shortest description, and apply function images to object images .


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) equation

is not recursive.



Proof:

Suppose that function images is recursive. Then we may define the recursive partial function

(7.39) equation

Since the partial function images is recursive, there exists a program images such that images for all images . Let us inspect the value of images . On the one hand, if images then images and so images . On the other hand, if images then images so images . Since we have obtained a contradiction then images 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. (1)A real number images is called lower semicomputable if there is a recursive function images which satisfies images and images .
  2. (2)A real number images is called upper semicomputable if there is a recursive function images which satisfies images and images .
  3. (3)A real number images is called computable if there is a recursive function images which satisfies images .

Analogously, we define:

  1. (1)A real function images is called lower semicomputable if there is a recursive function images which satisfies images and images for all images .
  2. (2)A real function images is called upper semicomputable if there is a recursive function images which satisfies images and images for all images .
  3. (3)A real function images is called computable if there is a recursive function images which satisfies images for all images .

We have the following results.


Theorem 7.17

A recursive function images or a rational number images considered as a real function or a real number respectively are computable.



Proof:

We put images or images 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 images and a number images , there is a Turing machine which computes the approximations images and images for increasing images successively until images and then outputs images .


Finally, it can be shown that Kolmogorov complexity can be approximated from above but cannot be known exactly.


Theorem 7.19

Function images considered as a real function is upper semicomputable but it is not recursive.



Proof:

  1. (1) By Theorem 7.12 , we have images for some constant images . Let images be the reference universal machine. We may define the time‐bounded Kolmogorov complexity

    (7.40) equation

    Function images is recursive since there exists a Turing machine, which given images simulates the operation of machine images in parallel on all programs images shorter than images and from this simulation it computes images . Moreover, is upper semicomputable.

  2. (2) Assume that function images is recursive. Then we may define the total recursive function

    (7.41) equation

    Since function images is recursive, there exists a string images such that images for all natural numbers images for the reference universal machine images . Hence, we obtain

    (7.42) equation

    whenever images . Hence, we obtain a contradiction since inequality images holds for sufficiently large images . Thus, function images 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) equation

which follows for any random variables images , images , and images 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 images and images , we have

(7.44) equation


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 images is called recursively enumerable if there exists a total recursive function images such that images for all images .


We will say informally that function images from the above definition enumerates set function images . This phrasing motivates the following more precise construction.


Definition 7.21 (Uniquely enumerating function)

A partial recursive function images is called a uniquely enumerating function if for each images there exists a set images or images such that:

  1. (1) images and images for images and images .
  2. (2) images for images .

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 images is recursively enumerable then there exists a uniquely enumerating function images such that images for all images .



Proof:

Let images such that images for all images be a total recursive function. For a fixed images , let us define images and let images be the smallest number such images that images is different from images if such a number exists or images else. Then an example of a uniquely enumerating function is images if images and images if images .


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 images satisfies inequality

(7.45) equation

for each images . Then there exist:

  1. (1)A partial recursive code images such that the partial code images is prefix‐free for each images and satisfies images for all images and images else.

  2. (2) A prefix‐free Turing machine images such that

    (7.46) equation



Proof:

The existence of the partial recursive code images follows from Theorem 7.5 , since the construction in its proof is effective. Subsequently, the machine images may operate in the following way. Given a program images and an oracle images , it constructs code words images for increasing numbers images until it encounters a code word equal to program images and then it returns number images . An important technical detail of this algorithm is that program images can be read from the unidirectional tape images incrementally while checking against code words images . Namely, if images for some images then the machine images reads the tape images until position images such that images and images or, if there is no such position, the machine images reads the tape images until position images , detects the end of code word images , returns number images , 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 images . Suppose that a set function images is recursively enumerable and satisfies

(7.47) equation

Then the prefix‐free Kolmogorov complexity is bounded by the inequality

(7.48) equation



Proof:

Let images be a uniquely enumerating function for the set function images . Subsequently, let images for images and images for images . In view of Theorem 7.22 , there exists a prefix‐free Turing machine images such that for all images where images there exists exactly one program images such that images and images . Moreover, since function images is recursive, there exists a prefix‐free Turing machine images that outputs images instead of images , i.e. for images such that images there exists exactly one program images such that images and images . Hence, for the reference Turing machine we obtain the bound

(7.49) equation


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 images , we define algorithmic probability as

(7.50) equation

and the halting probability as

(7.51) equation

If images is the reference machine, we will write

(7.52) equation

(7.53) equation



Theorem 7.24

We have

(7.54) equation



Proof:

Set images 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 images we have

(7.55) equation



Proof:

Consider the set function

(7.56) equation

, we obtain

(7.57) equation

Thus, in view of Theorem 7.23 , we obtain

(7.58) equation


In the following, we will write images and images if there exists a constant images such that images and images holds respectively for all arguments images . We will write images when we have both images and images . 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 images we have

(7.59) equation



Proof:

By the definition of algorithmic probabilities, we have images . 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) equation



Proof:

By images we will denote the reference machine. On the one hand, there exists a machine images such that images if images . Hence, by Theorem 7.26 ,

(7.61) equation

. Hence, by Theorem 7.26 ,

(7.62) equation


Now we may prove the chain rule for Kolmogorov complexity.


Proof of Theorem 7.20 :

By images we will denote the reference machine. First we will prove the easier inequality

(7.63) equation

Let images be the shortest program that satisfies images and let images be the shortest program that satisfies images . Given images and images we may compute both images and images and whereas given images and images we may compute images . Thus, there exists a machine images that satisfies images . Hence, we obtain the claim.

Next, we will show the harder inequality

(7.64) equation

By Theorems 7.26 and 7.27 we know that there exists a constant images such that for all images and images we have

(7.65) equation

Consider now the set function

(7.66) equation

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) equation

Thus, in view of Theorems 7.23 and 7.26 , we obtain

(7.68) equation


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) equation



Proof:

From the shortest program that computes images given images , we may compute both images and images . Hence, images . On the hand, we have images since given pair images we may compute images .


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 images and images given an object images as

(7.70) equation



Theorem 7.29

We have

(7.71) equation



Proof:

We have images since given pair images we may compute pair images and converse. Moreover, we have images since given images and images , computed independently, we may compute the pair images .



Theorem 7.30

We have

(7.72) equation



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 images be a semidistribution on discrete objects, i.e. images for images and images . We have

(7.73) equation



Proof:

For a semidistribution images , by Theorem 7.5 there exists a prefix‐free Shannon–Fano code images such that images . This code is effectively computable. Therefore, a certain machine images may operate in the following way. Given a program images and the oracle images , it enumerates objects images and constructs code words images until it encounters a code word equal to program images and then it returns object images . As in the proof of Theorem 7.22 , program images can be read from the unidirectional tape images incrementally while checking against code words images . In view of the above, we obtain inequalities

(7.74) equation


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 images on a probability space images , where images for some countable set images . Let be the distribution of the process. We have a nonprobabilistic upper bound

(7.75) equation

for all images , and probabilistic lower bounds

(7.76) equation

(7.77) equation

(7.78) equation



Proof:

W observe that images and images where images 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 images on a probability space images , where images for some countable set images . Let images be the distribution of the process. If images is a recursive function then we have a nonprobabilistic upper bound

(7.79) equation

for all images . Moreover, for an arbitrary images we have probabilistic lower bounds

(7.80) equation

(7.81) equation

(7.82) equation



Proof:

W observe that images and images where images are semidistributions on strings of arbitrary length, whereas

(7.83) equation

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 images such that for any sound formal inference system images propositions images are unprovable in system images for any particular string images – if these statements are expressible in system images .


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 images . Thus, by Theorem 7.34 there exists a constant images such that for any sound formal inference system images statements images are unprovable in images – if they are expressible in system images . 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 images distinct strings images of length images such that images . 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 images we may effectively enumerate all proofs in the system and check their conclusions. In particular, there is a total recursive function images such that

(7.84) equation

In consequence there exists a partial recursive function

(7.85) equation

Assume that the formal inference system is sound. Then function

(7.86) equation

is also a partial recursive function and returns some string images such that images , if there exists a proof of images . Since function images is recursive, there exists a string images such that images for all natural numbers images for the reference universal machine images . Hence, we obtain

(7.87) equation

whenever images . Thus, propositions images must be unprovable in system images where images is the smallest number such that images .


Let us stress that the Chaitin incompleteness theorem ( Theorem 7.34 ) holds only for strings images 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 images be the reference universal Turing machine. The unconditional halting probability is defined as

(7.88) equation


As shown in Theorem 7.24 , we have images . Subsequently, we will define the binary expansion of images .


Definition 7.25 (Halting probability)

We define the binary digits images of the halting probability images via equality

(7.89) equation


Digits images are given uniquely since the halting probability images is incompressible and thus uncomputable and irrational. Before we state this result, we will show a simpler fact, namely, that images can be approximated from below with an uncontrolled precision.


Theorem 7.35

Number images is lower semicomputable.



Proof:

Let us simulate the execution on machine images 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 images or a real number images , where images , is called algorithmically incompressible if inequality images holds for any images and some images .


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 images is computable. Then, by computability, there exists a recursive function images such that images . Hence, there exists a recursive function images such that images . Hence, by Theorem 7.15 , we obtain

(7.90) equation

which implies that images is not algorithmically incompressible.


Subsequently, we will show that halting probability images is algorithmically incompressible despite it is lower semicomputable. As an important auxiliary result, we will demonstrate first that given images we may decide whether the reference universal machine halts on any program of length up to images .


Theorem 7.37 (Halting problem)

There exists a partial recursive function images such that

(7.91) equation

for any program images such that images .



Proof:

Let us simulate the execution of machine images in parallel on all programs of length up to images . In the beginning of the simulations, we set the approximation of number images as images . When the simulated machine images halts for a certain program images , we improve the approximation by setting images . At any instant, we have images . But at a certain instant, the approximation images becomes greater than images . Since then we have images , then it becomes evident that machine images will not halt on any other program images of length images . Hence, we obtain a finite list of programs of lengths up to images with an information which of them halts and which does not. From this we may compute function images .


Some simple corollary of the above result is that given images we may also decide which mathematical statements of length up to images are true or false. This property is metaphorically called philosophers' stone.


Theorem 7.38 (Philosophers' stone)

There exist a constant images and a partial recursive function images such that

(7.92) equation

for any recursive predicate of natural numbers images such that images .



Proof:

There is a recursive partial function images which given the program for computing predicate images searches for the smallest images such that images does not hold. Namely, we have

(7.93) equation

For the reference machine images , we have images for a certain string images . Hence, by Theorem 7.37 , there exists a partial recursive function images that satisfies ( 7.92 ) if images .


In the sequel, we will show that the halting probability is algorithmically incompressible – and thus not computable and irrational.


Theorem 7.39

Number images is algorithmically incompressible.



Proof:

By Theorem 7.37 , we can enumerate, given string images , all programs of length up to images for which the reference universal machine images halts. For any string images which is not computed by these programs, we have images . Thus, we can construct a recursive function images which returns the first such string images given an . Hence, by Theorem 7.15 , we obtain

(7.94) equation

which is tantamount to images being algorithmically incompressible.


In the next section, we will see that halting probability images 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 images , images , or images 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 images on a probability space images , where images for some countable set images . To make the notation shorter, in the following, we will write infinite sequences as images , where images . For strings images and subsets images , called formal languages, will also write generalized cylinder sets as

(7.95) equation

(7.96) equation

and abbreviate the notation

(7.97) equation

(7.98) equation

.

Having made these remarks, we may introduce Martin‐Löf and Solovay tests.


Definition 7.27 (Martin‐Löf and Solovay tests)

Let images be a recursively enumerable set function. We write

(7.99) equation

The set function images is called a Martin‐Löf test for a probability measure images if for all images sets images are prefix‐free and

(7.100) equation

In contrast, the set function images is called a Solovay test for a probability measure images if for all images sets images are prefix‐free and

(7.101) equation


Borrowing names from mathematical statistics, formal languages images and their cylinder sets images will be called critical regions, whereas numbers images will be called significance levels. Thus, we may say that a Martin‐Löf test images for measure images is an arbitrary sequence of significance levels images and critical regions images that are jointly recursively enumerable. For a Solovay test, we relax the requirement that significance levels be of form images .

The above definition requires a certain illustration. Consider the following example. Let images be the probability measure of the Bernoulli images process, i.e. images where images and images . By the Hoeffding inequality (3.99), we have

(7.102) equation

Putting images , we obtain images for

(7.103) equation

Hence,

(7.104) equation

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 images , critical regions images are sets of approximately nonrandom sequences. In particular, if condition ( 7.100 ) is satisfied then the set of sequences images that are not contained in the intersection images of all critical regions has full measure images , whereas if condition ( 7.101 ) is satisfied then the set of sequences images that are contained in only finitely many critical regions images has also full measure images – 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. (1)Sequence images passes a Martin‐Löf test images for measure images if sequence images is not contained in the intersection images of all critical regions;
  2. (2)Sequence images passes a Solovay test images for measure images if sequence images is contained in only finitely many critical regions images .

For example, for the Solovay test ( 7.103 ) and the Bernoulli measure images , a sequence images passes the test if

(7.105) equation

for all but finitely many images . Since the set of such sequences images has full measure images , we may suppose that a proper subset of these sequences can be naturally called algorithmically random sequences with respect to images . 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 images .

In fact, passing any Martin‐Löf or Solovay test corresponds to a very natural property. The following Schnorr theorem states that a sequence images passes any imaginable Solovay or Martin‐Löf test for measure images if and only if the conditional Kolmogorov complexity of prefixes images is essentially larger than images . 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 images be a probability measure. The following conditions are equivalent:

  1. 1. Sequence images satisfies images .
  2. .
  3. 3. Sequence images passes any Martin‐Löf test images for probability measure images .
  4. 4.Sequence images satisfies images .


Proof:

We will demonstrate implications (1) images (4) images (3) images (2) images (1), which is sufficient to show the equivalence.

  • (1) images (4): Obviously, statistic images is bounded below if it tends to infinity. (In that case we have images for all images .)

  • (4) images (3): Suppose by contradiction that images for a certain Martin‐Löf test images . We will show that images satisfies images . We obtain

    (7.106) equation

    Since set function images is recursively enumerable, in view of Theorem 7.23 , we obtain

    (7.107) equation

    for any images and images . Since images , there exists a sequence of prefixes images such that images . This yields

    (7.108) equation

    for an arbitrary images .

  • (3) images (2): Suppose by contradiction that images is contained in infinitely many critical regions images for a certain Solovay test images . We will show that images for a certain Martin‐Löf test images . For images , the test images is constructed via

    (7.109) equation

    Then images belongs to all sets images . To show that images of this form is a Martin‐Löf test, we notice the following. We can choose some prefix‐free sets images generating the sets images in such a way that set function images is recursively enumerable. Moreover, we notice that

    (7.110) equation

    Hence, images and images is a Martin‐Löf test.

  • (2) images (1): Suppose by contradiction that images satisfies

    (7.111) equation

    We will show that images belongs to infinitely many critical regions images for a certain Solovay test images . We observe that if images then sequence images belongs to infinitely many sets images if we put

    (7.112) equation

    where images is a certain finite number. For this choice of images , set function images is recursively enumerable and sets images are prefix‐free. Thus, it remains to prove the second condition for the Solovay test. Denote

    (7.113) equation

    Then by the Markov inequality ( Theorem 3.11 ) and by the Kraft inequality for Kolmogorov complexity ( Theorem 7.24 ), we obtain

    (7.114) equation


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 images is 1‐random or algorithmically random in the Martin‐Löf sense with respect to a probability measure images when it satisfies conditions enumerated in Theorem 7.40 . The set of such sequences is denoted as images .


There are also stronger concepts of algorithmic randomness such as images ‐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 images .



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 “ images for images ‐almost all images ” to claims of form “ images for all images ,” where images is the set of 1‐random sequences for a relevant measure images . 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

  1. 7.1 Let images be a uniquely decodable code for natural numbers. Show that images for infinitely many images .

  2. 7.2 Show that there exists a uniquely decodable code images such that

    (7.115) equation

  3. 7.3 Consider the entropy images of a two‐point distribution defined in (5.111). Let images be a Bernoulli process. Show that

    (7.116) equation

    for certain constants images and images . What are the optimal images and images ?

  4. 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 images over a finite alphabet images . Denote the set of finite sequences of strings as images , i.e. for each images there exist a number images and strings images such that images . Let images and images be prefix‐free codes such that images , images , and images . Define codes

    (7.117) equation

    (7.118) equation

    Subsequently, for images and images we define mappings

    (7.119) equation

    (7.120) equation

    Now for images we define code

    (7.121) equation

    where images and images are chosen in such a way that the length of code word images is minimal given constraint

    (7.122) equation

    For these optimal images and images we will write images and images .

    1. Show that images is a prefix‐free code.

    2. Can we choose code images such that images is a universal semidistribution?

    3. Let images be the maximal repetition of string images . Show that

      (7.123) equation

    applying local minimization, see Kieffer and Yang ( 2000 ), Charikar et al. ( 2005 ), and Ochoa and Navarro ( 2019 ).

  5. 7.5 Show that all computable functions images are continuous.

  6. 7.6 Show that for natural numbers images and images we have

    (7.124) equation

  7. 7.7 Let images for a string images . Show that:

    1. images ;
    2. images .
  8. 7.8 For a natural number images define images . Show that images .

  9. 7.9 Consider strings images . Assume that images for a fixed number images . Show that images .

  10. 7.10 Having pair images we may effectively enumerate all programs of the smallest length that compute a discrete object images . Let images be the first such program in some fixed enumeration. Prove that:

    1. images ;
    2. images .
  11. 7.11 Show that images .

  12. 7.12 by the Kraft inequality. Show that

    (7.125) equation

  13. 7.13 Consider the Lebesgue measure over binary sequences, i.e. images where images . Show that sequence images is algorithmically random with respect to images if and only if images is algorithmically random for any images .

  14. 7.14 Let a probability measure images satisfy images , where images is a countable set of infinite sequences. Show that images .

  15. 7.15 Show that for a stationary process images over a finite alphabet and positive growing sequences images and images of natural numbers such that images , we have

    (7.126) equation

    where images is the Shannon entropy rate of the random ergodic measure of the process and object images is fixed. For images , images , and images , this result was shown by Brudno ( 1982 ).

  16. 7.16 Many theorems in probability can be stated as “ images holds for images ‐almost all images ,” where images is a random proposition and images is a probability measure. As we have discussed in Section 7.5 , there are related stronger statements “ images for all images ,” where images is the set of Martin‐Löf random points for measure images . Of course, we have images , which implies images for images ‐almost all images if images holds for all images . Does images for images ‐almost all images imply images for all images automatically if we assume some sort of generalized computability of random proposition images and measure images ? How general notions of computability can we consider?