You are on page 1of 5

Undecidability - 2

1. The Diagonalization Method

The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the
problem of measuring the sizes of infinite sets.

For finite sets, we can simply count the elements. But, it is not possible to count the number of elements
in an infinite set. Do infinite sets N= {0, 1, 2, ... } and Z= {1, 2, 3, ... } have the same size? N is larger
because it contains an extra element 0 and all other elements of Z. Cantor observed that two finite sets
have same size if elements of one set can be paired with the elements of the other set and this pairing can
also be extended to infinite set through a mapping/ correspondence/bijection function (one-to-one
(injection) and onto (surjection)) between them. One-to-one means a ≠ b implies f(a) ≠ f(b) and onto
means for every element ‘b’ in 2nd set, there is some ‘a’ in the first set such that f(a) = b. For example, the
map f(k) = 2k is a bijection between the integers and the even integers.

2. Countable Infinite Set

A set is said to be countable, if there exists a bijection between it and the set of naturals N = {0, 1, 2, 3, 4,
…}. It means that an infinite set that has the same size as N is countable. To show that any infinite set Z
is countable, establish a mapping with the set of natural numbers, N. We pair the 1 st element of Z with 1st
element of N, 2nd element of Z with 2nd element of N and result to an infinite pairing matrix. For
example, The pairing created between the elements of N = {0, 1, 2, ... } and Z= {1, 2, 3, ... } is shown in
the infinite pairing matrix in figure 1.

Figure 1: contents of Pairing Matrix between two infinite sets


Example 1:

The infinite sets N = {0, 1, 2, ... } and Z= {1, 2, 3, ... } have the same size because each element of Z can
be mapped to a unique element of N by using the bijection function f between Z and N: f(z) = z–1 as
shown in figure 2.

Figure 2: Two infinite sets are shown to be having equal size through pairing
To get the infinite pairing matrix for N to Z mapping, pairing is created with i th row containing all
numbers from N and jth column containing all numbers from Y and the i th row, jth column element is 1 if
the bijection is satisfied, else is 0. The infinite pairing matrix thus created is shown in Figure 3.

Figure 3: Pairing Matrix between the infinite sets, N= {0, 1, 2, ...} and Z= {1, 2, 3, ... }

Example 2: Refer to Sipser textbook example to show that the set of positive rational numbers is
countable.

Example 3: The set of all binary sequences of finite length is countable. Let ϵ denote the empty sequence
(the sequence with no terms). Then, the infinite sequence ϵ, 0, 1, 00, 01, 10, 11, 000, 001,...in which the
binary sequences of length 0 are listed, then the binary sequences of length 1 are listed in increasing
numeric order, then the binary sequences of length 2 are listed in increasing numeric order and so on,
contains every binary sequence of finite length exactly once. Hence the set is countable.

Exercise:

1) Prove that the set of all integers that are multiples of 5 is countable.

3. Uncountable infinite set

Consider the diagonal of any pairing matrix d(f)=(f(0), f(1), f(2),...). For example, in figure 8, d(f) = (1, 1,
1, 1, …). A possible complement of the diagonal, dc(f) is (0, 0, 0, 0, …). It can be seen that dc(f) do not
match with any matrix row. If dc(f) is considered as a row of the Matrix, it disagrees in some columns
with the Bijection function, which contradicts the paring between the sets.

Such infinite sets, where no bijection with N exists is said to be uncountable. Uncountable infinite set
theory is very useful to prove that some languages are unrecognizable.

Set of real numbers is an example for an uncountable set. To prove that some infinite set is uncountable,
Cantor used the Diagonalization method.

Theorem: Set of real Numbers R is uncountable

Proof:

In order to show that R is uncountable, we show that no a bijection exists between N and R. For
example, consider the real numbers ϵ R in Figure 4.
N Real Number
1 0.23246…
2 0.30589…
3 0.21754…
4 0.05424…
5 0.99548…
. ….
. ….
Figure 4: an example of real numbers ϵ R

The proof is by contradiction. Assume that a bijection f exists between N and R. Then f must pair all the
members of N with all the members of R. But we will find an x in R that is not paired with any other
number in N, which will be a contradiction.

We find an x by constructing it. We choose each digit dj of x as:

 dj = 0 if digit j of jth Real number is greater than 0

 dj = 1 if digit j of jth Real number is equal to 0

