Download presentation
Presentation is loading. Please wait.
Published byKristian Greene Modified over 6 years ago
1
CS 461 – Nov. 14 Section 5.2 – Undecidable problems starting from ATM:
Matching sets of strings Ambiguity of CFGs
2
String matching Formal name is the Post Correspondence Problem, (by mathematician Emil Post) Given a set of dominoes Each contains a string on the top and bottom Use the dominoes so that the strings on the top and bottom match. You may use each domino as many times as you like. But there must be one domino. The solution is the sequence of dominoes (e.g. 1,2,3) 11 111 100 001 111 11
3
Another PCP Can you find a solution to this one? Or this one? 1 111
10111 10 10 Or this one? 10 101 011 11 101 011
4
Undecidability To show the problem is undecidable in general, we draw a parallel with ATM, which we know is undecidable. Take any TM with an input word. If we follow the TM’s steps, there is a parallel sequence of dominoes! Accept there is a match, and reject there is no match. For each possible TM action, we specify what the dominoes look like.
5
Example This is best seen via an example. Let’s say we have a TM that accepts the language 1*00*1(0+1)*, and we feed it the word 01. State 1 _ s1 s2, 0, R s1, 1, R rej, _, R s2 acc, 1, r [s1] 0 [s2] 1 [acc]
6
Create dominoes! There are 7 kinds of dominoes we need. [s1] 0 1
The first domino represents the initial configuration of the TM, which is [s1] 0 [s2] 1 [acc] # #[s1] 0 1 #
7
Dominoes (2,3) Second type of domino represents moves to the right. In our case we see [s1] 0 [s2] 1 [acc] [s1] 0 0 [s2] [s2] 1 1 [acc] The third type of domino would represent moves going left, but we don’t have any of these. In general, right moves are qa/br and left moves are cqa/rcb.
8
Dominoes (4, 5) Allow ourselves to do nothing to a tape symbol away from the read-write head. [s1] 0 [s2] 1 [acc] 1 _ Also, allow use to put a delimiter (#) between steps, and put blanks on either side of the input as needed. # # # _ # _ #
9
Dominoes (6, 7) Allow ourselves to eat the tape once we accept! There will be 6 dominoes like this: [s1] 0 [s2] 1 [acc] 0 [acc] [acc] [acc] 0 [acc] And finally, we need a special case domino to “eat” the accept state notation on the tape. [acc] # # #
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.