# Can you give me some concrete examples of magmas?

I've seen the following:

I've learned a bit about groups and I could give examples of groups, but when reading the given table, I couldn't imagine of what a magma would be. It has no associativity, no identity, no divisibility and no commutativity. I can't imagine what such a thing would be. Can you give a concrete example of a magma?

-
Free magma $M(X)$ consists of binary trees with elements of $X$ at its' leaves, and the result of binary operation on two such trees is a new tree with root and these two trees attached as sons. That's because associativity is required to "flatten" the structure, as in the case of free monoid. Can you see it? –  Marcin Łoś May 3 '14 at 12:06
@MarcinŁoś Now much. But I have a first clue of what they could be. Thanks. –  Jesus Christ May 3 '14 at 12:08
A magma could have associativity, or an identity, etc. It is just not required to have those properties. For example, every group is a magma. –  Brad May 3 '14 at 12:13
If you're familiar with concept of formal grammars and parse trees, you can see elements of free magma as distinct parse trees of arbitrary strings of symbols in base set $X$. In the case of free monoid (or semigroup), the string itself is an element, due to associativity - it makes all the parse trees "mean the same". Of course, one can come up with less abstract examples. Still, personally, I think free magma is much better than some contrived, weirdly defined operation on $\mathbb{R}$, as it shows the bare, primitive, unconstrained structure that follows from the axioms. –  Marcin Łoś May 3 '14 at 12:17
Magma is molten rock. It cannot be concrete. –  Asaf Karagila May 17 '14 at 10:42

A ("strict") magma you've probably heard of is the vector cross-product in $\Bbb R^3$: $$(a, b, c)\times(x, y, z) = (bz - cy, cx - az, bx - ay)$$ $\Bbb R^3$ is closed under this operation, but it has neither associativity, commutativity, identity nor divisibility.

Kind of in the same way that any square, any rectangle and any parallelogram fulfills the criteria of a trapezoid, and thus are trapezoids, we say that any group, monoid or semigroup is also a magma. All we demand from the structure in order to call it a magma is that it is closed under the binary operation.

And just as any trapezoid in which all angles happens to be right still is a trapezoid even though most people would call it a rectangle, so too will any closed / total algebraic structure with associativity, identity and divisibility be a magma, even though most people would call it a group.

-

A magma is just a set $X$ together with a binary operation on $X$, i.e. a function $X\times X\to X$. Any such function will do!

For example, we could define a binary operation on $X=\mathbb R$ by

$$x\cdot y = xy+x^2-y.$$

-

My favorite example: the operation $*$ on the odd integers with $a * b = (3a + b) / 2^k$ where $2^k$ is the highest power of $2$ dividing $3a + b$. With this notation, the Collatz conjecture can be restated:

For all odd integers $k$, does there exists an $n$ such that $$\underbrace{\Big(\big(((k * 1) * 1) * \cdots \big) * 1\Big) * 1}_{n \text{ ones}} = 1?$$

Perhaps this sheds little light on actually solving the problem, but at least it provides a framework where the conjecture makes sense. The unpredictable, nonassociative behavior of this operation $*$ is one way of understanding why the Collatz problem is so hard.

-

The Cayley table:

$$\begin{array}{c|ccc} \ast & 0 & 1 & 2 \\ \hline 0 & 0 & 2 & 0 \\ 1 & 1 & 0 & 0 \\ 2 & 0 & 0 & 2 \end{array}$$ represents a (finite) groupoid or magma of order $3$ over the set $\{0,1,2\}$. It is not commutative, nor associative, it has no cancellation (left nor right), has no identity. Light years far from a nice group.

This book contains a lot of further examples of Cayley tables of finite groupoids: as you know, an operation (function) $\ast$ may be well defined both by an expression such as

$$a\ast b:=a+2b$$

or by the (finite) table with the whole set of values.

If you are looking forward examples of bare groupoids, it may be worth to dedicate some attention to finite structures in particular.

The set $\mathbb{R}^+$ of positive real numbers with exponentiation operation $a^b$ is an example of "strict" non-finite groupoid used by R.H. Bruck in his paper What is a loop? (1963).

Other examples of magmas over $\mathbb{Z}$ and $\mathbb{C}$ which are not semigroups nor quasigroups are included in this article (this article) by Shcherbacov, Tabarov, Puscasu (2009). You should better look for a free two-page preview of it.

-

As other people have pointed before you should pay attention to definition of magmas: it doesn't require that operation satisfies any property (associativity, existance of identity,etc) but it doesn't require either that the operations have to satisfy non associativity or non identity properties.

Anyway here's an example of magma which doesn't satisfy associativity (nor existance of identity).

Let $X$ be the set of finite planar binary trees. Given two trees $a$ and $b$ then we can form the tree $a \cdot b$ obtained from the union of the two trees adding a new root.

This operation is well illustrated by the following images: it should take two trees such as

and return a tree such as the following one

This is of course a binary operation and non associativity can be proven by drawing some trees. Non existance of identity follow from the fact that whatever trees you compose via this operation the composed tree has a depth strictly greater than both input trees.

Hope this helps.

-

One magma that I like is a magma with operation C:{0, 1}$\rightarrow${0, 1} described by this table:

C  0  1
0  1  1
1  0  1


It's not commutative, associative, it doesn't have an identity, and has no divisor (if there is no identity, there cannot exist a divisor). Interestingly, for this magma if C(p, q)=1, as well as p=1, then q=1.

With that in mind, more interestingly, for this magma,

$\forall$ p $\forall$ q $\forall$ r $\forall$ s [C ( C ( C (p, q), r), C ( C (r, p), C(s, p)))=1].

-