**1. Introduction**

The state machines and the hypergroups are mathematical achievements of the twentieth century. The state machines are mathematical models which are mostly used for the study of actual physical or behavioral processes. Their roots can be traced back to mathematical logic and they are the primary and major components of Computer Theory. Alan Mathison Turing (1912–1954) developed his theoretical universal-algorithm machine to address the question of whether an algorithm for providing proofs whenever they do exist can be found and he discovered that some tasks which this abstract machine is expected to be able to perform are impossible even for it. The usefulness of the state machines quickly began to spread in other sciences as well. For example, Warren Sturgis McCulloch (1898–1969) and Walter Harry Pitts (1923–1969) created a mathematical model in neuroscience [1]. The model they constructed for a "neural net" was a state machine of the same nature as Turing's. Stephen Cole Kleene (1909–1994) later elaborated their model [2], while Noam Chomsky created mathematical models in linguistics for the description of languages [3,4]. The rapid development of technology in the twentieth century has made it possible to materialize such theoretical machines by creating the computers. This development fulfilled the timeless dream of mankind, to create machines like the Antikythera mechanism of the Hellenistic era (the earliest known analog computer, dated back to the second century BC [5–7]), and the mechanical calculating devices created by Blaise Pascal (1623–1662), by Gottfried Wilhelm von Leibniz (1646–1716), by Charles Babbade (1792–1871) and his co-worker Ada Augusta (1815–1852), the daughter of poet Lord Byron, all of which were as powerful as their respective technologies would allow.

The basic building blocks of a state machine are their internal qualities which are named internal states. The internal states are reacting to certain changes in their environment and this reaction causes state transitions. In the general case, it does not matter what the states and the environment of a state machine really are.

For example, in biology, we can consider the state of a cell in its environment, which consists of certain chemical and physical conditions, such as PH, temperature, light and

**Citation:** Massouros, G.G.; Massouros, C.G. State Machines and Hypergroups. *Mathematics* **2022**, *10*, 2427. https:// doi.org/10.3390/math10142427

Academic Editors: Irina Cristea and Hashem Bordbar

Received: 19 June 2022 Accepted: 5 July 2022 Published: 12 July 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

so on. When these chemicals do not remain within a range of concentrations and/or the physical conditions exceed a threshold value, the cell changes its behavior, e.g., a plant cell performs photosynthesis under the "input" of sunlight.

Also, a population group or a business can move to a new state when the economic and social changes in its environment cross a certain threshold.

Respectively in an electronic system which involves various electrical components, the flow of electric current can activate some of these components and the system can switch from one state to another. In fact, as in the case of some circuits with flip-flops, the new state depends on both, the input pulse and the previous state of the circuit.

So, the same environmental change (input) can shift the system into different states, depending on its previous state (condition).

A lot of ink has been shed on the research and study of the behavior of such systems, both living and non-living. In this paper, we approach this issue from a different perspective, i.e., we will address the question of how many different state machines can "survive" or can be acceptable in a given environment. Undoubtedly, the interaction between a system and its environment can be vastly complicated and it still remains an area that needs to be understood, if we wish to be in a position to predict the behaviour of the system and perceive the level of the environmental constraints it can endure as well as their impact on it.

We will attempt this approach with the tools of abstract Algebra, which is the most extensively used branch of Mathematics in the study of the state machines. So, in this paper, the environment is a set equipped with a rule of synthesis such that the result of the synthesis of any two elements is one or more elements. In Éléments de Mathématique, Algèbre [8], Nicolas Bourbaki used the Greek word *magma*, which comes from the verb *μασσω* ´ (=knead), to indicate such a set, while in [9] this notion was generalized so as to include more structures. Here, we use the magma of two elements, which is the environment of the binary state machines, like the 0–1 environment which is used in the digital technology. The interaction of the environment on the states is modeled algebraically via the different types of the associativity.

Sometimes, algebraic tools had been developed before even the relevant questions were asked and this is one of the most fascinating aspects of mathematics: to give the answers long before the rest of the world realizes why they should ask the questions.

During the 20th century, Algebra itself faced, and on most occasions overcame, many difficult and serious challenges that were deriving from various mathematical and not only areas, such as the Theory of Equations, Geometry, Topology, Quantum Mechanics, Chemistry, etc. Also, the 20th century put an end to the paradise of determinism. David Hilbert's (1862–1943) visions collapsed under Kurt Gödel's (1906–1978) work. Quantum Mechanics, the uncertainty principle of Werner Heisenberg (1901–1976), the axiomatic foundation of probability by Andrey Kolmogorov (1903–1987) made uncertainty inherent in science and brought into existence its mathematics. In this direction, Frédéric Marty (1911–1940) in a series of three papers [10–12] introduced the hypergroup in Algebra and gave some of its initial properties. His untimely death during World War II, while serving as a French Army officer, did not allow him to write more papers. However, the aforementioned three were enough to bring into being the Hypercompositional Algebra. The fundamental notion of the Hypercompositional Algebra is the hypercomposition, that is, a law of synthesis of any two elements, which yields a set of elements instead of a single element only.

The introduction of Hypercompositional Algebra into Computer Theory occurred in the G.G. Massouros Ph.D. thesis [5], under the supervision of J. Mittas (1921–2012). There followed more papers by the same author and Ch. Massouros, e.g., [13–21], as well as other researchers such as J. Chvalina [22–28], L. Chvalinová [22], Š. Hošková-Mayerová [24,25], M. Novák [26–32], S. Kˇrehlík [26,27,29–31,33], M.M. Zahedi [34], M. Ghorani [34,35], D. Heidari and S. Doostali [36], R.A. Borzooei et al. [37]. In relation to this subject, there are applications of the Hypercompositional Algebra in graph theory, artificial intelligence, cryptography, sensor networks and many more that, indicatively, can be found in [38–60]. Also, results in the above areas, up to the date it was published, can be found in P. Corsini and V. Leoreanu's book [61].

The following section presents the necessary preliminary notions for the self-sufficiency of the paper. The third section contains a study of operators' and hyperoperators' actions and the way they define hypercompositional structures in the set on which they operate. The fourth paragraph focuses on the detailed study of the magma of two elements, which is the environment of the binary state machines. The next (fifth) paragraph is dedicated to the analysis of the binary state machines, when their environment has the structure of a group or a hypergroup. The quasi-automata and quasi-multiautomata that can exist in such an environment are studied and enumerated.

#### **2. Preliminaries**

The fundamental notion of the Hypercompositional Algebra is the hypercomposition, that is, a law of synthesis which yields a set of elements instead of a single element, when applied on any two elements. More specifically, we have the definitions [9]:

**Definition 1.** *Let E be a non-void set. A mapping from E* × *E into E is called a composition on E, while a mapping from E* × *E into the power set P*(*E*) *of E is called a hypercomposition on E. A hypercomposition is called partial, if ab* = ∅*, for some a*, *b in E. A set enriched with a composition or a hypercomposition is called a magma.*

