Idempotence: Difference between revisions
→Examples: Add pretty-printing example |
Unit Mango (talk | contribs) Undid revision 1257357005 by 2409:40D4:405E:F1B7:8000:0:0:0 (talk) reverted vandalism |
||
(214 intermediate revisions by more than 100 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Property of operations}} |
|||
{{For|the concept in matrix algebra|Idempotent matrix}} |
|||
{{For|the concepts in algebra|Idempotent (ring theory)|Idempotent matrix}} |
|||
[[File:On Off - Zał Wył (3086204137).jpg|thumb|''On''/''Off'' buttons of a train's [[destination sign]] control panel. Pressing the ''On'' button (green) is an idempotent operation, since it has the same effect whether done once or multiple times. Likewise, pressing ''Off'' is idempotent.]] |
|||
'''Idempotence''' ({{IPAc-en|UK|,|ɪ|d|ɛ|m|ˈ|p|əʊ|t|ən|s}},<ref>{{cite dictionary |title=idempotence |dictionary=[[Oxford English Dictionary]] |url=http://www.oed.com/view/Entry/273873 |date=2010 |edition= 3rd|publisher=Oxford University Press }}</ref> {{IPAc-en|US|ˈ|aɪ|d|ə|m|-}})<ref>{{cite dictionary |title=idempotent |url=http://www.merriam-webster.com/dictionary/idempotent |dictionary=[[Merriam-Webster]] |url-status=live |archive-url=https://web.archive.org/web/20161019143953/http://www.merriam-webster.com/dictionary/idempotent |archive-date=2016-10-19 }}</ref> is the property of certain [[operation (mathematics)|operations]] in [[mathematics]] and [[computer science]] whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of places in [[abstract algebra]] (in particular, in the theory of [[projector (linear algebra)|projector]]s and [[closure operator]]s) and [[functional programming]] (in which it is connected to the property of [[referential transparency]]). |
|||
The term was introduced by American mathematician [[Benjamin Peirce]] in 1870<ref>Original manuscript of 1870 lecture before National Academy of Sciences (Washington, DC, USA): Peirce, Benjamin (1870) [https://books.google.com/books?id=HqQKAAAAYAAJ&pg=PA16 "Linear associative algebra"] From pages 16-17: "When an expression which is raised to the square or any higher power vanishes, it may be called ''nilpotent''; but when raised to a square or higher power it gives itself as the result, it may be called ''idempotent''.<br> |
|||
'''Idempotence''' ({{IPAc-en|ˌ|aɪ|d|ɨ|m|ˈ|p|oʊ|t|ən|s}} {{respell|EYE|dəm|POH|təns}})<ref>[http://www.merriam-webster.com/dictionary/idempotent ''idempotent'' entry] at [[Merriam-Webster]] dictionary</ref> is the property of certain [[operation (mathematics)|operations]] in [[mathematics]] and [[computer science]], that can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of places in [[abstract algebra]] (in particular, in the theory of [[projector (linear algebra)|projector]]s and [[closure operator]]s) and [[functional programming]] (in which it is connected to the property of [[Referential transparency (computer science)|referential transparency]]). |
|||
The defining equation of nilpotent and idempotent expressions are respectively A<sup>n</sup> = 0 and A<sup>n</sup> = A; but with reference to idempotent expressions, it will always be assumed that they are of the form A<sup>n</sup> = A unless it be otherwise distinctly stated." |
|||
*Printed: {{cite journal |last1=Peirce |first1=Benjamin |title=Linear associative algebra |journal=American Journal of Mathematics |date=1881 |volume=4 |issue=1 |pages=97–229 |doi=10.2307/2369153 |jstor=2369153 |url=https://babel.hathitrust.org/cgi/pt?id=uc1.$b772370&seq=107}} See p. 104. |
|||
*Reprinted: {{cite book |last1=Peirce |first1=Benjamin |title=Linear Associative Algebra |date=1882 |publisher=D. Van Nostrand |location=New York, New York, USA |page=8 |url=https://ia903403.us.archive.org/33/items/linearassocalgeb00pierrich/linearassocalgeb00pierrich_bw.pdf}}</ref>{{sfn|Polcino|Sehgal|2002|p=[https://books.google.com/books?id=7m9P9hM4pCQC&q=Idempotence&pg=PA127 127]}} in the context of elements of algebras that remain invariant when raised to a positive integer power, and literally means "(the quality of having) the same power", from {{wikt-lang|la|idem}} + ''[[wikt:potence|potence]]'' (same + power). |
|||
== Definition == |
|||
The term was introduced by [[Benjamin Peirce]]<ref>Polcino & Sehgal (2002), p. 127.</ref> in the context of elements of algebras that remain invariant when raised to a positive integer power, and literally means "(the quality of having) the same power", from ''[[wikt:idem|idem]]'' + ''[[wikt:potence|potence]]'' (same + power). |
|||
An element <math>x</math> of a set <math>S</math> equipped with a [[binary operator]] <math>\cdot</math> is said to be ''idempotent'' under <math>\cdot</math> if<ref>{{cite book |last=Valenza |first=Robert |date=2012 |title=Linear Algebra: An Introduction to Abstract Mathematics |url=https://books.google.com/books?id=7x8MCAAAQBAJ |location=Berlin |publisher=Springer Science & Business Media |page=22 |isbn=9781461209010 |quote=An element ''s'' of a magma such that ''ss'' = ''s'' is called ''idempotent''.}}</ref><ref>{{cite book |last=Doneddu |first=Alfred |date=1976 |title=Polynômes et algèbre linéaire |url=https://books.google.com/books?id=5Ry7AAAAIAAJ |language=fr |location=Paris |publisher=Vuibert |page=180 |quote=Soit ''M'' un magma, noté multiplicativement. On nomme idempotent de ''M'' tout élément ''a'' de ''M'' tel que ''a''<sup>2</sup> = ''a''.}}</ref> |
|||
: {{nowrap|1=<math>x\cdot x=x</math>}}. |
|||
The ''binary operation'' <math>\cdot</math> is said to be ''idempotent'' if<ref>{{cite book | author=George Grätzer | title=General Lattice Theory | url=https://archive.org/details/generallatticeth0000grat | url-access=registration | location=Basel | publisher=Birkhäuser | year=2003 | isbn=978-3-7643-6996-5 }} Here: Sect.1.2, p.5.</ref><ref>{{cite book | author=Garrett Birkhoff | title=Lattice Theory | location=Providence | publisher=Am. Math. Soc. | series=Colloquium Publications | volume=25 | year=1967 }}. Here: Sect.I.5, p.8.</ref> |
|||
: {{nowrap|1=<math>x\cdot x=x</math> for all <math>x\in S</math>}}. |
|||
== Examples == |
|||
There are several meanings of idempotence, depending on what the concept is applied to: |
|||
* In the [[monoid]] <math>(\mathbb{N}, \times)</math> of the [[natural number]]s with [[multiplication]], only <math>0</math> and <math>1</math> are idempotent. Indeed, {{nowrap|1=<math>0\times 0 = 0</math>}} and {{nowrap|1=<math>1\times 1=1</math>}}. |
|||
* In the [[monoid]] <math>(\mathbb{N}, +)</math> of the [[natural number]]s with [[addition]], only <math>0</math> is idempotent. Indeed, {{nowrap|1=0 + 0 = 0}}. |
|||
* In a [[Magma (algebra)|magma]] <math>(M, \cdot)</math>, an [[identity element]] <math>e</math> or an [[absorbing element]] <math>a</math>, if it exists, is idempotent. Indeed, {{nowrap|1=<math>e\cdot e=e</math>}} and {{nowrap|1=<math>a\cdot a=a</math>}}. |
|||
* In a [[Group (mathematics)|group]] <math>(G, \cdot)</math>, the identity element <math>e</math> is the only idempotent element. Indeed, if <math>x</math> is an element of <math>G</math> such that {{nowrap|1=<math>x\cdot x=x</math>}}, then {{nowrap|1=<math>x\cdot x=x\cdot e</math>}} and finally <math>x=e</math> by multiplying on the left by the [[inverse element]] of <math>x</math>. |
|||
* In the monoids <math>(\mathcal{P}(E), \cup)</math> and <math>(\mathcal{P}(E), \cap)</math> of the [[power set]] <math>\mathcal{P}(E)</math> of the set <math>E</math> with [[Union (set theory)|set union]] <math>\cup</math> and [[Intersection (set theory)|set intersection]] <math>\cap</math> respectively, <math>\cup</math> and <math>\cap</math> are idempotent. Indeed, {{nowrap|1=<math>x\cup x=x</math> for all <math>x\in \mathcal{P}(E)</math>}}, and {{nowrap|1=<math>x\cap x=x</math> for all <math>x\in \mathcal{P}(E)</math>}}. |
|||
* In the monoids <math>(\{0, 1\}, \vee)</math> and <math>(\{0, 1\}, \wedge)</math> of the [[Boolean domain]] with [[logical disjunction]] <math>\vee</math> and [[logical conjunction]] <math>\wedge</math> respectively, <math>\vee</math> and <math>\wedge</math> are idempotent. Indeed, {{nowrap|1=<math>x\vee x=x</math> for all <math>x\in \{0, 1\}</math>}}, and {{nowrap|1=<math>x\wedge x=x</math> for all <math>x\in \{0, 1\}</math>}}. |
|||
* In a [[GCD domain]] (for instance in <math>\mathbb{Z}</math>), the operations of [[greatest common divisor|GCD]] and [[least common multiple|LCM]] are idempotent. |
|||
* In a [[Boolean ring]], multiplication is idempotent. |
|||
* In a [[Tropical semiring]], addition is idempotent. |
|||
* In a [[Matrix_ring|ring of quadratic matrices]], the [[determinant]] of an [[idempotent matrix]] is either 0 or 1. If the determinant is 1, the matrix necessarily is the [[identity matrix]].{{cn|date=November 2022}} |
|||
===Idempotent functions=== |
|||
*A [[unary operation]] (or [[function (mathematics)|function]]) is idempotent if, whenever it is applied twice to any value, it gives the same result as if it were applied once; i.e., {{nowrap|''ƒ''(''ƒ''(''x'')) ≡ ''ƒ''(''x'')}}. For example, the [[absolute value]] function, where {{nowrap|abs(abs(''x'')) ≡ abs(''x'')}}, is idempotent. |
|||
In the monoid <math>(E^E, \circ)</math> of the functions from a set <math>E</math> to itself (see [[Function_(mathematics)#Set_exponentiation|set exponentiation]]) with [[function composition]] <math>\circ</math>, idempotent elements are the functions {{nowrap|<math>f\colon E\to E</math>}} such that {{nowrap|1=<math>f\circ f = f</math>}},<ref>This is an equation between functions. Two functions are equal if their domains and ranges agree, and their output values agree on their whole domain.</ref> that is such that {{nowrap|1=<math>f(f(x))=f(x)</math> for all <math>x\in E</math>}} (in other words, the image <math>f(x)</math> of each element <math>x\in E</math> is a [[Fixed point (mathematics)|fixed point]] of <math>f</math>). For example: |
|||
*Given a binary operation, an idempotent element (or simply an "idempotent") for the operation is a value for which the operation, when given that value for both of its operands, gives that value as the result. For example, the number 1 is an idempotent of [[multiplication]]: {{nowrap|1=1 × 1 = 1}}. |
|||
* the [[absolute value]] is idempotent. Indeed, {{nowrap|1=<math>\operatorname{abs}\circ \operatorname{abs}=\operatorname{abs}</math>}}, that is {{nowrap|1=<math>\operatorname{abs}(\operatorname{abs}(x))=\operatorname{abs}(x)</math> for all <math>x</math>}}; |
|||
*A [[binary operation]] is called idempotent if all elements are idempotent elements with respect to the operation. In other words, whenever it is applied to two equal values, it gives that value as the result. For example, the function giving the [[maximum]] value of two equal values is idempotent: {{nowrap|max(''x'', ''x'') ≡ ''x''}}. |
|||
* [[Constant function|constant]] functions are idempotent; |
|||
* the [[identity function]] is idempotent; |
|||
* the [[Floor and ceiling functions|floor]], [[Floor and ceiling functions|ceiling]] and [[fractional part]] functions are idempotent; |
|||
* the real part function <math>\mathrm{Re}(z)</math> of a [[complex number]], is idempotent. |
|||
* the [[Generating set of a group|subgroup generated]] function from the power set of a group to itself is idempotent; |
|||
* the [[convex hull]] function from the power set of an [[affine space]] over the [[Real number|reals]] to itself is idempotent; |
|||
* the [[Closure (topology)|closure]] and [[Interior (topology)|interior]] functions of the power set of a [[topological space]] to itself are idempotent; |
|||
* the [[Kleene star]] and [[Kleene plus]] functions of the power set of a monoid to itself are idempotent; |
|||
* the idempotent [[endomorphism]]s of a [[vector space]] are its [[Projection (linear algebra)|projections]]. |
|||
If the set <math>E</math> has <math>n</math> elements, we can partition it into <math>k</math> chosen fixed points and {{nowrap|<math>n-k</math>}} non-fixed points under <math>f</math>, and then <math>k^{n-k}</math> is the number of different idempotent functions. Hence, taking into account all possible partitions, |
|||
== Definitions == |
|||
: <math>\sum_{k=0}^n {n \choose k} k^{n-k}</math> |
|||
is the total number of possible idempotent functions on the set. The [[integer sequence]] of the number of idempotent functions as given by the sum above for ''n'' = 0, 1, 2, 3, 4, 5, 6, 7, 8, ... starts with 1, 1, 3, 10, 41, 196, 1057, 6322, 41393, ... {{OEIS|A000248}}. |
|||
Neither the property of being idempotent nor that of being not is preserved under function composition.<ref>If <math>f</math> and <math>g</math> commute under composition (i.e. if {{nowrap|1=<math>f\circ g=g\circ f</math>}}) then idempotency of both <math>f</math> and <math>g</math> implies that of {{nowrap|<math>f\circ g</math>}}, since {{nowrap|1=<math>(f\circ g)\circ (f\circ g)=f\circ (g\circ f)\circ g=f\circ (f\circ g)\circ g=(f\circ f)\circ (g\circ g)=f\circ g</math>}}, using the associativity of composition.</ref> As an example for the former, {{nowrap|1=<math>f(x)=x</math>}} [[modular arithmetic|mod]] 3 and <math>g(x)=\max(x, 5)</math> are both idempotent, but {{nowrap|<math>f\circ g</math>}} is not,<ref>e.g. <math>f(g(7))=f(7)=1</math>, but <math>f(g(1))=f(5)=2\neq 1</math></ref> although {{nowrap|<math>g\circ f</math>}} happens to be.<ref>also showing that commutation of <math>f</math> and <math>g</math> is not a [[necessary condition]] for idempotency preservation</ref> As an example for the latter, the negation function <math>\neg</math> on the Boolean domain is not idempotent, but {{nowrap|<math>\neg\circ\neg</math>}} is. Similarly, unary negation {{nowrap|<math>-(\cdot)</math>}} of real numbers is not idempotent, but {{nowrap|<math>-(\cdot)\circ -(\cdot)</math>}} is. In both cases, the composition is simply the [[identity function]], which is idempotent. |
|||
===Unary operation=== |
|||
A [[unary operation]] <math>f</math>, that is, a map from some set <math>S</math> into itself, is called idempotent if, for all <math>x</math> in <math>S</math>, |
|||
:<math>f\!\left(f\!\left(x\right)\right) = f\!\left(x\right)</math>. |
|||
== Computer science meaning == |
|||
In particular, the [[identity function]] <math>\text{id}_S</math>, defined by <math>\text{id}_S\left(x\right) = x</math>, is idempotent, as is the [[constant function]] <math>K_c</math>, where <math>c</math> is an element of <math>S</math>, defined by <math>K_c\left(x\right) = c</math>. |
|||
{{See also|Referential transparency|Reentrant (subroutine)|Stable sort|Command query separation}} |
|||
In [[computer science]], the term ''idempotence'' may have a different meaning depending on the context in which it is applied: |
|||
* in [[imperative programming]], a [[subroutine]] with [[Side effect (computer science)|side effects]] is idempotent if multiple calls to the subroutine have the same effect on the system state as a single call, in other words if the function from the system state space to itself associated with the subroutine is idempotent in the mathematical sense given in [[#Definition|the definition]]; |
|||
* in [[functional programming]], a [[pure function]] is idempotent if it is idempotent in the mathematical sense given in [[#Definition|the definition]]. |
|||
This is a very useful property in many situations, as it means that an operation can be repeated or retried as often as necessary without causing unintended effects. With non-idempotent operations, the algorithm may have to keep track of whether the operation was already performed or not. |
|||
An important class of idempotent functions is given by [[projection (linear algebra)|projection]]s in a [[vector space]]. An example of a projection is the function <math>\pi_{xy}</math> defined by <math>\pi_{xy}\left(x, y, z\right) = \left(x, y, 0\right)</math>, which projects an arbitrary point in 3D space to a point on the <math>xy</math>-[[plane (mathematics)|plane]], where the third coordinate (<math>z</math>) is equal to 0. |
|||
=== Computer science examples === |
|||
A unary operation <math>f\colon S \to S</math> is idempotent if it maps each element of <math>S</math> to a [[Fixed point (mathematics)|fixed point]] of <math>f</math>. We can partition a set with <math>n</math> elements into <math>k</math> chosen fixed points and <math>n-k</math> non-fixed points, and then <math>k^{n-k}</math> is the number of different idempotent functions. Hence, taking into account all possible partitions, |
|||
A function looking up a customer's name and address in a [[database]] is typically idempotent, since this will not cause the database to change. Similarly, a request for changing a customer's address to XYZ is typically idempotent, because the final address will be the same no matter how many times the request is submitted. However, a customer request for placing an order is typically not idempotent since multiple requests will lead to multiple orders being placed. A request for canceling a particular order is idempotent because no matter how many requests are made the order remains canceled. |
|||
:<math>\sum_{k=0}^n {n \choose k} k^{n-k}</math> |
|||
is the total number of possible idempotent functions on the set. The [[integer sequence]] of the number of idempotent functions as given by the sum above for <math>n = \left\{0, 1, 2, \dots\right\}</math> starts with <math>1, 1, 3, 10, 41, 196, 1057, 6322, 41393, \dots</math>. {{OEIS|A000248}} |
|||
A sequence of idempotent subroutines where at least one subroutine is different from the others, however, is not necessarily idempotent if a later subroutine in the sequence changes a value that an earlier subroutine depends on—''idempotence is not closed under sequential composition''. For example, suppose the initial value of a variable is 3 and there is a subroutine sequence that reads the variable, then changes it to 5, and then reads it again. Each step in the sequence is idempotent: both steps reading the variable have no side effects and the step changing the variable to 5 will always have the same effect no matter how many times it is executed. Nonetheless, executing the entire sequence once produces the output (3, 5), but executing it a second time produces the output (5, 5), so the sequence is not idempotent.<!-- {{Citation needed|date=December 2017}} please discuss this on talk page before reinstating --> |
|||
Neither the property of being idempotent nor that of being not is preserved under composition of unary functions.<ref>If ''f'' and ''g'' commute, i.e. if ''f''∘''g'' = ''g''∘''f'', then idempotency of both ''f'' and ''g'' implies that of ''f''∘''g'', since ''f''∘''g'' ∘ ''f''∘''g'' = ''f''∘''f'' ∘ ''g''∘''g'' = ''f'' ∘ ''g'', using the associativity of composition.</ref> As an example for the former, ''f''(''x'') = ''x'' [[modulo arithmetic|mod]] 3 and ''g''(''x'') = max(''x'',5) are both idempotent, but ''f''∘''g'' is not,<ref>e.g. ''f''(''g''(7)) = ''f''(7) = 1, but ''f''(''g''(1)) = ''f''(5) = 2 ≠ 1</ref> although ''g''∘''f'' happens to be.<ref>also showing that commutation of ''f'' and ''g'' is not a [[necessary condition]] for idempotency preservation</ref> As an example for the latter, the negation function ¬ on [[truth value]]s isn't idempotent, but ¬∘¬ is. |
|||
<syntaxhighlight lang=c> |
|||
int x = 3; |
|||
void inspect() { printf("%d\n", x); } |
|||
void change() { x = 5; } |
|||
void sequence() { inspect(); change(); inspect(); } |
|||
int main() { |
|||
===Idempotent elements and binary operations=== |
|||
sequence(); // prints "3\n5\n" |
|||
Given a [[binary operation]] <math>\bigstar</math> on a set <math>S</math>, an element <math>x</math> is said to be idempotent (with respect to <math>\bigstar</math>) if: |
|||
sequence(); // prints "5\n5\n" |
|||
:<math>x \,\bigstar\, x = x</math>. |
|||
return 0; |
|||
In particular an [[identity element]] of <math>\bigstar</math>, if it exists, is idempotent with respect to the operation <math>\bigstar</math>. |
|||
} |
|||
The binary operation itself is called idempotent if every element of <math>S</math> is idempotent. That is, for all <math>x \in S</math> where <math>\in</math> denotes set membership: |
|||
</syntaxhighlight> |
|||
:<math>x \,\bigstar\, x = x</math>. |
|||
For example, the operations of [[union (set theory)|set union]] and [[intersection (set theory)|set intersection]] are both idempotent, as are [[logical conjunction]] and [[logical disjunction]], and, in general, the [[meet (mathematics)|meet]] and [[join (mathematics)|join]] operations of a [[lattice (order)|lattice]]. |
|||
In the [[Hypertext Transfer Protocol]] (HTTP), idempotence and [[Hypertext Transfer Protocol#Safe methods|safety]] are the major attributes that separate [[Hypertext Transfer Protocol#Request methods|HTTP methods]]. Of the major HTTP methods, GET, PUT, and DELETE should be implemented in an idempotent manner according to the standard, but POST doesn't need to be.<ref name="httpStd-methods">IETF, [http://tools.ietf.org/html/rfc7231#section-4.2.2 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content] {{webarchive|url=https://web.archive.org/web/20140608213403/http://tools.ietf.org/html/rfc7231 |date=2014-06-08 }}. See also [[Hypertext Transfer Protocol|HyperText Transfer Protocol]].</ref> GET retrieves the state of a resource; PUT updates the state of a resource; and DELETE deletes a resource. As in the example above, reading data usually has no side effects, so it is idempotent (in fact [[wiktionary:nullipotent|''nullipotent'']]). Updating and deleting a given data are each usually idempotent as long as the request uniquely identifies the resource and only that resource again in the future. PUT and DELETE with unique identifiers reduce to the simple case of assignment to a variable of either a value or the null-value, respectively, and are idempotent for the same reason; the end result is always the same as the result of the initial execution, even if the response differs.<ref>{{cite IETF|title=Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |rfc=7231 |section=4.2.2 |sectionname=Idempotent Methods |quote=It knows that repeating the request will have the same intended effect, even if the original request succeeded, though the response might differ.}}</ref> |
|||
===Connections=== |
|||
Violation of the unique identification requirement in storage or deletion typically causes violation of idempotence. For example, storing or deleting a given set of content without specifying a unique identifier: POST requests, which do not need to be idempotent, often do not contain unique identifiers, so the creation of the identifier is delegated to the receiving system which then creates a corresponding new record. Similarly, PUT and DELETE requests with nonspecific criteria may result in different outcomes depending on the state of the system - for example, a request to delete the most recent record. In each case, subsequent executions will further modify the state of the system, so they are not idempotent. |
|||
The connections between the three notions are as follows. |
|||
In [[event stream processing]], idempotence refers to the ability of a system to produce the same outcome, even if the same file, event or message is received more than once. |
|||
*The statement that the binary operation ★ on a set ''S'' is idempotent, is equivalent to the statement that every element of ''S'' is idempotent for ★. |
|||
*The defining property of unary idempotence, {{nowrap|1=''f''(''f''(''x'')) = ''f''(''x'')}} for ''x'' in the domain of ''f'', can equivalently be rewritten as {{nowrap|1=''f'' ∘ ''f'' = ''f''}}, using the binary operation of [[function composition]] denoted by ∘. Thus, the statement that ''f'' is an idempotent unary operation on ''S'' is equivalent to the statement that ''f'' is an idempotent element with respect to the function composition operation ∘ on functions from ''S'' to ''S''. |
|||
In a [[load–store architecture]], instructions that might possibly cause a [[page fault]] are idempotent. So if a page fault occurs, the [[operating system]] can load the page from disk and then simply re-execute the faulted instruction. In a processor where such instructions are not idempotent, dealing with page faults is much more complex.<ref> |
|||
==Common examples== |
|||
[[John Ousterhout]]. |
|||
[https://web.stanford.edu/~ouster/cgi-bin/cs140-spring14/lecture.php?topic=paging "Demand Paging"]. |
|||
</ref><ref> |
|||
Marc A. de Kruijf. |
|||
[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.259.7708&rep=rep1&type=pdf "Compiler construction of idempotent regions and applications in architecture design"]. |
|||
2012. |
|||
p. 10. |
|||
</ref> |
|||
When reformatting output, [[prettyprint|pretty-printing]] is expected to be idempotent. In other words, if the output is already "pretty", there should be nothing to do for the pretty-printer.{{Citation needed|date=March 2017}} |
|||
=== Functions === |
|||
As mentioned above, the identity map and the constant maps are always idempotent maps. The [[absolute value]] function of a [[real number|real]] or [[complex number|complex]] argument, and the [[floor function]] of a real argument are idempotent. |
|||
In [[service-oriented architecture]] (SOA), a multiple-step orchestration process composed entirely of idempotent steps can be replayed without side-effects if any part of that process fails. |
|||
The function that assigns to every subset <math>U</math> of some [[topological space]] <math>X</math> the [[closure (topology)|closure]] of <math>U</math> is idempotent on the [[power set]] <math>\mathcal{P}\left(X\right)</math> of <math>X</math>. It is an example of a [[closure operator]]; all closure operators are idempotent functions. |
|||
Many operations that are idempotent often have ways to "resume" a process if it is interrupted{{snd}} ways that finish much faster than starting all over from the beginning. For example, [[upload#Resumability of file transfers|resuming a file transfer]], |
|||
The operation of subtracting the mean of a list of numbers from every number in the list is idempotent. For example, consider the numbers <math>3, 6, 8, 8, \text{and }10</math>. The mean is <math>\frac{3 + 6 + 8 + 8 + 10}{5} = \frac{35}{5} = 7</math>. Subtracting 7 from every number in the list yields <math>\left(-4\right), \left(-1\right), 1, 1, 3</math>. The mean of that list is <math>\frac{\left(-4\right) + \left(-1\right) + 1 + 1 +3}{5} = \frac{0}{5} = 0</math>. Subtracting 0 from every number in that list yields the same list. |
|||
[[rsync|synchronizing files]], creating a [[software build]], installing an application and all of its dependencies with a [[package manager]], etc. |
|||
== Applied examples == |
|||
[[File:Colección de hombres cruzando.JPG|thumb|A typical crosswalk button is an example of an idempotent system]] |
|||
The [[Kleene star]] and [[Kleene plus]] operators used to express repetition in [[Formal grammar|formal languages]] are idempotent. |
|||
Applied examples that many people could encounter in their day-to-day lives include [[elevator]] call buttons and [[crosswalk button]]s.<ref>{{cite web |url=http://www.nclabor.com/elevator/geartrac.pdf |title=Geared Traction Passenger Elevator Specification Guide Information/Instructions |work=NC Department Of Labor, Elevator Bureau |year=2002 |archive-url=https://web.archive.org/web/20110523081716/http://www.nclabor.com/elevator/geartrac.pdf |archive-date=2011-05-23 |url-status=dead}} For example, this design specification includes detailed algorithm for when elevator cars will respond to subsequent calls for service</ref> The initial activation of the button moves the system into a requesting state, until the request is satisfied. Subsequent activations of the button between the initial activation and the request being satisfied have no effect, unless the system is designed to adjust the time for satisfying the request based on the number of activations. |
|||
== See also == |
|||
* [[Biordered set]] |
|||
{{main |Idempotent (ring theory)}} |
|||
* [[Closure operator]] |
|||
An idempotent element of a [[ring (mathematics)|ring]] is, by definition, an element that is idempotent for the ring's multiplication.<ref>See [[Michiel Hazewinkel|Hazewinkel]] et al. (2004), p. 2.</ref> That is, an element ''a'' is idempotent precisely when {{nowrap|1=''a''<sup>2</sup> = ''a''}}. |
|||
* [[Fixed point (mathematics)]] |
|||
* [[Idempotent of a code]] |
|||
* [[Idempotent analysis]] |
|||
* [[Idempotent matrix]] |
|||
* [[Idempotent relation]]{{snd}} a generalization of idempotence to binary relations |
|||
* [[Idempotent (ring theory)]] |
|||
* [[Involution (mathematics)]] |
|||
* [[Iterated function]] |
|||
* [[List of matrices]] |
|||
* [[Nilpotent]] |
|||
* [[Pure function]] |
|||
* [[Referential transparency]] |
|||
== References == |
|||
Idempotent elements of rings yield [[Indecomposable module|direct decomposition]]s of [[module (algebra)|modules]], and play a role in describing other homological properties of the ring. |
|||
While "idempotent" usually refers to the multiplication operation of a ring, there are rings in which both operations are idempotent: [[Boolean algebra]]s are such an example. |
|||
=== Other examples === |
|||
In [[Boolean algebra]], both the [[Logical conjunction|logical and]] and the [[Logical disjunction|logical or]] operations are idempotent. This implies that every element of Boolean algebra is idempotent with respect to both of these operations. Specifically, <math>x \wedge x = x</math> and <math>x \vee x = x</math> for all <math>x</math>. |
|||
In [[linear algebra]], [[projection (linear algebra)|projection]]s are idempotent. In fact, the projections of a vector space are exactly the idempotent elements of the ring of [[linear transformation]]s of the vector space. After fixing a [[basis (linear algebra)|basis]], it can be shown that the matrix of a projection with respect to this basis is an idempotent matrix. |
|||
An [[idempotent semiring]] (also sometimes called a ''dioid'') is a semiring whose ''addition'' (not multiplication) is idempotent. If both operations of the semiring are idempotent, then the semiring is called ''doubly idempotent''.<ref>Gondran & Minoux. ''Graphs, dioids and semirings''. Springer, 2008, p. 34</ref> |
|||
==Computer science meaning== |
|||
{{See also|Referential transparency (computer science)|Reentrant (subroutine)|Stable sort}} |
|||
In [[computer science]], the term '''idempotent''' is used more comprehensively to describe an operation that will produce the same results if executed once or multiple times.<ref name=IBM>{{cite web|last=Rodriguez|first=Alex|title=RESTful Web services: The basics|url=https://www.ibm.com/developerworks/webservices/library/ws-restful/|work=IBM developerWorks|publisher=IBM|accessdate=24 April 2013}}</ref> This may have a different meaning depending on the context in which it is applied. In the case of [[Method (computer science)|method]]s or [[subroutine]] calls with [[Side effect (computer science)|side effects]], for instance, it means that the modified state remains the same after the first call. In [[functional programming]], though, an idempotent function is one that has the property {{nowrap|1=''f''(''f''(''x'')) = ''f''(''x'')}} for any value ''x''.<ref>http://foldoc.org/idempotent</ref> |
|||
This is a very useful property in many situations, as it means that an operation can be repeated or retried as often as necessary without causing unintended effects. With non-idempotent operations, the algorithm may have to keep track of whether the operation was already performed or not. |
|||
=== Examples === |
|||
A function looking up a customer's name and address in a [[database]] is typically idempotent, since this will not cause the database to change. Similarly, changing a customer's address is typically idempotent, because the final address will be the same no matter how many times it is submitted. However, placing an order for a car for the customer is typically not idempotent, since running the call several times will lead to several orders being placed. Canceling an order is idempotent, because the order remains canceled no matter how many requests are made. |
|||
A composition of idempotent methods or subroutines, however, is not necessarily idempotent if a later method in the sequence changes a value that an earlier method depends on – idempotence is not closed under composition. For example, suppose the initial value of a variable is 3 and there is a sequence that reads the variable, then changes it to 5, and then reads it again. Each step in the sequence is idempotent: both steps reading the variable have no side effects and changing a variable to 5 will always have the same effect no matter how many times it is executed. Nonetheless, executing the entire sequence once produces the output (3, 5), but executing it a second time produces the output (5, 5), so the sequence is not idempotent.<ref name="httpStd-methods">IETF, [http://tools.ietf.org/html/rfc7231#section-4.2.2 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]. See also [[Hypertext Transfer Protocol|HyperText Transfer Protocol]].</ref> |
|||
In the [[Hypertext Transfer Protocol]] (HTTP), idempotence and [[Hypertext Transfer Protocol#Safe methods|safety]] are the major attributes that separate [[Hypertext Transfer Protocol#Request methods|HTTP verbs]]. Of the major HTTP verbs, GET, PUT, and DELETE should be implemented in an idempotent manner according to the standard, but POST need not be.<ref name="httpStd-methods" /> GET retrieves a resource; PUT stores content at a resource; and DELETE eliminates a resource. As in the example above, reading data usually has no side effects, so it is idempotent (in fact nullipotent). Storing and deleting a given set of content are each usually idempotent as long as the request specifies a location or identifier that uniquely identifies that resource and only that resource again in the future. The PUT and DELETE operations with unique identifiers reduce to the simple case of assignment to an immutable variable of either a value or the null-value, respectively, and are idempotent for the same reason; the end result is always the same as the result of the initial execution. |
|||
Violation of the unique identification requirement in storage or deletion typically causes violation of idempotence. For example, storing or deleting a given set of content without specifying a unique identifier: POST request, which do not need to be idempotent, often do not contain unique identifiers, so the creation of the identifier is delegated to the receiving system which then creates a corresponding new record. Similarly, PUT and DELETE requests with nonspecific criteria may result in different outcomes depending on the state of the system - for example, a request to delete the most recent record. In each case, subsequent executions will further modify the state of the system, so they are not idempotent. |
|||
In [[Event Stream Processing]], idempotence refers to the ability of a system to produce the same outcome, even if an event or message is received more than once. |
|||
In a [[load-store architecture]], instructions that might possibly cause a [[page fault]] are idempotent. So if a page fault occurs, the OS can load the page from disk and then simply re-execute the faulted instruction. In a processor where such instructions are not idempotent, dealing with page faults is much more complex.{{fact|date=August 2016}} |
|||
When reformatting output, [[Prettyprint|pretty-printing]] is expected to be idempotent. In other words, if the output is already "pretty", there should be nothing to do for the pretty-printer. |
|||
==Applied examples== |
|||
Applied examples that many people could encounter in their day-to-day lives include [[elevator]] call buttons and crosswalk buttons.<ref>http://web.archive.org/web/20110523081716/http://www.nclabor.com/elevator/geartrac.pdf For example, this design specification includes detailed algorithm for when elevator cars will respond to subsequent calls for service</ref> The initial activation of the button moves the system into a requesting state, until the request is satisfied. Subsequent activations of the button between the initial activation and the request being satisfied have no effect. |
|||
==See also== |
|||
*[[Closure operator]] |
|||
*[[Fixed point (mathematics)]] |
|||
*[[Idempotent of a code]] |
|||
*[[Nilpotent]] |
|||
*[[Idempotent matrix]] |
|||
*[[Idempotent relation]] — a generalization of idempotence to binary relations |
|||
*[[List of matrices]] |
|||
*[[Pure function]] |
|||
*[[Referential transparency]] |
|||
*[[Iterated function]] |
|||
*[[Biordered set]] |
|||
*[[Involution (mathematics)]] |
|||
==References== |
|||
{{Reflist|30em}} |
{{Reflist|30em}} |
||
http://www.merriam-webster.com/dictionary/idempotent |
|||
== Further reading == |
== Further reading == |
||
{{wiktionary}} |
{{wiktionary}} |
||
{{ |
{{Wikibooks}} |
||
{{ |
{{Wikiversity | Portal:Computer Science}} |
||
* |
* "[http://foldoc.org/idempotent idempotent]" at the [[Free On-line Dictionary of Computing]] |
||
*{{citation |
*{{citation |
||
|author=Goodearl, K. R. |
|author=Goodearl, K. R. |
||
Line 123: | Line 130: | ||
|year=1991 |
|year=1991 |
||
|pages=xviii+412 |
|pages=xviii+412 |
||
|isbn=0-89464-632- |
|isbn=978-0-89464-632-4 |
||
|mr=1150975 |
|mr=1150975}} |
||
* {{citation | last=Gunawardena | first=Jeremy | chapter=An introduction to idempotency | zbl=0898.16032 | editor1-last=Gunawardena | editor1-first=Jeremy | title=Idempotency. Based on a workshop, Bristol, UK, October 3–7, 1994 | location=Cambridge | publisher=[[Cambridge University Press]] | pages=1–49 | year=1998 | url=http://www.hpl.hp.com/techreports/96/HPL-BRIMS-96-24.pdf }} |
* {{citation | last=Gunawardena | first=Jeremy | chapter=An introduction to idempotency | zbl=0898.16032 | editor1-last=Gunawardena | editor1-first=Jeremy | title=Idempotency. Based on a workshop, Bristol, UK, October 3–7, 1994 | location=Cambridge | publisher=[[Cambridge University Press]] | pages=1–49 | year=1998 | chapter-url=http://www.hpl.hp.com/techreports/96/HPL-BRIMS-96-24.pdf }} |
||
* {{springer|title=Idempotent|id=p/i050080}} |
* {{springer|title=Idempotent|id=p/i050080}} |
||
*{{citation |
*{{citation |
||
|author1= |
|author1=Hazewinkel, Michiel |
||
|author-link=Hazewinkel, Michiel |
|||
|author2=Gubareni, Nadiya |
|author2=Gubareni, Nadiya |
||
|author3=Kirichenko, V. V. |
|author3=Kirichenko, V. V. |
||
Line 138: | Line 146: | ||
|year=2004 |
|year=2004 |
||
|pages=xii+380 |
|pages=xii+380 |
||
|isbn=1-4020-2690- |
|isbn=978-1-4020-2690-4 |
||
|mr=2106764 |
|mr=2106764}} |
||
*{{citation |
*{{citation |
||
|author=Lam, T. Y. |
|author=Lam, T. Y. |
||
Line 150: | Line 158: | ||
|year=2001 |
|year=2001 |
||
|pages=xx+385 |
|pages=xx+385 |
||
|isbn=0-387-95183- |
|isbn=978-0-387-95183-6 |
||
|mr=1838439 |
|mr=1838439 |
||
|doi=10.1007/978-1-4419-8616-0}} |
|||
* {{Lang Algebra|edition=3}} p. 443 |
* {{Lang Algebra|edition=3}} p. 443 |
||
* Peirce, Benjamin. [http://www.math.harvard.edu/history/peirce_algebra/ |
* Peirce, Benjamin. [http://legacy-www.math.harvard.edu/history/peirce_algebra/ ''Linear Associative Algebra''] 1870. |
||
* {{citation |last1=Polcino Milies |ref={{harvid|Polcino|Sehgal|2002}} |last2=Sehgal |first2=Sudarshan K. |first1=César |title=An Introduction to Group Rings |series=Algebras and Applications |url=https://books.google.com/books?id=7m9P9hM4pCQC&q=Idempotence&pg=PA127 |volume=1 |publisher=Kluwer Academic Publishers |place= |year=2002 |pages=[https://books.google.com/books?id=7m9P9hM4pCQC&q=Idempotence&pg=PA127 127] |isbn=978-1-4020-0238-0 |mr=1896125 |doi=}} |
|||
*{{citation |
|||
|author1=Polcino Milies, César |
|||
|author2=Sehgal, Sudarshan K. |
|||
|title=An introduction to group rings |
|||
|series=Algebras and Applications |
|||
|volume=1 |
|||
|publisher=Kluwer Academic Publishers |
|||
|place=Dordrecht |
|||
|year=2002 |
|||
|pages=xii+371 |
|||
|isbn=1-4020-0238-6 |
|||
|mr=1896125 (2003b:16026)}} |
|||
[[Category: |
[[Category:Properties of binary operations]] |
||
[[Category:Algebraic properties of elements]] |
|||
[[Category:Closure operators]] |
[[Category:Closure operators]] |
||
[[Category:Mathematical relations]] |
[[Category:Mathematical relations]] |
||
[[Category:Theoretical computer science]] |
[[Category:Theoretical computer science]] |
||
[[Category:Binary operations]] |
Latest revision as of 14:19, 14 November 2024
Idempotence (UK: /ˌɪdɛmˈpoʊtəns/,[1] US: /ˈaɪdəm-/)[2] is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of places in abstract algebra (in particular, in the theory of projectors and closure operators) and functional programming (in which it is connected to the property of referential transparency).
The term was introduced by American mathematician Benjamin Peirce in 1870[3][4] in the context of elements of algebras that remain invariant when raised to a positive integer power, and literally means "(the quality of having) the same power", from idem + potence (same + power).
Definition
[edit]An element of a set equipped with a binary operator is said to be idempotent under if[5][6]
- .
The binary operation is said to be idempotent if[7][8]
- for all .
Examples
[edit]- In the monoid of the natural numbers with multiplication, only and are idempotent. Indeed, and .
- In the monoid of the natural numbers with addition, only is idempotent. Indeed, 0 + 0 = 0.
- In a magma , an identity element or an absorbing element , if it exists, is idempotent. Indeed, and .
- In a group , the identity element is the only idempotent element. Indeed, if is an element of such that , then and finally by multiplying on the left by the inverse element of .
- In the monoids and of the power set of the set with set union and set intersection respectively, and are idempotent. Indeed, for all , and for all .
- In the monoids and of the Boolean domain with logical disjunction and logical conjunction respectively, and are idempotent. Indeed, for all , and for all .
- In a GCD domain (for instance in ), the operations of GCD and LCM are idempotent.
- In a Boolean ring, multiplication is idempotent.
- In a Tropical semiring, addition is idempotent.
- In a ring of quadratic matrices, the determinant of an idempotent matrix is either 0 or 1. If the determinant is 1, the matrix necessarily is the identity matrix.[citation needed]
Idempotent functions
[edit]In the monoid of the functions from a set to itself (see set exponentiation) with function composition , idempotent elements are the functions such that ,[9] that is such that for all (in other words, the image of each element is a fixed point of ). For example:
- the absolute value is idempotent. Indeed, , that is for all ;
- constant functions are idempotent;
- the identity function is idempotent;
- the floor, ceiling and fractional part functions are idempotent;
- the real part function of a complex number, is idempotent.
- the subgroup generated function from the power set of a group to itself is idempotent;
- the convex hull function from the power set of an affine space over the reals to itself is idempotent;
- the closure and interior functions of the power set of a topological space to itself are idempotent;
- the Kleene star and Kleene plus functions of the power set of a monoid to itself are idempotent;
- the idempotent endomorphisms of a vector space are its projections.
If the set has elements, we can partition it into chosen fixed points and non-fixed points under , and then is the number of different idempotent functions. Hence, taking into account all possible partitions,
is the total number of possible idempotent functions on the set. The integer sequence of the number of idempotent functions as given by the sum above for n = 0, 1, 2, 3, 4, 5, 6, 7, 8, ... starts with 1, 1, 3, 10, 41, 196, 1057, 6322, 41393, ... (sequence A000248 in the OEIS).
Neither the property of being idempotent nor that of being not is preserved under function composition.[10] As an example for the former, mod 3 and are both idempotent, but is not,[11] although happens to be.[12] As an example for the latter, the negation function on the Boolean domain is not idempotent, but is. Similarly, unary negation of real numbers is not idempotent, but is. In both cases, the composition is simply the identity function, which is idempotent.
Computer science meaning
[edit]In computer science, the term idempotence may have a different meaning depending on the context in which it is applied:
- in imperative programming, a subroutine with side effects is idempotent if multiple calls to the subroutine have the same effect on the system state as a single call, in other words if the function from the system state space to itself associated with the subroutine is idempotent in the mathematical sense given in the definition;
- in functional programming, a pure function is idempotent if it is idempotent in the mathematical sense given in the definition.
This is a very useful property in many situations, as it means that an operation can be repeated or retried as often as necessary without causing unintended effects. With non-idempotent operations, the algorithm may have to keep track of whether the operation was already performed or not.
Computer science examples
[edit]A function looking up a customer's name and address in a database is typically idempotent, since this will not cause the database to change. Similarly, a request for changing a customer's address to XYZ is typically idempotent, because the final address will be the same no matter how many times the request is submitted. However, a customer request for placing an order is typically not idempotent since multiple requests will lead to multiple orders being placed. A request for canceling a particular order is idempotent because no matter how many requests are made the order remains canceled.
A sequence of idempotent subroutines where at least one subroutine is different from the others, however, is not necessarily idempotent if a later subroutine in the sequence changes a value that an earlier subroutine depends on—idempotence is not closed under sequential composition. For example, suppose the initial value of a variable is 3 and there is a subroutine sequence that reads the variable, then changes it to 5, and then reads it again. Each step in the sequence is idempotent: both steps reading the variable have no side effects and the step changing the variable to 5 will always have the same effect no matter how many times it is executed. Nonetheless, executing the entire sequence once produces the output (3, 5), but executing it a second time produces the output (5, 5), so the sequence is not idempotent.
int x = 3;
void inspect() { printf("%d\n", x); }
void change() { x = 5; }
void sequence() { inspect(); change(); inspect(); }
int main() {
sequence(); // prints "3\n5\n"
sequence(); // prints "5\n5\n"
return 0;
}
In the Hypertext Transfer Protocol (HTTP), idempotence and safety are the major attributes that separate HTTP methods. Of the major HTTP methods, GET, PUT, and DELETE should be implemented in an idempotent manner according to the standard, but POST doesn't need to be.[13] GET retrieves the state of a resource; PUT updates the state of a resource; and DELETE deletes a resource. As in the example above, reading data usually has no side effects, so it is idempotent (in fact nullipotent). Updating and deleting a given data are each usually idempotent as long as the request uniquely identifies the resource and only that resource again in the future. PUT and DELETE with unique identifiers reduce to the simple case of assignment to a variable of either a value or the null-value, respectively, and are idempotent for the same reason; the end result is always the same as the result of the initial execution, even if the response differs.[14]
Violation of the unique identification requirement in storage or deletion typically causes violation of idempotence. For example, storing or deleting a given set of content without specifying a unique identifier: POST requests, which do not need to be idempotent, often do not contain unique identifiers, so the creation of the identifier is delegated to the receiving system which then creates a corresponding new record. Similarly, PUT and DELETE requests with nonspecific criteria may result in different outcomes depending on the state of the system - for example, a request to delete the most recent record. In each case, subsequent executions will further modify the state of the system, so they are not idempotent.
In event stream processing, idempotence refers to the ability of a system to produce the same outcome, even if the same file, event or message is received more than once.
In a load–store architecture, instructions that might possibly cause a page fault are idempotent. So if a page fault occurs, the operating system can load the page from disk and then simply re-execute the faulted instruction. In a processor where such instructions are not idempotent, dealing with page faults is much more complex.[15][16]
When reformatting output, pretty-printing is expected to be idempotent. In other words, if the output is already "pretty", there should be nothing to do for the pretty-printer.[citation needed]
In service-oriented architecture (SOA), a multiple-step orchestration process composed entirely of idempotent steps can be replayed without side-effects if any part of that process fails.
Many operations that are idempotent often have ways to "resume" a process if it is interrupted – ways that finish much faster than starting all over from the beginning. For example, resuming a file transfer, synchronizing files, creating a software build, installing an application and all of its dependencies with a package manager, etc.
Applied examples
[edit]Applied examples that many people could encounter in their day-to-day lives include elevator call buttons and crosswalk buttons.[17] The initial activation of the button moves the system into a requesting state, until the request is satisfied. Subsequent activations of the button between the initial activation and the request being satisfied have no effect, unless the system is designed to adjust the time for satisfying the request based on the number of activations.
See also
[edit]- Biordered set
- Closure operator
- Fixed point (mathematics)
- Idempotent of a code
- Idempotent analysis
- Idempotent matrix
- Idempotent relation – a generalization of idempotence to binary relations
- Idempotent (ring theory)
- Involution (mathematics)
- Iterated function
- List of matrices
- Nilpotent
- Pure function
- Referential transparency
References
[edit]- ^ "idempotence". Oxford English Dictionary (3rd ed.). Oxford University Press. 2010.
- ^ "idempotent". Merriam-Webster. Archived from the original on 2016-10-19.
- ^ Original manuscript of 1870 lecture before National Academy of Sciences (Washington, DC, USA): Peirce, Benjamin (1870) "Linear associative algebra" From pages 16-17: "When an expression which is raised to the square or any higher power vanishes, it may be called nilpotent; but when raised to a square or higher power it gives itself as the result, it may be called idempotent.
The defining equation of nilpotent and idempotent expressions are respectively An = 0 and An = A; but with reference to idempotent expressions, it will always be assumed that they are of the form An = A unless it be otherwise distinctly stated."- Printed: Peirce, Benjamin (1881). "Linear associative algebra". American Journal of Mathematics. 4 (1): 97–229. doi:10.2307/2369153. JSTOR 2369153. See p. 104.
- Reprinted: Peirce, Benjamin (1882). Linear Associative Algebra (PDF). New York, New York, USA: D. Van Nostrand. p. 8.
- ^ Polcino & Sehgal 2002, p. 127.
- ^ Valenza, Robert (2012). Linear Algebra: An Introduction to Abstract Mathematics. Berlin: Springer Science & Business Media. p. 22. ISBN 9781461209010.
An element s of a magma such that ss = s is called idempotent.
- ^ Doneddu, Alfred (1976). Polynômes et algèbre linéaire (in French). Paris: Vuibert. p. 180.
Soit M un magma, noté multiplicativement. On nomme idempotent de M tout élément a de M tel que a2 = a.
- ^ George Grätzer (2003). General Lattice Theory. Basel: Birkhäuser. ISBN 978-3-7643-6996-5. Here: Sect.1.2, p.5.
- ^ Garrett Birkhoff (1967). Lattice Theory. Colloquium Publications. Vol. 25. Providence: Am. Math. Soc.. Here: Sect.I.5, p.8.
- ^ This is an equation between functions. Two functions are equal if their domains and ranges agree, and their output values agree on their whole domain.
- ^ If and commute under composition (i.e. if ) then idempotency of both and implies that of , since , using the associativity of composition.
- ^ e.g. , but
- ^ also showing that commutation of and is not a necessary condition for idempotency preservation
- ^ IETF, Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content Archived 2014-06-08 at the Wayback Machine. See also HyperText Transfer Protocol.
- ^ "Idempotent Methods". Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content. sec. 4.2.2. doi:10.17487/RFC7231. RFC 7231.
It knows that repeating the request will have the same intended effect, even if the original request succeeded, though the response might differ.
- ^ John Ousterhout. "Demand Paging".
- ^ Marc A. de Kruijf. "Compiler construction of idempotent regions and applications in architecture design". 2012. p. 10.
- ^ "Geared Traction Passenger Elevator Specification Guide Information/Instructions" (PDF). NC Department Of Labor, Elevator Bureau. 2002. Archived from the original (PDF) on 2011-05-23. For example, this design specification includes detailed algorithm for when elevator cars will respond to subsequent calls for service
Further reading
[edit]- "idempotent" at the Free On-line Dictionary of Computing
- Goodearl, K. R. (1991), von Neumann regular rings (2 ed.), Malabar, FL: Robert E. Krieger Publishing Co. Inc., pp. xviii+412, ISBN 978-0-89464-632-4, MR 1150975
- Gunawardena, Jeremy (1998), "An introduction to idempotency" (PDF), in Gunawardena, Jeremy (ed.), Idempotency. Based on a workshop, Bristol, UK, October 3–7, 1994, Cambridge: Cambridge University Press, pp. 1–49, Zbl 0898.16032
- "Idempotent", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
- Hazewinkel, Michiel; Gubareni, Nadiya; Kirichenko, V. V. (2004), Algebras, rings and modules. vol. 1, Mathematics and its Applications, vol. 575, Dordrecht: Kluwer Academic Publishers, pp. xii+380, ISBN 978-1-4020-2690-4, MR 2106764
- Lam, T. Y. (2001), A first course in noncommutative rings, Graduate Texts in Mathematics, vol. 131 (2 ed.), New York: Springer-Verlag, pp. xx+385, doi:10.1007/978-1-4419-8616-0, ISBN 978-0-387-95183-6, MR 1838439
- Lang, Serge (1993), Algebra (Third ed.), Reading, Mass.: Addison-Wesley, ISBN 978-0-201-55540-0, Zbl 0848.13001 p. 443
- Peirce, Benjamin. Linear Associative Algebra 1870.
- Polcino Milies, César; Sehgal, Sudarshan K. (2002), An Introduction to Group Rings, Algebras and Applications, vol. 1, Kluwer Academic Publishers, pp. 127, ISBN 978-1-4020-0238-0, MR 1896125