Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

ELI5: monoids

elbeno, 29 February, 2016

(Resulting from my claim that “a child of 8 can understand monoids…”)

Wikipedia says: “In abstract algebra, a branch of mathematics, a monoid is an algebraic structure with a single associative binary operation and an identity element.”

Wolfram says: A monoid is a set that is closed under an associative binary operation and has an identity element I ∈ S such that for all a ∈ S, Ia = aI = a.

Mathematics has to be precise, which is why it uses jargon. But what do these concise definitions mean in everyday language? Consider adding up numbers.

  • The set is the whole numbers (and we need zero). 0, 1, 2, 3 etc.
  • The associative binary operation is addition.
    • “binary” just means it’s a thing you do to two numbers.
    • “associative” means it doesn’t matter what order you group things in. 1 + 2 + 3 gives the same answer whether you add 1 and 2 first and then add 3, or add 2 and 3 first and then add the answer to 1.
  • The set being “closed” under addition means that when you add two numbers you get another number – you don’t get some other kind of thing. (You might think this is obvious, but in maths it has to be stated.)
  • The identity element is 0 – the thing that doesn’t make any difference when you add it. Anything plus zero is itself.

So adding whole numbers is a monoid. A mathematician would say that the non-negative integers form a monoid under addition. The important thing is that the numbers aren’t a monoid on their own; it’s the combination of the set (0, 1, 2, 3…) and the operation (+) that makes the monoid. If we chose another operation, we could get another monoid. Think about multiplication, for instance.

It turns out that lots of things behave the same way as addition on numbers, which is why the notion of a monoid is very useful to mathematicians and computer scientists.

Maths

Post navigation

Previous post
Next post

Related Posts

On ellipses

1 March, 20081 March, 2008

Having conquered equidistant spacing along a Bézier curve, my thoughts now turn to the same problem for an ellipse. I have solved the problem for a circle of course, which is a special case of an ellipse. One would think that going from a circle to an ellipse would be…

Read More

Amaze your friends, and confound your enemies!

4 November, 20154 November, 2015

When I was young, I read lots of books with titles (or at least subheadings) along the lines of, “Amaze Your Friends and Confound Your Enemies” – a lot of them were filled with tricks and oddities like the Birthday Paradox, or the old saw about the elephant from Denmark….

Read More

More on ellipses

1 March, 20081 March, 2008

I think I will use the same method as I do for Bézier curves to step along the circumference. Another generalisation I had to make from the circle code is with respect to the normal. For a circle of radius r, centred on the origin, and parameterised by angle θ,…

Read More

Comment

  1. Alan Wolfe says:
    4 March, 2016 at 1:09 pm

    This makes more sense now, but I’m looking forward to how it is useful in relation to programming (:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes