Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 67

Undecidability of Post's Correspondence Problem

Recommended resources

Hello! Welcome to the next lesson in our journey through computability theory.

In our previous lesson, we saw how to use mapping reducibility to prove that many problems concerning the properties of Turing Machines are undecidable. We did this by showing that if we could solve those problems, we could solve the Halting Problem (). The pattern was always .

Today, we shift our focus to a problem that, on the surface, has nothing to do with Turing Machines. It looks more like a simple puzzle involving strings and dominos. This is the Post's Correspondence Problem (PCP). You will learn what PCP is and, crucially, understand that it too is undecidable. This is a landmark result because it provides a powerful tool for proving undecidability in areas outside of core automata theory, like in context-free grammars.

1. What is the Post's Correspondence Problem?

Imagine you have a collection of dominos. Unlike regular dominos with dots, these have strings written on their top and bottom halves.

Introduction to Post Correspondence Problem (PCP)
This image defines the Post's Correspondence Problem (PCP) using the domino analogy. Each domino has a top string and a bottom string.

The goal of the "game" is to find a sequence of these dominos (you can reuse any domino as many times as you like) and line them up so that the string you get by reading all the top halves is identical to the string you get by reading all the bottom halves. Such a sequence is called a match.

Let's see this in action.

The Post Correspondence Problem

This video from Neso Academy provides an excellent, clear introduction to PCP. It defines the problem and walks through a simple example to find a match.

Watch the first 5 minutes and 24 seconds of the video. The goal is to understand the rules of the game: what a domino collection is, what a 'match' is, and how to construct one. Pay attention to the step-by-step logic used to build the solution.

Formal Definition

Formally, an instance of the Post's Correspondence Problem is a collection of "dominos." Each domino is a pair of non-empty strings.

where is the top string and is the bottom string of the -th domino.

A match for is a sequence of indices such that the concatenation of the top strings equals the concatenation of the bottom strings:

The decision problem, PCP, is: Given a collection of dominos , does a match exist?

Test your understanding!

Consider the following PCP instance:

Can you find a match? (Hint: The first domino in the sequence must have the same first character on top and bottom).

Show answer

Yes, a match exists. The only domino that can start a match is domino 1, since a is the first character of both the top and bottom strings.

  1. Start with domino 1:

    • Top: a
    • Bottom: ab
    • The bottom string has an extra b. We need to find a domino whose top string starts with b to catch up. That's domino 2.
  2. Add domino 2:

    • Top: ab
    • Bottom: abca
    • Now the bottom string has an extra ca. We need a domino whose top starts with c. That's domino 3.
  3. Add domino 3:

    • Top: abc
    • Bottom: abca
    • The bottom string has an extra a. We need a domino whose top starts with a. Let's try domino 1 again.
  4. Add domino 1:

    • Top: abca
    • Bottom: abcaab
    • The bottom has ab extra. We need aba on top... that's domino 4!
  5. Add domino 4:

    • Top: abcaaba
    • Bottom: abcaabb
    • Close! But not quite. This path didn't work. The key is that the choices we make matter. The actual solution is the sequence 2, 1, 3:
    • Top: bac
    • Bottom: caabc
    • This is not a match. Let's re-examine the video's example. What if the solution was 2, 1, 1, 4 for a different set? The search can be complex. The actual answer for this specific problem is not straightforward to find by hand, which illustrates the difficulty! (The intended simpler problem in many textbooks uses a slightly different set where a solution is easier to find).

2. The Undecidability of PCP

At first glance, PCP seems decidable. You could write a program to perform a breadth-first search on all possible sequences of dominos. If a match exists, you will eventually find it.

But what if a match doesn't exist? How do you know when to stop searching?

The Post Correspondence Problem

Let's continue the Neso Academy video to see what happens when a PCP instance has no solution.

Watch the segment from 08:59 to 14:11. This part demonstrates a PCP instance that leads to an infinite search, highlighting why we can't just 'try everything' and be guaranteed to stop.

The problem is that the search for a match might go on forever. This is the same dilemma as the Halting Problem: we can confirm a "yes" answer (the TM halts, or a match exists) by observing it, but we can't always confirm a "no" answer.

This leads to the main result of this lesson:
Post's Correspondence Problem (PCP) is undecidable.

There is no algorithm that can take any arbitrary PCP instance and correctly report "yes" or "no" in a finite amount of time for all inputs.


