The set splittability problem

# The set splittability problem

Peter Bernstein Peter Bernstein, Tufts University, Medford, MA 02155 Cashous Bortner Cashous Bortner, University of Nebraska, Lincoln, NE 68588 Samuel Coskey Samuel Coskey, Boise State University, Boise, ID 83702 Shuni Li Shuni Li, Macalester College, Saint Paul, MN 55105  and  Connor Simpson Connor Simpson, Cornell University, Ithaca, NY 14853
###### Abstract.

The set splittability problem is the following: given a finite collection of finite sets, does there exits a single set that selects half the elements from each set in the collection? (If a set has odd size, we allow the floor or ceiling.) It is natural to study the set splittability problem in the context of combinatorial discrepancy theory and its applications, since a collection is splittable if and only if it has discrepancy .

After introducing the concepts and their background, we show that the set splittability problem is NP-complete. We in fact establish this for the generalized version called the -splittability problem, in which one seeks to select the fraction from each set instead of half. Next we investigate several criteria for splittability and -splittability, giving a complete characterization of -splittability for three sets and of splittability for four sets. Finally we show that when there are sufficiently many elements, unsplittability is asymptotically much more rare than splittability.

###### 2010 Mathematics Subject Classification:
05D05, 05C15, 11K38, 68Q17

## 1. Introduction

Let be a collection of finite sets and let . We say the collection is -splittable if there exists a set (called a -splitter) such that for all , we have that , the nearest integer to . Of course, the nearest integer is not well-defined when is a half-integer, and in this case we adopt the convention that may be either the floor or the ceiling. When , we will sometimes simply say that is splittable and that is a splitter.

It is natural to study splittability and its generalizations in the context of combinatorial discrepancy theory. Given a collection as above, the discrepancy of is

 disc(B)=minSmaxi≤n∣∣|Bi∩S|−|Bi∖S|∣∣.

Intuitively, the discrepancy measures to what extent it is possible to simultaneously and evenly split each set in the collection. In fact if and only if is () splittable.

Upper bounds for the discrepancy have been studied in recent decades. In 1981 Beck and Fiala showed that if every element of is contained in at most of the sets in , then [BF81]. Incremental improvements to this bound can be found in works such as [BH97, Hel99, Buk13]. In 1985, Spencer gave an upper bound for the discrepancy of an arbitrary collection:

 disc(B)≤K√n

where is an absolute constant and is the number of sets [Spe85]. The upper bound of is asymptotically tight for general collections. Of course the discrepancy of any given collection may be much smaller than this bound, and since least discrepancy is usually best, it is natural to study the discrepancy case.

Set splittability can also be viewed as a combinatorial version of the outcome of the ham sandwich theorem: given Lebesgue measurable subsets there exists a hyperplane such that for all exactly half the measure of lies to each side of . If Lebesgue measure is replaced by a discontinuous measure, then some of the mass of may lie on itself. In this case the conclusion must be modified to say that that at most half the measure of lies to each side of [EH]. Thus a ham sandwich hyperplane does not precisely solve the splittability problem, nor does set splittability help to find a geometric hyperplane. Nevertheless the two problems are closely related.

A third way to think of set splittability is as a very strong form of hypergraph -colorability. Recall that a hypergraph with hyperedges is -colorable if there exists a -coloring of its vertices such that no hyperedge is monochromatic. With -splittability we ask not simply that both colors are represented in each hyperedge, but that the color red always appears a prescribed percentage of the time.

In the next section, we study the computational complexity of the set splittability problem. In particular, we will show that for any , the -splittability problem is NP-complete. Questions of computational complexity have of course been explored in both the discrepancy theory and the hypergraph coloring contexts. For example, the problem of deciding whether a given hypergraph is -colorable has been shown to be NP-complete [Lov73].

In the area of discrepancy theory, when Spencer established the above-mentioned bound on the discrepancy he also conjectured that it is not efficient to find a splitter which actually witnesses the bound [AS00]. The conjecture was disproved in 2010, when such an algorithm was indeed found [Ban10]. In 2012, an efficient algorithm was found with the additional property that its correctness does not depend on Spencer’s theorem itself, thus providing a constructive proof of Spencer’s result [LM12]. In the context of these positive results, it is natural to ask whether it is efficient to decide whether a collection has discrepancy . Our NP-completeness result, invoked in the special case , answers this question in the negative. This result thus affirms the belief that some discrepancy decision problems are algorithmically hard.

