News for hackers. Stuff that matters.
Re:Functional Programming, Abstraction, and Names by katzface on Saturday May 21, 2016 @01:01AM (#11743275)
I can't understand the difference between the definitions of Identity and Invertibility - can someone explain?

I.e.:

Identity For any element a in G there is an element e where e⋆a = a⋆e = a.

Invertibility For each element a in G there is an element b where a⋆b = b⋆a = e, where e is the identity.

Re:Functional Programming, Abstraction, and Names by lubomir on Saturday May 21, 2016 @04:24AM (#11743778)
Identity: there exists one unique element e such that for any a it holds that e⋆a = a⋆e = a. This e is the same no matter what a you pick.

Invertibility: given any a, there is b such that a⋆b = b⋆a = e. For two different a's you get two different b's.

As example let G be a set of all strings and the operation is appending. There is element e == "". For any string a it holds that if you append empty string to any side, you get the original string back. However there is no inverse. You can not append two string to form an empty string. Apparently, strings with appending do not form a group.

Group example: let G be a set of all integers and the operation is addition. Then e is 0, as for all a it holds that a + 0 = 0 + a = a, and for each a you can find -a such that a + (-a) = (-a) + a = 0.

Re:Functional Programming, Abstraction, and Names by SatvikBeri on Saturday May 21, 2016 @01:08AM (#11743291)
The integers >= 0 have 0 as the identity: 0 + n = n + 0 = n. But they don't have inverses, because e.g. there's no positive number n such that n + 1 = 0.
Re:Functional Programming, Abstraction, and Names by cantankerous on Saturday May 21, 2016 @02:48AM (#11743513)
I think you mean the naturals.
Re:Functional Programming, Abstraction, and Names by floatboth on Saturday May 21, 2016 @07:29AM (#11744305)
People disagree about whether 0 is natural though. Better not to use the word at all :D
Re:Functional Programming, Abstraction, and Names by SatvikBeri on Tuesday May 24, 2016 @10:38AM (#11761889)
I wanted to avoid an argument about whether 0 is a natural number or not.
Re:Functional Programming, Abstraction, and Names by shele on Saturday May 21, 2016 @04:19AM (#11743765)
OP said "integers >= 0". Not much to "think" here.
Re:Functional Programming, Abstraction, and Names by mdpopescu on Saturday May 21, 2016 @01:49AM (#11743386)
It's about where "e", the identity element, is placed - in the "identity" rule it is one of the terms of the operation (e * a, a * e) while in the "invertibility" rule it's the result of the operation.

If you want an example, think Z (integers) and "+": there is an element of Z, namely zero (0), where the identity rule tells us that x + 0 = 0 + x = x and the invertibility rule says that for any x in Z, there is an y in z such that x + y = 0

Re:Functional Programming, Abstraction, and Names by eklavya on Saturday May 21, 2016 @07:54AM (#11744361)
Think of identity as neutral (not good, not bad). Add neutral to good or bad and they remain the same.

Invertibility is existence of Yin for a Yang, superhero for a supervillain, north pole for a south and combining them creates a neutral.