More ties than we thought

We extend the existing enumeration of neck tie knots to include tie knots with a textured front, tied with the narrow end of a tie. These tie knots have gained popularity in recent years, based on reconstructions of a costume detail from The Matrix Reloaded, and are explicitly ruled out in the enumeration by Fink and Mao (2000). We show that the relaxed tie knot description language that comprehensively describes these extended tie knot classes is either context sensitive or context free. It has a sub-language that covers all the knots that inspired the work, and that is regular. From this regular sub-language we enumerate 177 147 distinct tie knots that seem tieable with a normal necktie. These are found through an enumeration of 2 046 winding patterns that can be varied by tucking the tie under itself at various points along the winding.


A. Formal languages
The work in this paper relies heavily on the language of formal languages, as used in theoretical computer science and in mathematical linguistics. For a comprehensive reference, we recommend the textbook by Sipser [11].
Recall that given a finite set L called an alphabet, the set of all sequences of any length of items drawn (with replacement) from L is denoted by L * . A formal language on the alphabet L is some subset A of L * . Depending on how difficult it is to accurately determine membership in a formal language A, it places in one of several complexity classes. Languages that are described by finite state automata are regular; languages that require a pushdown automaton are context free; languages that require a linear bounded automaton are context sensitive and languages that require a full Turing machine to determine are called recursively enumerable. This sequence builds an increasing hierarchy of expressibility and computational complexity for syntactic rules for strings of some arbitrary sort of tokens.
One way to describe a language is to give a grammar -a set of production rules that decompose some form of abstract tokens into sequences of abstract or concrete tokens, ending with a sequence of elements in some alphabet. The standard notation for such grammars is the Backus-Naur form, which uses ::= to denote the production rules and some name to denote the abstract tokens. Further common symbols are * -the Kleene star, that denotes an arbitrary number of repetitions of the previous token (or group in brackets), and | denoting a choice of one of the adjoining options.

II. THE ANATOMY OF A NECKTIE
In the following, we will be referring quite a lot to various parts and constructions with a necktie. We call the ends of a necktie blades, and distinguish between the broad blade and the thin blade 1see Figure 1 for these names. The tie knot can be divided up into a body, consisting of all the twists and turns that are not directly visible in the final knot, and a façade, consisting of the parts of the tie actually visible in the end. In Figure 2 we demonstrate this distinction. The body builds up the overall shape of the tie knot, while the façade gives texture to the front of the knot. The enumeration of Fink and Mao only considers knots with trivial façades, while these later inventions all consider more interesting façades. As a knot is in place around a wearer, the Y-shape of the tie divides the torso into 3 regions: Left, Center and Right -as shown to the right in Figure 1.
A tie knot has to be tied by winding and tucking one of the two blades around the other: if both blades are active, then the tie can no longer be adjusted in place for a comfortable fit. We shall refer to the blade used in tying the knot as the leading blade or the active blade. Each time the active blade is moved across the tie knot -in front or in back -we call the part of the tie laid on top of the knot a bow.

III. A LANGUAGE FOR TIE KNOTS
Fink and Mao [2] observe that once the first crossing has been made, the wrapping sequence of a classical tie knot is completely decided by the sequence of regions into which the broad blade is moved. Adorning the region specifications with a direction -is the tie moving away from the wearer or towards the wearer -they establish a formal alphabet for describing tie knots with 7 symbols. We reproduce their construction here, using U for the move to tuck the blade Under the tie itself 2 . The notation proposed by Fink and Mao [2] interprets repetitions U k of U as tucking the blade k bows under the top. It turns out that the complexity analysis is far simpler if we instead write U k for tucking the blade under the bow that was produced 2k windings ago. This produces a language on the alphabet: {L ⊗ , L , C ⊗ , C , R ⊗ , R , U } They then introduce relations and restrictions on these symbols: Tie 1 No region (L, C, R) shall repeat. U moves do not influence this. Tie 2 No direction ( , ⊗) shall repeat. U moves do not influence this. Tie 3 Tucks (U ) are valid after an outward move. Tie 4 A tie knot can end only on one of C ⊗ , C or U . In fact, almost all classical knots end on U . 3 Tie 5 A k-fold tuck U k is only valid after at least 2k preceding moves. Fink and Mao [2] do not pay much attention to the conditions on k-fold tucks, since these show up in their enumeration as stylistic variations, exclusively at the end of a knot. This collection of rules allow us to drastically shrink the tie language, both in alphabet and axioms. Fink and Mao are careful to annotate whether tie knot moves go outwards or inwards at any given point. We note that the inwards/outwards distinction follows as a direct consequence of axioms Tie 2 , Tie 3 and Tie 4 . Since non-tuck moves must alternate between inwards and outwards, and the last non-tuck move must be outwards, the orientation of any sequence of moves follows by backtracking from the end of the string.
Hence, when faced with a non-annotated string like

