Definition of Algorithm and P contained in co-NP

35 Views Asked by At

Greeting, I am using the schrijver's course notes on optimization and reading chapter 6 on problem, algorithm and running time.

One thing that confuses me is the definition of algorithm, given a problem (defined as a subset of a library), An algorithm is defined as a finite list of instructions that replaces subwords in a word. And it's defined as $({u1,u1'} .....)$, and this is how they describe it, we say $w'$ follows from word $w$ if there exists a $j \in (1,....n)$ s.t. $w = tu_jv$ and $w'=tu_j'v$ for certain words $t$ and $v$, in such a way that j is the smallest index for which this is possible and the size of t is as small as possible.

So I take it as, for any word in the sequence of your algorithm, you first look at the subwords with the smallest $j$ you can replace, and you choose the left most copy of it if there are multiple. This makes sense, but it's hard for me to understand how this coincides with my usual intuition of an algorithm, for instance, if I simply want to replace the second symbol in every word in my algorithm, it's very hard for me to describe what this algorithm would be since I would first have to know what words I am allowed to take in. And so I fail to understand why an algorithm is defined in such a way.

This is especially troublesome when I am trying to prove that $P \subset co-NP$, it suffices to show that for a problem $W$, the complementary problem $\sigma - W$ is in $P$. The way $P$ is defined, is the set of problems with a polynomial time solving algorithm, and "solving" means every words generate a sequence with at most p(size w) words. for some polynomial $p(x)$, suppose I have a problem $W \in P$, with the polynomial time solving algorithm $A$, how can I use $A$ to find the polynomial time solving algorithm for $\sigma - W$?

1

There are 1 best solutions below

0
On

Disclaimer: I don't feel like checking whether I can find myself a copy of the course notes and verifying everything I'm about to say, so I'll infer a bunch of things, and will attempt to explicitly say which assumptions I'm making. This is somewhat important here because you're asking about understanding formalism, and formalism requires (a lot of) rigour. Also, I won't address the P in co-NP part.


Definition of algorithm

As you've observed, the rules about how a word $w'$ follows from $w$ allows you to pick one substitution to perform first, over other possibles substitutions. That property is important for an "algorithm" since it leaves no room for arbitrary choices. This makes "algorithm" perfectly deterministic.

Now, how is that "thing" an "algorithm"? I don't know what your intuitive view of algorithms is, but to me it's mostly about a series of instructions you can follow blindly to perform a(n ideally) useful computation. Put another way, it's a recipe to transform some number/word/input into another number/word/output. And in that regard the definition you've provided matches. You're given some form of input, the initial word, and you perform substitutions on that word to transform it into another, (more useful?,) word.

If you're knowledgeable about computers, you can also look at this from the perspective of a computer. In that context, a "word" is just the state of your (RAM) memory. You can represent very complex structures with only binary words (like this website), and a computer algorithm will essentially read binary words, and modify some parts of it, based on very specific rules (instructions). The result of this modification may be to trigger another modification, or also maybe to display specific colours at specific places of a monitor display.

The thing here is that words can have a meaning, but an algorithm don't have to understand that meaning. All that matters is that the set of rules/instructions produces a sensible result. So at the abstract level, an algorithm is (and should be) completely agnostic to what the words mean. This yields a definition of algorithms that is general, and that can be worked with in a formal context. Because you are agnostic to the meaning, you can rigorously measure an algorithm performance against objective criterion. And a very popular measure of performance is the time and space complexities.


About replacing the second symbol of a word

First, I'll assume that words are a finite sequence of characters, and that the list of all characters is known and finite. As far as I'm concerned, that is a reasonable assumption. Fundamentally, computers only work with two characters, and every alphabet I know of is finite (including Asian alphabets). Extend "characters" to digits, some other symbols, merge the alphabet of every language on Earth, you still end up with a finite alphabet.

Now, replacing the second symbol of a word is fairly "easy". Say there are $n$ characters in your alphabet, then there are ${n\choose 2} = \frac{n(n-1)}2$ two characters subwords. Make an instruction for every of these subwords that change the second character to another character of your choice.

If this feels overkill to you, that's just the price you have to pay for the theoretical simplicity of the definition. Creating and designing actually useful algorithms through that definition is definitely a nightmare (which is why compilers and interpreters are a thing), but on the flipside that definition is "mathematically" simple and functional.