22

In mathematics, there are many existence proofs that are non-constructive, so we know that a certain object exists although we don't know how to find it.

I am looking for similar results in computer science. In particular: is there a problem that we can prove it is decidable without showing an algorithm for it? I.e. we know that it can be solved by an algorithm, but we don't know what the algorithm looks like?

Erel Segal-Halevi
  • 5,994
  • 1
  • 23
  • 59
  • 5
    There is a trivial answer. Take any yes/no question the answer of which is unkown, like "is $\pi$ random", then the question is decidable, only we do not yet know which of the two possible algorithms is correct. – Hendrik Jan Oct 26 '14 at 11:25
  • @HendrikJan I don't think so. Counter-example: "This program halts on input X." – wberry Oct 26 '14 at 17:26
  • @HendrikJan Undecidability does not apply to a question having a unique answer. At best it may be an issue of incompleteness of the axioms (CF Gödel). The fact that we do not know the answer is only a statement on our ignorance. A fact may be provably true or false, or it may be always true, or always false (always="in all models"), but without being provably so. – babou Oct 26 '14 at 18:03
  • 6
  • @wberry If the program and X are both fixed one of the answers "yes" or "no" must be true. Even if we don't always know (or cannot find) which answer to choose. – Hendrik Jan Oct 26 '14 at 18:58
  • 1
    @babou Indeed: a question with a unique answer is decidable. Here ignorance is the point it seems, it is a case of "dont't know" from the question, although only "don't know now". Once we have found out whether $\pi$ is random or not we need to look for another example. Your answer below is much better of course! It is a form of "don't know" which is inherently "will never know". – Hendrik Jan Oct 26 '14 at 19:05
  • 1
    @HendrikJan: And that procedure is what we call an algorithm in CS. But taking the halting problem as an example, we cannot even prove that an algorithm exists! – MSalters Oct 26 '14 at 19:06
  • @MSalters There is no algorithm for the Halting problem, of course. But whether a single fixed automaton halts on a single fixed output technically is decidable with algorithm "yes" or algorithm "no". Even if we do not know which one works because we are asking about an unknown instance of the halting problem. – Hendrik Jan Oct 26 '14 at 19:14
  • @HendrikJan "In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever." Your argument seems to be that, for a particular machine and input, either an always-yes or always-no machine would produce the correct answer. But this misses the point; the problem is undecideable because no algorithm exists to determine which. http://en.wikipedia.org/wiki/Halting_problem – wberry Oct 26 '14 at 19:26
  • @wberry That's not what undecidable. E.g., there's is an algorithm that correctly answers "Is the sequence 99999999999999999999999999 present in pi?". It's either the algorithm "return yes" or the algorithm "return no". It's a decidable problem, even if we don't know which of the candidate algorithms is a decision procedure for it. This will actually be the case for any problem with a finite domain. The difficulty is that we might not have a decision procedure for determining which decision procedure is the one we want. – Joshua Taylor Oct 27 '14 at 01:55
  • 1
    Some more interesting examples can be found here: http://cstheory.stackexchange.com/questions/4777/are-there-problems-without-efficient-algorithms-where-existence-theorems-have-p – Erel Segal-Halevi Oct 27 '14 at 07:29
  • 1
    See also this question for a specific example. – Raphael Oct 27 '14 at 16:52

3 Answers3

15

The simplest case I know of an algorithm that exists, though it is not known which algorithm, concerns finite state automata.

The quotient $L_1/L_2$ of a language $L_1$ by a language $L_2$ is defined as $L_1/L_2=\{x \mid \exists y\in L_2 \text{ such that } xy\in L_1\}$.

It is easily proved that regular set are closed under quotient by an arbitrary set. In other words, if $L_1$ is regular and $L_2$ is arbitrary (not necessarily regular), then $L_1/L_2$ is regular, too.

The proof is quite simple. Let $M=(Q,\Sigma,\delta,q_0,F)$ be a FSA accepting the regular set $R$, where $Q$ and $F$ are respectively the set of states and the set of accepting states, and let $L$ be an arbitrary language. Let $F'=\{q\in Q\mid \exists y\in L \;\;\delta(q,y)\in F\}$ be the set of states from which a final state can be reached by accepting a string from $L$.

