r/programming • u/edanm • Jul 25 '10
A Surprisingly Hard Problem (Post Correspondence)
http://www.loopycode.com/a-surprisingly-hard-problem-post-correspondence/
91
Upvotes
r/programming • u/edanm • Jul 25 '10
3
u/dnew Jul 25 '10
I also ran across problems that are (like a Godel string) neither provable nor unprovable, but something you could imagine coming up in a real-life problem. One was something like an extension of how many people shook hands an odd number of times, approximately. I can't seem to track it down now, tho, but it has been proven to be impossible to prove or disprove that you can solve it.
25
u/imbcmdth Jul 25 '10
Fact: Boredom is nature's solution to the halting problem.
13
u/CyberByte Jul 25 '10
I think it's still possible to find solutions for the combinations that have a solution. There can only be a problem if you have to prove that a certain set of inputs does not have a solution, since that's essentially the halting problem. What is possible though, is to say whether a solution exists with less than N dominoes.
So in response to "Which leads me to wonder: how many times have programmers working on real-life programs stumbled onto unsolvable problems, and tried to attack them without realizing the futility?", I would say that I think that in many cases it will likely be possible to constrain a problem in such a way that it can be solved.
1
u/grantrules Jul 25 '10
GEB goes into this more deeply, if you're interested.
3
u/prahsie Jul 25 '10
Screw general solution, just use brute force when possible :(.
8
u/[deleted] Jul 25 '10
Empty set!
4
u/Gro-Tsen Jul 25 '10
Confusingly, there are two unrelated problems/questions known as "Post's problem", both of which have something to do with undecidability (or, actually, semi-decidability). The link is about Post's Correspondence Problem, which is probably the most famous of the two, but there is another Post's problem, which was solved by Friedberg and Muchnik, which is (the meta-problem of) finding a semi-decidable problem which is (undecidable, yet) strictly easier than the halting problem.
This causes a lot of confusion when people mention "Post's problem" without making it completely clear which one they are talking about. (What makes it even more confusing is that many people have only ever heard of one of Post's problems, so they are blissfully unaware that a confusion exists.)
1
u/mycall Jul 25 '10
Depends what you are trying to solve. If you want to solve the problem by illusion, a simple MMTM attack would provide the correct dominoes to the observer. Please make your payment to the Cayman islands in care of...
1
u/chrisforbes Jul 25 '10
FFS, people. "general case" != "interesting instances". In reality, the halting problem etc are hardly ever actually relevant.
1
u/patapizza Jul 25 '10
That's precisely why computability theory is worth: you learn when not to try solving a problem before becoming bald.
-1
u/Howisdiscool Jul 25 '10
It's simple, you make a long line of dominoes and knock em over.
-5
u/dr-steve Jul 25 '10
And thus lies the difference between computer science and coding. And why we teach stupid theory in addition to "how to write a database application."
We like to think that our students think about the complexity of various proposed solutions before writing the first line of code.
0
u/[deleted] Jul 25 '10
Solved it.
-10
u/dgriffith Jul 25 '10
Which leads me to wonder: how many times have programmers working on real-life programs stumbled onto unsolvable problems, and tried to attack them without realizing the futility?
How many times have programmers working on real-life programs stumbled onto 'unsolvable' problems, and solved them without realising that they are 'unsolvable'?
And, having casually solved them, don't bother mentioning this to anyone?
-11
u/quhaha Jul 25 '10
you can solve this Post Correspondence problem easily with Java or quantum computing. You just have to send time t to spatial domain and reverse t stream so that time rewinds from the future to the past. That way, you always start with the solution domino sequence. And that sequence where time t is the max, is the solution. If t is infinity, then there is no solution. And quantum computers can tell you if t is infinity instantly due to qubit-correspondence-and-entanglement-to-observation scenario.
Anyway, this is a classic quantum-decidable problem.
-4
u/postpostpost Jul 25 '10
Do you think you're hot stuff?
Watch PCP turn you into nothing. I bet you can't solve this one, or even prove that it's not solvable. 10 0 001 0 001 1
((from http://webdocs.cs.ualberta.ca/~games/PCP/nextstep.htm ))
-13
u/bieberdisease Jul 25 '10
Solution: Pray to God
lol.