PREPARED FOR:

Dr. Gede Pramudya Ananta
PREPARED BY:
THAMER J.ABBAS
SAIF MOHAMMED MAKKI
SAIF ZUHAIR ABDULMAJEED

M031020009
M031020010
M031110012
Turing machines
a device with a finite amount of read-only “hard” memory
(states), and an unbounded amount of read/write tape-memory
 The output depends only on input
and the previous output

Black box reads a
sequence of 0’s and
1’s

 The main thing is ????
That the changes from one output state to
the next
 Given by definite rules, called the
TRANSITION rules
Reducibility
Definition
 Primary method for Proving
computationally unsolvable.

that problems are

Reducibility also occurs in mathematical problems .

A Reduction : is a way of converting one problem
to another problem in such a way that a solution to the
second problem can be used to solve the first problem.
Such reducibilities come up often in everyday life, even
if we don't usually refer to them in this.
EXAMPLE: use problem B to
solve problem A
A
CAN'T TAKE IT DIRECT.. XX

B
DECIDABLE
Recall that:
A language
machine

A

and

M

A

is decidable, if there is a Turing
(decider) that accepts the language

halts on every input string.

Turing Machine
Input
string

Decider for

M
A

Decision
On Halt:
YES

Accept

NO

Reject
UNDECIDABLE
• Undecidable
problems
have
no
algorithm, regardless of whether or not
they are accepted by a TM that fails to
halt on some inputs
• Undecidability: undecidable languages
that cannot be decided by any Turing
Machine
Example for: Decidable And Undecidable

x=2
y=1

z =5
Assume, we have a program which assigns all possible
combination of 3 integers to variables x, y and z. For the
first case there is at least one solution (x = 2, y = 1, z
=5). Thus, the program will eventually stops. But for the
second case we don’t know if this system has a solution.
If there is no solution for the second system, then the
program never stops.
Examples: Halting Problem
halts(“2+2”) True
halts(“def f(n):

if n==0: return 1
else: return n * f(n-1)
f(5)”) True

halts(“def f(n):

if n==0: return 1
else: return n * f(n-1)
f(5.5)”) false
2+
X
10

2+
Y

2
Z

11

12

365
6

=

13

=
8

7

149

2+
A

14

365
10

9

≠

2
B

182
Post’s Correspondence Problems (PCP)
Definition
An instance of PCP consists of two lists of strings
over some alphabet S.
The two lists are of equal length, denoted as A and
B.

The instance is denoted as (A, B).
We write them as
A = w1, w2, …, wk

B = x1, x2, …, xk

for some integer k.

For each i, the pair (wi, xi) is said a corresponding
pair.
PCP Instances
An instance of PCP is a list of pairs of

nonempty strings over some alphabet Σ
Say (w1, x1), (w2, x2), …, (wn, xn).

The answer to this instance of PCP is
“yes” if and only if there exists a

nonempty sequence of indices
i1,…,ik, such that wi1…win = xi1…xin.
Post’s Correspondence Problem

 (PCP) is an example of a problem

that does not mention TM’s in its
statement, yet is undecidable.

 From

PCP, we can prove many
other non-TM problems undecidable.
Example: PCP
• Let the alphabet be {0, 1}.
• Let the PCP instance consist of the two
pairs (0, 01) and (100, 001).

• We claim there is no solution.
• You can’t start with (100, 001), because the
first characters don’t match.
Example: PCP
Recall: pairs are (0, 01) and (100, 001)

0 100 100
01 001 001

Must start
with first
pair

Can add the
second pair
for a match

But we can never make
the first string as long
as the second.
As many
times as
we like
Example: PCP – (3)
 Suppose

we add a third
pair, so the instance becomes:
1 = (0, 01); 2 = (100, 001); 3
= (110, 10).
Now 1,3 is a solution; both
strings are 0110.
In fact, any sequence of
indexes in 12*3 is a solution.
A Simple Undecidable Problem
We say this instance of PCP has a

solution, if there is a sequence of
integers, i1, i2, …, im, that, when
interpreted as indexes for strings in the A
and B lists, yields the same string, that
is, wi1wi2…wim = xi1xi2…xim.
We say the sequence is a solution to this
instance of PCP.
A Simple Undecidable Problem
The Post’s corresponding problem is:
given an instance of PCP, tell whether this

