An Ehrhart theoretic approach to generalized Golomb rulers
Abstract.
A Golomb ruler is a sequence of integers whose pairwise differences, or equivalently pairwise sums, are all distinct. This definition has been generalized in various ways to allow for sums of integers, or to allow up to repetitions of a given sum or difference. Beck, Bogart, and Pham applied the theory of inside-out polytopes of Beck and Zaslavsky to prove structural results about the counting functions of Golomb rulers. We extend their approach to the various types of generalized Golomb rulers.
1. Introduction
A Golomb ruler of length with markings is a sequence of integers such that the differences are all distinct. Golomb rulers were originally considered by Sidon [Sid32] and are also known as Sidon sets or -sets.
The main question that has been studied about such sets is their maximum density; that is, for a given , what is the maximum possible such that there exists a Golomb ruler of length with markings? It has long been known that as tends to , this maximum is asymptotic to . The lower bound is due to Singer [Sin38] and the asymptotically matching upper bound to Erdós and Turán [ET41]. For a range of more recent and related results, we refer the reader to O’Bryant’s survey [O’B04].
A different problem is to count Golomb rulers given the parameters and . We denote by the number of Golomb rulers of length with markings. For fixed and tending to infinity, almost every possible sequence is a Golomb ruler, so
In order to obtain more algebraically precise results, Beck, Bogart, and Pham [BBP12] introduced the following framework. Since , the sequence is equivalently specified by the sequence of successive differences , where . The condition that becomes the condition that the ’s are all positive, and the ’s, like the ’s, must all be integers. That is, each Golomb ruler corresponds to a lattice point in the th dilation of the standard -simplex in . Finally, the condition that differences are unique can be written as a collection of linear inequations in the ’s.
In more general terms, we have just observed that Golomb rulers are in bijection with the lattice points in the interior of a certain polytope that do not lie on any of the hyperplanes in a certain arrangement. Beck and Zaslavsky [BZ06] studied such sets of lattice points in general under the name of inside-out polytopes. They extended Ehrhart’s theorem (both quasipolynomiality and reciprocity) to this context. Their theory could thus be brought to bear on the counting function (see Theorem 2.2 below.) It also yielded a bijection between the combinatorial types of Golomb rulers and the regions of the hyperplane arrangement that intersect the interior of the polytope.
Golomb rulers have been generalized in several ways.
Definition 1.1.
We define a ruler to be any sequence of integers .
-
(1)
The ruler is a -set if each positive integer admits at most representations as a sum of two markings.
-
(2)
The ruler is a -Golomb ruler or -set if each positive integer admits at most representations as a difference of two markings.
-
(3)
For , the set is a -set if each positive integer admits at most one representation as a sum of markings.
-
(4)
Combining the first and third definitions, the ruler is a -set if each positive integer admits at most representations as a sum of markings.
Remark 1.2.
A Golomb ruler (i.e. set) is the same as a -set, but for , a -set is not the same as a -set.
The asympototic density question is still open in these cases. To our knowledge, the best general upper and lower bounds for the density of sets appear in a recent preprint of Johnson, Tait, and Timmons [JTT21]. They also note that in many cases, their upper bound matches one of Green [Gre01], and their lower bound matches one of Caicedo, Gómez, Gómez, and Trujillo [CGGT14]. For -sets, Dellamonica, Kohayakwawa, Lee, Rödl, and Samotij [DJKL+16] give good asymptotic results for the total number of sets of length at most .
Returning to the question of enumeration, given and , we denote by , , and the number of rulers of length with markings that are respectively -sets. -sets, and -sets. (We will not consider -sets from now on, but it should be possible to extend our results on -sets to this case.) In comparison with [DJKL+16], our approach deals with the simpler situation in which the number of markings is fixed, but it yields results that are more precise in an algebraic sense.
In Section 2 we state our main theorems about the counting functions of generalized Golomb rulers after laying out the necessary definitions. In Section 3, we extend the approach of Beck, Bogart, and Pham in order to prove these theorems. In all cases, the underlying polytope is still a dilated standard simplex. For -sets, we explicitly describe the hyperplane arrangement that must be removed. For the other types of generalized Golomb rulers, the conditions yield that not a hyperplane arrangement but a subspace arrangement must be removed, and we explicitly describe these arrangements. Some of the results of Beck and Zaslavsky extend to the situation of subspace arrangements, so in particular we obtain quasipolynomiality results in all cases.
In addition, Beck, Bogart, and Pham gave a combinatorial interpretation of the regions of the inside-out polytope in terms of orientations of a certain mixed graph that satisfy a certain coherence property. Unfortunately, in the course of this project we realized that this result is not correct. There is indeed an explicit injection from regions to orientations but this function is not surjective in general. We review the proof of injectivity and give an explicit counterexample to surjectivity in Section 4. Finally, in Section 5 we extend the construction and the injective map to the case of -sets, using a more elaborate mixed graph.
2. Background and Statements of Theorems
Let denote a ruler with markings and again identify the ruler with the sequence of successive differences of . As we have seen, these differences form a sequence of positive integers that sum to , which can be identified with an integer point in the interior of the -th dilation of the standard -simplex. That is,
where .
Now by definition, a Golomb ruler is a ruler for which the differences between two markings are all distinct. In terms of the consecutive differences, we have . Thus a ruler is a Golomb ruler if for every pair of consecutive subsets of we have
Definition 2.1.
In the following, we specify rulers by their consecutive differences.
-
(1)
Two Golomb rulers and are combinatorially equivalent if for all consecutive sets , we have
(1) -
(2)
Applying the same notion of equivalence to Golomb rulers with real entries, the multiplicity of an (integral) ruler is defined as the number of combinatorial types of real Golomb rulers in a sufficiently small neighborhood of .
Note that if is itself a Golomb ruler, then its multiplicity is one.
Theorem 2.2.
[BBP12, Theorem 1] The Golomb counting function , is a quasipolynomial of degree in of degree , with leading coefficient . The evaluation equals the number of rulers with length and markings, counted with multiplicity, and the evaluation equals the number of combinatorial types of Golomb rulers with markings.
We extend parts of this result to generalized Golomb rulers as follows.
Theorem 2.3.
For any , and (where appropriate) , , the functions , and are all quasipolynomials in of degree with leading coefficient .
Our remaining results apply only to -sets. The reason for this is that (as we will see in Section 3), -sets are defined by avoidance of certain hyperplanes, while the other types of generalized Golomb rulers are defined by avoidance of certain subspaces.
By definition, a set with markings is a ruler such that for each pair of distinct sequences and we have
(2) |
Definition 2.4.
-
(1)
Two such rulers are combinatorially equivalent if for every such pair and , either the inequality holds for both rulers or the opposite inequality holds for both rulers.
-
(2)
We can apply the same notion of equivalence for real Golomb rulers . Then the -multiplicity of an integral ruler is the number of combinatorial types of real Golomb ruler in an -neighborhood of for sufficiently small .
Theorem 2.5.
Let and .
-
(1)
For each , the evaluation equals the total number of rulers with length and markings, counted with -multiplicities.
-
(2)
The evaluation is the number of combinatorial types of -sets.
3. Inside-out polytopes and proofs of Theorems 2.3 and 2.5
Our results are proved via the theory of inside-out polytopes, developed by Beck and Zaslavsky [BZ06]. Their main ideas, which we now review, extend Ehrhart theory to the situation of a polytope with a hyperplane arrangement or a subspace arrangement removed.
An inside-out polytope in is a pair where is a rational polytope and is a rational hyperplane arrangement. A region of is a connected component of and a closed region (respectively open region) is simply the relative closure (respectively relative interior) of a region. For , the multiplicity of with respect to is defined to be the number of closed regions that contain . In particular, if does not belong to then and if is contained in an open region of then .
By analogy with standard Ehrhart theory (see for example [BR07]), the closed Ehrhart function and the open Ehrhart function of the inside-out polytope are respectively defined to be
Theorem 3.1.
[BZ06, Theorem 4.1] If is an inside-out polytope in such that does not contain the degenerate hyperplane , then both and are quasipolynomials in of degree , with leading coefficients equal to the volume of and periods dividing the least common multiple of the denominators in the coordinates of the vertices of the closed regions of . The value is equal to the number of closed regions of . Furthermore, the Ehrhart reciprocity formula
continues to hold in this case.
Note that the Ehrhart reciprocity law involves not the open Ehrhart function itself, but the function for which we remove not only the hyperplanes of , but also the boundary of . If the facet-defining hyperplanes of belong to , then these two functions coincide.
More generally, if is a rational affine subspace arrangement in and is a rational -polytope, then the closed Ehrhart function and open Ehrhart function can be defined just as above. However, no longer divides into regions and so multiplicity must be defined in a different way. The multiplicity of is defined to be
where is the intersection semilattice of flats of . If then we simply define its multiplicity to be zero. If is in fact a hyperplane arrangement then this algebraic definition of multiplicity coincides with the geometric one given above [BZ06, Lemma 3.4].
Theorem 3.2.
[BZ06, Theorem 8.2] Let be a rational polytope of dimension in and a rational subspace arrangement. Then, and are quasipolynomials in of degree , with leading coefficients equal to the volume of , periods dividing the least common multiple of the denominators in the coordinates of the vertices of (which are the vertices of and its regions), and the flats of dimension in . Furthermore, we have the reciprocity law
Theorems 2.3 and 2.5 will thus follow by interpreting the various types of generalized Golomb rulers as lattice points in inside-out polytopes. From their definitions via linear inequations it is not surprising that this will be possible, but we give explicit combinatorial descriptions of the hyperplanes and subspaces in order to be able to calculate examples.
3.1. -sets
Proposition 3.3.
-sets with markings and length are in bijection with lattice points in the interior of that are not contained in any nondegenerate hyperplane of the form
(3) |
where and are proper consecutive subsets of .
Proof.
Consider one of the constraints on -sets given in (2); that is,
with and . Rewrite the constraint as . In terms of the consecutive differences , this becomes
which is an inequation of the desired form with and . Conversely, each inequation in as in (3) gives a valid inequation on by reversing these steps. ∎
Example 3.4.
The -sets with 4 markings and length are in bijection with lattice points of that avoid the 20 hyperplanes
as shown in Figure 1. There are 37 intersection points in the interior of the simplex, 12 points of intersection in the boundary of the polytope and the hyperplanes divide the polytope into 80 closed regions. From Theorem 2.3, we conclude that the Ehrhart quasipolynomial has period , so it is not practical to describe it completely. However, we calculate111https://github.com/Quillar/ExtensionsGolomb/tree/a97554c93916108bfb69efb5326106442ed7e11f that if is a multiple of 2520, the number of -sets with 4 markings and length is
Remark 3.5.
The correspondence given in the proof of Proposition 3.3 is not a bijection: several collections of consecutive subsets may correspond to the same constraint. For example, again take -sets with 4 markings and consider the equation that must be avoided. Following the proof of Proposition 3.3, we rewrite this equation as . In terms of , this becomes . However, we can also write the original equation as , which yields .