The above definition, which was introduced in [9], extends the definition of the magma given by Nicolas Bourbaki [8] in order to include laws of synthesis which are hypercompositions on a set *E*.

Let (*E*, ⊥) be a magma. For any two non-void subsets *X*,*Y* of *E*, *X*⊥*Y* = <sup>=</sup>{*x*⊥*<sup>y</sup>* <sup>∈</sup> *<sup>E</sup>*|*<sup>x</sup>* <sup>∈</sup> *<sup>X</sup>*, *<sup>y</sup>* <sup>∈</sup> *<sup>Y</sup>*}, if <sup>⊥</sup> is a composition and *<sup>X</sup>*⊥*<sup>Y</sup>* <sup>=</sup> <sup>∪</sup> *<sup>x</sup>*∈*X*, *<sup>y</sup>*∈*<sup>Y</sup>* (*x*⊥*y*), if ⊥ is a hypercomposition.

If *X* or *Y* is empty, then *X*⊥*Y* is empty. If *a* ∈ *E*, we usually write *a*⊥*Y* instead of {*a*}⊥*Y* and *X*⊥*a* instead of *X*⊥{*a*}. In general, the singleton {*a*} is identified with its member *a*. Sometimes it is convenient to use the relational notation *A* ≈ *B* to assert that subsets *A* and *B* have a non-void intersection. Then, as the singleton {*a*} is identified with its member *a*, the notation *a* ≈ *A* or *A* ≈ *a* is used as a substitute for *a* ∈ *A*. The relation ≈ may be considered as a weak generalization of the equality, since, if *A* and *B* are singletons and *A* ≈ *B*, then *A* = *B*. Thus, *a* ≈ *b*⊥*c* means *a* = *b*⊥*c*, if the synthesis is a composition and *a* ∈ *b*⊥*c*, if the synthesis is a hypercomposition. This notation is extensively used when it is not necessary to distinguish between a composition or a hypercomposition with respect to a law of synthesis.

**Definition 2.** *A law of synthesis* (*x*, *y*) → *x*⊥*y on a set E is called associative if the property,*

$$(\mathfrak{x} \bot \mathfrak{y}) \bot z = \mathfrak{x} \bot (\mathfrak{y} \bot z)$$

*is valid, for all elements x*, *y*, *z in E, while it is called reproductive if for all elements x in E the equality*

*x*⊥*E* = *E*⊥*x* = *E*

*holds.*

**Definition 3.** *An associative magma is called α semigroup if the law of synthesis on the magma is a composition, while it is called α semihypergroup if the law of synthesis is a non-partial hypercomposition.*

**Definition 4.** *A reproductive magma is called α quasigroup if the law of synthesis on the magma is a composition, while it is called α quasihypergroup if the law of synthesis is a non-partial hypercomposition.*

**Definition 5.** *An associative and reproductive magma is called α group if the law of synthesis on the magma is a composition, while it is called α hypergroup if the law of synthesis is a hypercomposition.*

The above Definition 5 appeared in [9], which also contains a detailed presentation of the fundamental properties that derive from the axioms of the associativity and the reproductivity in groups and hypergroups. Among other things, in [9] it is proved that:

**Theorem 1.** *If G is a group, then:*


**Theorem 2.** *If H is a hypergroup, then:*

*ab* = ∅ *for all a*, *b* ∈ *H*

Thus, the hypercomposition in a hypergroup cannot be partial. In this paper, we will consider only non-partial hypercompositions.

It is very common in the bibliography to enrich a magma with the axiom of associativity. Besides, another equality that can be valid in the successive synthesis of the magma's elements is the *inverted associativity.* Recall that a composition or a hypercomposition on a non-void set *E* is called *left inverted associative* if

$$(a \bot b) \bot c = (c \bot b) \bot a,\text{ for every } a, b, c \in E,$$

while it is called right inverted associative if

$$a \bot (b \bot c) = c \bot (b \bot a), \text{ for every } a, b, c \in E.$$

The notion of the inverted associativity was initially conceived by Kazim and Naseeruddin [62]. A magma equipped with a left inverted associativity is called *left almost semigroup* if the law of synthesis is a composition, while it is called *left almost semihypergroup* if the law of synthesis is a hypercomposition. The terminology is analogous for the right inverted associative magma.

**Definition 6.** *A reproductive magma which satisfies the axiom of the left inverted associativity is called a left almost-group (LA-group) when the law of synthesis on the magma is a composition, while it is called α left almost-hypergroup (LA-hypergroup) when the law of synthesis is a hypercomposition. A reproductive, right inverted associative magma is called a right almost-group (RA-group) or a right almost-hypergroup (RA-hypergroup) when the law of synthesis is a composition or a hypercomposition respectively.*

Apparently, if the law of synthesis is commutative, then the almost left or almost right groups and hypergroups are groups and hypergroups, respectively. However, it is possible for both associativity and inverted associativity to be valid in a magma. Such cases can be found in the examples of [63], which presents a detailed study of the left/right almost-hypergroups. For the quasi-canonical LA-hypergroups, see [64].

Every law of synthesis in a magma induces two new laws of synthesis. If the law of synthesis is written multiplicatively, then the two induced laws are:

$$a/b = \{ \mathfrak{x} \in E \mid a \approx \mathfrak{x}b \} \text{ and } b \backslash a = \{ \mathfrak{x} \in E \mid a \approx b\mathfrak{x} \}.$$

Thus *x* ≈ *a*/*b* if and only if *a* ≈ *xb* and *x* ≈ *b*\*a* if and only if *a* ≈ *bx*. In the case of a multiplicative magma, the two induced laws are called *inverse laws* and they are named *right division* and *left division*, respectively. If the magma is commutative, it is obvious that the right and left divisions coincide.

Directly connected to the induced laws of synthesis is the transposition axiom, which was firstly introduced by W. Prenowitz (1906–2000) for the study of geometry with the tools of Hypercompositional Algebra (e.g., [65]) and afterwards it was generalized by J. Jantosciak (1942–2017) in [66].

**Definition 7.** *A magma E is called α transposition magma if it satisfies the axiom:*

*b*\*a* ≈ *c*/*d implies ad* ≈ *bc*, *f or all a*, *b*, *c*, *d* ∈ *E*

It is obvious that in a transposition magma the following implication

