The SET game is a card game in which players identify triples satisfying an all-same-or-all-different rule for each of four attributes. Every card specifies a number of symbols, a shape,
a color, and a shading, with three possibilities for each attribute. The deck has
one card for every combination, so it contains cards. Three distinct cards form a SET when, separately
for each attribute, the three values are either all equal
or all different (Davis and Maclagan 2003).
Assigning 0, 1, and 2 to the values of each attribute identifies the cards with vectors in , where
is the finite field with
three elements. A triple of distinct cards
,
,
and
is a SET iff
For one coordinate, the three values have sum zero modulo 3 exactly when they are all equal or all different.
Thus SETs are precisely the three-point lines of the affine space (Davis and Maclagan 2003).
Any two distinct cards determine a unique third card, , that completes a SET. There are
therefore
SETs in the full deck, since each triple contains three unordered pairs. A collection
containing no SET corresponds to a cap set. Such a collection
can have at most 20 cards, and collections of 20 with no SET exist (Davis and Maclagan
2003).
The algebraic description also motivates variants using other groups. In these variants, selected distinct group elements are combined using the group operation to obtain the identity element. For a non-Abelian group, the selected order can matter (Hsu et al. 2021).