Proof of Theorem 2.3 for -sets and Theorem 2.5.
Let be the hyperplane arrangement described in Proposition 3.3. By this proposition, we have that . It is immediate from Theorem 3.1 that the function is a quasipolynomial. The same theorem yields that is the number of closed regions of the inside-out polytope , which is the number of possible combinatorial types of a -set. (For sufficiently large , there will exist a lattice point in each open region, so all of these types are actually realized. This holds because is unimodularly equivalent to a full-dimensional polytope in via projection on any coordinates.) Finally, reciprocity yields that for ,
which is the number of rulers counted with their -multiplicities. ∎
3.2. -sets
By Definition 1.1, a ruler is a -set if it does not satisfy any chain of equations of the form
(4) |
As we did for -sets, we can obtain an inside-out polytope by expressing these equations in terms of the successive differences .
Proposition 3.6.
-sets with markings and length are in bijection with lattice points in the interior of that are not contained in any subspace of the form
(5) |
where the indices satisfy
(6) |
Proof.
Given indices , and any ruler , we have by the order of the markings, so it can never be the case that nor that . So in order to see whether is a -set, the only equation on these four indices that must be considered is .
Now consider a chain of equations as in (4). Without loss of generality for each and . Then by the previous paragraph, we may also assume that . That is, the indices satisfy (6). Since (using the usual convention that the empty sum equals zero to correctly obtain ), (4) is equivalent to
Now cancel the common terms and to obtain (5).
Example 3.7.
For -sets with five markings (that is, and ), the only chain of equations we must consider is
In terms of the successive differences, this becomes
or after cancelling common terms,
This forbidden subspace is a line which passes through the interior of the tetrahedron .
3.3. -sets
The defining inequations for -sets are similar to those for -sets, but with differences instead of sums. That is, we must avoid chains of equations
(7) |
Again we obtain an inside-out polytope by expressing these chains in terms of the successive differences.
Proposition 3.8.
-sets with markings and length are in bijection with lattice points in the interior of that are not contained in any subspace of the form
(8) |
where are consecutive subsets of , none of which is contained in another.
Proof.
As in the proof of Proposition 3.3, we must rewrite each constraint given by (7) in terms of the vector of successive differences. Now for any we have , so we obtain a constraint of the form (8) by taking for . If is contained in , then the condition is redundant because each succesive difference is positive, so it can never be the case that . By reversing this process, we can also transform any constraint of the form (8) into one of the form (7). ∎
Remark 3.9.
Unlike the original case of Golomb rulers (i.e. -sets), we cannot restrict to conditions given by disjoint consecutive sets . For example, let and and consider the chain of equations
In terms of the ’s, this becomes
so that the consecutive subsets are , and which are not disjoint. On the other hand, we could obtain an equivalent chain of equations with disjoint sets by cancelling the common term , but then one of these sets would be , which is no longer consecutive.
4. Combinatorial Types and Orientations of Mixed Graphs
Returning to the original case of Golomb rulers, the combinatorial types are related to acyclic orientations of a certain mixed graph. We have already seen that combinatorial types are in bijection with open regions of an inside-out polytope , where is the hyperplane arrangement given by the hyperplanes (1) for each pair of consecutive subsets of , so we will work directly with these regions.
Definition 4.1.
-
(1)
The Golomb graph is a mixed graph whose vertices are the proper consecutive subsets of . The graph is complete and an edge is directed from to if . All other edges are undirected.
-
(2)
An orientation of is called coherent if:
-
(a)
it is consistent with the directed edges, and
-
(b)
if are disjoint consecutive sets and and are also consecutive, then if and only if .
-
(a)
We first review the construction in [BBP12] of an injective map from regions of the Golomb inside-out polytope to acyclic orientations of the Golomb (mixed) graph . To do this, let be a region of the inside-out polytope. Then is the intersection of half-spaces given by inequalities of the form
where and range over all pairs of consecutive subsets of . We may assume that both sets are proper, since otherwise the inequality would hold over the entire positive orthant (in particular, over all of .) Furthermore, we may restrict to disjoint sets because if and are consecutive subsets that are not disjoint, then , , and are all consecutive sets, and
For a pair of disjoint proper consecutive sets (dpcs) , orient the edge of by . If is disjoint from both and and if and are consecutive sets, then orient the edge by . Thus the orientation is coherent. It is total because (again) any pair of consecutive sets can be decomposed in this way. Finally, it is acyclic because if there were a cycle then we could take the multiset union of the sets along the whole cycle and conclude that , which is impossible.
Proposition 4.2.
The injection is not surjective when . In particular, there is no bijection between the orientations of and the regions of .
Remark 4.3.
It would not be difficult to extend the counterexample to any .)
Proof.
Consider the following linear order on proper consecutive subsets of :
Its transitive closure is an acyclic orientation on the Golomb graph consistent with the directed edges given by set containment. To verify that is coherent, note that the linear order always places smaller subsets before larger ones, so it suffices to consider pairs of sets of the same size. So we check all such pairs, and indeed:
However, suppose there exists a region of the inside-out polytope such that . Let be a vector in the relative interior of . Then from the edges , , and , we obtain that
and these three inequalities sum to
which is a contradiction. ∎
5. Reciprocity and the -graph
In this section we generalize the injection described in Section 4 to the case of -sets.
For Golomb graphs, the vertices are consecutive subsets of . Here we would need to consider collections of such sets, but in light of the non-uniqueness illustrated in Remark 3.5, it is better to consider unions with repetition of such sets, which are multisets. We represent a multiset by the vector . In this way, multiset union corresponds to addition of vectors, and multiset containment corresponds to with respect to the standard partial order on . A single consecutive set corresponds to a consecutive vector .
Next, we need to know which pairs of vectors correspond to inequations defining -sets. In particular, given a vector , we need to know the minimum number of consective vectors whose sum is . The following definition and lemma will help us do this.
Definition 5.1.
The climb of a vector is , where
,
with taken to be 0.
Lemma 5.2.
Let . The minimum number of consecutive vectors whose sum is equals the climb of .
Proof.
Induct on . If then is a consecutive vector and the result is clear. Otherwise, we can write for some nonzero vector . Then equals either (if ) or (if ). Similarly, equals either (if ) or (if ). For all other values of , we always have . In particular, . It follows by induction that the number of consecutive vectors in any decomposition of is at least the climb of .
For the other direction, we first observe that if the support of is disconnected (that is, if there exist such that and ), then the climb of is the sum of the climbs of the connected components. Also, any decomposition of into consecutive vectors respects the connected components of . So it is enough to consider vectors with connected support.
Let be such a vector, so its support is an interval , and again let . Now we can subtract the consecutive vector , and the remaining vector has climb exactly because the climb at the first step is one less than that of , and the climb at all other steps equals that of . By induction, we conclude that there exists a decomposition of into consecutive vectors. ∎
Now the Golomb graph is complete in the sense that there is either a directed or an undirected edge between every pair of vertices. However, the analogous graph that we will define for -sets cannot be complete for the following reason.
Example 5.3.
Again consider -sets with four markings as in Example 3.4. (That is, and .) Two of the hyperplanes we consider are given by and . That is, our graph must include vertices given by each of the vectors with (undirected) edges between and and between and . However, is not a hyperplane in the arrangement because it does not correspond to an equation built from only three consecutive sets. Therefore our graph must not include an edge between and .
On the other hand, it will not suffice to consider only edges between vectors and such that the sum of the climbs of and of is at most . The reason is as follows.
Example 5.4.
Again consider -sets with four markings. The hyperplanes listed in Example 3.4 require our graph to contain vertices labelled by the vectors , , , , and with certain undirected edges between them. We also will need directed edges from to , from to , and from to to represent the fact that and are always positive. The resulting mixed subgraph on these five vertices is shown on the left side of Figure 2(b)
Now the climbs of the vectors and are both equal to two, so the sum of the two climbs is greater than . But if we do not add an edge between these two vertices, then the graph can be acyclically oriented as in Figure 2(b). In this orientation, the edge would be associated with the inequality and the edges and , by transitivity, would be associated with the inequality .
In determining which vertices and edges to include in our graph, we must also take into account that climb is not monotonic. For example, the climb of is two and the climb of is only one. However, we have the following result for pairs of vectors.
Proposition 5.5.
Let be vectors such that and have disjoint supports. Then
Proof.
We can write as a sum of consecutive vectors, so by induction it is sufficient to prove the statement in the case that is itself a consecutive vector. Furthermore, if and then the conclusion immediately follows.
So without loss of generality, let and assume that . From the proof of Lemma 5.2, this can happen only if and , and in this case . In particular, this means that both and belong to the support of . Since and have disjoint supports, neither nor belong to the support of . So and , and again by the proof of Lemma 5.2, . We conclude that in this case,
∎
Definition 5.6.
Let be the set of vectors in of climb at most .
-
(1)
Let be the undirected graph on the vertex set where is an edge if, when we write , with , we have .
-
(2)
An orientation of the edges of is called coherent if:
-
•
Every edge is oriented from to , and
-
•
for every , with and every such that and belong to , the orientation of agrees with the orientation of .
-
•
Note that is a finite graph because no coordinate of any vector in can be greater than .
Now define a function from the inside-out polytope to the set of orientations of as follows. Given an integer vector and an edge of , choose the orientation
Theorem 5.7.
The function induces an injection from the open regions of the inside-out polytope to the coherent acyclic orientations of the graph .
Proof.
Let . We first note that since , every edge of the form is oriented . For each edge of the graph, write , where . Since is an edge, we have . Then by Proposition 5.5, as well. Since cannot belong to the hyperplane in , the edge is assigned an orientation by , say . By adding to both sides of the inequality we see that the edge is also oriented as . That is, for any , the orientation is total and coherent.
Furthemore, if the orientation contained a cycle
then by the definition of we would have
which is a contradiction. Thus is acyclic.
It remains to show that is invariant within each region and that it takes different values on different regions. That is:
Claim: Given , we have if and only if and lie in the same region of the inside-out polytope.
To prove this claim, first suppose that . Then for all edges in , we have
Since edges of correspond to hyperplanes in , and lie on the same side of each of the hyperplanes in the arrangement.
On the other hand, suppose . Then there exists an edge such that when we again write , where , the orientation has and has . That is,
This implies that and lie on opposite sides of the hyperplane in determined by the pair . ∎
Acknowledgements
Tristram Bogart was supported by internal research grant INV-2020-105-2076 from the Faculty of Sciences of the Universidad de los Andes.
References
- [BBP12] Matthias Beck, Tristram Bogart, and Tu Pham, Enumeration of golomb rulers and acyclic orientations of mixed graphs, The Electronic Journal of Combinatorics 19 (2012), no. 3, P42.
- [BR07] Matthias Beck and Sinai Robins, Computing the continuous discretely, vol. 61, Springer, 2007.
- [BZ06] Matthias Beck and Thomas Zaslavsky, Inside-out polytopes, Advances in Mathematics 205 (2006), no. 1, 134–162.
- [CGGT14] Nidia Y Caicedo, Carlos A Gómez, Jhonny C Gómez, and Carlos A Trujillo, {} modular sets from {} modular sets, arXiv preprint arXiv:1411.5741, 2014.
- [DJKL+16] Domingos Dellamonica Jr, Yoshiharu Kohayakawa, Sang June Lee, Vojtěch Rödl, and Wojciech Samotij, The number of b3-sets of a given cardinality, Journal of Combinatorial Theory, Series A 142 (2016), 44–76.
- [ET41] Paul Erdos and Pál Turán, On a problem of sidon in additive number theory, and on some related problems, J. London Math. Soc 16 (1941), no. 4, 212–215.
- [Gre01] Ben Green, The number of squares and sets, Acta Arithmetica 100 (2001), 365–390.
- [JTT21] Griffin Johnston, Michael Tait, and Craig Timmons, Upper and lower bounds on the size of sets, arXiv preprint arXiv:2105.03706, 2021.
- [O’B04] Kevin O’Bryant, A complete annotated bibliography of work related to sidon sequences, The Electronic Journal of Combinatorics 1000 (2004), DS11–Jul.
- [Sid32] Simon Sidon, Ein satz über trigonometrische polynome und seine anwendung in der theorie der fourier-reihen, Mathematische Annalen 106 (1932), no. 1, 536–539.
- [Sin38] James Singer, A theorem in finite projective geometry and some applications to number theory, Transactions of the American Mathematical Society 43 (1938), no. 3, 377–385.