The fact that the -splittability decision problem is hard means we cannot hope to find a general and useful characterization of -splittability. However it is possible to do so for small collections and for other special collections of sets. For an example involving (very) small collections, we will show that a collection of at most two sets is -splittable for any . For an example involving special collections, suppose that is a collection of sets such that every element lies in exactly sets of . In this case we will show that is -splittable if and only if the sum is divisible by . The calculations used in these two results eventually lead us to a complete algebraic characterization of -splittability for collections of at most three sets.

If one specializes to the important case , some things become simpler and new characterizations become tractable. For example, if is a collection of three sets then is -unsplittable if and only if each Venn region of multiplicity  is odd, and all other Venn regions are empty. (This result was previously observed in [CCSS16].) With the help of a supercomputer, we were also able to provide a complete characterization of the -unsplittable collections of four sets in terms of the sizes of its Venn regions. The proof of the result rests on an exhaustive search for unsplittable configurations with a small number of elements, together with a reduction lemma which implies that if is unsplittable then it remains unsplittable after reducing the number of elements of each Venn region modulo .

These Venn-style characterizations of the -unsplittable configurations easily imply that unsplittability is extremely rare for collections of three and four sets. Although our method of finding unsplittable configurations becomes intractable for collections of five or more sets, this rarity phenomenon remains true. Specifically we show that if and grows sufficiently fast relative to , then the probability that a collection with sets and elements is splittable converges to . In particular if is fixed and is large enough then most collections with sets and elements are splittable.

The rest of this paper is organized as follows. In Section 2 we prove that the problem of deciding whether a given collection is -splittable is NP-complete. In Section 3, we give criteria for deciding whether some special collections are -splittable, and provide a complete characterization of -splittability for collections of at most three sets. In Section 4, we give further splittability criteria for the special case and use them to give a complete characterization of -splittability for collections of at most four sets. Finally we show that for collections with sufficiently many elements, splittability is by far more common than unsplittability.

Acknowledgement. This article represents a portion of the research carried out during the 2016 math REU program at Boise State University. The program was supported by NSF grant #DMS 1359425 and by Boise State University.

## 2. The complexity of splittability

In this section we establish that the set splittability problem is hard. Before proceeding, let us clarify how we regard the -splittability problem formally as a decision problem, which we denote -Split. If is a finite collection of subsets of then the incidence matrix of is the matrix whose entry is whenever , and otherwise. An instance of -Split consists of an incidence matrix of a collection . The matrix lies in -Split if and only if there exists a binary vector such that . Indeed, such a vector is the indicator function of a set that is a -splitter of .

In this section we will make significant use of the notations: for the th row of ; for a vector of ’s of length determined by context, and; for the number of ’s in the th row of . It is important to note that the values of the right-hand sides from the previous paragraph can be determined just from the matrix because we have .

###### Theorem 2.1.

For any , the problem -Split of determining whether a collection is -splittable is NP-complete.

Note that -Split lies in NP because given an instance of -Split and a characteristic vector of an ostensible splitter, one can easily decide in polynomial time whether is equal to for each .

To establish that -Split is NP-complete, we will exhibit a polynomial-time reduction from the decision problem ZOE (which is very similar to zero-one integer programming [Kar72]) to -Split. Here ZOE stands for zero one equations, and is formalized as follows. An instance of ZOE consists of a binary matrix . The matrix lies in ZOE if and only if there exists a binary vector such that . It is known that ZOE is NP-complete [DPV06].

In the definition of ZOE, we can clearly assume without loss of generality that the matrix has no zero rows. We can also assume that at least one row of has at least two ’s. Indeed, if has just one in each row then is trivial to solve.

Now in order to establish Theorem 2.1, we will describe a mapping from binary matrices to incidence matrices , with the property that lies in ZOE if and only if lies in -Split. In order to guarantee this, the matrix that we construct will have the special properties:

1. is an upper-left submatrix of ;

2. any solution to extends to a solution to ; and

3. any solution to restricts to a solution to .

Having described our general approach, we now proceed with the details.

### 2.1. Specification of the construction

