Computing A Glimpse of Randomness
Computing A Glimpse of Randomness
E-mails: {cristian,mjd,cshu004}@cs.auckland.ac.nz
Abstract
000000100000010000100000100001110111001100100111100010010011100.
1 Introduction
Any attempt to compute the uncomputable or to decide the undecidable is without doubt
challenging, but hardly new (see, for example, Marxen and Buntrock [24], Stewart [32],
Casti [10]). This paper describes a hybrid procedure (which combines Java program-
ming and mathematical proofs) for computing the exact values of the first 63 bits of a
concrete Chaitin Omega number, ΩU , the halting probability of the universal Chaitin
(self-delimiting Turing) machine U , see [15]. Note that any Omega number is not only
uncomputable, but random, making the computing task even more demanding.
Computing lower bounds for ΩU is not difficult: we just generate more and more
halting programs. Are the bits produced by such a procedure exact? Hardly. If the
first bit of the approximation happens to be 1, then sure, it is exact. However, if the
provisional bit given by an approximation is 0, then, due to possible overflows, nothing
prevents the first bit of ΩU to be either 0 or 1. This situation extends to other bits as
well. Only an initial run of 1’s may give exact values for some bits of ΩU .
The paper is structured as follows. Section 2 introduces the basic notation. Com-
putably enumerable (c.e.) reals, random reals and c.e. random reals are presented in
Section 3. Various theoretical difficulties preventing the exact computation of any bits
of an Omega number are discussed in Section 4. The register machine model of Chaitin
[15] is discussed in Section 5. In section 6 we summarize our computational results con-
cerning the halting programs of up to 84 bits long for U . They give a lower bound for
ΩU which is proved to provide the exact values of the first 63 digits of ΩU in Section 7.
Chaitin [13] has pointed out that the self-delimiting Turing machine constructed in
the preliminary version of this paper [9] is universal in the sense of Turing (i.e., it is
capable to simulate any self-delimiting Turing machine), but it is not universal in the
sense of algorithmic information theory because the “price” of simulation is not bounded
by an additive constant; hence, the halting probability is not an Omega number (but a
c.e. real with some properties close to randomness). The construction presented in this
paper is a self-delimiting Turing machine. Full details will appear in [26].
2 Notation
We will use notation that is standard in algorithmic information theory; we will assume
familiarity with Turing machine computations, computable and computably enumerable
(c.e.) sets (see, for example, Bridges [2], Odifreddi [25], Soare [28], Weihrauch [33]) and
elementary algorithmic information theory (see, for example, Calude [4]).
By N, Q we denote the set of nonnegative integers (natural numbers) and rationals,
respectively. Let Σ = {0, 1} denote the binary alphabet. Let Σ∗ be the set of (finite)
binary strings, and Σω the set of infinite binary sequences. The length of a string x is
denoted by |x|. A subset A of Σ∗ is prefix-free if whenever s and t are in A and s is a
prefix of t, then s = t.
For a sequence x = x0x1 · · · xn · · · ∈ Σω and an nonnegative integer n ≥ 1, x(n)
denotes the initial segment of length n of x and xi denotes the ith digit of x, i.e. x(n) =
x x ···x ∈ Σ∗ . Due to Kraft’s inequality, for every prefix-free set A ⊂ Σ∗ , ΩA =
P0 1 −|s|n−1
s∈A 2 lies in the interval [0, 1]. In fact ΩA is a probability: Pick, at random using
the Lebesgue measure on [0, 1], a real α in the unit interval and note that the probability
that some initial prefix of the binary expansion of α lies in the prefix-free set A is exactly
ΩA .
Following Solovay [29, 30] we say that C is a (Chaitin) (self-delimiting Turing) ma-
chine, shortly, a machine, if C is a Turing machine processing binary strings such that
its program set (domain) P ROGC = {x ∈ Σ∗ | C(x) halts} is a prefix-free set of strings.
Clearly, P ROGC is c.e.; conversely, every prefix-free c.e. set of strings is the domain
of some machine. The program-size complexity of the string x ∈ Σ∗ (relatively to C) is
HC (x) = min{|y| | y ∈ Σ∗ , C(y) = x}, where min ∅ = ∞. A major result of algorithmic
information theory is the following invariance relation: we can effectively construct a
machine U (called universal ) such that for every machine C, there is a constant c > 0
(depending upon U and C) such that for every x, y ∈ Σ∗ with C(x) = y, there exists
a string x0 ∈ Σ∗ with U (x0 ) = y (U simulates C) and |x0 | ≤ |x| + c (the overhead
for simulation is no larger than an additive constant). In complexity-theoretic terms,
HU (x) ≤ HC (x) + c. Note that P ROGU is c.e. but not computable.
If C is a machine, then ΩC = ΩP ROGC represents its halting probability. When
C = U is a universal machine, then its halting probability ΩU is called a Chaitin Ω
2
number, shortly, Ω number.
Theorem 1 Let α be a real in (0, 1]. The following conditions are equivalent:
(a) If for some k, n we have f (k, n) = 1 and f (k, n + 1) = 0 then there is an l < k
with f (l, n) = 0 and f (l, n + 1) = 1.
(b) We have: k ∈ Xα ⇐⇒ limn→∞ f (k, n) = 1.
3
until 2k changes have occurred (of course, there need not be so many changes, but in
this case there is no guarantee of the exactness of the value of the kth bit).
Chaitin [14] proved the following important result:
The converse of Theorem 2 is also true: it has been proved by Slaman [21] based
on work reported in Calude, Hertling, Khoussainov and Wang [11] (see also Calude and
Chaitin [8] and Calude [6]):
Theorem 4 Given the first n bits of ΩU one can decide whether U (x) halts or not on
an arbitrary program x of length at most n.
4
It is worth noting that even if we get, by some kind of miracle, the first 10,000 digits
of ΩU , the task of solving the problems whose answers are embodied in these bits is
computable but unrealistically difficult: the time it takes to find all halting programs of
length less than n from 0.Ω0 Ω2 . . . Ωn−1 grows faster than any computable function of n.
Computing some initial bits of an Omega number is even more difficult. According to
Theorem 3, c.e. random reals can be coded by universal machines through their halting
probabilities. How “good” or “bad” are these names? In [14] (see also [17, 18]), Chaitin
proved the following:
In fact one can give a bound on the number of bits of ΩU which ZF C can determine;
this bound can be explicitly formulated, but it is not computable. For example, in [17]
Chaitin described, in a dialect of Lisp, a universal machine U and a theory T , and
proved that U can determine the value of at most H(T ) + 15, 328 bits of ΩU ; H(T ) is
the program-size complexity of the theory T , an uncomputable number.
Fix a universal machine U and consider all statements of the form
for all n ≥ 0, k = 0, 1. How many theorems of the form (1) can ZF C prove? More
precisely, is there a bound on the set of non-negative integers n such that ZF C proves a
theorem of the form (1)? From Theorem 5 we deduce that ZF C can prove only finitely
many (true) statements of the form (1). This is Chaitin information-theoretic version of
Gödel’s incompleteness (see [17, 18]):
Again, a bound can be explicitly found, but not effectively computed. Of course, for
every c.e. random real α we can construct a universal machine U such that α = ΩU and
ZF C is able to determine finitely (but as many as we want) bits of ΩU .
A machine U for which P A3 can prove its universality and ZF C cannot determine
more than the initial block of 1 bits of the binary expansion of its halting probability, ΩU ,
will be called Solovay machine.4 To make things worse Calude [7] proved the following
result:
Theorem 7 Assume that ZF C is arithmetically sound. Then, every c.e. random real
is the halting probability of a Solovay machine.
1
Zermelo set theory with choice.
2
That is, any theorem of arithmetic proved by ZF C is true.
3
P A means Peano Arithmetic.
4
Clearly, U depends on ZF C.
5
For example, if α ∈ (3/4, 7/8) is c.e. and random, then in the worst case ZF C can
determine its first two bits (11), but no more. For α ∈ (0, 1/2) we obtained Solovay’s
Theorem [30]:
Theorem 8 Assume that ZF C is arithmetically sound. Then, every c.e. random real
α ∈ (0, 1/2) is the halting probability of a Solovay machine which cannot determine any
single bit of α. No c.e. random real α ∈ (1/2, 1) has the above property.
The conclusion is that the worst fears discussed in the first section proved to mate-
rialize: In general only the initial run of 1’s (if any) can be exactly computed.
Set the register R to be the label of the next instruction and go to the instruction
with label L2.
L: @ R (L: GOBACK R)
L: = R1 R2 L2 (L: EQ R1 R2 L2)
This is a conditional branch. The last 7 bits of register R1 are compared with the
last 7 bits of register R2. If they are equal, then the execution continues at the
instruction with label L2. If they are not equal, then execution continues with the
next instruction in sequential order. R2 may be replaced by a constant which can be
represented by a 7-bit ASCII code, i.e. a constant from 0 to 127.
6
L: # R1 R2 L2 (L: NEQ R1 R2 L2)
This is a conditional branch. The last 7 bits of register R1 are compared with the
last 7 bits of register R2. If they are not equal, then the execution continues at
the instruction with label L2. If they are equal, then execution continues with the
next instruction in sequential order. R2 may be replaced by a constant which can be
represented by a 7-bit ASCII code, i.e. a constant from 0 to 127.
L: ) R (L: RIGHT R)
Shift register R1 left 7 bits, add to it the rightmost 7 bits of register R2, and then
shift register R2 right 7 bits. The register R2 may be replaced by a constant from 0
to 127.
L: ! R (L: OUT R)
The character string in register R is written out. This instruction is usually used for
debugging.
L: / (L: DUMP)
Each register’s name and the character string that the register contains are written
out. This instruction is also used for debugging.
L: % (L: HALT)
Halt execution. This is the last instruction for each register machine program.
A register machine program consists of finite list of labeled instructions from the
above list, with the restriction that the halt instruction appears only once, as the last
instruction of the list. Because of the privileged position of the halt instruction, register
machine programs are Chaitin machines.
To be more precise, we present a context-free grammar G = (N, Σ, P, S) in Backus-
Naur form which generates the register machine programs.
7
(1) N is the finite set of nonterminal variables:
N = {S} ∪ IN ST ∪ T OKEN
(2) Σ, the alphabet of the register machine programs, is a finite set of terminals, disjoint
from N :
Σ = hAlphai ∪ hSpeciali ∪ hSpacei ∪ hConstanti
hAlphai = {a, b, c, . . ., z}
hSpeciali = {:, /, ?, ∧, @, =, #, ), (, &, !, ?, %}
hSpacei = {‘space’,‘tab’}
hConstanti = {d | 0 ≤ d ≤ 127}
S → hRMSIns i∗ h%Ins i
hLSi → : hSpacei∗
(L: HALT)
h%Ins i → hLabelihLSi%
(L: GOBACK R)
h@Ins i → hLabelihLSi@hSpacei∗ hRegisteri
8
(L: NEQ R 0/127 L2 or L: NEQ R R2 L2)
h#Ins i → hLabelihLSi#hSpacei∗ hRegisterihSpacei+ hConstantihSpacei+
hLabeli | hLabelihLSi#hSpacei∗ hRegisterihSpacei+
hRegisterihSpacei+ hLabeli
(L: RIGHT R)
h)Ins i → hLabelihLSi)hSpacei∗ hRegisteri
(L: OUT R)
h!Ins i → hLabelihLSi!hSpacei∗ hRegisteri
(L: DUMP)
h/Ins i → hLabelihLSi/
(4) S ∈ N is the start symbol for the set of register machine programs.
0:&a 41 1:^b 4 2:!c 3:?11 4:=a 127 8 5:&c ’n’ 6:(c ’e’ 7:@b 8:&c ’e’ 9:(c
’q’ 10:@b 11:%
To facilitate the understanding of the code we rewrite the instructions with additional
comments and spaces:
9
0:& a 41 // assign 41 to register a
1:^ b 4 // jump to a subroutine at line 4
2:! c // on return from the subroutine call c is written out
3:? 11 // go to the halting instruction
4:= a 127 8 // the right most 7 bits are compared with 127; if they
// are equal, then go to label 8
5:& c ’n’ // else, continue here and
6:( c ’e’ // store the character string ’ne’ in register c
7:@ b // go back to the instruction with label 2 stored in
// register b
8:& c ’e’ // store the character string ’eq’ in register c
9:( c ’q’
10:@ b
11:% // the halting instruction
We can further “compress” these canonical programs by (a) deleting all labels, spaces
and the colon symbol with the first non-data instruction having an implicit label 0, (b)
separating multiple operands by a single comma symbol, (c) replacing constants with
their ASCII numerical values. By (a) we forbid branching to any data instruction. If
branching is desired, then we can override its status, as a data instruction, by inserting
a non-data (e.g., DUMP) instruction before it. The compressed format of the above
program is
&a,41^b,4!c?11=a,127,7&c,110(,c,101@b&,c,101(,c,113@b%
Note that compressed programs are canonical programs because during the process of
“compression” everything remains the same except possible relabelings (of line numbers)
to separate the data from the program parts. For example, the following canonical
program "0:&a 0 1:?0 2:%" is compressed to "/&a,0?0%". Compressed programs use
an alphabet with 49 symbols (including the halting character).
For the remainder of this paper we will be focusing on compressed programs.
1. Start by generating all programs of 7 bits and test which of them stops. All strings
of length 7 which can be extended to programs are considered prefixes for possible
halting programs of length 14 or longer; they will be called simply prefixes. In
general, all strings of length n which can be extended to programs are prefixes
10
for possible halting programs of length n + 7 or longer. Compressed prefixes are
prefixes of compressed (canonical) programs.
2. Testing the Halting Problem for programs of length n ∈ {7, 14, 21, . . . , 84} was
done by running all candidates (that is, programs of length n which are exten-
sions of prefixes of length n − 7) for up to 100 instructions, and proving that
any generated program which does not halt after running 100 instructions never
halts. For example, (uncompressed) programs that match the regular expression
"0:\^ a 5.* 5:\? 0" never halt.
One would naturally want to know the shortest program that halts with more than
100 steps. If this program is larger than 84 bits, then all of our looping programs never
halt. The trivial program with a sequence of 100 dump instructions runs for 101 steps
but can we do better? The answer is yes. The following family of programs {P1 , P2 , . . .}
recursively count to 2i but have linear growth in size. The programs P1 through P4 are
given below:
/&a,0=a,1,5&a,1?2%
/&a,0&b,0=b,1,6&b,1?3=a,1,9&a,1?2%
/&a,0&b,0&c,0=c,1,7&c,1?4=b,1,10&b,1?3=a,1,13&a,1?2%
/&a,0&b,0&c,0&d,0=d,1,8&d,1?5=c,1,11&c,1?4=b,1,14&b,1?3=a,1,17&a,1?2%
&a,0/&b,0/////////////////////=b,1,26&b,1?2=a,1,29&a,1?0%
This program of 57 bytes (399 bits) runs for 102 steps. Note that the problem of
finding the smallest program with the above property is undecidable (see [18]).
The distribution of compressed programs of up to 84 bits for U , the universal machine
processing compresed programs, is presented in Table 1. All binary strings representing
programs have the length divisible by 7.
11
Program Number of Number of Number of programs
length halting programs looping programs with run-time errors
7 1 0 0
14 1 0 0
21 4 1 1
28 8 3 2
35 57 19 17
42 323 68 50
49 1187 425 407
56 5452 2245 2176
63 23225 13119 12559
70 122331 72821 68450
77 624657 415109 389287
84 3227131 2405533 2276776
Table 1.
So, to be able to compute the exact values of the first N bits of ΩU we need to be able
to prove that longer programs do not affect the first N bits of ΩU . And, fortunately, this
is the case for our computation. Due to our specific procedure for solving the Halting
Problem discussed in Section 6, any compressed halting program of length n has as
compressed prefix of length n − 7. This gives an upper bound for the number of possible
compressed halting programs of length n. For example, there are 402906842 compressed
prefixes of length 84, so the number of compressed halting programs of length 98 is less
than 402906842 × 47 = 18936621574.
The number 47 comes from the fact that the alphabet has 48 characters and a halting
program has a unique halting instruction, the last one.
Let ΩnU be the approximation of ΩU given by the summation of all halting programs
of up to n bits in length. Accordingly, the “tail” contribution to the value of
∞
X X
ΩU = 2−|x|
n=0 {|x|=n, U (x) halts}
12
is bounded from above by the series
∞
X
#{x | x prefix, |x| = k} · 47n−k · 128−n .
n=k
Ω7U = 0.0000001
Ω14
U = 0.00000010000001
Ω21
U = 0.000000100000010000100
Ω28
U = 0.0000001000000100001000001000
Ω35
U = 0.00000010000001000010000010000111001
Ω42
U = 0.000000100000010000100000100001110111000011
49
ΩU = 0.0000001000000100001000001000011101110011000100011
Ω56
U = 0.00000010000001000010000010000111011100110010011011001100
Ω63
U = 0.000000100000010000100000100001110111001100100111100000010111001
70
ΩU = 0.000000100000010000100000100001110111001100100111100010010011010110101
10010
77
ΩU = 0.000000100000010000100000100001110111001100100111100010010011010110101
10010001
84
ΩU = 0.000000100000010000100000100001110111001100100111100010010011100011000
000011001111011
Ω84
U = 0.000000100000010000100000100001110111001100100111100010010011100011000
000011001111011
000000100000010000100000100001110111001100100111100010010011100
13
8 Conclusions
The computation described in this paper is the first attempt to compute some initial
exacts bits of a random real. The method, which combines programming with mathe-
matical proofs, can be improved in many respects. However, due to the impossibility of
testing that long looping programs never actually halt (the undecidability of the Halting
Problem), the method is essentially non-scalable.
As we have already mentioned, solving the halting problem for programs of up to n
bits might not be enough to compute exactly the first n bits of the halting probability.
In our case, we have solved the halting problem for programs of at most 84 bits, but we
have obtained only 63 exact initial bits of the halting probability.
The web site ftp://ftp.cs.auckland.ac.nz/pub/CDMTCS/Omega/ contains all pro-
grams used for the computation as well as all intermediate and final data files (3 giga-
bytes in gzip format).
Acknowledgement
We thank Greg Chaitin for pointing out an error in our previous attempt to compute
the first bits of an Omega number [9], for advice and encouragement.
References
[1] C. H. Bennett, M. Gardner. The random number omega bids fair to hold the mys-
teries of the universe, Scientific American 241 (1979) 20–34.
[6] C. S. Calude. A characterization of c.e. random reals, Theoret. Comput. Sci., 217
(2002), 3-14.
14
[8] C. S. Calude, G. J. Chaitin. Randomness everywhere, Nature, 400 22 July (1999),
319–320.
[9] C. S. Calude, M. J. Dinneen, C. Shu. Computing 80 Initial Bits of A Chaitin Omega
Number: Preliminary Version, CDMTCS Research Report 146, 2000, 12 pp.
[10] J. L. Casti. Computing the uncomputable, The New Scientist, 154/2082, 17 May
(1997), 34.
[11] C. S. Calude, P. Hertling, B. Khoussainov, and Y. Wang. Recursively enumerable
reals and Chaitin Ω numbers, in: M. Morvan, C. Meinel, D. Krob (eds.), Proceed-
ings of the 15th Symposium on Theoretical Aspects of Computer Science (Paris),
Springer–Verlag, Berlin, 1998, 596–606. Full paper in Theoret. Comput. Sci. 255
(2001), 125-149.
[12] C. Calude, H. Jürgensen. Randomness as an invariant for number representations,
in H. Maurer, J. Karhumäki, G. Rozenberg (eds.). Results and Trends in Theoretical
Computer Science, Springer-Verlag, Berlin, 1994, 44-66.
[13] G. J. Chaitin. Personal communication to C. S. Calude, November 2000.
[14] G. J. Chaitin. A theory of program size formally identical to information theory, J.
Assoc. Comput. Mach. 22 (1975), 329–340. (Reprinted in: [16], 113–128)
[15] G. J. Chaitin. Algorithmic Information Theory, Cambridge University Press, Cam-
bridge, 1987. (third printing 1990)
[16] G. J. Chaitin. Information, Randomness and Incompleteness, Papers on Algorithmic
Information Theory, World Scientific, Singapore, 1987. (2nd ed., 1990)
[17] G. J. Chaitin. The Limits of Mathematics, Springer-Verlag, Singapore, 1997.
[18] G. J. Chaitin. The Unknowable, Springer-Verlag, Singapore, 1999.
[19] G. J. Chaitin. Exploring Randomness, Springer-Verlag, London, 2000.
[20] P. Hertling, K. Weihrauch. Randomness spaces, in K. G. Larsen, S. Skyum, and
G. Winskel (eds.). Automata, Languages and Programming, Proceedings of the 25th
International Colloquium, ICALP’98 (Aalborg, Denmark), Springer-Verlag, Berlin,
1998, 796–807.
[21] A. Kučera, T. A. Slaman. Randomness and recursive enumerability, SIAM J. Com-
put., 31, 1 (2001), 199-211.
[22] P. Martin-Löf. Algorithms and Random Sequences, Erlangen University, Nürnberg,
Erlangen, 1966.
[23] P. Martin-Löf. The definition of random sequences, Inform. and Control 9 (1966),
602–619.
[24] H. Marxen, J. Buntrock. Attaching the busy beaver 5, Bull EATCS 40 (1990), 247–
251.
15
[25] P. Odifreddi. Classical Recursion Theory, North-Holland, Amsterdam, Vol.1, 1989,
Vol. 2, 1999.
[26] C. Shu. Computing Exact Approximations of a Chaitin Omega Number, Ph.D. The-
sis, University of Auckland, New Zealand (in preparation).
[27] R. I. Soare. Recursion theory and Dedekind cuts, Trans. Amer. Math. Soc. 140
(1969), 271–294.
[28] R. I. Soare. Recursively Enumerable Sets and Degrees, Springer-Verlag, Berlin, 1987.
[29] R. M. Solovay. Draft of a paper (or series of papers) on Chaitin’s work . . . done for
the most part during the period of Sept.–Dec. 1974, unpublished manuscript, IBM
Thomas J. Watson Research Center, Yorktown Heights, New York, May 1975, 215
pp.
[30] R. M. Solovay. A version of Ω for which ZF C can not predict a single bit, in
C.S. Calude, G. Păun (eds.). Finite Versus Infinite. Contributions to an Eternal
Dilemma, Springer-Verlag, London, 2000, 323-334.
[31] L. Staiger. The Kolmogorov complexity of real numbers, in G. Ciobanu and Gh.
Păun (eds.). Proc. Fundamentals of Computation Theory, Lecture Notes in Comput.
Sci. No. 1684, Springer–Verlag, Berlin, 1999, 536-546.
16