1 Introduction

The direct or cross product of automata is well known from the intersection and union construction from automata theory. It is only a special case of more complex automata operations, which were recently studied from a descriptional complexity perspective in [4]. In general, a product of automata is obtained by series (cascading), parallel, and/or feedback composition of automata. In the direct product there is no communication between the component automata, while for instance, in the cascade product that is yet another well known product of automata, the second automaton receives along with the input letter also the state of the first automaton. For the hierarchy of automata products of increasing feedback dependencies the magic number problem was almost completely classified for all meaningful product types of two automata on the classes of reset (RFA), permutation (PFA), permutation-reset (PRFA), and deterministic finite state automata in general (DFA)—see Table 1 for the results on the direct product. Let us explain how to interpret the “yes” and “no” entries within the table: a “no” means that there are no magic numbers, i.e., the whole range [1, nm] of state complexities can be reached by m- and n-state automata of the appropriate type not including reset automata if the input alphabet is at least binary. For instance, the “no” entry for the direct product of DFAs is due to [7] and all other “no” entries are from [4]. On the other hand, a “yes” entry indicates that at least one magic number \(\alpha \) exists under the same condition on the input alphabet as mentioned above, i.e., it cannot be reached by a direct product of appropriate automata of m- and n-states, respectively. The “yes” entry in the PFA-PFA cell is due to [4].

Table 1. The magic number problem for the direct product of different types of automata. A “no” entry indicates that there are no magic numbers and the whole induced interval of state complexities can be reached, while a “yes” entry gives rise to at least one state complexity that cannot be reached, i.e., a magic number. If not specified elsewhere all automata have an input alphabet of size at least two.

The gray shaded entries in Table 1 are the results that are presented here. Previously in [4] magic numbers for these cases were announced, which where found by exhaustive computer programs for small values of m, n, and \(\alpha \). To be more precise,

  • \(\alpha =2\) is magic, for \(n=m=3\) and alphabets of size at most three for the direct product of a PFA and PRFA, and

  • \(\alpha =8\) is magic, for \(n=m=3\) and at most binary alphabetsFootnote 1 for the direct product of two PRFAs.

A complete understanding of the magic number problem for both cases is missing in [4]. We partially close this gap and show the following results: (i) \(\alpha =2\) is magic for m and n both odd and at least three for binary input alphabets in case of the direct product of a PFA and a PRFA. For larger alphabets the value \(\alpha \) remains magic, but we can only prove it for fixed \(n=3\) and odd m at least three. (ii) For the direct product of two PRFAs we first show that no magic numbers exist if the input alphabet is at least four. Whether this result is optimal w.r.t. the input alphabet size is left open, but we can narrow the search for the answer to a small interval of numbers for the outcome of the direct product for two given permutation-reset input automata. In passing we show that the above mentioned result for \(\alpha =8\) is best possible w.r.t. the input alphabet size, because with three letters this number is obtainable for \(n=m=3\)—see Example 1. In the light of [7] and the previously obtained results of the authors on automata products the existence of magic numbers is expected, because if several restrictions are being imposed on automata, then, sooner or later, some values of the state complexity become unreachable. However these results solve the main open issues from [4] and thus complete the overall picture of automata products on finite automata. Nevertheless, certain fine grain details on the question whether a particular value \(\alpha \) is magic or not for the direct product of the automata under consideration are still open and await solution.

The paper is organized as follows: next we introduce the necessary notations on automata and the direct product. Then we start our investigation and first give an overview on the previously obtained results on the direct product of automata w.r.t. the magic number problem. Then we prove our new results and finally we conclude with an open problem and topics for further investigations.

2 Preliminaries

