4
$\begingroup$

Sometimes I encounter the term "deterministic" and sometimes I encounter "idempotent" in describing functions . Are they just two different names for the same concept ? Or are they different ?

P.S : I found about these two terms in an answer of stackoverflow .

  • 3
    This has nothing to do with mathematics. As used in the SO discussion, the terms are referring to the behaviour of functions in computer programs on data in memory or in storage. Idempotency means that a function when called twice has no further side effects. A function is deterministic when it returns the same result (and has the same side effects) on the same input.2012-10-30

1 Answers 1

5

They are usually completely different. An idempotent function is a function $f$ for which $f(x) = f(f(x))$ for all $x$. A deterministic function is not even a proper mathematical concept, as all mathematical functions are deterministic in a sense of the common meaning of the word. Rather than the determinism of a function, one might refer to its decidability, which is the ability to prove that it results in particular values from any particular argument given a particular theory. Decidability and idempotency are very different from each other, as are determinacy and idempotency. What is the context in which you are seeing "deterministic"? It may mean the same as "idempotent" there. But I do not believe that the terms are commonly or in any general mathematical sense understood to be equivalent.

EDIT: I guess the difficulty is the explanation that "it returns the same result when run repeatedly", which seems to mean the same thing as both "deterministic" and "idempotent". So I guess there is probably a better way to answer this.

  • 0
    I guess it does mean the same thing, whenever the procedure has no effect at all. But in that sense of idempotency, it is the identity function. So all we are saying in that context is that the identity function is both idempotent and deterministic, which is obvious. I suggest that you investigate the distinctions between mathematical functions and functions in computer programming.2012-10-30