4 ms·
I don't think that's what idempotent means. The only way f can be idempotent when f(f(x)) == x is if f(x) == x. (This implies that f is the identity function).
by reverius42 12y ago
I don't think that's what idempotent means. The only way f can be idempotent when f(f(x)) == x is if f(x) == x. (This implies that f is the identity function).
The property that makes the function idempotent is that successive application produces the same result as initial application: f(f(x)) == f(x).
- e12e 12y agoYou're right, of course. I typed that on my cellphone, and were a little quick looking up alternatives for @double_application_turns_this_into_an_identity_function -- that made more sense, and was a little more succinct. Maybe @left_inverse would be more appropriate? It's been a while since I had to classify functions.
- jfarmer 12y agoIf you're curious, the math-y term for an operation that is its own inverse is involution. I don't know that I've ever heard the word in a programming context, but there it is! :)
- tmoertel 12y agoAn involution played a rather important role in this programming context: http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html http://blog.moertel.com/posts/2013-12-14-great-old-timey-gam...
- e12e 12y agoThank you! A quick look through my bookshelf reveals that out of four books on discrete mathematics, only one contain involution in the index: and there it is mentioned once in a supplementary exercise... I guess that explains why I couldn't seem to recall a term for "self-inverse" [ed: No, that's wrong to, lol. Lets just stick with involution].
- jfarmer 12y agoThe word "involution" finds more use in analysis and algebra, where self-inverses have more interesting (often geometric) properties. The only interesting property I can think of in the context of discrete mathematics would be that if S is a finite set and f:S → S is an involution then the parity of |S| is equal to the parity of the fixed points of f. That is, |S| ≡ |Fix(f)| (mod 2) where Fix(f) = {x in S : f(x) = x}.