Is abstract algebra (mostly?) restricted to $2$-ary operators? This may be due to my own pure ignorance but it's my experience that all abstract algebra I've been introduced to, both in actual courses and in self-studies only exclusively deals with algebraic objects consisting of a set together with one or more binary operators defined on that set, perhaps over some other algebraic structure. Not counting categories here, just "low-level"-ish stuff.
I'm an undergraduate so my knowledge is of course very limited but I can't help to wonder why I never stumble upon algebraic structures with $n$-ary operators? Is there a good reason for this, something along the lines of $n$-ary operators behave "badly" when $n>2$ or is it just my ignorance because I'm a beginner in the field?
 A: Associativity allows you to "connect" binary operations to produce $n$-ary ones. In modern algebra one can work with $n$-ary operations called $\infty$-structures (like $A_\infty$, $L_\infty$, $E_\infty$ etc...). Associativity is no more required.
A: In logic the operators are 2-ary because any function $\mathbb Z_2^n\rightarrow \mathbb Z_2$ can be expressed by 2-ary operators. In mathematics it's only because that abstract algebra is a generalization of the numbers and their common operators.
To study general n-aries in the same manner would require a lot of new experiences and heuristic superstructures.
However, Heap-theory do study ternary (3-ary) operations. And an other interesting example is planar ternary rings.
But obviously, humans like 2-aries more.
A: The reason is simply that many interesting mathematics can be done (or modelled by) operations of arities $\leq 2$. The purpose of abstract algebra is not to study algebraic structures defined by random operations and random rules between them, but rather to give a general framework for algebraic structures which appear from other contexts (which are often more geometric).
On the other hand, there are algebraic structures which are studied and which have $\geq 3$-ary operations which are not reducible to $\leq 2$-ary operations.


*

*ternary fields

*heaps

*ternary algebras
See also the introduction of arXiv:1403.7099 for some background and references on ternary algebras.
A: Three comments:


*

*You might be interested in reading up on universal algebra http://en.wikipedia.org/wiki/Universal_algebra.  (I know virtually nothing about this subject beyond what one learns about binary operations in an undergraduate abstract algebra course, so I can't attest to the accuracy of the information in that wiki article.)

*This is purely speculation, but my guess is that most of the algebraic operations you're likely to encounter can be understood in terms of binary operations, so most introductory abstract algebra courses and textbooks will be centred around them.

*Around the time I took my undergraduate abstract algebra course, I wondered more or less the same thing.  I explored it a little on my own (without any references, since I didn't know about universal algebra then).  One of the difficulties I had was how to generalize some ideas from the binary case to the $n$-ary case.  For example, suppose you're trying to construct an analogue of a group, but with a ternary operation instead of binary.  How do you define the identity element and inverse of an element?

