Universal Cycles of Discrete Functions
aa r X i v : . [ m a t h . C O ] M a y Universal Cycles of Discrete Functions
Britni LaBounty-LayEast Tennessee State University Ashley BechelEast Tennessee State UniversityAnant P. GodboleEast Tennessee State University [email protected]
Abstract
A connected digraph in which the in-degree of any vertex equals itsout-degree is Eulerian; this baseline result is used as the basis of existenceproofs for universal cycles (also known as deBruijn cycles or U -cycles) ofseveral combinatorial objects. We present new results on the existenceof universal cycles of certain classes of functions. These include ontofunctions, and 1-inequitable sequences on a binary alphabet. In each casethe connectedness of the underlying graph is the non-trivial aspect to beestablished. (Informal) Definition 1 A universal cycle of a combinatorial object is acyclic and “efficient” listing of all the values of that object with no repeti-tion.
Example 1. 3-letter words on the binary alphabet.
The cycle 11100010covers all the possible “words”, namely 111, 110, 100, 000, 001, 010, 101,and 011 in the smallest sized sequence, namely of length 8.
Example 2 All 3-subsets of { , , , , , , , } . Note that the U-cycle below is obtained ([2]) by starting with the 7 numbers1356725 and then adding 5 mod 8 successively to get the sequence1356725 6823472 3578147 8245614 5712361 2467836 7134582 4681258 . This U-Cycle (constructed by Glenn Hurlbert) of length (cid:0) (cid:1) = 56 is readas follows: { , , } , { , , } , { , , } . . . { , , } , { , , } , { , , } . In fact1urlbert shows in [2] that for k = 3 , ,
6, there is an integer n ( k ) such thatfor n ≥ n ( k ) ⇒ U-cycles of k -subsets of [ n ] = { , , . . . , n } exist.The following result is found as standard fare in most graph theorytexts, see e.g. Theorem 1.4.24 in [6] Theorem 1.
A connected digraph is Eulerian if and only if the in-degreeof each vertex equals its out degree.
The next key result in the area of U-cycles is known as DeBruijn’stheorem; see e.g. Theorem 1.4.26 in [6] for a special case.
Theorem 2.
U-Cycles of k -letter words on an n -letter alphabet exist forall k and n . Proof.
Identical to the proof of Theorem 1.4.26 in [6]. The key idea is tocreate a graph G with vertex set that consists of all k − n letter alphabet, i.e. of length one less than the original word length,with a directed edge being drawn from vertex v to vertex v if the last k − v coincide with the first k − v . Here andin all the other situations we consider in this paper, we label the edge withthe concatenated k -letter word thus formed, e.g. for n = 26 , k = 4 the edgefrom CAT to AT E is labeled as
CAT E . It is clear that each vertex has in-degree and out-degree equal to n . Theorem 1 tells us that G is Eulerian; ifthe Eulerian circuit happens to be, e.g., CAT E, AT EZ, T EZO, . . . , RCAT then the corresponding U-cycle is
CAT EZO . . . R .The following result was proved in [3]
Theorem 3.
A U-Cycle of − functions from { , ..., k } → { , ..., n } existsif and only if n > k ; these are merely permutations of n objects taken k ata time, or, alternatively, k -letter words on [ n ] in which no letter repeats. When k = n it turns out that the underlying graph is not connectedand thus a U-cycle cannot exist. For example for n = k = 3 the graph withvertex set consisting of two-letter words on { , , } decomposes into thecycles 12 → → → → . Notice that in Theorem 3, the induced edge labels consist of the objectswe seek to build a U-cycle of, namely one-to-one functions, whereas thevertices are also one to one functions with domain (word length) of size k −
1. This will be in marked contrast to our Theorems 4 and 5, in whichthe vertices will often represent different kinds of combinatorial objects.The proof of Theorem 3 utilizes Theorem 1 but is non constructive. Knuth[4] raised the question of when a U-cycle of one to one functions can beexplicitly constructed and the first such effort appears to be, for k = n − do consider the case of k = n and deal with U-cycles of all the n ! permutations on [ n ] but obviously ina different sense than what we consider above. Now, one to one functionsconstitute a restricted class of all functions from [ k ] to [ n ]. In this paper,we focus on this line of inquiry, turning our attention first from one to oneto onto functions and then, when n = 2, to functions, whichwe define below. Definition 2
A function f : [ k ] → [ n ] is said to be almost onto if | [ n ] \ Range( f ) | = 1 Definition 3
A binary word of even length k ≥ equitable ifit consists of k/ k/ Definition 4
A binary word of odd length k ≥ if it consists of ⌊ k/ ⌋ zeros and ⌈ k/ ⌉ ones – or vice versa. Definition 5
A binary word of even length k is said to be ifthe numbers of ones and zeros differ by two. Theorem 4.
A U-Cycle of onto functions from { , ..., k } → { , ..., n } existsiff k > n Proof.
We have already seen that a U-cycle of onto functions cannot existwhen k = n ; assume, henceforth that k > n . The vertices of the underlyinggraph consist of certain kinds of functions from { , ..., k − } → { , ..., n } – these are functions such that the corresponding concatenated edge labelconsists of an onto function from { , ..., k } → { , ..., n } . A moment’s reflec-tion reveals that the only allowable such vertices are those correspondingto onto and almost onto functions on { , , . . . , k − } . Moreover, there is adichotomy between the degree structure of these two classes of vertices: If v is onto, its indegree and outdegree both equal n , however i ( v ) = o ( v ) = 1for almost onto vertices, where i ( v ) and o ( v ) represent the indegree andoutdegree of v respectively. What is critical, though, is that i ( v ) = o ( v ) foreach v . To invoke Theorem 1, we need to show that our graph is connected,i.e., that there is a path from u to v , no matter what kind of vertices u, v happen to be. We start by assuming that both u and v are onto functionsfrom { , ..., k − } → { , ..., n } and will now exhibit the fact that there is apath between them. The idea is simple. Set k − M . Suppose that weseek to build a path between a = a a . . . a M and b = b b . . . b M , where a and b are both onto. We start by “building” the sequence b to the extentthat it is “legal,”, i.e. by traversing the trail a a . . . a M → a . . . a M b → . . . → a r . . . a M b . . . b r − (1)3o the extent possible, i.e. for some r ≥
2. At this point the word we havearrived at must be almost onto, for if it were onto we could continue theprocess. Now we claim that either two of the a s in the last sequence in (1)must be the same, or else one of the a s must equal one of the b s. For, ifnot, the a s must all be distinct, and, since the set of a s and the set of b sare disjoint it would be impossible for b to be onto. Let a s − be the first a ,from the left, that is a “duplicate”.Now the outdegree of the last word in (1) is one; we continue to add theonly allowable letter as we build the trail through a series of almost ontowords, ultimately arriving at an onto word c as follows: a r . . . a M b . . . b r − → a r +1 . . . a M b . . . b r − ♦ . . . → c = a s . . . a M b b . . . b r − ♦ . . . ♦ s − r , where the ♦ j ’s are those letters forced to be added on by the fact thatwe are building the trail through almost onto words, thus having only onechoice for the next vertex in the trail. But c is onto, so that we may nexttravel from it to a cyclic version c ∗ = ♦ . . . ♦ s − r a s . . . a M b . . . b r − which is also onto. But now we may travel to ♦ . . . ♦ s − r a s . . . a M b . . . b r and we are thus able to build one more letter, namely b r , in our questto travel to the sequence b as begun in (1). We iteratively continue thisprocess until the word b is reached.Let us illustrate the above process by an example: Suppose M = n = 5and we wish to exhibit a path from a = 13425 to b = 41235. We first addon the first two letters of b as follows:13425 → → . Next we travel from 42541 to an onto word as follows42541 → , which we cycle around until the “41” segment is at the tail as follows25413 → → → → b may be reached easily:25412 → → . Continuing with the proof of Theorem 4, there are three more casesthat need to be considered to establish that G is connected, namely thatthere is a path between an almost onto a and an onto b (or vice versa), orbetween two almost onto vertices a, b . Let a be almost onto and b onto.4et a = a a . . . a M and let a s be the first letter that is represented twicein a . We then proceed from a as follows: a a . . . a M → . . . → a s − . . . a M ♦ . . . ♦ s − , from which we travel to an onto word c in a single step by reintroducingthe missing letter. Finally we can find a path from c to b as in the first partof the proof. If a is onto and b is almost onto, then the strategy is inverseto the one indicated above; we first traverse a path from a to a “logical”onto vertex c , from which the path to b is easy to establish. Specifically, if b s is the first letter, from the right of the word b , that is represented twice,then we “backtrack” from b to c as follows: b = b b . . . b M ← ♣ b . . . b M − ← . . . ← ♣ M − s . . . ♣ b . . . b s ← c = ♥♣ M − s . . . ♣ b . . . b s − , where c , by construction, is onto. A path from a to c is found as in Case1 of the theorem. Finally, the fourth case is proved by combining Cases 2and 3. This completes the proof.Our next result deals with a special class of onto functions. If thealphabet is binary, onto functions consist of all binary sequences except for(1 , , . . . ,
1) and (0 , , . . . , smaller class of onto functions that we show admits a U-cycle. Theorem 5.
A U-Cycle of − inequitable functions from { , ..., k } ( k ≡ → { , } exists, while U-cycles of equitable functions from { , ..., k } ( k ≡ → { , } do not exist. Proof.
Let us first prove that U-cycles of equitable binary functions do notexist. For small values of k , say k = 4, the fact that the underlying graphis disconnected is easy to see. Vertices consist of binary words of length k − i ( v ) = o ( v ) = 1 for each vertex v . Thegraph decomposes for k = 4 into the 2 cycles C = 110 → → → → C = 101 ↔ . In general, we might ask how many cycles a k the graph G with vertexset consisting of 1-inequitable binary functions decomposes into; the aboveshows that a = 2 and there is one cycle of length 4, written, in terms ofedges as 1100 → → → → → → . The solution to the above question is rooted in the number of divisors of k . If a word is p -periodic, then it will generate a cycle of length p . Let k , k , . . . k r denote the even divisors of the even integer k and let b r denotethe number of cycles with length r . We clearly have a k = b k + b k + . . . b k r , (2)and kb k + r X j =1 k j b k j = (cid:18) kk/ (cid:19) , or, in more useful terms, b k = (cid:0) kk/ (cid:1) − P rj =1 k j b k j k . (3)Equations (2) and (3) lead to the sequences { a k } = 1 , , , , , , , , , , , . . . and { b k } = 1 , , , , , , , , , , , , . . . ∼ njas/sequencesas Sequences A003239 and A022553 respectively, indicating that (albeit ina slightly different context) this problem had been previously solved.We thus move to the main part of the proof, namely showing that aU-cycle of 1-inequitable functions exists. In this case, the underlying graphhas vertex set that consists either of equitable sequences of length k − i ( v ) = o ( v ) = 2) or 2-inequitable sequences of length k − i ( v ) = o ( v ) =1). We next establish connectedness. Assume first that we wish to traversea path from a = a a . . . a M to b = b b . . . b M , both equitable sequences.We start by building b as in the proof of Theorem 4 as follows: a a . . . a M → . . . → a r . . . a M b . . . b r − , (4)where the last word in the above chain is 2-inequitable and has, without lossof generality, ⌊ k/ ⌋ zeros and ⌈ k/ ⌉ ones. We thus add a “0” to the chainto reach the vertex a r +1 . . . a M b . . . b r −
0, which may be either equitableor 2-inequitable. Assuming it is the latter, we travel from here through apossibly empty set of 2-inequitable vertices until ultimately we reach anequitable vertex (this will occur in the step immediately after the first “1”among the a s above is reached. Note that one of the a s must be a 1 since6he word b has been assumed to be equitable and thus has M/ M/
2) + 1 ones, one of which must come fromthe a segment.)Let the equitable vertex thus reached be denoted by∆ = c ℓ +1 . . . c M b b . . . b r − c r . . . c ℓ . We next travel through cyclic versions of ∆, ending at c r . . . c M b . . . b r − ,which permits us to travel to c r +1 . . . c M b . . . b r , one step beyond what wehad achieved in (4). This algorithm is implemented until the word b isreached. The proof of the other three cases, namely establishing a pathbetween (i) an equitable and a 2-inequitable vertex; (ii) a 2-inequitablevertex and an equitable vertex; and (iii) two 2-inequitable vertices is similarto that in Theorem 4 and is omitted. The kinds of open problems that this paper raises concern, for example, theexistence of universal cycles of certain kinds of inequitable functions whenwe are no longer restricted to a binary alphabet; or the existence of U-cyclesof functions with growth-like conditions (possibly discrete Lipschitz-typeconditions). There are many possibilities.
This work forms part of the undergraduate research project of AshleyBechel and Britni LaBounty-Lay conducted under the supervision of AnantGodbole, who was supported by NSF Grant DMS-0552730.
References [1] F. Chung, P. Diaconis, and R. Graham (1992), “Universal cycles for com-binatorial structures,”
Discrete Math. , 43–59.[2] Hurlbert, G. (1994), “On universal cycles for k -subsets of an n -elementset,” SIAM J. Discrete Math. , 598–604.[3] Jackson, B. (1993), “Universal cycles of k -subsets and k -permutations,” Discrete Math. , 114–150.[4] Knuth, D. (2005),