Let be a given binary matrix, and assume that for all and that at least one . Additionally let be given. We will now construct a block matrix of the form:

 M:=[ABC0DE].

Before we describe the blocks , , , and , let us let and let be indices of the columns following the columns of . Next let and let be the indices of the many columns to the right of the columns indexed by .

Now is an matrix whose th row contains many ’s, followed by all ’s. And is an matrix whose th row contains many ’s, followed by all ’s.

The blocks and each consist of sublocks. For , let be the matrix whose th column consists of ’s, and all other columns consist of ’s. And let denote a matrix whose rows consist of the indicator functions of the subsets of of size . Then we let

 D=⎡⎢ ⎢⎣D1⋮D|T|⎤⎥ ⎥⎦, and E=⎡⎢ ⎢⎣E0⋮E0⎤⎥ ⎥⎦

Here there are many copies of in .

It is easy to see that the dimensions of the matrix are polynomial in the dimensions of the matrix . (Recall here that is a fixed parameter of the construction.) Hence the construction is a polynomial-time mapping.

### 2.2. Example of the construction

Before proving that the construction satisfies our requirements, let us give an example. Suppose that and we are given the ZOE system

 Ax=x=.

Then we have , , , and . Thus consists of the columns , and consists of the columns .

The block is thus a matrix with many ’s in the first row and many ’s in the second row. The block is a matrix with many ’s in the first row and many ’s in the second row.

Next, the blocks and are each which comes to . Block is a column of ’s followed by a column of ’s, and block is a column of ’s followed by a column of ’s.

Finally, the block is which comes to . The rows of correspond to the subsets of of size . The full matrix is displayed in Figure 1.

Having given the example construction, we briefly preview how the proof will play out in this case. The matrix gives rise to the collection of subsets of , where the characteristic vector of is the th row of . The collection is splittable if and only if the linear system has a binary solution. In our example the values one the right-hand side are , , and for .

Note that if , then extends to a solution of by setting the variables of to be and the variables of to be . Conversely, if then carefully inspecting the and blocks of , the variables of are forced to be and the variables of are forced to be . Since the rows of the block have one fewer than the rows of (and the corresponding right-hand side), such a restricts to a solution to .

### 2.3. Proof of the main theorem

We now establish that the construction described above is indeed a reduction from ZOE to -Split. We will assume throughout that , since it is clear that a collection is -splittable if and only if it is splittable. To begin, we present a simple rounding calculation that will be used below.

###### Lemma 2.2.

Let and as before. Then for any we have

 ⌊p(m+⌈qm⌉)⌉=m.
###### Proof.

Let . Then

 ⌊p(m+⌈qm⌉)⌉ =⌊p(m+qm+ε)⌉ =⌊pm+m(1−p)+pε⌉ =⌊m+pε⌉ =m+⌊pε⌉

Since and , we have , which gives that the last quantity equals as desired. ∎

Next we establish the values of the right-hand sides of the system that we have constructed.

###### Lemma 2.3.

Let , let be , and let be constructed as above. Then for all , and for all .

###### Proof.

First consider . Then

 ⌊pMi1⌉ =⌊p(Ai1+Bi1+Ci1)⌉ =⌊p(Ai1+⌈qAi1⌉)⌉

By Lemma 2.2, the latter quantity is simply , as claimed.

Next consider . Here we have

 ⌊pMi1⌉=⌊p(Di1+Ei1)⌉=⌊p(1+⌈q⌉)⌉.

Again using Lemma 2.2, the latter quantity is , as desired. ∎

To commence with the proof proper, we first show that if has a solution, then has a solution. Given a solution to , we extend to a vector by appending many ’s followed by many ’s. Then for we have

 Miy=Aix+Bi1+Ci0=1+(Ai1−1)=Ai1

By Lemma 2.3, . On the other hand for , we have

 Miy=0x+Di1+E0=Di1=1

Again by Lemma 2.3, this is equal to , as desired.

For the converse, we show that if has a solution then has a solution. We make a series of claims about the structure of that will enable us to create from it a solution to .

###### Claim 2.4.

Either there is an index such that or there is an index such that , but not both.

###### Proof of claim.

Suppose towards a contradiction that , and . Recalling the definitions of and , we can find a row index such that has a in its th and th columns. It follows that , which contradicts the calculation from Lemma 2.3 that . ∎

