# Why are finite automata defined as ordered $n-tuples$ and not as sets?

First off, I should mention that I am a new contributor on this site and as such, please bear with me if this has been asked and answered before. I searched to the best of my ability to find similar questions and didn't find any.

The Question

Consider the definition of a deterministic finite automaton given below:

A deterministic finite automaton $$M$$ is an ordered $$5$$-tuple $$(Q,\Sigma, \delta, q_0, F)$$ where:

• $$Q$$ is the set of input states;
• $$\Sigma$$ is a finite set of input symbols;
• $$\delta\colon Q \times \Sigma \to Q$$ is the transition function;
• $$q_0$$ is the initial state
• $$F$$ is the set of final states

My main question is, would it be inaccurate to define $$M$$ as the set $$\{Q,\Sigma, \delta, q_0, F\}$$ of five elements? I arrived at this question when wondering if a DFA must necessarily be ordered since n-tuples are, by definition, ordered. In other words, the tuple $$(Q,\Sigma, \delta, q_0, F)$$ is, by definition, different from $$(Q,\Sigma, \delta, F,q_0)$$. But what if we define its elements the same way as given in the definition above? Will it be a DFA? If it will, then can a DFA be instead defined as a set?

• Would you call a set of letters a sentence? Can it be unrolled unambiguously? – Yuval Filmus Jan 23 '19 at 17:33
• @YuvalFilmus Ah, I see! No, I wouldn't call it a sentence. So the point of defining a DFA as 5-tuple is to ensure that all of its elements are included? Well, what about the order? Does it matter? – E.Nole Jan 23 '19 at 17:42
• It’s a technicality. A DFA is defined by an alphabet, a set of states, an initial state, a subset of final states, and a transition function. How you represent this information is up to you. Representing it as a set is a questionable idea - how would you know which of the five elements plays which part? There really seems nothing to gain from such a representation, but it is a lot more awkward to use. There are other possible representations - say a set of pairs (field,value), but these are basically equivalent to the standard representation. – Yuval Filmus Jan 23 '19 at 17:48
• @YuvalFilmus I'm still not yet clear on why it's a questionable idea. Say we represented it as a set and demanded that the set must always contain those elements. Now, since there is only one element of each type (i.e one transition function, one set of states, one final state etc.) in the set, we'd know precisely which one does what, not so? – E.Nole Jan 23 '19 at 18:02
• Also, if I may ask, why did you downvote? Is this question not suited to this site? – E.Nole Jan 23 '19 at 18:02

But, if you wanted to represent a DFA as some sort of dictionary instead, like $$\{Q":\{\ldots\}, \Sigma":\{\ldots\},\ldots\}$$, that would be perfectly fine. Or a list of pairs, or really any way you like that makes it clear what's what.