A groupoid $G$ is a set together with a binary operation $\cdot : G \times G \longrightarrow G$ . The groupoid (or ``magma'') is closed under the operation.
There is also a separate, category-theoretic definition of ``groupoid.''