RCLCRCLCRCLRU RCLU
we can immediately trace from the tail of the knot string: the last move before the final tuck must be outwards, so that L must be a L . So it must be preceded by R C ⊗ . Tracing backwards, we can specify 2 Fink and Mao used T for Tuck 3 The exemption here being the Onassis style knot, favored by the eponymous shipping magnate, where after a classical knot the broad blade is brought up with a C move to fall in front of the knot, hiding the knot completely. the entire string above to Next, the axiom Tie 1 means that a sequence will not contain either of LU * L, CU * C, RU * R as subsequences 4 . Hence, the listing of regions is less important than the direction of transition: any valid transition is going to go either clockwise or counterclockwise. Writing T for clockwise 5 and W for counterclockwise 6 , we can give a strongly reduced tie language on the alphabet T, W, U . To completely determine a tie knot, the sequence needs a starting state: an annotation on whether the first crossing of a tie knot goes across to the right or to the left. In such a sequence, a U instruction must be followed by either T or W dictating which direction the winding continues after the tuck, unless it is the last move of the tie: in this case, the blade is assumed to continue straight ahead -down in front for most broad-blade tie knots, tucked in under the collar for most thin-blade knots.
Position of the leading blade after a sequence of W/T windings is a direct result of #W −#T (mod 3). This observation allows us to gain control over several conditions determining whether a distribution of U symbols over a sequence of W/T produces a physically viable tie knot.
Theorem 1: A position in a winding sequence is valid for a k-fold tuck if the position is preceded by 2k winding symbols (W or T) that either 1) starts with W and satisfies #W − #T = 2 (mod 3) 2) starts with T and satisfies #T − #W = 2 (mod 3) Proof: The initial symbol produces the bow under which the tuck will go. If the initial symbol goes, say, from R to L, then the tuck move needs to come from C in order to go under the bow. In general, a tuck needs to come from the one region not involved in the covering bow. Every other bow goes in front of the knot, and the others go behind the knot. Hence, there are 2k − 1 additional winding symbols until the active blade returns to the right side of the knot. During these 2k − 1 symbols, we need to transition one more step around the sequence of regions. The transitions W and T are generator and inverse for the cyclic group of order 3, concluding the proof.
We may notice that with the usual physical constraints on a tie -where we have experimentally established that broad blade ties tend to be bounded by 9 moves, and thin blade ties by 15 moves, we can expect that no meaningful tuck deeper than 7 will ever be relevant; 4 for the broad blade ties. The bound of 4 is achieved in the enumeration by Fink and Mao [3] .

IV. LANGUAGE COMPLEXITY
In this section, we examine the complexity features of the tie knot language. Due to the constraints we have already observed on the cardinality of W and T , we will define a grammar for this language using the attribute grammar formalism of Knuth [5] . We will write this grammar with an annotated Backus-Naur form -symbols may have a finite number of numeric or boolean attributes that can be used to validate a potentially correct string in the grammar. Although in practice it is only possible to realise finite strings in the tie knot language due to the physical properties of fabric, we assume an arbitrarily long (but finite), infinitely thin tie.

A. Single-depth tucks
The following regular grammar describes all valid winding sequences for knots in which tucks only pass the active blade under the most recent bow made over the knot (which we will call depth-1-tuckable). 4 Recall that the Kleene star F * is used to denote sequences of 0 or more repetitions of the string F . 5 T for Turnwise 6 W for Widdershins This subclass can be described by a simple grammar; if we want to allow deeper tucks -going under earlier bows -then an attribute grammar as in Section IV-B is called for.

B. Recursive tucks
We allow for greater tuck depth by making the tuck rule recursive: Note that the validity of a tuck depends only on the count of T and W in the entire sequence comprising the tuck, and not the validity of any tucks recursively embedded into it. For instance, TWTTUU is a valid depth-2-tuckable sequence, as is its embedded depth-1-tuckable sequence TTU. However, TTWTUU is also a valid depth-2-tuckable sequence, even though WTU is not a valid depth-1-tuckable sequence.
Finally, we add one last attribute to the top-level tie rule: Since all the semantic information passes up the parse tree, the grammar uses only synthesized attributes and is therefore an S-attributed grammar, amenable to both top-down and bottom-up parsing approaches.

C. Classification of the tie-knot language
If we limit our attention to only the single depth tie knots described in Section IV-A, then the grammar is regular, proving that this tie language is a regular language and can be described by a finite automaton. In fact, an automaton accepting these tie knots is given by: Execution starts at the middle node, but has to go outside and return before the machine will accept input.
As for the deeper tucked language in Section IV-B, classification is significantly harder: the presence of recursion means it is at least context-free, whereas the expressibility with an attribute grammar implies at most context-sensitive. The language does not seem immediately amenable to pumping lemma arguments, nor to treatment with Ogden's lemma or Parikh's theorem or interchange lemmas [8][9][10]13].

V. ENUMERATION
We can cut down the enumeration work by using some apparent symmetries. Without loss of generality we can assume that a tie knot starts by putting the active blade in region R: any knot starting in the region L is the mirror image of a knot that starts in R and swaps all W to T and vice versa.

A. The classical case
Knots finishing in region C include all classical knots as classified by Fink and Mao [2]: these are all tied with the broad blade and finish with C. Hence, they are classified completely by W/T sequences with #W − #T = 1 (mod 3), by not counting the initial crossing as one of the moves -For a tie knot with k moves, the W and T moves need to divide so that #W − #T = 1 (mod 3). This is possible in k/3 ways. For each allotment of W and T moves, then, a classical tie knot must end with at least a single order tuck. If it weren't for this condition, we could count the number of ties for each allotment as k #T , by choosing the positions that receive a T symbol. However, we need to disqualify the choices that place different symbols at the two last positions of the string.
These disqualified versions end with either WT or TW and are preceded by an arbitrary sequence of k − 2 W and T symbols. They are only possible if there are at least 1 of each symbol available to begin with.
Theorem 2: The number of classical ties with exactly k winding steps is Proof: Out of the k winding steps, we need 1 more T than W to reach the C position for the finishing move. For any choice of #T, #W , there are k #T of these. Out of all ways to place the requisite number of T in the winding sequence, we remove those that use up one each of T and W for the last two moves. Such windings are counted by k−2 #T −1 , and for each such sequence, both TW and WT are forbidden finishing sequences.

