Question: Show how in Example 1 4 . 6 the checking of the trial solution can be done in O ( n 2 logn ) time.
Show how in Example the checking of the trial solution can be done in
Onlogn time.
EXAMPLE
Reconsider the SAT problem. We made some rudimentary argument
to claim that this problem can be solved efficiently by a nondeterministic
Turing machine and, rather inefficiently, by a bruteforce
exponential search. A number of minor points were ignored in that
argument.
Suppose that a CNF expression has length n with m different
literals. Since clearly m n we can take n as the problem size. Next,
we must encode the CNF expression as a string for a Turing machine.
We can do this, for example, by taking x and
encoding the subscript of x as a binary number. In this system, the
CNF expression x xx x is encoded as
x x x x
Since the subscript cannot be larger than m the maximum length of
any subscript is logm As a consequence the maximum encoded length
of an nsymbol CNF is Onlogn The next step is to generate a trial solution for the variables. Nondeterministically, this can be done in On time. See Exercise at the end of this section. This trial solution is then substituted into the input string. This can be done in Onlogn time The entire process therefore can be done in Onlogn or On time, and SAT in NP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