We recall some definitions on finite automata as contained in [3]. A deterministic finite automaton (DFA) is a quintuple \(A=(Q,\varSigma ,{}\cdot {},q_0,F)\), where Q is the finite set of states, \(\varSigma \) is the finite set of input symbols, \(q_0\in Q\) is the initial state, \(F\subseteq Q\) is the set of accepting states, and the transition function \(\cdot \) maps \(Q\times \varSigma \) to Q. The language accepted by the DFA A is defined as \(L(A) =\{\,w\in \varSigma ^*\mid q_0\cdot w\in F \,\}\), where the transition function is recursively extended to a mapping \(Q\times \varSigma ^*\rightarrow Q\) in the usual way. Obviously, every letter \(a\in \varSigma \) induces a mapping from the state set Q to Q by \(q\mapsto q\cdot a\), for every \(q\in Q\). A DFA is unary if the input alphabet \(\varSigma \) is a singleton set, that is, \(\varSigma =\{a\}\), for some input symbol a. Moreover, a DFA is said to be a permutation-reset automaton (PRFA) if every input letter induces either a permutation or a constant mapping on the state set. If every letter of the automaton induces only permutations on the state set, then we simply speak of a permutation automaton (PFA). Finally, a DFA is said to be a reset automaton (RFA) if every letter induces either the identity or a constant mapping on the state set. The class of reset, permutation, permutation-reset, and deterministic automata in general are referred to as \(\mathbf {RFA}\), \(\mathbf {PFA}\), \(\mathbf {PRFA}\), and \(\mathbf {FA}\), respectively. It is obvious that the inclusions \(X\mathbf {FA}\subseteq \mathbf {PRFA}\subseteq \mathbf {FA}\), where \(X\in \{\mathbf {P},\mathbf {R}\}\), hold. Moreover, it is not hard to see that the classes \(\mathbf {RFA}\) and \(\mathbf {PFA}\) are incomparable.

The direct product of two DFAs, also known as the cross product, \(A=(Q_A,\varSigma ,{}\cdot _A{},q_{0,A},F_A)\) and \(B=(Q_B,Q_A\times \varSigma ,{}\cdot _B{},q_{0,B},F_B)\), denoted by \(A\times B\), is defined as the automatonFootnote 2

$$A\times B=(Q_A\times Q_B,\varSigma ,{}\cdot {},(q_{0,A},q_{0,B}),F_A\times F_B),$$

where the transition function is given by

$$(q,p)\cdot a = (q\cdot _A a, p\cdot _B a),$$

for \(q\in Q_A\), \(p\in Q_B\), and \(a\in \varSigma \). Observe, that the transitions of A and B depend only on \(\varSigma \). We say that A is the first automaton and B the second automaton in the product. Observe, that although the statements to come on the direct product explicitly refer to first and second automaton of a certain type, these types can be obviously commuted, since in the direct product the order of the operand automata is not relevant to the product automaton (up to isomorphism). For the choice of the final set of states of the direct product automaton we follow the lines of [1] and the forerunner papers [4,5,6]. One observes, that the device \(A\times B\) accepts the intersection of the language accepted by A and B.

We give a small example.

Example 1

Consider the PRFA \(A=(\{q_0,q_1,q_2\},\{a,b,c,d\},{}\cdot _A{},q_0,\{q_0,q_2\})\), where

$$\begin{aligned} \begin{array}{ccc} \begin{array}{c} q_0\cdot _A a = q_0,\\ q_0\cdot _A b = q_0,\\ q_0\cdot _A c = q_2,\\ q_0\cdot _A d = q_0, \end{array} &{} \qquad \qquad \begin{array}{c} q_1\cdot _A a = q_1, \\ q_1\cdot _A b = q_1, \\ q_1\cdot _A c = q_2, \\ q_1\cdot _A d = q_2, \end{array} &{} \qquad \qquad \begin{array}{c} q_2\cdot _A a = q_2, \\ q_2\cdot _A b = q_2, \\ q_2\cdot _A c = q_2, \\ q_2\cdot _A d = q_1. \end{array} \end{array} \end{aligned}$$

Then let

$$\begin{aligned} B=(\{p_0,p_1,p_2\},\{a,b,c,d\},{}\cdot _B{},p_0,\{p_0,p_2\}), \end{aligned}$$

be the PRFA, where

$$\begin{aligned} \begin{array}{ccc} \begin{array}{c} p_0\cdot _B a = p_2,\\ p_0\cdot _B b = p_0,\\ p_0\cdot _B c = p_1,\\ p_0\cdot _B d = p_0, \end{array} &{} \qquad \qquad \begin{array}{c} p_1\cdot _B a = p_2, \\ p_1\cdot _B b = p_1, \\ p_1\cdot _B c = p_0, \\ p_1\cdot _B d = p_1, \end{array} &{} \qquad \qquad \begin{array}{c} p_2\cdot _B a = p_2, \\ p_2\cdot _B b = p_2, \\ p_2\cdot _B c = p_2, \\ p_2\cdot _B d = p_2. \end{array} \end{array} \end{aligned}$$

The automata A and B are depicted in Fig. 1 on the top and lower right, respectively. It is easy to see that both automata are minimal.

Fig. 1.
figure 1

The example automata A and B both with input alphabet \(\{a,b,c,d\}\) on the top and lower right, respectively. For a better representability not all transitions of the automata are shown. In particular, this is the case for the automaton \(A\times B\), where only the transitions of the initially reachable states are shown. Additionally no self-loops are shown. For instance, letter a acts as the identity on the state set of A. The direct-product \(A\times B\) is depicted on the lower left.

By construction the \(\nu _0\)-product of A and B is given by

$$A\times B=(\{q_0,q_1,q_2\}\times \{p_0,p_1,p_2\},\{a,b,c,d\},{}\cdot {},(q_0,p_0),\{q_0,q_2\}\times \{p_0,p_2\}),$$

where the transitions of the initially reachable states

$$\begin{aligned} (q_0,p_0),(q_0,p_2),(q_1,p_0),(q_1,p_1),(q_1,p_2),(q_2,p_0),(q_2,p_1),(q_2,p_2), \end{aligned}$$

can be deduced from Fig. 1, too, on the lower left. By inspection no initially reachable states in \(A\times B\) are equivalent and \((q_0,p_1)\) is not reachable. Hence, the minimal DFA accepting \(L(A\times B)\) has \(\alpha =8\) states. One may have noticed that the letter b induces the identity mapping on all involved automata. The transitions of the letters a, b, c, and d are chosen such that in \(A\times B\) the letter a maps every state onto the last row, the letter b induces a cycle in the first column of specific length (here one), the letters b and c map the states in the last column without \((q_{n-1},p_{m-1})\) transitively onto each other and the letter d forms row-wise cycles of a specific length (here two) beginning in the last column.   \(\square \)

When considering the descriptional complexity of the product of two automata, we limit ourselves to the case where the involved automata are non-trivial, i.e., they have more than one state. Thus, in the following we only consider non-trivial automata. It is easy to see that \(n\cdot m\) states are sufficient for any product of an n-state and m-state automaton.

3 Results

First let us recall what is known from the literature for the magic number problem of the direct product, which is the following question: which numbers of states of the minimal DFA for the direct product of two minimal automata of state size n and m are reachable? Whenever a number is not obtainable, it is called “magic”. Obviously the answer to this question depends on the types of the involved input automata. The following results are known:

  1. 1.

    In [7] it was shown that if the input automata are arbitrary deterministic finite automata the whole range [1, nm] can be reached (DFA-DFA case), and

  2. 2.

    all combinations of RFAs, PFAs, PRFAs, and DFAs were considered in [4], where the following results were shown:

    1. (a)

      Whenever a RFA is involved in the direct product (RFA-RFA, RFA-PFA, RFA-PRFA, and RFA-DFA case) no magic numbers exist and the whole interval can be reached. Note that minimal RFAs have state size at most two.

    2. (b)

      For the PFA-PFA case the answer to the magic number problem is “yes”, because magic numbers were already identified for the more complex cascade product of permutation automata.

    3. (c)

      For the cases PFA-PRFA and PRFA-PRFA magic numbers were identified only by exhaustive computer programs for small cases of m, n, and \(\alpha \). In particular, for the direct product of a PFA and a PRFA the value \(\alpha =2\) is magic for \(n=m=3\) and alphabets of size at most three.

    4. (d)

      Finally, no magic numbers exist for the PFA-DFA case and thus for the more general PRFA-DFA case.

Thus, only the PFA-PRFA and PRFA-PRFA lack a complete theoretical understanding, since in this case only computer determined evidence for magic numbers were given. In the forthcoming we close this gap in the affirmative of the magic number problem. We start our investigation with the PFA-PRFA case. As mentioned above \(\alpha =2\) was identified magic for \(n=m=3\) and alphabets of size at most three by a computer program.Footnote 3 Already in [4] it was conjectured that \(\alpha =2\) is magic whenever m and n are odd and at least three. The next lemma shows that this is actually the case for binary alphabets.

Lemma 2

Let \(n,m\ge 3\) be both odd. Then there exists no minimal binary n-state PRFA A and no minimal binary m-state PFA B such that the minimal DFA for the language \(L(A\times B)\) has 2 states.

Proof

We prove the statement by contradiction. Therefore assume to the contrary that there is a minimal n-state PRFA A and a minimal m-state PFA B such that the minimal DFA for the language \(L(A\times B)\) has two states.

First we prove that A is neither a RFA nor a PFA. In case A is a RFA, i.e., all input letters are resets, we obtain a contradiction on the minimality of A, because every minimal RFA has at most two states [6], but A is a minimal device with at least 3 states. Hence, not all letters of the input alphabet of A are resets. Next assume that A is a PFA. In [6] it was shown that for every \(\alpha \) in [2, nm] that is coprime to n, there does not exist a minimal n-state PFA A and a minimal m-state PFA B such that the minimal DFA accepting the language of the cascade product of A and B has \(\alpha \) states. Since the direct product is a special case of the cascade product this result also holds if the direct product \(\nu _0\) is considered. Thus, one letter, say a, of the input alphabet of A induces a reset on the state set \(Q_A\) of A and the other letter, say b, induces a permutation on \(Q_A\). For convenience let \(Q_B\) refer to the state set of B. Thus, the input alphabet of A and also B, since we consider the direct product, is equal to \(\varSigma =\{a,b\}\).

Next we define the state sets

$$\begin{aligned} Q_{A,1}:=\{q_0\cdot w\mid w\in \varSigma ^*\text { for }w\text { inducing a permutation on }Q_A\}, \end{aligned}$$

and

$$\begin{aligned} Q_{A,2}:=\{\,q_0\cdot w\mid w\in a\varSigma ^*\}, \end{aligned}$$

for \(q_0\) being the initial state of A. Clearly this results in the properties

$$\begin{aligned} Q_{A,1}\cdot a=\{q_0\cdot a\}&\subseteq Q_{A,2},&Q_{A,2}\cdot a=\{q_0\cdot a\}&\subseteq Q_{A,2},\\ Q_{A,1}\cdot b&=Q_{A,1},&Q_{A,2}\cdot b&=Q_{A,2}, \end{aligned}$$

and

$$\begin{aligned} Q_A=Q_{A,1}\cup Q_{A,2}, \end{aligned}$$