###### Claim 2.5.

If , then for all indices , and for all indices , .

###### Proof of claim.

Suppose towards a contradiction that there is a such . By the previous claim, for all we have . If there is just one such with , then by construction of we can find a row such that the th entry of is . This implies that contradicting that .

On the other hand if there are two distinct with , then since implies , we can find a row such that the th and th entry of is . This implies that again contradicting that .

Thus we have shown that for all . It follows from the construction of that for all . ∎

To continue the proof, let us assume first that . Then for all we have and for all we have . Letting denote the restriction of to its first entries, for any we have . By Lemma 2.3 we also know that . It follows that .

Next consider the case when . Then so both and have exactly one per row. It follows that we either have

1. for all and for all , or

2. for all and for all .

If I holds, we can do as we did when , so we are done. Otherwise, if II holds, let . Then

We know that has the opposite parity of , and that when . Therefore, is even, so , meaning that .

Thus, also corresponds to a valid splitter of , and since for all we must also have that its first entries pick out exactly one 1 per row of by the argument used for when . Therefore, taking to be restriction of to its first entries, we find that once again.

This concludes the proof that the construction of is a reduction from ZOE to -Split.

## 3. p-Splittability criteria and characterizations

The result of the previous section implies that it is not easy to find a general characterization of -splittability. Nevertheless, in this section we provide several -splittability criteria for special types of collections. Furthermore we completely characterize -splittability for collections of at most three sets.

Before we begin our study, it is necessary to introduce the following notation. For a collection and an element , the multiplicity of is the number of sets such that . Given a subsequence of the sets we can form a Venn region of consisting of the elements that lie in and in no other . If consists of elements of multiplicity , we will also say that has multiplicity .

In the following result, we will say that a sequence is a target sequence for if for all . The target sequence is achievable if there is a set such that for all .

###### Lemma 3.1 (Parity Lemma).

Let be a collection and assume that for every the multiplicity is divisible by . If the target sequence is achievable, then is divisible by .

###### Proof.

Let be a set witnessing that is achievable. Then

 ∑1≤i≤nti=∑1≤i≤n|S∩Bi|=∑x∈Smx

By hypothesis, is divisible by for all , so the right-hand side is also divisible by . ∎

Since is -splittable if and only if the target sequence is achievable, the contrapositive of Lemma 3.1 provides a useful condition for showing that certain collections are not -splittable. While the converse of Lemma 3.1 is false in general, we do have the following partial converse.

###### Lemma 3.2.

Let be a collection such that for all , . If is divisible by , then is -splittable.

###### Proof.

Let be the size of the (unique) Venn region of multiplicity which is not contained in . Letting be the target sequence, we wish to find values such that and . The latter system of equations is square and invertible, so an elementary calculation gives the unique solution:

 (1) ¯bi=1n−1⎛⎝−(n−2)ti+∑j≠itj⎞⎠.

Note that is always an integer, because the above expression is equal to

 1n−1(−(n−1)ti+∑jtj)=−ti+1n−1∑jtj

and is divisible by by hypothesis. Hence it remains only to establish that .

For this, note that where . Substituting this expression in for every in Equation (1), we note that occurs times in the parentheses while all other occur times negatively and times positively. Thus, the cancel, leaving us just with and error terms as follows:

 (2) ¯bi=pbi+1n−1⎛⎝−(n−2)ϵi+∑j≠iϵj⎞⎠.

There are many terms in the parentheses, so we can conclude that where . Since and all of are integers, it follows that too. ∎

###### Remark 3.3.

It is necessary to amend the statement of the previous result if any of the are half-integers. In this case the property “ is divisible by ” should be replaced by “it is possible to select the values of in such a way that is divisible by .” Several of the results below will have similar amendments, as we will note briefly each time.

We are now ready to begin our classification of -splittability for collections of size . We begin with the simple case of just two sets, because it helps motivate some of the steps for the three set case below.

###### Theorem 3.4.

Every collection of two sets is -splittable for every .

###### Proof.

Let be a given two-set collection. Replacing with if necessary, we can suppose that . We fix the following notation for the sizes of the regions of : , , and (see Figure 2). Next let and denote the target cardinalities for and for a -splitter . To show is -splittable it suffices to find integers such that: (i) ; (ii) , and; (iii) .

