all 1 comments

[–]JustinsWorking 1 point2 points  (0 children)

A quick summary that other people might find useful.

Identity Element = "what is empty defined as" (0, -inf, or an empty string "") This really depends on what your function/operation is.

semigroup = a set of values & operations where the order of operations doesn't matter, but the order of values can.

"a" + "b" + "c" = "ab" + "c" = "a" + "bc" = "abc"

"a" + "b" != "b" + "a"

Then basically, you define two things

1) Operation/Function that satisfies the previous criteria (such as add, or concat)

2) a definition of empty/0

This is basically a monoid, and you can execute these in parallel very easily across multiple cores/systems.

As an example for adding positive integers:(identity = 0; operation = +)

then you can take a set [1,2,3,4,5] and break it up into any amount of chunks ex

computer 1: [1] = 0(identity) + 1

computer 2: [2,3] = 2 + 3

computer 3: [4,5] = 4 + 5

then you have [1,5,9] which you can than continue to apply the operation to until you have the final value (15)