Constructible function: Difference between revisions
imported>Cosmia Nebula →Space-constructible: fully |
imported>TeaTowel341076 |
||
| Line 1: | Line 1: | ||
{{Short description|Concept in complexity theory}} | {{Short description|Concept in complexity theory}} | ||
In [[computational complexity theory|complexity theory]], a '''time-constructible function''' is a function ''f'' from [[natural numbers]] to natural numbers with the property that ''f''(''n'') can be constructed from ''n'' by a [[Turing machine]] in the time of order ''f''(''n''). The purpose of such a definition is to exclude functions that do not provide an upper bound on the runtime of some Turing machine.<ref name=":0">{{Cite book|title=Computational Complexity: A Conceptual Perspective|last=Goldreich|first=Oded|publisher=Cambridge University Press|year=2008|isbn=978-0-521-88473-0|pages=130, 139}}</ref> | In [[computational complexity theory|complexity theory]], a '''time-constructible function''' is a function ''f'' from [[natural numbers]] to natural numbers with the property that ''f''(''n'') can be constructed from ''n'' by a [[Turing machine]] in the time [[big O notation|of order]] ''f''(''n''). The purpose of such a definition is to exclude functions that do not provide an upper bound on the runtime of some Turing machine.<ref name=":0">{{Cite book|title=Computational Complexity: A Conceptual Perspective|last=Goldreich|first=Oded|authorlink = Oded Goldreich|publisher=Cambridge University Press|year=2008|isbn=978-0-521-88473-0|pages=130, 139}}</ref> | ||
==Time-constructible== | ==Time-constructible== | ||
Let the Turing machine be defined in the standard way, with an alphabet that includes the symbols <math>0, 1</math>. It has a standard input tape containing zeros except for an input string. Let <math>1^n</math> denote a string composed of <math>n</math> ones. That is, it's the [[Unary numeral system|unary representation]]. Let <math>|n|</math> be the binary representation. | Let the Turing machine be defined in the standard way, with an alphabet that includes the symbols <math>0, 1</math>. It has a standard input tape containing zeros except for an input string. Let <math>1^n</math> denote a string composed of <math>n</math> ones. That is, it's the [[Unary numeral system|unary representation]] of <math>n</math>. Let <math>|n|</math> be the [[Binary number|binary representation]]. | ||
A function <math>f</math> is called '''time-constructible''' if there exists a Turing machine <math>M</math> such that the computation <math>M(1^n)</math> halts in <math>O(f(n))</math> steps with value <math>|f(n)|</math>. | |||
This definition may use <math>M(1^n) = 1^{f(n)}</math> instead, since the two can be interconverted in <math>O(f(n))</math> steps.<ref name=":0" /> | |||
=== Fully time-constructable === | === Fully time-constructable === | ||
There is also a notion of a '''''fully'' time-constructible function'''. | There is also a notion of a '''''fully'' time-constructible function'''. | ||
A function <math>f</math> is called fully time-constructible if there exists a Turing machine <math>M</math>, such that for all but finitely many <math>n</math>, <math>M(1^n)</math> halts in ''exactly'' <math>f(n)</math> steps.<ref name=":2">{{Cite book |last1=Homer |first1=Steven |title=Computability and Complexity Theory |last2=Selman |first2=Alan L. |publisher=Springer |year=2011 |isbn=978-1-4614-0681-5 |edition=Second}}</ref> This definition is slightly less general than the first | A function <math>f</math> is called fully time-constructible if there exists a Turing machine <math>M</math>, such that for all but finitely many <math>n</math>, <math>M(1^n)</math> halts in ''exactly'' <math>f(n)</math> steps.<ref name=":2">{{Cite book |last1=Homer |first1=Steven |title=Computability and Complexity Theory |last2=Selman |first2=Alan L. |author2link = Alan Selman|publisher=Springer |year=2011 |isbn=978-1-4614-0681-5 |edition=Second}}</ref> This definition is slightly less general than the first, but for most applications, either definition can be used.<ref name=":1">{{Cite book | ||
|title=Structural Complexity I | |title=Structural Complexity I | ||
|last1=Balcázar | |last1=Balcázar | ||
| Line 28: | Line 24: | ||
|year=1988}}</ref> The following equivalence theorem shows that these two concepts are equivalent for most functions used in practice: | |year=1988}}</ref> The following equivalence theorem shows that these two concepts are equivalent for most functions used in practice: | ||
Theorem.<ref name=":1" />{{Pg|location=Theorem 2.6}} If <math>f</math> is a function such that there exists <math>\epsilon > 0</math> such that, for all but finitely many <math>n</math>, <math>f(n) \geq (1+ \epsilon) n</math> | Theorem.<ref name=":1" />{{Pg|location=Theorem 2.6}} If <math>f</math> is a function such that there exists <math>\epsilon > 0</math> such that, for all but finitely many <math>n</math>, <math>f(n) \geq (1+ \epsilon) n</math> (that is, if <math>f(n) - n = \Omega(n)</math>), then <math>f</math> is time-constructible if and only if it is fully time-constructible. | ||
==Space-constructible== | ==Space-constructible== | ||
A function <math>f</math> is called '''space-constructible''' if there exists a Turing machine <math>M</math> such that <math>M(1^n)</math> halts with value <math>|f(n)|</math> (or equivalently <math>1^{f(n)}</math>), while using <math>O(f(n))</math> space.<ref name=":0" /> | |||
Equivalently, if there exists a Turing machine <math>M</math>, such that for all but finitely many <math>n</math> | Equivalently, <math>f</math> is called space-constructible if there exists a Turing machine <math>M</math>, such that for all but finitely many <math>n</math>, the computation <math>M(1^n)</math> halts in a configuration in which ''exactly'' <math>f(n)</math> cells are not blank, and no other cell has been written to during its operation.<ref name=":1" />{{Pg|location=Definition 2.4}} This is sometimes called "fully space-constructible". However, the two definitions are equivalent.<ref name=":1" />{{Pg|location=Theorem 2.7}} | ||
==Properties== | ==Properties== | ||
All the commonly used functions (such as <math>n, n^2, 2^n, n!</math>) are time- and space-constructible, as long as <math>f(n) = \Omega(n)</math>. The construction is straightforward. For example, <math>n^2</math> is constructed by one for-loop, while <math>n^3</math> is constructed by two for-loops, etc. | All the commonly used functions (such as <math>n, n^2, 2^n, n!</math>) are time- and space-constructible, as long as <math>f(n) = \Omega(n)</math>. The construction is straightforward. For example, <math>n^2</math> is constructed by one nested for-loop, while <math>n^3</math> is constructed by two nested for-loops, etc. | ||
If <math>f(n) = o(n)</math> is time-constructible, then it is eventually constant, since otherwise there is insufficient time to read the entire input. | If <math>f(n) = o(n)</math> is time-constructible, then it is eventually constant, since otherwise there is insufficient time to read the entire input. | ||
| Line 45: | Line 39: | ||
</math>. | </math>. | ||
For every | For every [[computable function]] <math>f</math>, there is a computable function <math>g</math> that is time constructible and <math>\forall n, g(n) > f(n)</math>.<ref name=":1" />{{Pg|location=Lemma 2.3}} | ||
==Applications== | ==Applications== | ||
Latest revision as of 22:18, 28 December 2025
Template:Short description In complexity theory, a time-constructible function is a function f from natural numbers to natural numbers with the property that f(n) can be constructed from n by a Turing machine in the time of order f(n). The purpose of such a definition is to exclude functions that do not provide an upper bound on the runtime of some Turing machine.[1]
Time-constructible
Let the Turing machine be defined in the standard way, with an alphabet that includes the symbols . It has a standard input tape containing zeros except for an input string. Let denote a string composed of ones. That is, it's the unary representation of . Let be the binary representation.
A function is called time-constructible if there exists a Turing machine such that the computation halts in steps with value .
This definition may use instead, since the two can be interconverted in steps.[1]
Fully time-constructable
There is also a notion of a fully time-constructible function.
A function is called fully time-constructible if there exists a Turing machine , such that for all but finitely many , halts in exactly steps.[2] This definition is slightly less general than the first, but for most applications, either definition can be used.[3] The following equivalence theorem shows that these two concepts are equivalent for most functions used in practice:
Theorem.[3]Template:Pg If is a function such that there exists such that, for all but finitely many , (that is, if ), then is time-constructible if and only if it is fully time-constructible.
Space-constructible
A function is called space-constructible if there exists a Turing machine such that halts with value (or equivalently ), while using space.[1]
Equivalently, is called space-constructible if there exists a Turing machine , such that for all but finitely many , the computation halts in a configuration in which exactly cells are not blank, and no other cell has been written to during its operation.[3]Template:Pg This is sometimes called "fully space-constructible". However, the two definitions are equivalent.[3]Template:Pg
Properties
All the commonly used functions (such as ) are time- and space-constructible, as long as . The construction is straightforward. For example, is constructed by one nested for-loop, while is constructed by two nested for-loops, etc.
If is time-constructible, then it is eventually constant, since otherwise there is insufficient time to read the entire input.
is space-constructible even though .
For every computable function , there is a computable function that is time constructible and .[3]Template:Pg
Applications
Time-constructible functions are used in results from complexity theory such as the time hierarchy theorem. They are important because the time hierarchy theorem relies on Turing machines that must determine in O(f(n)) time whether an algorithm has taken more than f(n) steps. This is, of course, impossible without being able to calculate f(n) in that time. Such results are typically true for all natural functions f but not necessarily true for artificially constructed f. To formulate them precisely, it is necessary to have a precise definition for a natural function f for which the theorem is true. Time-constructible functions are often used to provide such a definition.
Space-constructible functions are used similarly, for example in the space hierarchy theorem.
References
This article incorporates material from constructible on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.
<templatestyles src="Reflist/styles.css" />
Script error: No such module "Check for unknown parameters".