For this we let and so that (ii) and (iii) are clearly satisfied. Of course the definitions of both and may be ambiguous; in such cases we need only make sure that if then we choose too.

To see that (i) is satisfied, write for the rounding error in computing and for the rounding error in computing . Then the equations easily imply that we have

 ¯ai=pai+(ϵi−ε).

Since and we know that . Assuming the above equation gives , and since and are integers, (i) is satisfied. On the other hand if then too and (i) is clearly satisfied. ∎

To state our results for three sets, we extend the notation from the previous proof. For a three-set collection we let denote the number of multiplicity 1 elements of , let denote the number of multiplicity  elements not in , and let denote the number of multiplicity 3 elements (see Figure 2). As in the previous proof we let be the targets and be the rounding error. Finally we set the values .

###### Lemma 3.5.

Assume that , and let be given. Also assume there are no multiplicity 1 elements, that is, all . Then is not -splittable if and only if is odd and one of the conditions holds:

1. ; or

2. and some .

###### Proof.

Recall that is -splittable if and only if one can find values and such that , , and . Assuming one has chosen the value of , the equations have the unique solution:

 (3) ¯bi=12⎛⎝−ti+∑j≠itj−¯c⎞⎠.

At this point we can observe that in order to achieve integer values of , one must choose the value to have the same parity as . Next we substitute to rewrite the above equation as

 (4) ¯bi=pbi+12(pc−¯c+ρi).

Now assume that is odd and that either (a) or (b) holds. We have already shown in Lemma 3.1 that if condition (a) holds then is unsplittable. Next assume that (b) holds. Since is odd, we cannot choose to be of even parity and in particular cannot choose . Condition (b) together with Equation (4) clearly implies that any positive value of results in . Thus is once again unsplittable.

For the converse we will need to show that if either is even or both (a) and (b) are false, then is splittable. First we claim that the choice always ensures that . To see this note first that this choice ensures . Moreover we can always assume , since otherwise all and we would be able to change the rounding of the targets (even while preserving the parity of ). Thus Equation (4) implies that where , and we can therefore argue as in the proof of Lemma 3.1 to complete the claim.

Of course we cannot necessarily choose , since this may not have the same parity as . Thus we also claim that one of the two choices or results in . Indeed the two choices result in values of and that differ by and have absolute value . Meanwhile the lie in some interval of length which is contained in . It is an easy exercise to conclude that either all or all . Thus one of two choices or gives values where , and we are again done as in the previous claim.

Now assume that is even. Then if is even we have already argued leads to a solution. And if is odd then we always have (here we are using ). Thus one of the choices leads to a solution as well.

Finally assume both (a) and (b) are false. Since (a) is false and we have that . On the other hand since (b) is false we either have (i) , or else (ii) and all . In case (i) we have , which we have previously shown implies is splittable. In case (ii) we have and moreover that the choice leads to a valid solution for all . This concludes the proof. ∎

In the lemma, if any of the is a half-integer, then is splittable. Indeed, in this case we can select the set target to make even. We also record here that if case (b) of the lemma holds, then there is in fact a unique such that , and moreover we must have that , that , and that the other two .

In the next result we consider the case when a collection of three sets has elements of multiplicity .

###### Lemma 3.6.

Assume that , and let be a given collection with as in Figure 2. Then provided at least one of the is sufficiently large, is -splittable.

###### Proof.

First let be the collection obtained from by removing all elements of multiplicity . For the rest of the proof, let be as in the previous lemma, for the collection .

Suppose first that is -splittable. Then is splittable too; in fact we claim that any splittable collection remains splittable after adding elements of multiplicity . To see this, it suffices to show it when we add just one element of multiplicity  to some set . Now if adding raises the value of by , then we include in the splitter; otherwise we would exclude from the splitter.

Next suppose that is -unsplittable. Then by Equation (3) we can “split” the collection by setting and . However these choices of will be half-integers, and need not satisfy .

We claim that for all we have , and that there is at most one such that or . The first part of the claim follows directly from Equation (4), together with and .

For the second part of the claim, the only plausible contrary case is one where two of the have opposite error, say and . We now show this implies that . Indeed, Equation (4) for says and this implies . Since all lie within an interval of length , it follows that . Then Equation (4) for says . Now , , and all together imply .