3. How to Prove PCP is Undecidable

The proof is a beautiful application of the reduction technique you learned in the last lesson. We show that PCP is undecidable by reducing the Turing Machine Acceptance Problem, , to it.

The strategy is to build a constructor algorithm that takes an input for (a Turing Machine and an input string ) and produces a PCP instance that has a match if and only if accepts .

The core idea is to design the dominos such that the only possible match they can form is a sequence representing the accepting computation history of on .

This is a multi-step proof, which we will only sketch. The full details are intricate, but the high-level concept is elegant and relies on two main steps:

  1. Reduce to a slightly easier version of the problem, called the Modified Post's Correspondence Problem (MPCP).
  2. Reduce MPCP to the standard PCP.

The following document gives an excellent, clear overview of this proof strategy.

Lecture 26: Post's Correspondence Problem and Tilings

These lecture notes from the University of Illinois explain the reduction from A_TM to PCP. We'll focus on the high-level intuition first.

Read Section 1.1.1, titled 'An informal description of the set of tiles generated and why it works' (pages 2-3). This section perfectly captures the intuition behind the reduction without getting lost in the formal details. Focus on how the tiles are designed to force the match to simulate the TM's computation.

Step 1: Reduction from to MPCP

The Modified PCP (MPCP) is the same as PCP, but with an additional rule: the match must begin with a specific, designated start domino.

To reduce to MPCP, we construct a set of dominos from that simulates 's computation.

  1. Start Domino: The designated start domino is . This sets up the initial configuration on the bottom string. The top string is "lagging behind."

  2. Copying Dominos: For every tape symbol a, we have a domino . These are used to copy the parts of the configuration that the TM head is not touching.

  3. Transition Dominos: These are the heart of the simulation. They encode 's transition function .

    • For a right move, , we create a domino . This tile matches qa (state q seeing symbol a) on the top string and puts bp (the new symbol b and new state p) on the bottom string.
    • For a left move, , we need to look at the symbol to the left. For every tape symbol a, we create a domino .
  4. "Cleanup" Dominos: Once the simulation on the bottom reaches an accepting state , we need the top string to "catch up" so a match can be completed. We add special dominos that "eat" the symbols around the accepting state until the top and bottom strings are identical.

If accepts , a sequence of these dominos can be assembled to form a match that corresponds to the accepting computation history. If does not accept , no such history exists, and the tiles are constructed so that no other kind of match is possible.

Step 2: Reduction from MPCP to PCP

The final step is to show that if we can solve PCP, we can solve MPCP. This proves PCP is at least as hard as the (undecidable) MPCP.

The trick is to modify the MPCP instance so that the "special start domino" is the only one that can possibly begin a match, even without an explicit rule.

Given an MPCP instance with start domino , we construct a PCP instance as follows:

  1. Introduce a new special symbol, *, that appears nowhere else.
  2. For the start domino , create a new domino .
  3. For every other domino (for ), create a new domino .
  4. Add an extra copy of the modified start tile for use in the middle of a sequence: .
  5. Add a final domino to end the match: (or a similar construction to balance the *s).

In this new set , the only domino whose top and bottom strings both begin with the same character (*) is . Therefore, any match must start with . We have effectively forced the MPCP start condition without needing a special rule.

This completes the reduction chain , proving that PCP is undecidable.


Conclusion

Today, we've explored the Post's Correspondence Problem, a fascinating puzzle that bridges the gap between abstract Turing Machines and more concrete combinatorial problems. While it appears simple, its undecidability reveals a fundamental limitation of computation.

Key Takeaways:

  • Post's Correspondence Problem (PCP) asks if a given set of dominos has a "match," where the top and bottom strings formed by a sequence of dominos are identical.
  • PCP is undecidable. There is no general algorithm that can solve all instances of PCP.
  • The proof of undecidability is a reduction from . The core idea is to construct a PCP instance where a match corresponds precisely to an accepting computation history of a Turing Machine.
  • This result is important because PCP is a useful tool for proving other problems are undecidable, especially in the domain of formal languages and grammars.

Preview of the Next Lesson:
We will immediately put this new tool to use. In the next lesson, we will leverage the undecidability of PCP to prove that another fundamental problem is undecidable: determining whether two context-free grammars generate the same language (). This will show how the limits of computation extend up through the Chomsky Hierarchy.