*a*\*b* ≈ *d*/*c* ⇒ *ad* ≈ *bc* , *f or all a*, *b*, *c*, *d* ∈ *E*

is valid as well. In [9], the above implications reversed and so we have the two reverse transposition axioms:

*Weak reverse transposition axiom:*

$$a \, a \approx b \, c \, implies \, b \,\backslash a \approx c \,/\, d \, or \, a \,\backslash b \approx d \,/\, c, \, for \, all \, a, b, c, d \in E$$

*Strong reverse transposition axiom:*

*ad* ≈ *bc implies b*\*a* ≈ *c*/*d and a*\*b* ≈ *d*/*c*, *f or all a*, *b*, *c*, *d* ∈ *E*

However, the following property also applies:

*ad* ≈ *bc* ⇔ *a*\*b* ≈ *d*/*c or b*\*a* ≈ *c*/*d* , *f or all a*, *b*, *c*, *d* ∈ *E*

This axiom was named *bilateral transposition* axiom [9].

Special notation: In the following pages, in addition to the typical algebraic notations, we are using Krasner's notation for the complement and difference. So, we denote by *A*··*B* the set of elements that are in the set *A*, but not in the set *B*.

#### **3. Action of a Magma on a Set**

Let *E* and *S* be two non-empty sets. A mapping of *E* into the set *S<sup>S</sup>* of the mappings of *S* into itself is called an *action* of *E* on *S*. Let *a* → *δ<sup>a</sup>* be an action of *E* on *S*. The mapping *δ* of *S* × *E* to *S* such that *δ*(*s*, *a*) = *δa*(*s*) is an external law of composition on *S*, with *E* being the operating set. *δ* is called the *law of right action* of *E* on *S*. The *law of left action* of *E* on *S* is defined in a similar way. The element *δa*(*s*) is also called the *transform* of *s* under *a*. It is usually denoted by a right (resp. left) multiplicative notation *sa* (resp. *as*). The elements of *E* are called *operators*.

A mapping *δ* of *S* × *E* to the power set *P*(*S*) of *S* is an external law of hypercomposition on *S*. Then, the elements of *E* are called *hyperoperators* [67]. If *a* ∈ *E* is a hyperoperator, then the multiplicative notation *sa* (resp. *as*) signifies an element of *P*(*S*), that is, *sa* ⊆ *S* (resp. *as* ⊆ *S*).

A subset *T* of *S* is called *stable* under the action *a* → *δ<sup>a</sup>* of *E* on *S* if *δa*(*T*) ⊆ *T* for all *a* ∈ *E*. The intersection of a family of stable subsets of *S* under a given action is a stable subset of *S* as well. Therefore, if *X* is any subset of *S*, there exists a smallest stable subset of S that contains it. This subset is said to be *generated* by *X* and it consists of the elements (*δa*<sup>1</sup> ◦ *δa*<sup>2</sup> ◦···◦ *δan* )(*x*), where *x* ∈ *X*, *n* > 0, *ai* ∈ *E* for all *i*.

**Definition 8.** *An element s*<sup>2</sup> *of S is called connected to an element s*<sup>1</sup> *of S if there exists an element a of E such that δa*(*s*1) = *s*2.

It must be mentioned that *s*<sup>2</sup> being connected to *s*<sup>1</sup> does not necessarily imply that *s*<sup>1</sup> is connected to *s*2. If *s*<sup>2</sup> is connected to *s*1, there may be a sequence *a*1, *a*2, ... , *an* of elements of *E* such that (*δa*<sup>1</sup> ◦ *δa*<sup>2</sup> ◦···◦ *δan* )(*s*1) = *s*2. Thus, via the notion of the connected elements, a hypercomposition can be defined on *S*, as follows:

$$s\_1 + s\_2 = \begin{cases} \{ s \in S \mid s = s\_1 a \text{ and } s\_2 = s b, \text{ with } a, b \in E \}, \text{ if } s\_2 \text{ is connected to } s\_1 \\\\ \{ s\_1, s\_2 \}, \text{if } s\_2 \text{ is not connected to } s\_1 \end{cases}$$

**Proposition 1.** *If the set of the operators E over a non-void set S is a unitary magma, then* (*S*, +) *becomes a hypergroup.*

**Proof.** Since *E* is a unitary magma, the result of the hypercomposition always contains the two participating elements, thus *s* + *S* = *S* + *s* = *S* for all *s* ∈ *S* and so the reproductive axiom is valid. Moreover, the associativity holds. Indeed, if *s*1, *s*<sup>2</sup> and *s*<sup>3</sup> are not connected to each other, then

$$s\_1 + (s\_2 + s\_3) = (s\_1 + s\_2) + s\_3 = \{s\_{1'} \text{ s}\_{2'} \text{ s}\_3\}$$

Next, suppose that *s*<sup>2</sup> and *s*<sup>3</sup> are connected to *s*1. Also let *s*<sup>3</sup> be connected to *s*2. Then:

$$\begin{array}{rcl} (s\_1 + s\_2) + s\_3 &=& \{ q \in S \mid q = s\_1 a \text{ and } s\_2 = (s\_1 a)b, \text{ with } a, b \in E \} + s\_3 = 0\\ &=& \left\{ \begin{array}{l} s \in S \mid \text{ } s = (s\_1 a)c, \text{ } s\_2 = (s\_1 a)b, \text{ and} \\ s\_3 = ((s\_1 a)c)d \text{ with } a, b, c, d \in E \end{array} \right\} = \\ &= s\_1 + s\_3 \end{array}$$

and

$$\begin{array}{lcl} s\_1 + (s\_2 + s\_3) & = s\_1 + \{q \in S \mid q = s\_2a \text{ and } s\_3 = (s\_2a)b, \text{ with } a, b \in E\} = \\ & = \left\{ \begin{array}{l} s \in S \mid s = s\_1c \text{ and } (s\_1c)d = s\_2a, (s\_2a)k = s\_3 \text{ or } \\ (s\_1c)l = s\_3 \text{ with } a, c, d, k, l \in E \end{array} \right\} = \\ & = s\_1 + s\_3 \end{array}$$

Similar is the proof of all the other cases and hence the proposition.

**Corollary 1.** *The set of vertices of a directed graph is endowed with the structure of the hypergroup if the result of the hypercomposition of two vertices vi and vj is the set of the vertices which appear in all the possible paths that connect vi to vj, or {vi, vj}, if there do not exist any connecting paths from vertex vi to vertex vj.*

If *E* is a magma, an equivalence relation *ξ* on *E* is called a *congruence relation* if

$$(a,b)\in\mathbb{\xi},\ (c,d)\in\mathbb{\xi}\text{ implies}\begin{cases}\ [\{y\}\times bd]\cap\mathbb{\xi}\neq\mathcal{Q}\text{ for all }y\in ac\\ \\\ [ac\times\{z\}]\cap\mathbb{\xi}\neq\mathcal{Q}\text{ for all }z\in bd\end{cases}$$

When the law of synthesis in the magma is a composition, then *ac* and *bd* are singletons and the above definition is simplified to:

$$(a, b) \in \mathfrak{J}, \ (c, d) \in \mathfrak{J} \text{ implies } (ac, bd) \in \mathfrak{J}$$

The set *E*/*ξ* of all equivalence classes defined on *E* by *ξ* becomes an associative magma if we define

