Module 7
Module 7
5
Post Correspondence Problem
(PCP)
• Devised by Emli Post
• An abstract problem that involves string rather than
TMs.
• Tool for proving problems in logic or in formal
language theory to be undecidable.
Definition
Example 1
Solution
Decidable – able
to find the
solution
Example: 2
List A List B
a ble
–
1) 1 111 d ab ele
c i
2) 10111 10 De nd th
fi
to t ion
u
3) 10 0 sol
(3) w 101111110
(2) w 10111 x 101111110
x 10
w=x
(1) w 101111
solution: 2 1 1 3
x 10111
(1) w 1011111 2113211321132113
x 10111111
Example: 3
List A List B
a ble
1) bbab a le –
id ab e
c
2) ab abbb De nd th
fi
to t ion
u
3) baa aa sol
4) b bbb
(3) w abbbabbbaa
(2) w ab x abbbabbbaa
x abbb
(1) w abbbab w=x
x abbba solution: 2 1 4 3
(4) w abbbabb 214321432143
x abbbabbb
Example: 4
List A List B ot
n
1) 10 101 b le–
id a t he
2) 011 11 ndec find
U e to
abl tion
3) 101 011 sol
u
(1) w bbaab
x bbaaba This problem has no solution.
(1) w bbaabaab
x bbaabaaba
Computable Functions
A recursive function is defined in terms of itself.
1. The recursive definition of factorial is
n! = n * (n-1)! for n ≥1
2. The recursive definition of the exponential xn is defined as
xn = x * xn-1 for n ≥1
• A recursive function can be generalized by defining it in
addition to in terms of itself, possibly in terms of some other
functions.
• Such generalization defines primitive recursion.
• Turing machine is viewed as a mathematical model of partial
recursive function.
Some basic properties:
f : A → B A = N , B = N , N is a set of natural
numbers
1. Total function
A total function from A to B assigns a unique
element of B to every element of A.
f(x) = 2x is a total function.
2. Partial function
A partial function from A to B assigns at most one
element of B to every element of A.
f(x) = + is a partial function.
f(x) is not defined if x is a negative real number.
3. Function of k-variables
A function of k-variables is represented as f(x1, x2, . . . ,
xk).
f(x1, x2) = x1+2x2 is a function of two variables.
4. Primitive recursive function
Some initial functions are taken as primitive recursive
functions. These initial functions are:
a) Zero function
b) Successor function
c) Projection function
A function derived from combination / composition of
primitive recursive functions is primitive recursive.
The zero function z is defined by z(x) = 0
fact(0) = 1
fact(x+1) = (x+1)*fact(x)
= S(x)*fact(x)
= g(x, fact(x))
= S( = (x + 1) * fact(x)
n=5
fact(5) = fact(4+1) = 5 * fact(4) = 5 * fact(3 + 1) = 5 * 4 * fact(3) =5 * 4 *
fact(2 + 1)
= 5 * 4 * 3 * fact(2) = 5 * 4 * 3 * fact(1 + 1) = 5 * 4 * 3
* 2 * fact(1)
= 5 * 4 * 3 * 2 * fact ( 1 + 0) = 5 * 4 * 3 * 2 * 1* fact(0)
= 5 * 4 * 3 * 2 * 1 * 1 = 120