Hacker News new | ask | show | jobs
by rocqua 1802 days ago
I think that such an algorithm, if the order of algorirthms tried is random, is almost surely (so with probability 1) never going to terminate.

Moreover, you'd probably want to limit the tries to algorithms that terminate. But that brings you into the halting problem.

1 comments

You can run a countably infinite sequence of algorithms in parallel and stop when one of them terminates without running into the halting problem. Say you have a set of algorithms, numbered 1, 2, 3, ... and each algorithm consists of a sequence of instructions (with jumps and gotos), where each instruction takes a finite amount of time to run. The algorithm is as follows: run the first instruction for algorithm 1, then the next instruction for algorithm 1, then the instruction for algorithm 2, then 1 again, then 2, then 3, then 1, 2, 3, and 4, and you can see the pattern now. If any of them reaches the halt instruction halt. Even if all but one of these algorithms runs forever, you'll still eventually halt when that one algorithm completes. I believe this approach is called dove tailing
Can you iterate through a set without * selection *? I'm confused about this part. It seems to me in order to use an algorithm from the set of all algorithms you need to invoke the axiom itself.

I think us programmers think in terms of time. But in math there is no time so whether you do things in parallel or procedural is irrelevant. That's why you can discuss infinities in math.

> It seems to me in order to use an algorithm from the set of all algorithms you need to invoke the axiom itself.

Nope, you don't need the axiom of choice to define the sequence of all algorithms. The axiom of choice allows you to order any arbitrary set, but you don't need it for things you can construct an explicit order for, like the natural numbers. In the case of all algorithms, it's somewhat straightforward to construct the set of all of them. You can construct the sequence of all strings, right? You can construct them as "", "a", "b", "c", ... "y", "z", "aa", "ab", ... "ay", "az", "ba", "bb", ... Now, pick a programming language, like C. Given any valid string, you can determine if it is a valid C program in finite time, and if so you can convert it into a set of instructions to use in the dove-tailing procedure in finite time. Take the list of all strings in the manner described above. For each one interpret it as a C program, or if it's got invalid syntax interpret it as a program that immediately halts. Now you've got an enumerable sequence of algorithms. Since C is Turing complete you'll find every single algorithm in that sequence. There will be a ton of duplicates (for whatever notion of equivalence you want to use) but all the algorithms will be there, and in a well-defined order that you can enumerate through.

>Nope, you don't need the axiom of choice to define the sequence of all algorithms.

No. I'm saying selecting an algorithm out of the set of all algorithms.

I'm not saying defining the set of all algorithms.

Putting the set of all algorithms in an order is quite easy. Like the comment above suggests. Just put them in alphabetical / lexicographical order.

Then you don't need to "randomly pick" an algorithm. You just start with the first algorithm in the sequence, and keep going.

As my retort to that common mentioned, he is wrong.

That is still random. You are arbitrarily picking an encoding, (English) in this case. Why not a Russian programming language or Chinese? How did you *select* your encoding out of the set of all encodings?

The act of assigning order to an unordered set is arbitrary. ABC order is a made up concept. It's not numerical, it's an arbitrary language and an arbitrary order that's a by product of human culture. Thus invoking this is at it's essence invoking the axiom of choice. You are arbitrarily selecting an algorithm.