From the above example, we get a unique x as 01000…, which is not equal to any real number in the set.
So there a pair which do have not a bisection, which contradicts the assumption. Hence, proved that the
set of real numbers is uncountable.

Exercise:

1) Prove that the set of all infinite binary sequences is uncountable.

4. Universal Turing Machine

A Universal Turing Machine U is a fixed Turing Machine which can simulate any Turing Machine M
including itself for the purpose of language recognition.

The Universal TM U has three tapes: the first tape contains the encoding of the TM M. The 2 nd tape
contains w = a1a2...ak ϵ {0, 1}* in the form 00010a1+110a2+11 ... 10ak+110000. Tape 2 simulates the tape
contents of M along with the tape head, keeps changing the tape contents as the simulation proceeds and
the tape head keeps moving left or right. Tape 3 keeps track of the state of the TM M during the
simulation. The organization of UTM is shown in figure 5.

Figure 5: Organization of UTM


TM U works in phases, simulating one transition of M at each step. First U searches the position of the
encoding of M (tape 1) that corresponds to the simulated state (tape 3) of M and the symbol in tape 2 at
the position of the tape head 2. Let the chosen sequence of encoding be 0 i+110j+110r+110s+110t+1, which
corresponds transition function rule δ(qi, aj) = (qr, as, Δt). During the simulation, state 0i+1 in tape 3 will be
changed to state 0r+1 and on tape 2, the tape symbol 0j+1 will be replaced to 0s+1. In addition the head of
tape 2 will be moved to the left so that the code of one symbol is passed, if t = 0 and to the right
otherwise.

When tape 1 does not contain any code for the simulated state qi, M has reached a final state to accept or
reject. TM M may not halt when the input string w is not in the language, U may also not halt, thus will
have the same behaviour as M on w.

For example, for a TM M = (Q, X, ∑, δ, q0, B, F) to validate a string w, the TM U takes the binary code as
<M, w> and U simulates M on w. U accepts <M, w> if and only if M accepts w.
The Universal language Lu is the set of binary strings that encode a pair <M, w> (by putting111 between
the code for M and w) where w ∈ L(M) so that Lu=L(M). Hence Lu is RE but, not recursive.

5. Diagonalization Language

Diagonalization as a proof technique is used to demonstrate that there are some languages that cannot be
recognized by a Turing Machine.

We define Ld, the diagonalization language, as follows:

1. Let w1, w2, w3, . . . be an enumeration of all binary strings.


2. Let M1, M2, M3, . . . be an enumeration of all Turing machines.
3. Let Ld = {wi | wi is not in L(Mi) }.

Ld consists of all strings of wi such that the TM M whose code is Mi, does not accept when given wi as
input.

We create a pairing matrix as shown in Figure 6 consists of each row corresponds to a TM M i and each
column wj corresponds to the input string. The (i, j) entry of the matrix is 1 (means “Yes”) is M i accepts
wj and 0 (means “No”), otherwise. In this matrix, the ith row is the characteristic vector for the language
L(Mi); the 1’s in the row indicates all the strings of the language accepted by M i.

Figure 6: Pairing Matrix of TMs and strings


The diagonal values of this matrix tell whether Mi accepts wi. To construct Ld (all w not in L(M)), we
complement the diagonal. In this example, the complement of the diagonal is <0, 1, 1, 1, …) meaning
that w1 is not in M1, w2, w3 and w4 are in M2, M3, M4 etc. It can be seen that the diagonal cannot be the
characteristic vector of any Turing Machine in any row. This trick of complementing the diagonal is
called diagonalization.

Theorem: Ld is not a Recursively Enumerable language.

Proof:

We have to prove that there is no Turing Machine to accept Ld.

o Suppose Ld = L(Mi) for some TM Mi.


o This gives rise to a contradiction. Consider what M i will do on an input string wi.
 If Mi accepts wi, then by definition wi cannot be in Ld.
 If Mi does not accepts wi, then by definition wi is in Ld.
o Since wi can neither be in Ld nor not be in Ld, we must conclude there is no Turing
machine that can define Ld.

Ld does not have any Turing Machine to accept it. Hence Ld is not recursively Enumerable.

You might also like