instance has a solution.
The solution to an instance of PCP
sometimes is not unique.
Also, an instance of PCP might have no
solution.
Post’s (Domino) Correspondence
Problem
PCP as a game
Usually dominoes is played as follows:

18
Post’s (Domino) Correspondence
Problem
Usually dominoes is played as follows:
•
•
•

19
Post’s (Domino) Correspondence
Problem
Usually dominoes is played as follows:
•
•

•
•

•
•
•

•
•

20
Post’s (Domino) Correspondence
Problem
Usually dominoes is played as follows:
•
•

•
•

•
•

•
•

•
•
•

•
•

•
•
•
21
Post’s (Domino) Correspondence
Problem
Usually dominoes is played as follows:
•
•

•
•

•
•

•

•
•

•

•
•

•
•

•
•

•

•

•
•
•
•

22
Post’s (Domino) Correspondence
Problem
Usually dominoes is played as follows:
•
•

•
•

•
•

•

•
•

•

•
•
•

•

•
•

•

•
•

•

•
•

•

•
•

•

23
Post’s (Domino) Correspondence
Problem
We’ll play horizontally instead of vertically.
Furthermore, dominoes will not be allowed to
be flipped so each half will be a different color:

•
•

•

24
Post’s (Domino) Correspondence
Problem
Aim of the game is to have same total
number of dots on the top as on the
bottom. Player is given a set of domino
prototypes to choose from, and can
choose as many of a given prototype as
necessary.
Let’s play with the following 2 prototypes:
•
•
•

• •
• •
• •
•
25
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
•
•
•

• •
• •
• •
•

Total
Total
26
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
•
•
•

•

•
•

• •
• •
• •
•

Total
1
Total
2
27
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
•
•
•

•

•

•

•
•

•

• •
• •
• •
•

Total
2
Total
4
28
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
•
•
•

•

•

•

•
•

•

• •
• •
• •
•

• •
• •
• •
•

Total
8
Total
5
29
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
•
•
•

•

•

•

•
•

•

• •
• •
• •
•

•

•
•

• •
• •
• •
•

Total
9
Total
7
30
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
• •
• •
• •

•
•

•

•

•

•

•

•
•

•

• •
• •
• •
•

•

•

•

•
•

•

Total
10
Total
9
31
Post’s (Domino) Correspondence
Problem
Let’s play with the following 2 prototypes:
• •
• •
• •

•
•

•

•

•

•

•

•
•

•

• •
• •
• •
•

•

•

•

•
•

WINNER!

•

•
•

•

Total
11
Total
11
32
Post’s (Domino) Correspondence
Problem
Could have represented dominos using unary
strings:

•

•
•

• •
• •
• •

1

111111

•

11

1

Point of game is to get the same string to be
written on top as bottom.
33
Post’s (Domino) Correspondence
Problem

In general, could use arbitrary strings. EG:
a

c

ba

acb

ac

ba

a

b

Aim: Get the same string on top as bottom.
PCP: Given an alphabet S and finite set of string
pairs (u1,v1), (u2,v2), … , (un,vn) with ui ,vi S*, can
a non-empty sequence of indices i1, i2, i3, … , it be
chosen so that
ui1ui2ui3…uit =
vi1vi2vi3…vit
?
34
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

ba

, 3:

ba

a

, 4:

acb

b

Total

Total
Indices
35
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

ba

, 3:

ba

a

, 4:

acb

b

Total
a

a

ac

Total
ac
Indices
1
36
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

, 3:

ba

ba

a

, 4:

acb

b

Total
ac

a

ac

c

ba

Total
acba
Indices
12
37
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

, 3:

ba

a

ac

ba

, 4:

a

c

ba

acb

b

ba

a

Total
acba
Total
acbaa
Indices
123
38
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

, 3:

ba

a

ac

ba

, 4:

a

c

ba

acb

b

ba

a

a

ac

Total
acbaa
Total
acbaaac
Indices
1231
39
Post’s (Domino) Correspondence
Problem

Let’s play with the following 4 prototypes:

1:

a

ac

, 2:

c

, 3:

ba

a

ac

ba

, 4:

a

c

ba

acb

b

ba

a

a

ac

Answer: YES! (solution is 12314)

acb

b

Total
acbaaacb
Total
acbaaacb
Indices
12314
40
PCP is undecidable
We can try all lists i1, i2, … , ik in

order of k. if we find a solution,
the answer is “yes”
But if we never find a solution,
how can we be sure no longer
solution exists?
So, we can never say no
A Simple Undecidable Problem
• Example 1