B. The modern case
A knot with the thick blade active will cover up the entire knot with each new bow. As such, all thick blade active tie knots will fall within the classification by Fink and Mao [2].
The modern case, thus, deals with thin blade active knots. As evidenced by the Trinity and the Eldredge knots, thin blade knots have a wider range of interesting façades and of interesting tuck patterns. Where for thick blade knots, it was enough to assume that the tuck happens last, and from the C region, the thin blade knots have a far wider variety.
The case remains that unless the last move is a tuck -or possibly finishes in the C region -the knot will unravel from gravity. We can thus expect this to be a valid requirement for the enumeration. There are often more valid tuck sites than the final position in a knot, and the tuck need no longer come from the C region: R and L are at least as valid.
To enumerate windings that end with a single depth tuck move, the formula from Theorem 2 will serve our needs, with some slight modification. More interesting, however, is to enumerate all tie knots with all their choices of possible tuck sites.
Winding sequences can be generated with the same building blocks we used for the classical case above.
Theorem 3: The number of tie winding sequences ending with a single depth tuck from the left after k winding steps is The number of winding sequences ending with a single depth tuck from the right after k winding steps is Proof: The proof closely follows that of Theorem 2. In each case, we need to enforce repetition of the last winding symbol to allow for a single depth tuck at the end. In each case, we also need to end our winding sequence in the correct region for the tuck to take place. The region placement is handled by the mod 3 residue.
While a good closed form expression for the total number of tie knots, especially including all the tuck combinations of different depths, seems out of reach at the current time, the descriptions we have given so far provide accessible routes to algorithmically enumerating possible tie knots. In the appendix, we include a listing of single depth tuck knots, as well as python code that will list and print knots and potential tuck sites for any depth and winding length.
To extend the table above, we can use the formulae in Theorems 2 and 3 to establish the following: The reason for the similarity between the right and the center counts is that if t − w = 1 (mod 3), then w − t = 2 (mod 3). Hence, a winding sequence for a center tuck can be mirrored to a winding sequence for a right tuck.
By counting the number of detected tuck sites, we have calculated the total number of tie knots using only single depth tucks to be 177 147. Of these, 59 016 each end with a right or a center tuck, and 59 115 end with a left tuck.

VI. AESTHETICS
Fink and Mao [2] propose several measures to quantify the aesthetic qualities of a necktie knot; notably symmetry and balance, corresponding to the quantities #R − #L and the number of transitions from a streak of W to a streak of T or vice versa.
By considering the popular thin-blade neck tie knots: the Eldredge and the Trinity, as described in [6,7], we can immediately note that balance no longer seems to be as important for the look of a tie knot as is the shape of its façade. Symmetry still plays an important role in knots, and is easy to calculate using the CLR notation for tie knots.
Knot TW-string CLR-string Balance Symmetry Eldredge TTTWWTTUTTWWU LCRLRCRLUCRCLU 3 0 Trinity TWWWTTTUTTU LCLRCRLCURLU 2 1 We do not in this paper attempt to optimize any numeric measures of aesthetics, as this would require us to have a formal and quantifiable measure of the knot façades. This seems difficult with our currently available tools.

VII. CONCLUSION
In this paper, we have extended the enumeration methods originally used by Fink and Mao [2] to provide a larger enumeration of necktie knots, including those knots tied with the thin blade of a necktie to produce ornate patterns in the knot façade.
We have found 2 046 winding patterns that take up to 11 moves to tie and are anchored by a final single depth tuck, and thus are reasonable candidates for use with a normal necktie. We chose the number of moves by examining popular thin-blade tie knots -the Eldredge tie knot uses 11 moves. Most of these winding patterns allow several possible tuck patterns, and thus the 2 046 winding sequences generate 177 147 tie knots with single depth tucks.
We have further shown that in the limit, the language describing neck tie knots is either context sensitive or context free, with a regular sub-language describing the 177 147 knots above.
Questions that remain open to our mind include: • Settle the language complexity class of the full tie knot language.
• Find a way to algorithmically divide a knot description string into a body/façade distinction. • Using such a distinction, classify all possible knot façades with reasonably short necktie lengths.

Classical ties in WTU notation
The 85 ties enumerated by Fink and Mao [2] are given by the following winding strings in our WTU notation for tie knots:

Thin blade active tie knots
The knots that started this project were the Eldredge and the Trinity. Our transcriptions of these ties as demonstrated by Krasny [6,7] are: Eldredge TTTWWTTUTTWWU Trinity TWWWTTTUTTU Note that these show up in the enumerations below as L-373 (uuUu) and L-110 (uU). In the next several pages of this appendix, we shall list enumerations for up to 12 winding movesincluding the Eldredge and the Trinity in our enumeration. Throughout, we write u for a potential tuck site, where a single depth tuck is allowed, and U for the final tuck that keeps the tie knot in place. We split the enumeration based on where the final tuck takes place: from L, from R or from C.