$$
\mathfrak{F}\_a \cdot \mathfrak{F}\_b = \{ \mathfrak{F}\_c \mid c \approx ab \} \text{ for all } \mathfrak{F}\_a, \mathfrak{F}\_b \in \mathbb{F}/\mathfrak{F}\_c
$$

**Proposition 2.** *Every congruence relation ξ on a magma E is a normal equivalence relation, and therefore the set E*/*ξ becomes a magma under the law of synthesis*

$$\mathsf{C}\_{x} \cdot \mathsf{C}\_{y} = \{ \mathsf{C}\_{z} \: \mid \: z \approx \mathsf{x}y \}.$$

*where Cx is the class of an arbitrary element x* ∈ *E*.

**Proof.** Since *ξ* is a congruence relation, for each *x*, *y* ∈ *E* it holds:

$$\begin{array}{rcl} \mathsf{z}' \in \mathsf{C}\_{\mathsf{x}} \cdot \mathsf{C}\_{\mathsf{y}} & \Rightarrow \\ & \Rightarrow \quad (\exists (\mathsf{x}', \mathsf{y}')) \in \mathsf{C}\_{\mathsf{x}} \times \mathsf{C}\_{\mathsf{y}}) \,\,[\mathsf{z} \approx \mathsf{x}' \mathsf{y}'] \Rightarrow (\exists \mathsf{z} \approx \mathsf{x} \mathsf{y}) [\mathsf{z}' \mathsf{y}' \,\, z] \Rightarrow \mathsf{z}' \in \mathsf{C}\_{\mathsf{z}} \Rightarrow \mathsf{z}' \\ & \Rightarrow \quad \mathsf{C}\_{\mathsf{x}} \cdot \mathsf{C}\_{\mathsf{y}} \subseteq \underset{z \approx \mathsf{x} \mathsf{y}}{\mathsf{C}\_{\mathsf{x}}} \,\, \mathsf{C}\_{z} \end{array}$$

Conversely now:

$$\begin{array}{rcl} z'' \in \underset{z \approx xy}{\cup} \mathbb{C}\_z & \Rightarrow \\ & \Rightarrow \quad (\exists z \approx xy) [z'' \xi z] \Rightarrow (\exists (x'', y'') \in E^2) [x'' \xi x \land y'' \xi y \land z'' \approx x''y''] \Rightarrow \\ & \Rightarrow \quad z'' \in \mathbb{C}\_x \cdot \mathbb{C}\_y \Rightarrow \underset{z \approx xy}{\cup} \mathbb{C}\_z \subseteq \mathbb{C}\_x \cdot \mathbb{C}\_y \end{array}$$

Thus, *Cx*·*Cy* = ∪ *z*≈*xy Cz*, and so the quotient set *<sup>E</sup>*/*ξ*, enriched with the law of synthesis *Cx*·*Cy* = {*Cz* | *z* ≈ *xy*}, is a magma. Obviously, if the law of synthesis is a composition, then the previous equality is simplified to *Cx*·*Cy* = *Cxy*.

**Corollary 2.** *Every congruence relation ξ on a hypergroup E is a normal equivalence relation, and therefore the quotient E*/*ξ becomes a hypergroup under the hypercomposition Cx*·*Cy* = {*Cz* | *z* ≈ *xy*}*. If E is a group, then <sup>E</sup>*/*<sup>ξ</sup> is a group as well, under the composition*

$$
\mathsf{C}\_x \cdot \mathsf{C}\_y = \mathsf{C}\_{xy}
$$

**Proposition 3.** *If E is a transposition magma and ξ is a congruence relation on E, then E*/*ξ is a transposition magma.*

**Proof.** Suppose that for some elements *Cx*, *Cy*, *Cz*, *Cw*, of the quotient set *<sup>E</sup>*/*<sup>ξ</sup>* it holds that *Cy*\*Cx* ≈ *Cz*/*Cw*. Then there exist elements *x* , *y* , *z* , *w* belonging to *Cx*, *Cy*, *Cz*, *Cw*, respectively, such that *y* \*x* ≈ *z* /*w* . Since the transposition axiom is valid in *E*, it derives that *x w* ≈ *y z* . Therefore, *Cx*·*Cw* ≈ *Cy*·*Cz* and hence the proposition.

**Definition 9.** *A state machine M is a triplet* (*S*, *E*, *δ*) *where S and E are sets and δ is mapping of S* × *E to S*.

The set *S* describes the internal qualities of the system. The elements of *S* are called *internal states* of *M*. If *S* is finite, then M is called a *finite state machine*. The set *E* describes the environmental inputs that can affect the system. The mapping *δ* describes the environmental influences on the internal qualities of the system and it is called a *state transition function*. Such a system is obviously quite general and can be used in a variety of cases. From the mathematical standpoint, a state machine is a set with operators and the fact that we can successfully approach, describe and examine such systems via algebraic tools and techniques is one of the most impressive and remarkable achievements of modern algebra.

**Example 1.** *State machines can be depicted by the so-called transition diagrams. Thus, if S* = {*s*1} *and E is a finite set, then the relevant state machine is illustrated with the transition diagram presented in Figure 1:*

**Figure 1.** Transition diagram for a state machine with one state.

*Moreover, if S* = {*s*1,*s*2} *and E* = {*a*}, *we could have any of the following four state machines that are shown in Figure 2:*

**Figure 2.** Transition diagrams for a state machine with two states and a singleton as the set of the operators.

*Another way of specifying a state machine is by writing out the transition function δ in tabular form, thus creating the so-called* state transition table*. For example, the state transition table of the last in the above figure state machine is the following one:*


Suppose that *a* ∈ *E* is applied to the state *s* ∈ *S* of a state machine *M.* Then the machine moves to state *δ*(*s*, *a*) = *δa*(*s*) = *sa*. Next, if another input, say *b* ∈ *E*, is applied to the machine, the resultant state is:

$$\delta(\delta\_a(s), b) = \delta\_b(\delta\_a(s)) = \delta\_b(sa) = (sa)b$$

Since *δb*(*δa*(*s*)) = (*δ<sup>b</sup>* ◦ *δa*)(*s*), if *E* is a magma, we say that the state transition function satisfies the associativity if *δb*(*δa*(*s*)) = *δc*(*s*), *c* ≈ *ab*. If the law of synthesis is a composition, then the associativity is of the form *δb*(*δa*(*s*)) = *δab*(*s*) or equivalently (*sa*)*b* = *s*(*ab*) and it is named *mixed associativity*, while if the law of synthesis is a hypercomposition, the associativity is fulfilled if (*sa*)*b* ∈ *s*(*ab*) and it is called *generalized mixed associativity* [26,29,68].

**Definition 10.** *A state machine M =* (*S*, *E*, *δ*) *is called quasi-automaton if E is a magma and the state transition function satisfies the mixed associativity, i.e.,* (*sa*)*b* = *s*(*ab*) *for any pair a*, *b* ∈ *E and any state s* ∈ *S.*

**Definition 11.** *A state machine M = (S,E,δ) is called quasi-multiautomaton if E is a magma and the state transition function satisfies the generalized mixed associativity, i.e.,* (*sa*)*b* ∈ *s*(*ab*) *for any pair a*, *b* ∈ *E and any state s* ∈ *S.*

A detailed presentation of the terminology, based on the historical development of the area, can be found in the well-written paper [29]. The above definitions are in line with [29]. Obviously, every quasi-automaton is a quasi-multiautomaton. Apparently, quasimultiautomata which are not quasi-automata can only exist when *E* is a hypercompositional magma. On the contrary, quasi-automata exist when either the magma is endowed with a composition or when it is endowed with a hypercomposition. A special case of quasiautomata occurs when *E* is a free semigroup or a free monoid instead of an arbitrary magma. In this case, computer theory tends to use the term "*word*" for the elements of *E*, the term "*letter*" for the elements of its generating set Σ and the term *concatenation of words* for the law of synthesis in *E*. Moreover, the free semigroup generated by Σ is denoted by Σ<sup>+</sup> and the corresponding free monoid by Σ∗. Also, the quasi-automaton is denoted by *M* = (*S*,*E*,*δ*).

**Proposition 4.** *Let* (*S,E,δ*) *be a quasi-automaton and* ∼ *a binary relation on the magma, defined by*

$$a \sim b \Leftrightarrow \delta\_a = \delta\_{b\prime} \text{ where } a, b \in E$$

*Then* ∼ *is a congruence relation on E and the magma <sup>E</sup>*/∼ *has the same algebraic structure as E.*

