programming languages - Requirements for optimal time complexity for every algorithm? -


the time complexity of algorithms can differ programming language programming language in implemented, because of things not possible done in 1 language opposed other. turing-completeness doesn't time complexity possibilities of said languages.

my question is, requirements programming language able solve every algorithm in best time complexity possible language? being turing-complete , added possibility inspect/edit datastructures in constant time enough?

i think it's provably impossible build single programming language or model of computation can optimally solve every computational problem.

there's result in theoretical computer science called time hierarchy theorem says many functions f(n), there many problems can solved in time o(f(n)) on turing machine not time o(f(n) / log n). proof of result works this: consider problem "does turing machine m reject input w within f(|w|) steps?" can show can solve deterministically in time o(f(n)k) k simulating m on w f(|w|) steps , seeing happens. however, if solve problem "too faster" this, can use halting-problem-like argument make program asks whether it going reject input within f(|w|) steps, opposite of whatever it's supposed do.

i confident feasible model of computation, find analogue of time hierarchy theorem. example, suppose have computer of type x, , consider problem "does x accept w within f(|w|) steps?" computer of type x can solve this, can't or results in contradiction. therefore, argue there functions a(x) , b(x) such computer of type x solve problem in time o(a(x)) not time o(a(x) / b(x)). go , define model of computation x' x, in operation "solve problem 'does x accept w within f(|w|) steps?'" built-in operation requires 1 step. now, model of computation x' can solve @ least 1 problem faster x. keep iterating construction build model of computation x'' can solve problems faster x', model of computation x''' can solve problems faster x'', etc.

therefore, i'm confident can't find single "best" model of computation, since model of computation can used against define model of computation that's faster on specific input. (this related incompleteness theorem - sound , complete formal system have can't prove, , if fix adding in statement axion, new system has it can't prove, etc.)


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

mysql - FireDac error 314 - but DLLs are in program directory -