Two lists of an instance of PCP are shown
• A solution is 2, 1, 1, 3 (strings may be
repeated)
because
List A
List B
w2, w1, w1, w3
= 101111 110
i
wi
xi
= 10111 1110
1
1
111
= x2, x1, x1, x3
• Another solution is
2
10111
10
2, 1, 1, 3, 2, 1, 1, 3
3
10
0
There is much
more I haven’t
told you about It

Theory of computation / Post’s Correspondence Problems (PCP)

  • 1.
    PREPARED FOR: Dr. GedePramudya Ananta PREPARED BY: THAMER J.ABBAS SAIF MOHAMMED MAKKI SAIF ZUHAIR ABDULMAJEED M031020009 M031020010 M031110012
  • 2.
    Turing machines a devicewith a finite amount of read-only “hard” memory (states), and an unbounded amount of read/write tape-memory  The output depends only on input and the previous output Black box reads a sequence of 0’s and 1’s  The main thing is ???? That the changes from one output state to the next  Given by definite rules, called the TRANSITION rules
  • 3.
    Reducibility Definition  Primary methodfor Proving computationally unsolvable. that problems are Reducibility also occurs in mathematical problems . A Reduction : is a way of converting one problem to another problem in such a way that a solution to the second problem can be used to solve the first problem. Such reducibilities come up often in everyday life, even if we don't usually refer to them in this.
  • 4.
    EXAMPLE: use problemB to solve problem A A CAN'T TAKE IT DIRECT.. XX B
  • 5.
    DECIDABLE Recall that: A language machine A and M A isdecidable, if there is a Turing (decider) that accepts the language halts on every input string. Turing Machine Input string Decider for M A Decision On Halt: YES Accept NO Reject
  • 6.
    UNDECIDABLE • Undecidable problems have no algorithm, regardlessof whether or not they are accepted by a TM that fails to halt on some inputs • Undecidability: undecidable languages that cannot be decided by any Turing Machine
  • 7.
    Example for: DecidableAnd Undecidable x=2 y=1 z =5 Assume, we have a program which assigns all possible combination of 3 integers to variables x, y and z. For the first case there is at least one solution (x = 2, y = 1, z =5). Thus, the program will eventually stops. But for the second case we don’t know if this system has a solution. If there is no solution for the second system, then the program never stops.
  • 8.
    Examples: Halting Problem halts(“2+2”)True halts(“def f(n): if n==0: return 1 else: return n * f(n-1) f(5)”) True halts(“def f(n): if n==0: return 1 else: return n * f(n-1) f(5.5)”) false
  • 9.
  • 10.
    Post’s Correspondence Problems(PCP) Definition An instance of PCP consists of two lists of strings over some alphabet S. The two lists are of equal length, denoted as A and B. The instance is denoted as (A, B). We write them as A = w1, w2, …, wk B = x1, x2, …, xk for some integer k. For each i, the pair (wi, xi) is said a corresponding pair.
  • 11.
    PCP Instances An instanceof PCP is a list of pairs of nonempty strings over some alphabet Σ Say (w1, x1), (w2, x2), …, (wn, xn). The answer to this instance of PCP is “yes” if and only if there exists a nonempty sequence of indices i1,…,ik, such that wi1…win = xi1…xin.
  • 12.
    Post’s Correspondence Problem (PCP) is an example of a problem that does not mention TM’s in its statement, yet is undecidable.  From PCP, we can prove many other non-TM problems undecidable.
  • 13.
    Example: PCP • Letthe alphabet be {0, 1}. • Let the PCP instance consist of the two pairs (0, 01) and (100, 001). • We claim there is no solution. • You can’t start with (100, 001), because the first characters don’t match.
  • 14.
    Example: PCP Recall: pairsare (0, 01) and (100, 001) 0 100 100 01 001 001 Must start with first pair Can add the second pair for a match But we can never make the first string as long as the second. As many times as we like
  • 15.
    Example: PCP –(3)  Suppose we add a third pair, so the instance becomes: 1 = (0, 01); 2 = (100, 001); 3 = (110, 10). Now 1,3 is a solution; both strings are 0110. In fact, any sequence of indexes in 12*3 is a solution.
  • 16.
    A Simple UndecidableProblem We say this instance of PCP has a solution, if there is a sequence of integers, i1, i2, …, im, that, when interpreted as indexes for strings in the A and B lists, yields the same string, that is, wi1wi2…wim = xi1xi2…xim. We say the sequence is a solution to this instance of PCP.
  • 17.
    A Simple UndecidableProblem The Post’s corresponding problem is: given an instance of PCP, tell whether this instance has a solution. The solution to an instance of PCP sometimes is not unique. Also, an instance of PCP might have no solution.
  • 18.
    Post’s (Domino) Correspondence Problem PCPas a game Usually dominoes is played as follows: 18
  • 19.
    Post’s (Domino) Correspondence Problem Usuallydominoes is played as follows: • • • 19
  • 20.
    Post’s (Domino) Correspondence Problem Usuallydominoes is played as follows: • • • • • • • • • 20
  • 21.
    Post’s (Domino) Correspondence Problem Usuallydominoes is played as follows: • • • • • • • • • • • • • • • • 21
  • 22.
    Post’s (Domino) Correspondence Problem Usuallydominoes is played as follows: • • • • • • • • • • • • • • • • • • • • • • 22
  • 23.
    Post’s (Domino) Correspondence Problem Usuallydominoes is played as follows: • • • • • • • • • • • • • • • • • • • • • • • • • • 23
  • 24.
    Post’s (Domino) Correspondence Problem We’llplay horizontally instead of vertically. Furthermore, dominoes will not be allowed to be flipped so each half will be a different color: • • • 24
  • 25.
    Post’s (Domino) Correspondence Problem Aimof the game is to have same total number of dots on the top as on the bottom. Player is given a set of domino prototypes to choose from, and can choose as many of a given prototype as necessary. Let’s play with the following 2 prototypes: • • • • • • • • • • 25
  • 26.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • Total Total 26
  • 27.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • Total 1 Total 2 27
  • 28.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • • • • Total 2 Total 4 28
  • 29.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • • • • • • • • • • • Total 8 Total 5 29
  • 30.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • • • • • • • • • • • • • • Total 9 Total 7 30
  • 31.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • Total 10 Total 9 31
  • 32.
    Post’s (Domino) Correspondence Problem Let’splay with the following 2 prototypes: • • • • • • • • • • • • • • • • • • • • • • • • • • • • WINNER! • • • • Total 11 Total 11 32
  • 33.
    Post’s (Domino) Correspondence Problem Couldhave represented dominos using unary strings: • • • • • • • • • 1 111111 • 11 1 Point of game is to get the same string to be written on top as bottom. 33
  • 34.
    Post’s (Domino) Correspondence Problem Ingeneral, could use arbitrary strings. EG: a c ba acb ac ba a b Aim: Get the same string on top as bottom. PCP: Given an alphabet S and finite set of string pairs (u1,v1), (u2,v2), … , (un,vn) with ui ,vi S*, can a non-empty sequence of indices i1, i2, i3, … , it be chosen so that ui1ui2ui3…uit = vi1vi2vi3…vit ? 34
  • 35.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c ba , 3: ba a , 4: acb b Total Total Indices 35
  • 36.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c ba , 3: ba a , 4: acb b Total a a ac Total ac Indices 1 36
  • 37.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c , 3: ba ba a , 4: acb b Total ac a ac c ba Total acba Indices 12 37
  • 38.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c , 3: ba a ac ba , 4: a c ba acb b ba a Total acba Total acbaa Indices 123 38
  • 39.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c , 3: ba a ac ba , 4: a c ba acb b ba a a ac Total acbaa Total acbaaac Indices 1231 39
  • 40.
    Post’s (Domino) Correspondence Problem Let’splay with the following 4 prototypes: 1: a ac , 2: c , 3: ba a ac ba , 4: a c ba acb b ba a a ac Answer: YES! (solution is 12314) acb b Total acbaaacb Total acbaaacb Indices 12314 40
  • 41.
    PCP is undecidable Wecan try all lists i1, i2, … , ik in order of k. if we find a solution, the answer is “yes” But if we never find a solution, how can we be sure no longer solution exists? So, we can never say no
  • 42.
    A Simple UndecidableProblem • Example 1 Two lists of an instance of PCP are shown • A solution is 2, 1, 1, 3 (strings may be repeated) because List A List B w2, w1, w1, w3 = 101111 110 i wi xi = 10111 1110 1 1 111 = x2, x1, x1, x3 • Another solution is 2 10111 10 2, 1, 1, 3, 2, 1, 1, 3 3 10 0
  • 43.
    There is much moreI haven’t told you about It