**Proof.** This relation is easily seen to be an equivalence relation. Next, let *a* ∼ *b* and *c* ∼ *d*. From *a* ∼ *b*, it follows that *δa*(*s*) = *δb*(*s*) for all *s* ∈ *S*. Next, since *c* ∼ *d*, the following sequence of equivalent statements holds:

$$\delta\_{\mathfrak{c}}(\delta\_{\mathfrak{a}}(s)) = \delta\_{\mathfrak{c}}(\delta\_{\mathfrak{b}}(s)); \; \delta\_{\mathfrak{c}}(\delta\_{\mathfrak{a}}(s)) = \delta\_{\mathfrak{d}}(\delta\_{\mathfrak{b}}(s)); \; \bigcup\_{y \approx \alpha \mathbf{n}} \delta\_{\mathfrak{y}}(s) = \bigcup\_{z \approx d \mathbf{b}} \delta\_{\mathfrak{z}}(s);$$

Therefore, ∼ is a congruence relation on *E*. Next, it is easy to see that the magma *<sup>E</sup>*/∼ is of the same type as *E*, that is, if *E* is a semigroup, semi-hypergroup, hypergroup, group, etc., then *<sup>E</sup>*/∼ has the same algebraic structure, respectively.

Now, if *M* = (*S*,*E*,*δ*) is a quasi-automaton, then the semigroup *E* = <sup>Σ</sup><sup>+</sup> /∼ or the monoid *E* = <sup>Σ</sup><sup>∗</sup> /∼ can be constructed with the use of Proposition 4. In many cases, it is more convenient to study this semigroup rather than the original machine *M*. However, if we do not want to lose sight of the set of states, we consider the machine *M* = (*S*,*E*,*δ*). Each element of *E* is an equivalence class of Σ<sup>+</sup> or Σ∗, which acts on *S* as follows: *s*[*a*] = *δa*(*s*), where *s* ∈ *S* and *a* ∈ Σ<sup>+</sup> or *a* ∈ Σ∗.

#### **4. The Magma of 2 Elements**

In this section, we will proceed to a detailed study and classification of the two-element magma, which is the binary state machines' environment.

While there exists only one single element magma which is a group and also a LA/RAgroup, there exist 3<sup>4</sup> = 81 magmas with 2 elements. These magmas can be constructed, classified and enumerated, with the techniques and methods which are developed in [69–71] and [63]. In the following propositions, these magmas are presented via their Cayley tables. Note that, in a Cayley table, the entry in the row headed by *x* and the column headed by *y* is the synthesis *x*·*y*.

#### **i. Associative Magmas**

**Proposition 5.** *There exist 6 semigroups which are classified into 2 classes with 2 isomorphic semigroups each, and into 2 single-member classes, which are presented below via their Cayley tables. Moreover, since SG*<sup>1</sup> *and SG*<sup>2</sup> *are commutative, they satisfy both the left and the right inverted associativity.*


**Remark 1.** When *a* = 0 and *b* = 1 in the two isomorphic semigroups *SG*2, we get the two well-known operations of the Boolean algebra:



< *a b a* {*a,b*} *b b b b* 

< *a b a a* {*a,b*} *b b b* 

**Proposition 6.** *There exist 10 semihypergroups which are classified into 5 classes with 2 isomorphic semihypergroups each. These are displayed below in the form of Cayley tables. Moreover, since SH*<sup>1</sup> *is commutative, it satisfies both the left and the right inverted associativity.*



## **ii. Reproductive Magmas**

**Proposition 7.** *There exist 21 quasihypergroups which are classified into 9 two-member classes and 3 single-member classes, which are presented below via their Cayley tables.*



#### **iii. Associative and Reproductive Magmas**

**Proposition 8.** *There exists one class with 2 isomorphic commutative groups*.

**Proposition 9.** *There exist 12 hypergroups which are classified into 5 classes with 2 isomorphic hypergroups each and into 2 single-member classes, which are presented below via their Cayley tables. H*<sup>3</sup> − *H*<sup>7</sup> *are commutative.*



*H*<sup>6</sup> is the two-element *B-hypergroup*. B(inary)-hypergroups came into being during the study of formal languages and automata with the use of hypercompositional algebra [5,13,16,17]. The free monoid of the words generated by an alphabet Σ can be endowed with the B-hypergroup structure, and so become a join hyperringoid [21,72–74], which is named *linguistic hyperringoid* [14,21,73,74]. If the B-hypergroup is fortified with a strong identity [31], which is necessary for the theory of formal languages and automata [14,21], then the join hyperring comes into being [72–74]. *H*<sup>7</sup> is the two-element *total hypergroup*.

#### **Proposition 10.** *All the two-element hypergroups are transposition hypergroups.*

**Proof.** The Cayley tables of the induced hypercompositions for the seven two-element hypergroups are presented below. For the classes with two elements, we chose the first hypergroup for the presentation of the induced hypercomposition. Observe that the hypergroups *H*3, *H*4, *H*5, *H*<sup>6</sup> and *H*<sup>7</sup> are commutative; therefore, the two induced hypercompositions coincide, and so there is only one Cayley table corresponding to each one of them. As mentioned above, in the Cayley tables, the entry in the row headed by *x* and the column headed by *y* is the synthesis *x/y* or *y*\*x* respectively.




