13.12.2012 Views

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.8 Summary 43<br />

Table 2.6. Running times of different algorithms for different values of n<br />

n O(n) O(n 2 ) O(2 n ) O(n n )<br />

1 0.000001 seconds 0.000001 seconds 0.000002 seconds 0.000001 seconds<br />

5 0.000002 seconds 0.000025 seconds 0.000032 seconds 0.003125 seconds<br />

10 0.00001 seconds 0.0001 seconds 0.001024 seconds 2.778 hours<br />

50 0.00005 seconds 0.0025 seconds 35.7 years 2.87 × 10 70 years<br />

2.7 P <strong>and</strong> NP<br />

We can therefore call an algorithm “fast” if the number of steps to solve a<br />

problem of size n is (no more than) some polynomial involving n. We define<br />

the complexity class P to mean the set of all problems (not algorithms) that<br />

have polynomial-time solutions. Therefore, the problem of sorting numbers is<br />

in P , since some solution (e.g., bubble sort) runs in O(n 2 )time,<strong>and</strong>n 2 is a<br />

polynomial.<br />

By the late 1960s it became apparent that there were several seemingly<br />

simple problems for which no fast algorithms could be found, despite the best<br />

efforts of the algorithms community. In an attempt to classify this set of problems,<br />

Cook observed that in order for a problem to be solved in polynomial<br />

time one should be able (at the very least) to verify a given correct solution in<br />

polynomial time [47]. This observation holds because if we have a polynomialtime<br />

algorithm for a problem <strong>and</strong> someone gives us a proposed solution, we can<br />

always re-run the algorithm to obtain the correct solution <strong>and</strong> then compare<br />

the two, in polynomial time.<br />

This led to the creation of the complexity class NP containing decision<br />

problems for which one can verify the solution in polynomial time. Cook also<br />

showed that within NP lies a set of problems that are the hardest of them<br />

all. If a polynomial-time algorithm exists for any one of these problems then<br />

all NP problems can be solved in polynomial time. This fact is known as<br />

Cook’s Theorem [47], <strong>and</strong> is one of the most profound results in theoretical<br />

computer science. The class of those “hardest” problems in NP is known as<br />

NP-complete problems, of which satisfiability is the archetype.<br />

Soon after Cook’s paper, Karp [89] proved that several interesting problems<br />

could also be shown to be NP-complete. The list of NP-complete problems<br />

has grown considerably since, <strong>and</strong> the st<strong>and</strong>ard text may be found at<br />

[63]. The list includes many problems of great theoretical <strong>and</strong> practical significance,<br />

such as network design, scheduling, <strong>and</strong> data storage.<br />

2.8 Summary<br />

In this chapter we provided an introduction to the theory of computer science.<br />

We described the fundamental “building blocks” of computers, logic gates,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!