Polynomial time

 

P is the class of languages that are decidable (solvable) in polynomial time on a deterministic single-tape Turing machine.

P = TIME(nk)

 

There is an important point to note about the polynomial time class of languages, P.

 

P roughly corresponds to the class of problems that are realistically solvable on a computer.

 

The following table shows why.

 

 

Table 1: Running time for programs of various orders

Name

Running Time Function

T(n)

Order

Example:
n=256 (size of input)
1 microsec/instruction
1x10-6 sec/instruction

Constant time

c

O(1)

 

Log Log N time

a log log n + b

O(log log n)

0.000003 sec

Log N time

a log n + b

O(log n)

0.000008 sec

Linear time

an + b

O(n)

0.0025 sec

N Log N time

a n log n + b n + c

O(n log n)

0.002 sec

Quadratic time

a n2 + b n + c

O(n2)

0.065 sec

Polynomial time

a nk + ...

O(nk)

17 sec (k=3)

Exponential

a kn + ...

O(kn)

3.67x1061 centuries (k=2)