The verification of the transposition axiom gives the rest.

So, according to Proposition 10, there do not exist non-transposition hypergroups with cardinality 1 or 2. However, as shown in the following example, there exist nontransposition hypergroups if their cardinality is greater than or equal to 3.

**Example 2.** *The hypercomposition on hypergroup H6 can be written in the following two ways:*

$$a \cdot b = \begin{cases} \quad \{a, b\}, & \text{if } a \neq b \\\quad a, & \text{if } a = b \end{cases} \tag{1}$$

*and*

$$a \cdot b = \begin{cases} \text{ } \text{H, } \text{ if } a \neq b \\\ a, \text{ } \text{ if } a = b \end{cases} \tag{2}$$

*If H* = {*a*, *b*}*, then the above two formulas give the same hypercomposition, but if cardH* ≥ *3, then they produce two different hypergroups. The first one, which is the B-hypergroup, satisfies the transposition axiom (see [13] for the proof), while the second one does not. Indeed, the induced hypercomposition of (2) is:*

$$a \cdot b = \begin{cases} \quad \stackrel{H \cdot \{b\}}{\cdot}, & \stackrel{if}{\, a} \neq b \\\quad a, & \stackrel{}{\,} \stackrel{}{\,} a = b \end{cases}$$

*Next, if a* = *b, we have:*

$$a/b \cap b/a = [H \cdots \{b\}] \cap [H \cdots \{a\}] \neq \mathcal{Q}$$

*while*

$$aa \cap bb = \{a\} \cap \{b\} = \mathcal{Q}.$$

Moreover, the verification of the reverse transposition axiom for hypergroups *H*1–*H*<sup>7</sup> leads to the following result:

**Proposition 11.** *All the two-element hypergroups satisfy the strong reverse transposition axiom.*

A consequence of Propositions 10 and 11 is the following Theorem:

**Theorem 3.** *All the two-element hypergroups satisfy the bilateral transposition axiom.*

In [9], following the observation that the quasicanonical hypergroups, the canonical hypergroups, and of course, the groups and the abelian groups satisfy the bilateral transposition axiom, the question arose: *Do there exist other hypergroups satisfying the bilateral transposition axiom apart from the quasicanonical and the canonical ones*? The above Theorem 3 gives the affirmative answer to this question.

## **iv. Magmas with inverted associativity**

**Proposition 12.** *There exists only one class with 2 isomorphic left almost-semihypergroups, as per the following Cayley tables.*

**Proposition 13.** *In addition to the five non-isomorphic commutative hypergroups (and hence left and right almost-hypergroups) that are mentioned in Proposition 9, there also exist two nonisomorphic left almost-hypergroups which are classified into one two-member class and into one single-member class, as per the following Cayley tables.*




**Proposition 14.** *There exists only one class with 2 isomorphic right almost-semihypergroups, as per the following Cayley tables.*

**Proposition 15.** *In addition to the five non-isomorphic commutative hypergroups (and hence left and right almost-hypergroups) that are mentioned in Proposition 9, there also exist two nonisomorphic right almost-hypergroups which are classified into one two-member class and into one single-member class, as they are presented in the following Cayley tables.*



### **v. Rigid Magmas**

The remaining 26 magmas are classified into 12 two-member classes and into two single-member classes. The law of synthesis on the 2 magmas of the single-member classes is a composition. The same goes for the magmas in three of the twelve two-member classes.

**Proposition 16.** *There exist only two non-isomorphic groupoids of two elements, which are presented in the following Cayley tables.*


**Definition 12.** *A magma is called rigid if its group of automorphisms is of order 1.*

As it is shown in [75,76], there exist 21 rigid hypergroupoids whose classification is described in Theorem 4 of [76]. The following Theorem 4 applies to the two-element magmas:

**Theorem 4.** *There exist 9 rigid magmas of two elements, classified as follows:*


## **Proof.**

**i.** Let us consider the first groupoid of Proposition 15. Then, the two induced hypercompositions are given in the following Cayley tables:



Next, we have that *a*/*b* ∩ *b*\*a* = {*a*, *b*} ∩ {*b*} = ∅, while *ab* ∩ *ba* = {*a*} ∩ {*b*} = ∅. Therefore, the transposition axiom is not valid. Analogous is the proof for the second groupoid.

**ii.** Let us consider the semigroup *SG*3. Then, the two induced hypercompositions are the following ones:


The verification of the transposition axiom, according to the above Cayley tables, proves its validity. The same goes for the case of *SG*4.

**iii.** Since *QH*<sup>10</sup> is commutative, the two induced hypercompositions coincide and so we have:

$$a/b = b/a = \{a, b\}, \ a/a = b, \ b/b = a$$

Next, *a*/*b* ∩ *b*/*a* = {*a*, *b*} = ∅ but *aa* ∩ *bb* = ∅. Therefore, the transposition axiom is not valid.

**iv.** The induced hypercompositions on the *LA–H*<sup>2</sup> are:


Since the implication

$$a \lor a \cap a \backslash b = \{a\} \cap \{a, b\} \neq \mathcal{Q} \implies ab \cap ba = \mathcal{Q} \cdot \mathcal{Q}$$

holds, the transposition axiom is not valid.


#### **5. Binary State Machines**

Let *M* = (*S*,*E*,*δ*) be a state machine. Two states, *s*, *t*, are called *connected* if there exists a sequence of inputs which causes *S* to leave state *s* and go into state *t*, that is, if there exists a sequence *a*1, *a*2, ... , *an* of elements of *E* such that (*δa*<sup>1</sup> ◦ *δa*<sup>2</sup> ◦···◦ *δan* )(*s*) = *t*. The states *s*, *t* are called *isolated to each other* if neither *s* is connected to *t*, nor *t* to *s*. A state machine *M* is called *connected* if its undirected graph is connected, while it is called *strongly connected* if every ordered pair (*s*, *t*) of states in *S* is connected.

**Proposition 17.** *Suppose that the connected state machine M* = (*S,E,δ*) *is a quasi-multiautomaton. Then, for every pair* (*s*, *t*) *of states, there exists one element of E which connects them, i.e., δa*(*s*) = *t for some a* ∈ *E*.

**Proof.** Let *a*1, *a*2, ... , *an* be a sequence of elements of *E* such that (*δa*<sup>1</sup> ◦ *δa*<sup>2</sup> ◦···◦ *δan* )(*s*) = *t*. If *n* = 1 the proposition is obvious. Let *n* > 1. Then

$$\begin{aligned} \left(\delta\_{a\_1} \diamond \delta\_{a\_2} \diamond \cdots \diamond \delta\_{a\_n}\right)(s) &= \delta\_{a\_1} \left(\delta\_{a\_2} \left(\cdot \cdots \delta\_{a\_{n-1}} \left(\delta\_{a\_n}(s)\right)\right)\right) \in \\ &\in \underset{a \in a\_1 a\_2 \ldots a\_n}{\cup} \delta\_a(s) = \left\{\delta(s, a) \: \mid \: a \in a\_1 a\_2 \ldots a\_n\right\} \end{aligned}$$

Hence, there exists *a* ∈ *a*1*a*<sup>2</sup> ... *an* such that *t* = *δ*(*s*, *a*).

**Theorem 5.** *If the magma E in a quasi-multiautomaton M* = (*S,E,δ*) *has n elements, then the set S cannot have more than n +* 1 *states.*

**Proof.** As per Proposition 17, for every pair of states (*s*, *t*), there exists one element of *E* which connects them, i.e., there exists *a* ∈ *E* such that *δ*(*s*, *a*) = *t*. Therefore, if *cardE* = *n* e.g., if *E* = {*a*1, *a*2,..., *an*}, then, for each state *s* ∈ *S*, there exist at most *n* states connected with *s*, which are the *si* = *δ*(*s*, *ai*), 1 ≤ *i* ≤ *n*. Next, if some state *sk* ∈ *S* yields *δ sk*, *aj* = *t*, then, since *sk* = *δ*(*s*, *ak*), it holds that

$$t = \mathcal{S}\left(\mathcal{S}(s, a\_k), a\_j\right) \in \left\{\mathcal{S}(s, a) \: \mid \: a \in a\_k a\_j\right\} \subseteq \mathcal{S}$$

Hence, *S* = {*s*,*s*1,*s*2,...,*sn*} and so the Theorem.

**Definition 13.** *If the magma E of a state machine M* = (*S,E,δ*) *has 2 elements, then M is called a binary state machine.*

**Corollary 3.** *The set S of the states of a binary quasi-multiautomaton M* = (*S,E,δ*) *cannot have more than 3 elements.*

**Theorem 6.** *There exists 1 binary state machine with 1 state, 16 binary state machines with 2 states and 729 with 3 states.*

**Proof.** The state transition table of a state machine with 1 state is:


The state transition table of a state machine with 2 states is:


where *x*, *y*, *z*, *w* ∈ {*s*1,*s*2}. Hence, there exist 2<sup>4</sup> = 16 different to each other binary state machines with 2 states.

Moreover, the state transition table of the state machines with 3 states is:


where *x*, *y*, *z*, *w*, *u*, *v* ∈ {*s*1,*s*2,*s*3}. Therefore, there are 3<sup>6</sup> = 729 different to each other binary state machines with three states.

**Definition 14.** *Two state machines M*<sup>1</sup> = (*S*1*,E*1*,δ*1) *and M*<sup>2</sup> = (*S*2*,E*2*,δ*2) *are isomorphic if E*<sup>1</sup> *and E*<sup>2</sup> *are isomorphic and there exists a one-to-one mapping f from S*<sup>1</sup> *onto S*<sup>2</sup> *such that*

$$f(\delta\_1(s,a)) = \delta\_2(f(s),a).$$

**Theorem 7.** *There exist 10 isomorphic binary state machines with 2 states, which are classified into 6 two-element classes and into 4 single-element classes, as presented in Figure 3:*

**Figure 3.** Binary state machines with two states.

Next, we will find which state machines are quasi-multiautomata or quasi-automata when their magma is a group or a hypergroup. In the proofs of the following propositions, we use the first member of each state machine class as the representative of the entire class. Similarly, the representative of every class from the group or the hypergroups will be its first member.

**Proposition 18.** *If E is the group G*<sup>1</sup> *(Proposition 8), then the state machines SM*4*, SM*9*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The verification of the axioms shows that *SM*4, *SM*9, *SM*<sup>10</sup> are quasi-automata. The rest state machines do not satisfy the mixed associativity. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*ab*) = *s*2*b* = *s*1. For *SM*<sup>2</sup> it holds: (*s*1*b*)*b* = *s*1*b* = *s*<sup>1</sup> while *s*1(*bb*) = *s*1*a* = *s*2. For *SM*<sup>3</sup> it holds: (*s*2*b*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*ba*) = *s*2*b* = *s*1. For *SM*<sup>5</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>1</sup> while *s*2(*ab*) = *s*2*b* = *s*2. For *SM*<sup>6</sup> it holds: (*s*2*b*)*b* = *s*1*b* = *s*<sup>1</sup> while *s*2(*bb*) = *s*2*a* = *s*2. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>8</sup> it holds: (*s*1*b*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*1(*ba*) = *s*1*b* = *s*1.

**Proposition 19.** *If E is the hypergroup H*<sup>1</sup> *(Proposition 9), then the state machines SM*3*, SM*6*, SM*<sup>9</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*3, *SM*6, *SM*<sup>9</sup> satisfy the generalized mixed associativity and hence they are quasi-multiautomata. Indicatively, for *SM*<sup>3</sup> we have:

$$(s\_1b)a = s\_1a = s\_2 \text{ and } s\_1(ba) = s\_1\{a, b\} = \{s\_1a, s\_1b\} = \{s\_2, s\_1\}, \text{ thus } (s\_1b)a \in s\_1(ba)$$

The state machines *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and so they are quasi-automata. Indicatively, for *SM*<sup>4</sup> we have:

(*s*2*b*)*a* = *s*1*a* = *s*<sup>1</sup> and *s*2(*ba*) = *s*2{*a*, *b*} = {*s*2*a*, *s*2*b*} = *s*1, thus (*s*2*b*)*a* = *s*2(*ba*)

The rest state machines do not satisfy any associativity condition. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*ab*) = *s*2*b* = *s*1. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*a* = *s*1. For *SM*<sup>5</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>1</sup> while *s*2(*ab*) = *s*2*b* = *s*2. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>8</sup> it holds: (*s*1*a*)*b* = *s*2*b* = *s*<sup>2</sup> while *s*1(*ab*) = *s*1*b* = *s*1.

**Proposition 20.** *If E is the hypergroup H*<sup>2</sup> *(Proposition 9), then the state machines SM*6*, SM*<sup>9</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*6, *SM*<sup>9</sup> satisfy the generalized mixed associativity, and therefore they are quasi-multiautomata, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and so they are quasi-automata. The rest state machines do not satisfy any associativity condition. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*ab*) = *s*2{*a*, *b*} = {*s*2*a*,*s*2*b*} = *s*1. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*a* = *s*1. For *SM*<sup>3</sup> it holds: (*s*2*b*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*ba*) = *s*2*b* = *s*1. For *SM*<sup>5</sup> it holds: (*s*2*b*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*2(*ba*) = *s*2*b* = *s*2. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>8</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2.

**Proposition 21.** *If E is the hypergroup H*<sup>3</sup> *(Proposition 9), then the state machines SM*6*, SM*<sup>9</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*6, *SM*<sup>9</sup> satisfy the generalized mixed associativity, and therefore they are quasi-multiautomata, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and therefore they are quasi-automata. The rest state machines do not satisfy any associativity condition. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*ab*) = *s*2*b* = *s*1. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*a* = *s*1. For *SM*<sup>3</sup> it holds: (*s*2*b*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*ba*) = *s*2*b* = *s*1. For *SM*<sup>5</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>1</sup> while *s*2(*ab*) = *s*2*b* = *s*2. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>8</sup> it holds: (*s*1*b*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*1(*ba*) = *s*1*b* = *s*1.

**Proposition 22.** *If E is the hypergroup H*<sup>4</sup> *(Proposition 9), then the state machines SM*3*, SM*5*, SM*6*, SM*<sup>9</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*3, *SM*5, *SM*6, *SM*<sup>9</sup> satisfy the generalized mixed associativity, and therefore they are quasi-multiautomata, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and therefore they are quasi-automata. The rest state machines do not satisfy any associativity condition. Indeed:

```
For SM1 it holds: (s2a)b = s1b = s2 while s2(ab) = s2{a, b} = {s2a,s2b} = s1.
For SM2 it holds: (s1a)a = s2a = s1 while s1(aa) = s1a = s2.
For SM7 it holds: (s1a)b = s2b = s1 while s1(ab) = s1{a, b} = {s1a, s1b} = s2.
For SM8 it holds: (s1a)a = s2a = s1 while s1(aa) = s1a = s2.
```
**Proposition 23.** *If E is the hypergroup H*<sup>5</sup> *(Proposition 9), then the state machine SM*<sup>8</sup> *is a quasi-multiautomaton and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machine *SM*<sup>8</sup> satisfies the generalized mixed associativity, and therefore it is a quasi-multiautomaton, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and therefore they are quasi-automata. The rest state machines do not satisfy any associativity condition. Indeed:

For *SM*<sup>1</sup> it holds: (*s*1*a*)*a* = *s*1*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*b* = *s*2. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*b* = *s*1. For *SM*<sup>3</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>2</sup> while *s*1(*aa*) = *s*1*b* = *s*1. For *SM*<sup>5</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>1</sup> while *s*2(*aa*) = *s*2*b* = *s*2. For *SM*<sup>6</sup> it holds: (*s*2*a*)*a* = *s*2*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*b* = *s*1. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*b* = *s*2. For *SM*<sup>9</sup> it holds: (*s*1*a*)*a* = *s*1*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*b* = *s*2.

**Proposition 24.** *If E is the hypergroup H*<sup>6</sup> *(Proposition 9), then the state machines SM*3*, SM*5*, SM*<sup>6</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*3, *SM*5, *SM*<sup>6</sup> satisfy the generalized mixed associativity, and therefore they are quasi-multiautomata, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and therefore they are quasi-automata. For the rest state machines, observe that they satisfy none of the associativity conditions. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*b*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*bb*) = *s*2*b* = *s*1. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2*a* = *s*1. For *SM*<sup>7</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>8</sup> it holds: (*s*1*a*)*a* = *s*2*a* = *s*<sup>1</sup> while *s*1(*aa*) = *s*1*a* = *s*2. For *SM*<sup>9</sup> it holds: (*s*1*b*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*bb*) = *s*2*b* = *s*1.

**Proposition 25.** *If E is the hypergroup H*<sup>7</sup> *(Proposition 9), then the state machines SM*3*, SM*5*, SM*6*, SM*8*, SM*<sup>9</sup> *are quasi-multiautomata and the state machines SM*4*, SM*<sup>10</sup> *are quasi-automata.*

**Proof.** The state machines *SM*3, *SM*5, *SM*6, *SM*8, *SM*<sup>9</sup> satisfy the generalized mixed associativity, and therefore they are quasi-multiautomata, while *SM*<sup>4</sup> and *SM*<sup>10</sup> satisfy the mixed associativity and therefore they are quasi-automata. The remaining state machines satisfy none of the associativity conditions. Indeed:

For *SM*<sup>1</sup> it holds: (*s*2*a*)*b* = *s*1*b* = *s*<sup>2</sup> while *s*2(*ab*) = *s*2{*a*, *b*} = {*s*2*a*,*s*2*b*} = *s*1. For *SM*<sup>2</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*2(*aa*) = *s*2{*a*, *b*} = {*s*2*a*, *s*2*b*} = *s*1. For *SM*<sup>7</sup> it holds: (*s*2*a*)*a* = *s*1*a* = *s*<sup>2</sup> while *s*1(*aa*) = *s*2{*a*, *b*} = {*s*2*a*, *s*2*b*} = *s*1.

#### **6. Conclusions and Open Problems**

This paper approaches the state machines from within their environment in which they can "survive", i.e., exist and operate. They are given an extended definition which derives from the consideration that the environment in which they can exist is an algebraic magma in the sense of [9], where the initial definition of magma by N. Bourbaki [8] is generalized for the purpose of incorporating algebraic structures endowed with hypercompositional laws. Hence, a state machine *M* is defined as a triplet (*S*,*E,δ*), where *S* is the set of the states of the machine, *E* is the set of the environmental inputs to the machine and *δ* is a mapping of *S* × *E* to *S*, which describes the interaction between each state and its environment. Our study focuses on the binary state machines, where *E* is a two-element magma and our results can be summarized in Table 1:

**Table 1.** Classification of the magmas with two elements.


With regard to the classification given in this table, we note that according to the above Theorem 3, the two-element hypergroups are not just transposition hypergroups (row 10), but bilateral transposition hypergroups. Hence, the hitherto open question which was asked in [9] is answered affirmatively.

Of all the structures that appear in the above table, this paper presents the state machines with two states whose environment is a two-element group or two-element hypergroups. The results are presented in Table 2:

**Table 2.** Binary state machines with two states.


According to Corollary 3, only quasiautomata and quasi-multiautomata with up to three states can operate in the environment of a two-element magma. The description of the three state binary machines, as well as the investigation of the state machines which correspond to algebraic structures of *E* that are other than groups or hypergroups, still remain open problems. This question becomes more complicated in the instances when *E* is enriched with two laws of synthesis, as it happens in a hyperringoid [74]. It is worth mentioning here that *E* is a hyperringoid in specific state machines like the automata, where the environment is defined via an alphabet [16,17,21].

All of the above refer to deterministic state machines. However, the state transition function can be a mapping from *S* × *E* to the power set *P*(*S*) of *S*, defining thus the nondeterministic state machines (see also [13,14,67]). This consideration broadens the margins of the study as there can exist state transition functions for which *δ*(*s*, *a*) is not necessarily just a single element. It can be more than one element and it can also be none, as it is possible for *δ*(*s*, *a*) to be equal to the empty set.

**Author Contributions:** G.G.M. and C.G.M. contributed equally to this work. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding. The APC was funded by the MDPI journal *Mathematics*.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