Using , we obtain in particular that . On the other hand Equation (3) for says , and this implies . This is a contradiction, and completes the proof of the claim.

Now we can finish the proof as follows. Let be the collection obtained from by removing just the elements of and of multiplicity . That is, is obtained by zeroing out and . We will show that if is sufficiently large, then is splittable.

For this, we will use the notation for the target value of as it would be defined for (or equivalently for ). Thus in particular . In the next paragraph we will only have need of small values of , so that we need only consider the cases and .

Our above claim implies that at least one of the two triples or lies within the desired bounds . In the first case if is large enough that then the triple is a valid splitting. In the second case if and then the triple extends to a valide splitting by selecting the single element of . And if and then the triple extends to a valid splitting by selecting two elements from .

Thus we have shown in each case that there exists a value of that results in being splittable. By our claim from the second paragraph, any larger value of will also result in being splittable. Again using the claim from the second paragraph, this always implies is splittable. ∎

The above lemma may seem natural, since intuitively the presence of elements of multiplicity  makes it easier to find a splitter. However the analogous result is false for collections of four or more sets. Indeed an unsplittable collection of Type 0 of Appendix A may have a Venn region of multiplicity  of arbitrary size.

We claim that the argument of the previous lemma is optimal. That is, in the case when is unsplittable, will be splittable if and only at least one of the as at least as large as we needed in our proof. We omit the case-by-case justification of this fact.

Thus the results of this section provide a simple procedure to decide whether a given configuration is -splittable. First one can replace with if necessary to assume that . Next given one can obtain as in Lemma 3.6, and use Lemma 3.5 to decide whether is splittable. If it is, then is splittable, and if not, then one can use the details of the proof of Lemma 3.6 to determine whether any is large enough to make is splittable.

## 4. 12-splittability criteria and characterizations

In the previous section, we examined -splittability criteria for arbitrary . In this section we specialize to the important case . After providing another very general lemma, we use it to give a complete characterization of splittability for collections of at most four sets. Throughout this section, the term splittability will always refer to -splittability.

The following result, while quite simple, is useful for converting our understanding of collections with few elements into more general theorems.

###### Lemma 4.1 (Reduction Lemma).

Let be a given collection, and let be a collection obtained from by adding an even number of elements to any of its Venn regions. Then if is splittable, so is .

###### Proof.

If is a splitter for , then we can construct a splitter for as follows. Begin by putting all the elements of into . Then for each Venn region of and corresponding Venn region of , put half of the elements of into . It is easy to see that is a splitter for . ∎

Before stating our characterization of splittability for configurations with four sets, we review the known characterization of splittability for configurations with three or fewer sets.

###### Proposition 4.2.

Any collection of one or two sets is splittable. A collection of three sets is unsplittable if and only if both:

1. every Venn region of multiplicity  contains an odd number of elements; and

2. all other Venn regions are empty.

The proposition can easily be extracted from the results of the previous section. It is also possible to give a direct proof, as was done in [CCSS16].

###### Theorem 4.3.

Any family of four sets is unsplittable if and only if it falls into one of the eleven types described in Appendix A.

###### Proof.

First we claim that each of the types described in Appendix A is unsplittable. The collections of Type 0 are by definition those which have some three-set subcollection that is unsplittable. It is tedious but straightforward to check that all of Types 1–10 are unsplittable; as an example we provide the proof that Type 1 is unsplittable in Proposition A.1.

In order to prove that all families not matching Types 0–10 are in fact splittable, note first that we have used a supercomputer to test splittability for every collection of four sets with all Venn regions of size . The code and its output are available in [REU16].

Now suppose that is a collection of four sets which is not of any of Types 0–10. We wish to show that is splittable. Let be a collection obtained from emptying each Venn region that is even in , and leaving just element in each Venn region that is odd in . In other words, is obtained by taking each Venn region “modulo ”.

If is also not of any of the eleven types, then since its regions all have size our software has checked that is splittable. By the Reduction lemma (Lemma 4.1), is also splittable, and we are done in this case.

On the other hand, suppose that is of one of the eleven types, say type . Then since is not of type , there must exist a Venn region , labelled (empty) or or , such that the size of in