The automaton $M'=(Q,\Sigma,\delta,q_0,F')$, which differs from $M$ only in its set $F'$ of final states recognizes precisely $R/L$. (Or see Hopcroft-Ullman 1979, page 62 for a proof of this fact.)

However, when the set $L$ is not decidable, there may be no algorithm to decide which states have the property that defines $F'$. So, while we know that the set $F'$ is a subset of $Q$, we have no algorithm to determine which subset. Consequently, while we know that $R$ is accepted by one of $2^{|Q|}$ possible FSA, we do not know which it is. Though I must confess we know to a large extent what it looks like.

This is an example of what is sometimes called an almost constructive proof, that is a proof that one of a finite number of answers is the right one.

I suppose an extension of that could be a proof that one of an enumerable set of answers is the right one. But I do not know any. Nor do I know a purely non-constructive proof that some problem is decidable, for example using only contradiction.

D.W.
  • 159,275
  • 20
  • 227
  • 470
babou
  • 19,445
  • 40
  • 76
  • 1
    @D.W. I said $R$ is regular, but $L$ is arbitrary. It does not have to be recursively enumerable, or regular. No property of $L$ is used other than the fact that it is a set of strings. If you do not trust me, check Hopcroft-Ullman 1979, page 62. – babou Oct 26 '14 at 17:46
  • Thanks. This is my favorite answer because the decidable language is infinite. – Erel Segal-Halevi Oct 27 '14 at 07:18
  • @babou, my mistake, I mis-read what you wrote. My fault -- sorry about that. I've edited your post to make the part that I mis-understood hopefully cleraer. – D.W. Oct 27 '14 at 15:45
  • @D.W. I am amused that you had a problem, but it happens to me too. But maybe I should have been clearer. This was not intentional. Saying that because some mathematicians think it is more elegant to be cryptic. Thanks for the edit. – babou Oct 27 '14 at 15:59
12

To expand on Hendrick's original comment, consider this problem

Given an integer $n\ge 0$ is there a run of $n$ or more consecutive 7s in the decimal expansion of $\pi$?

This problem is decidable, since one of two cases may obtain:

  1. There is an integer $N$ for which the decimal expansion of $\pi$ contains a run of $N$ consecutive 7s, but no longer run.
  2. For any $n$, the expansion of $\pi$ has a run of $n$ consecutive 7s.

In case (1) a decision algorithm for the problem would be one of

If $n > N$ answer "no" else answer "yes".

and in case (2) the algorithm would be

Answer "yes".

Clearly each of these is a decision algorithm; we just don't know which. That suffices, though, since decidability only requires the existence of an algorithm, not the specification of which algorithm to use.

Rick Decker
  • 14,826
  • 5
  • 42
  • 54
  • +1 This is a straightforward example that I remember my professor in Computability and Logic using. It's my go-to example, since it doesn't require much domain knowledge, so it's easy to convey. – Joshua Taylor Oct 27 '14 at 02:00
  • 1
    For alternative formulations, see also here. – Raphael Oct 27 '14 at 16:52
2

Here is a non-answer. I'm posting because I believe it's instructive, because I originally claimed the opposite and eight people agreed enough to upvote before @sdcwc pointed out the mistake. I didn't want to just edit my first answer because I'm not sure as many people would have upvoted it if they knew it was wrong.

I originally claimed that it sufficed to take any set $S$ that we know to be finite but for which we don't know the members. Since $S$ is finite, it is recursive, so there is an algorithm but I claimed that we don't know what it is.

However, this is incorrect. For example, by the Robertson–Seymour theorem, we know that the class of graphs of treewidth at most 10 has a finite set of forbidden minors. We don't know what this set is so I claimed we don't have an algorithm to decide if a graph $H$ is a forbidden minor of the class of graphs of treewidth at most 10. But @sdcwc points out that there is an algorithm: just check that $H$ has treewidth more than 10 and all its proper minors have treewidth at most 10.

David Richerby
  • 81,689
  • 26
  • 141
  • 235