0
$\begingroup$

Suppose one of the following holds for all x, or all y, or all z:

f(f(x)) = f(x)
f(f(y)) = f(y)
f(f(f(z))) = f(f(z)) = f(z)

... how do you call such a function?

$\endgroup$
0
7
$\begingroup$

A function satisfying that property is called idempotent.

$\endgroup$
5
  • $\begingroup$ Which is the answer if the function has the property for all inputs. The title seems to suggest the OP is looking at something else. $\endgroup$
    – Raphael
    Feb 1 '16 at 12:02
  • 2
    $\begingroup$ If the property existed only for a given set of inputs, I would most likely state it as "$f(x)$, $f(y)$, and $f(z)$ are fixed points of $f$" or, with a different wording, "$f(x)$, $f(y)$, and $f(z)$ are fixed by $f$". If $f$ is idempotent, then $f(x)$ is fixed by $f$ for all $x$. $\endgroup$ Feb 1 '16 at 12:13
  • 2
    $\begingroup$ I thought about "fixpoint", but those are $x$ with $f(x) = x$ -- not the same as $f(f(x)) = f(x)$. I don't know a term for "partially idempotent" functions. (Of course, if $f$ is some algorithm we iterate, e.g. a numerical one, then we'd say the final result -- when $f^{(n)}(x) = f^{(n-1)}(x)$ -- is a "fixpoint".) $\endgroup$
    – Raphael
    Feb 1 '16 at 12:45
  • $\begingroup$ As Raphael suggested, idempotent was not the answer I was looking for. Maybe there is no mathematical answer at all. Maybe it helps if I give a real-world example: consider jQuery. You can pass parameters to the jQuery function in lots of different ways. E.g. you can pass a selector, or an html string. Now, if you wrap whatever call with jQuery() again, you just get the same jQuery-Wrapping-Object returned back. This is useful, as it allows a developer not to care if an object has already been wrapped or not, a developer can just wrap it again to make sure to work with a jQuery object. $\endgroup$
    – NicBright
    Feb 2 '16 at 12:03
  • 1
    $\begingroup$ It would be completely accurate, if unusual, to say the jQuery function fixes jQuery-Wrapping-Objects or to say, when restricted to arrays (for example), jQuery is idempotent. $\endgroup$ Feb 2 '16 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.