2
$\begingroup$

From the text

A language $L$ is in the class $NP$ iff there exists a polynomial-time Turing machine, denoted $V$, that gets an input string $x$ as well as a read-only string called the witness $w$, such that for any input string $x$,

  • if $x \in L$, then there exits a witness string $w$ such that $V^{w}(x)$ = "yes".

  • if $x \notin L$, then for any witness string $w$, $V^{w}(x)$ = "no".

The Turing machine $V$ is also called a verifier.

First of all, I am unable to understand the notation $V^{w}(x)$ - is $w$ also an input to the verifier - i.e. is it the same as $V(w,x)$?

Also, what is the nature of this witness string? Can someone give an example witness for a simple problem (the problem need not be an NP hard problem) and how the witness string is used by the verifier?

$\endgroup$
2

2 Answers 2

9
$\begingroup$

To give a concrete example, imagine you have a box of 4-digit combination padlocks. All those padlocks are closed, but some of them have a defect and no code can open them.

Given a padlock, you want to know if it can be opened or if it has a defect. The naive way to do it is to try all codes until it opens, or until you have tried all codes, so it may take up to 10000 tries to know the answer, for just one padlock.

However, suppose Superman is in the room. With his X-ray vision, he can guess immediately what the opening code of a padlock is. When you pick a padlock, Superman may say "the opening code is 2587". No matter if he is lying or not, and you just have to roll the four wheels until the padlock is in position 2587 to try if it opens it. If it is the right code, then the padlock will open. However, if the padlock has a defect, no matter the code Superman tells, the padlock will never open.

In this context, the language $L$ is the set of padlocks that can be opened, a word $x$ is a padlock, the witness string $w$ is the 4-digit code given by Superman and the verifier is you rolling the wheels in the right position.

$\endgroup$
4
  • 7
    $\begingroup$ Maybe add that we don't have to trust Superman here to conclude that a padlock indeed can be opened? $\endgroup$
    – Arno
    Mar 4, 2022 at 11:14
  • $\begingroup$ I just noticed that there is a 2nd part of my question which isn't addressed. "First of all, I am unable to understand the notation $V^{w}(x)$ - is $w$ also an input to the verifier - i.e. is it the same as $V(w,x)$?" - if you know the answer to this, could you please add that also? $\endgroup$
    – user93353
    Oct 24, 2022 at 3:07
  • $\begingroup$ Yes, that's the same thing: in the example, $V^w(x)$ is either "the padlock is open" or "the padlock is still closed". $\endgroup$
    – Nathaniel
    Oct 24, 2022 at 11:59
  • $\begingroup$ We absolutely don't have to trust Superman. And if his code doesn't unlock the lock, then we don't know if the lock is working or defective, we'll have to check the other 9999 combinations in the worst case. Or ask Batman. $\endgroup$
    – gnasher729
    Oct 24, 2022 at 15:53
3
$\begingroup$

Example: Let L be the language of all binary strings representing composite numbers. The input x for the verifier is a binary string; x is in L iff x represents a composite number (i.e x factors into two or more smaller numbers both different from 1). A witness w for L would be a binary string, different from both 1 and x, representing a factor; the verifier uses the witness by confirming that x is exactly divisible by w. If x is in L (i.e. x is indeed composite), there is some w between 1 and x which divides it, so there is a witness; if x is NOT in L (i.e. x is 1 or prime), then it is divisible only by 1 and x, so there is no witness.

That is just one example. Exactly how the verifier uses the witness depends on the nature of L and how the verifier checks for membership in L. Another case would be of a language checked by a probabilistic verifier - i.e, the verifier is allowed to 'flip coins' during the checking, and x is in L iff it is possible for the verifier to reach an accepting state. In this situation the witness would be a recording of the required coin flips leading to acceptance - i.e whenever the verifier needs to flip a coin it actually gets the 'next' bit from the verifier.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.