where the union is not necessarily disjoint. Observe, that \(Q_{A,2}\) contains at least one state, since a is the reset letter. Moreover, note that for every word \(w\in \varSigma ^*\) which induces a permutation there is a word \(w^{-1}\in \varSigma ^*\) which induces the inverse permutation on the state set of A. Therefore either \(Q_{A,1}\) is a subset of \(Q_{A,2}\) or the two sets are disjoint. Since n is at least equal to three the first case can only appear for \(|Q_{A,2}|\ge 3\). Nevertheless the argumentation to come for the case \(|Q_{A,2}|\ge 3\) does not require \(Q_{A,1}\) and \(Q_{A,2}\) to be disjoint. We want to mention that in all cases b permutes the states of \(Q_{A,2}\) transitively because A is a binary device. Now we are ready to consider the following cases for \(Q_{A,2}\), where we will conclude a contradiction in each case:

  1. 1.

    Case \(|Q_{A,2}|=1\). Let \(Q_{A,2}=\{q\}\), for some state q in \(Q_A\). We first assume that q is an accepting state. So the set \(\{q\}\times Q_B\) induces a PFA which is isomorphic to B up to the initial state. Since B is minimal the states in \(\{q\}\times Q_B\) cannot contain any equivalent states which contradicts \(\alpha =2\). Thus q has to be non-accepting which implies that all states in \(\{q\}\times Q_B\) are equivalent. This implies the existence of an accepting state in the set \(Q_{A,1}\times Q_B\) which is initially reachable. Since there is at least one reachable state in \(A\times B\) for each state \(q'\) in \(Q_{A,1}\), which has \(q'\) as its first component the assumption that only one state of \(Q_{A,1}\times Q_B\) is reachable implies that \(Q_{A,1}\) consists of one state. Indeed this gives us that \(|Q_{A,1}\cup Q_{A,2}|=1+1=2\), which is a contradiction to \(2<n=|Q_A|\). Therefore there are at least two states of \(Q_{A,1}\times Q_B\) reachable. But on the other hand the states in \(Q_{A,1}\) have to contain an accepting and a non-accepting state. Therefore an accepting state and a non-accepting state in \(Q_{A,1}\times Q_B\) is reachable. Since there is a word \(w\in \varSigma ^*\) which maps the non-accepting state in \(Q_{A,1}\times Q_B\) onto an accepting state the reachable states in \(Q_{A,1}\times Q_B\) cannot contain a state equivalent to the reachable states of \(\{q\}\times Q_B\). Therefore the minimal DFA for the language \(A\times B\) has at least three states which is a contradiction to \(\alpha \) equal to two.

  2. 2.

    Case \(|Q_{A,2}|=2\). Clearly \(Q_{A,2}\) contains one accepting and one non-accepting state, because otherwise the above described closure properties of \(Q_{A,2}\) contradicts the minimality of A.

    We claim that each state in \(Q_{A,2}\times Q_B\) is reachable in \(A\times B\). Since B is a PFA for each pair of states p and \(p'\) there is a word w in \(\varSigma ^*a\) which maps p onto \(p'\). Let \(q'\) be the image of the reset induced by a in A. Therefore every state (qp) is mapped onto \((q',p')\) for q being a state of A. Clearly this implies that all states in \(\{q'\}\times Q_B\) are reachable in \(A\times B\). Since every letter induces a permutation on \(Q_B\) and since for every state q in \(Q_{A,2}\) there is a word which maps \(q'\) onto q the claim follows.

    The b-cycles of the state set \(Q_{A,2}\times Q_B\) can be interpreted as unary cyclic PFAs \(P_0,P_1,\ldots , P_k\), for some \(k\ge 0\). Recall that a cyclic automaton consists of one cycle. Observe, that there is an accepting state in one of the PFAs \(P_0,P_1,\ldots , P_k\), say this is \(P_i\). Additionally there must also be a non-accepting state in \(P_i\) which has the non-accepting state of \(Q_{A,2}\) as its first component.

    In [6] it was shown that for every (non-)minimal PFA there exists a number x such that every of its states is equivalent to x states. Therefore this also holds for each of the PFAs \(P_0,P_1,\ldots , P_k\). Since all accepting states of a PFA \(P_i\) and all non-accepting states are equivalent this implies that the number of accepting and non-accepting states has to be equal in \(P_i\). On the other hand all of the non-accepting states of all the PFAs are equivalent which implies that all PFAs must contain an accepting state and a non-accepting state. This holds because if \(P_i\) contains only non-accepting states and \(P_j\) contains an accepting state there is a word \(w\in b^*\) which maps a non-accepting state of \(P_i\) onto a non-accepting state \(P_i\) and a non-accepting state of \(P_j\) onto an accepting state of \(P_j\). In conclusion this means that for each of the PFAs \(P_0,P_1,\ldots , P_k\) the number of accepting and non-accepting states has to be equal. Because the union of their state sets is equal to \(Q_{A,2}\times Q_B\) we observe that \(Q_{A,2}\times Q_B\) contains \(|Q_{A,2}\times Q_B|/2\) accepting states.

    This is a contradiction to the fact that only the half of the states in \(Q_{A,2}\), i.e., only one, is accepting and \(Q_B\) contains at least one non-accepting stateFootnote 4 which implies that the number of accepting states in \(Q_{A,2}\times Q_B\) is strictly less than \(|Q_{A,2}\times Q_B|/2\). We want to mention that this causes a contradiction in all cases since there cannot be a single PFA \(P_0\), for \(k=0\), with two states because \(|Q_{A,2}\times Q_B|=2\cdot |Q_B|\) is at least equal to six.

  3. 3.

    Case \(|Q_{A,2}|\ge 3\). We use the notation as in the previous case, in particular the b-cycle PFAs \(P_0,P_1,\ldots ,P_k\), and argue along similar lines up to the contradiction in the last paragraph. Recall that each of the PFAs \(P_0,P_1,\ldots ,P_k\) contains an accepting and a non-accepting state.

    Since all accepting (non-accepting, respectively) states are equivalent it is easy to understand that this is only possible if the finality of the states in each cycle alternates. The first components appear in the states of \(P_i\) in the same ordering as in \(Q_{A,2}\). The ordering of \(Q_{A,2}\) may occur multiple times in \(P_i\) but this will not matter for our reasoning. Indeed this implies that without loss of generality every state which is on an even position in \(Q_{A,2}\) is accepting. There have to be also accepting states on odd positions in \(Q_{A,2}\) or \(|Q_{A,2}|\) because otherwise all accepting and all non-accepting states in \(Q_{A,2}\) would be equivalent which would contradict the minimality of A. In both cases there are consecutive states in \(Q_{A,2}\) which are accepting.

    We show that the finality of the states in each b-cycle of B alternates, too. It is already known that every state in \(Q_{A,2}\times Q_B\) is reachable. If p and \(p'\) are non-accepting states of B such that \(p\cdot b=p'\) we obtain that for \(q\cdot b=q'\) the states (qp) and \((q',p')\) are also non-accepting and that \((q,p)\cdot b=(q',p')\). Indeed this would contradict the fact that the finality of the states in each \(P_i\) alternates. If p and \(p'\) are accepting states of B such that \(p\cdot b=p'\) we obtain that for \(q\cdot b=q'\) the states (qp) and \((q',p')\) are also accepting if q and \(q'\) are acceptingFootnote 5 and that \((q,p)\cdot b=(q',p')\). Again this would contradict the fact that the finality of the states in each \(P_i\) alternates.

    Additionally we observe that each b-cycle of B has at least two states because otherwise there would be a PFA \(P_i\) which is either isomorphic to the PFA induced by \(Q_{A,2}\) up to the initial state or which is a cycle of length \(|Q_{A,2}|\) of non-accepting states. The first case contradicts the fact that all accepting states are equivalent in \(P_i\) and we proved already that the latter case is ruled out.

    It is not hard to see that the ordering of \(Q_{A,2}\) is the same ordering as for the first components of the states in each of the PFAs \(P_0,P_1,\ldots ,P_k\). Recall that there is an accepting state q in \(Q_{A,2}\) which is followed by an accepting state. Since we have shown that every state in \(Q_{A,2}\times Q_B\) is initially reachable we know that there is a reachable state (qp) that is accepting. Since the finality of the states in all b-cycles of B alternates we obtain that the cycle of (qp) contains two consecutive non-accepting states which is a contradiction to the fact that the finality of the states in each of the PFAs \(P_0,P_1,\ldots ,P_k\) alternates.   \(\square \)

By a careful inspection of the statement of the previous lemma we show that it can be improved to alphabets of arbitrary size restricting one automaton to three states. We have to leave open whether a more general improvement is possible.

Theorem 3

Let \(n=3\) and m be odd with \(m\ge 3\). Then there does not exist a minimal n-state PRFA A and no minimal m-state PFA B such that the minimal DFA for the language \(L(A\times B)\) has 2 states.

Proof

We prove this statement by showing that for \(n=3\) the reasoning of the proof of Lemma 2 is also valid for arbitrary alphabet size greater or equal to two. Therefore we use the same notation as in the previous proof which was mainly guided by the size of the state set \(Q_{A,2}\), a subset of \(Q_A\), the state set of the PRFA A.

By inspecting of the case \(|Q_{A,2}|=1\) of the previous proof we obtain that it only requires the input alphabet to contain the letters a and b which implies that there can be arbitrary many other letters in the input alphabet. The cases \(|Q_{A,2}|=2\) and \(|Q_{A,2}|\ge 3\) rely on the fact that there is letter b which induces a permutation and acts transitively on the set \(Q_{A,2}\), e.g., it forms a cycle on \(Q_{A,2}\). We prove now that the argument is also true for all alphabets with at least two elements if \(n=3\). To this end we consider two cases depending on the size of \(Q_{A,2}\):

  1. 1.

    Case \(|Q_{A,2}|=2\). The proof that there is a letter that permutes the states of \(Q_{A,2}\) non-trivially is shown by contradiction. Assume to the contrary that all letters which induce a permutation act on \(Q_{A,2}\) trivially. Since \(n=3\) and \(|Q_{A,2}|=2\) we know that \(|Q_{A,1}|=1\) and \(Q_{A,1}=Q_A{\setminus } Q_{A,2}\). Due to the definition of \(Q_{A,1}\) we know that every permutation fixes the sole state in \(Q_{A,1}\). This implies that every permutation induces the identity on \(Q_A=Q_{A,1}\cup Q_{A,2}\). So A is a RFA which is a contradiction to the fact that A is minimal and has three states.

  2. 2.

    Case \(|Q_{A,2}|\ge 3\). We distinguish three subcases with respect of the size of \(Q_{A,1}\); note that in fact \(|Q_{A,2}|=3\), since \(n=3\):

    1. (a)

      Subcase \(|Q_{A,1}|=1\). We observe that the arguments used in the case \(|Q_{A,2}|=2\) of the proof of Lemma 2 imply for the case \(|Q_{A,2}|=3\) under consideration that all states of \(A\times B\) are initially reachable because \(n=3\).

      One finds that there are three states of \(A\times B\) which have the single state of \(Q_{A,1}\) as their first component. These may contain zero, one, or two accepting states depending on the finality of the sole state in \(Q_{A,1}\) and the number of accepting states of B. These three states are either transitively mapped onto each other which makes them inequivalent if at least one of them is accepting or one of these states, say q, is only mapped onto itself by permutations. We will show the contradiction for the second case because if all three states are transitively permuted and non-accepting they are equivalent while they are inequivalent to every non-accepting state that is mapped onto an accepting state by a permutation. Indeed this causes a contradiction in a similar fashion like it will for the case that q is only mapped onto itself. So q is not mapped onto either an accepting or a non-accepting state. Since A is not an RFA there must be a permutation c which acts non-trivially on the state set of A. Furthermore, letter c has to permute two states of different finalities to preserve the minimality of A. Thus, one of the cycles induced by c in \(A\times B\) contains a non-accepting and an accepting state while q is a fixpoint of c. These three states cannot be equivalent because there is a word in \(c^*\) which maps them onto states of different finality. This implies that the minimal DFA accepting \(L(A\times B)\) has at least three states which is a contradiction.

    2. (b)

      Subcase \(|Q_{A,1}|=2\). It is not hard to see that the arguments in the previous subcase can also be used for \(|Q_{A,1}|=2\), if we exchange q in the reasoning above by the state \(\tilde{q}\) in \(Q_A{\setminus } Q_{A,1}\) and by observing that \(\tilde{q}\) is also mapped onto itself by every permutation.

    3. (c)

      Subcase \(|Q_{A,1}|\ge 3\)—By a similar reasoning as for the size of \(Q_{A,2}\) together with \(n=3\) we are actually in the case \(|Q_{A,1}|= 3\). Since \(|Q_{A,1}|= 3\) either there is a permutation that permutes \(Q_{A,1}=Q_{A,2}\) transitively or there are at least two non-trivial unequal permutations on that set. Due to the fact that they are non-trivial each of them must permute at least two elements while each of them permutes less than \(|Q_{A,2}|= 3\) elements. Obviously they have order two, e.g., they are transpositions. Additionally they have one element in common since they permute \(Q_{A,2}\) which has only three elements. So the composition of the two transposition has order three and therefore permutes \(Q_{A,2}\) transitively.

Therefore all possible cases lead to a contradiction.   \(\square \)

Next we consider the PRFA-PRFA case. Here also at least one magic number was announced in [4] with the help of a computer program. This number is \(\alpha =8=nm-1\), for \(n=m=3\) and alphabet of size at most two. In fact, if the alphabet size is large enough, we show that no magic number in the PRFA-PRFA case exists. Due to the lack of space the proof of the following statement has to be omitted.

Theorem 4

Let \(n,m\ge 2\). Then for every \(\alpha \) with \(1\le \alpha \le nm\), there exists a quaternary minimal n-state PRFA A and a quaternary minimal PRFA B such that the minimal DFA for the language \(L(A\times B)\) has \(\alpha \) states.

Now the question arises whether the above theorem is best possible w.r.t. the input alphabet size. For alphabet size two \(\alpha =8\) is magic as mentioned above for \(n=m=3\). Unfortunately, this is not true anymore if we consider alphabets of size at least three, which is shown next for the more general case of \(\alpha =nm-1\) for large enough m and n.

Lemma 5

Let \(n,m\ge 3\). Then for \(\alpha =nm-1\), there exists a ternary minimal n-state PRFA A and a ternary minimal PRFA B such that the minimal DFA for the language \(L(A\times B)\) has \(\alpha \) states. This results holds true even if one automaton is a PFA.

Proof

Define the PRFA

$$A=(\{q_0,q_1,\ldots ,q_{n-1}\},\{a,b,c\},{}\cdot _A{},q_0,\{q_0,q_{n-1}\})$$

with

$$\begin{aligned} q_{n-1}\cdot _A a&= q_{n-2},&\\ q_{n-2}\cdot _A a&= q_{n-1},&\\ q_i\cdot _A b&= q_1,&\text {for }0\le i\le n-1\\ q_i\cdot _A c&= q_{i+1},&\text {for }1\le i\le n-3\\ q_{n-2}\cdot _A c&= q_1,&\end{aligned}$$

where all not explicitly mentioned transitions are self-loops. Moreover, let

$$\begin{aligned} B=(\{p_0,p_1,\ldots ,p_{m-1}\},\{a,b,c\},{}\cdot _B{},p_0,\{p_0,p_{m-1}\}), \end{aligned}$$

be the PRFA, where

$$\begin{aligned} p_{m-2}\cdot _A b&= p_{m-1},&\\ p_{m-1}\cdot _A b&= p_{m-2},&\\ p_i\cdot _A c&= p_{i+1 \bmod (m-1)},&\text {for }0\le i\le m-2 \end{aligned}$$

where all not explicitly mentioned transitions are self-loops. The minimality of both automata are immediate. Observe, that B is even a permutation automaton. The argumentation that the minimal automata that accepts the language \(L(A\times B)\) requires exactly \(\alpha =nm-1\) states is left to the interested reader.   \(\square \)

The previous lemma does not answer the question whether Theorem 4 is best possible for the stated alphabet size. A careful inspection of the proof of Theorem 4 together with the previous lemma and results in [4] reveal that optimality is given if there is a number in the interval

$$[\max \{n+2m-1,m+2n-1\},nm-2]$$

that is magic for the PRFA-PRFA case for ternary alphabet size. Hopefully further research will give an answer to this question.