Exercises found in Michael Sipser’s Intoduction to Computation Theory

We will solve two exercises on the Post Correspondence Problem, which is defined as following:

We have n string pairs, with the following arrangement: There is a top string and a bottom string in the pair (think of it as a domino piece, with a string of chars on the top and bottom). Those can be different or the same and they can be of any length. An example is the following:

\{\frac{b}{ca},\frac{a}{ab},\frac{ca}{a},\frac{abc}{c}\}

We want to arrange the pairs in a way that the string created from the concatenation of the top strings is the same as the string created by the bottom strings. We must use each pair, but we can use pairs as many times as we want. Also, we cannot turn the pairs upside down.

In the above example, we can create such an arrangement:

\{\frac{a}{ab},\frac{b}{ca},\frac{ca}{a},\frac{a}{ab},\frac{abc}{c}\}

Onward to the problems.

a) Show that the Post Correspondence Problem is decidable over the unary alphabet S = {1}.

We will count the number of 1s in the top strings (t) and the number of 1s in the bottom string (b). If t = b, we accept. Any way we place the pairs, it will always be that the top is the same as the bottom. If t != b, we reject.

Example:

\{\frac{111}{1},\frac{11}{11},\frac{1}{11},\frac{1}{111},\frac{11}{1}\}

The top string has a length of 9 and the bottom also has a length of 9. As the alphabet is unary, the top will be 9 1s and the bottom will also be 9 1s. We accept.

We accept (and halt) when the lengths are the same and we reject (and halt) otherwise. Therefore, as we halt in any case, the problem is decidable.

b) Show that the Post Correspondence Problem is undecidable over the binary alphabet S = {0,1}.

We can encode every string in a finite alphabet into a binary string (like a computer using binary to encode text). As the Post problem for a random alphabet is undecidable, a random encoding in binary is also undecidable.

c) In the silly Post Correspondence Problem (SPCP), in each pair the top string has the same length as the bottom string. Show that the SPCP is decidable.

As the pairs have equal top and bottom lengths, the total length of the top word will be the same as the total length of the bottom word. That means the only way this problem is accepted, is if the top and bottom in the pair are the same.

For each pair:
     Check if the top and bottom are equal.
	 If yes, then continue to next pair.
	 If no, REJECT.

If we parse through all the pairs, we ACCEPT.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s