Today, I will be talking about a classic puzzle that uses linear algebra to attack a combinatorics problem. I first learned of this puzzle during our research group seminar here at UNM, where Jared presented this problem to us as an exercise. Later on, I read through a couple of formalizations for the same, and will now be presenting my take on the problem taking helpful references from [MIT307], [UC726] and [UC07]. My interest in this problem originates from the fact that upon first hearing the problem statement, it doesn’t strike to be something that can be made easier using linear algebra, however, the approach baffles my mind every time I think about it. Let’s dive in.
The problem, which is referred to as Elwyn Berlekamp Theorem in [UC726], is as follows: In Oddtown, there are citizens and clubs satisfying the rules that each club has an odd number of members and each pair of clubs shares an even number of members. We then need to show that , i.e. the number of clubs cannot be more than the number of citizens.
Before proceeding to the proof, I must point out that this problem has a close connection to Fisher’s inequality [MIT307], which is similar to a slight modification of the original problem. Apart from this, it is related to the study of designs, set systems with special intersection patterns. [MIT307] shows how such a system can be used to construct a graph on vertices, which does not have any clique or independent set of size . I will briefly talk about these results towards the end of this post.
Let us now focus on proving that the number of clubs in Oddtown cannot exceed the number of citizens. Formally, let be the set of clubs in Oddtown and be the set of citizens (people). We start by paying attention to the fact the no two clubs are allowed to share an odd number of members. The entire problem is full of even-odd type of constraints, which suggests that we should attack this problem using some form of parity checking. The easiest such setting is to work in the field with characteristic 2. In other words, we will perform all addition and multiplication operations modulo 2 from now on.
Within this setting, for each club , define its membership vector , where if citizen is a member of club , and 0 otherwise. Intuitively, this is similar to each club maintaining a ledger in which all the citizen names are listed and only those names are marked that correspond to member citizens for that club. These ledgers must satisfy the property that for any pair of clubs, if we compare their ledgers, the number of common members must be even (which allows no common members as well). Mathematically, we can represent this constraint using dot product of the membership vectors of the clubs.
Notice that if the number of citizens common to any given pair of clubs is even, then in our field, the dot product of the membership vectors of these clubs will be zero. Hence, in the magical world of modulo 2, all clubs have membership vectors that are orthogonal to each other. More importantly, note that none of these vectors is identically zero since the number of members in each club must be odd. Hence, the puzzle now reduces to asking the maximum number of pairwise independent vectors that exist in . This is where our friend, linear algebra, kicks in.
Form a matrix whose columns are the membership vectors of the clubs. Note that since all columns are pairwise independent and none of them are identically zero, the rank of this matrix is exactly . However, we know that the rank of any matrix must never exceed the number of rows or the number of columns. Voila! We’re done. The number of rows in this matrix is , which immediately proves that . Try holding your right ear using your left hand while swirling your arm around the back of your head. I felt exactly like that my first time with this puzzle!
Another way to see this without forming the matrix is by noticing that the number of pairwise independent vectors in cannot be more than the dimension of , which is . Hence, the same result as above. No matter how you prove it, we always obtain the condition we wanted to prove. See! that’s why we must befriend linear algebra.
A small technicality. Can we have exactly clubs, if not more? The answer is, trivially, yes. Since the number of common members to any pair of clubs must be even, set it to zero! Have a dedicated club for every man and you’re done. If you call this cheating, think about this. How cool will be it to have your own clubhouse?!
Given this construction above, we can prove some more exciting results about the fate of people in Oddtown. Specifically, we can prove that for every , we can always save the Mayor’s money by building no more than two clubs that satisfy all the constraints. Furthermore, we can prove that this system is maximal, in the sense that no more clubs can be added without violating at least one of the conditions. Let’s see how.
So the task at hand is to divide the citizens into 2 clubs, say and , such that (1) the number of citizens common to both the clubs is even, (2) the number of citizens in each club is odd and 3) adding even one more club will violate (1) and (2). If is even, then one way to divide the citizens is to allocate one citizen to the first club and the remaining citizens to the second club. This satisfies (1) and (2). To see if this satisfies (3), add another club, say to the town. Since this club must have even number of common members with the other two clubs, the number of common members between and must be zero. This requires all the members in to also belong to , which immediately gives a contradiction since (2) will require this number of common members to be even while (1) requires them to be odd. Hence, this distribution of citizens into two clubs is maximal.
What happens when is odd? Trivially, put all the members into one club and the problem is solved. The second club is not needed at all. The addition of any more clubs will not be possible because of the same argument as above. Hence, one club is maximal in this case. Thus, in both the cases, no more than two clubs are required for a maximal membership of citizens.
We now discuss a result that is closely related to a slight modification of the rules in Oddtown. We remove the restriction on the size of the clubs and require that every two clubs share a fixed number of members. We assume that if two clubs have exactly the same members, then they are the same. Fisher’s inequality then states that the number of non-empty clubs is at most , similar to the result above. The proof of this inequality is slightly involved, although the basic principle is the same. We consider the membership vectors of the clubs and prove them to be linearly independent in some field, which in this case will be the field of real numbers .
To see how this proof works, an important observation needs to be made : There is at most one club with exactly members. Wondering why? Well, let’s assume otherwise and try to get a contradiction. Let there be at least two clubs with exactly members. Then each of these must have the same members by the condition of the problem. This contradicts the fact that these clubs are distinct (because of our assumption) and hence, we have proved that at most one club can have exactly members.
Now, with this critical observation in hand, we proceed with the proof as follows. Let be the clubs of size , respectively (assuming each of these is non zero). The size here refers to the number of members in the clubs. Represent by the set of common members in clubs and . Then, according to the given problem, for each pair with . We define the membership vectors of each club similar to the proof above as , where if citizen belongs to club and 0 otherwise. Clearly, in , we have the dot product of any and to be , if . All we have to do now is to prove that these membership vectors are linearly independent in .
To see this, assume they are not. Then, using standard practice in such proofs, assume there exist real numbers such that , where is the zero vector in . Then, we must also have , where denotes the 2-norm of the vector . Hence, we have , since the 2-norm can be written as the dot product of the vector with itself. We can rewrite this sum as . Using our critical observation now, each of the two terms on the right of this equation are non-negative, which implies that they are both identically zero.
Hence, we have (1) , which implies , and (2) . From (2), since at most one club, say can have exactly members, each whenever . However, then, from (1), , which contradicts the fact that the membership vectors are linearly dependent. Hence, Fisher’s inequality holds.
Fisher’s inequality has a number of cool applications. Two interesting examples are presented in [MIT307], where they prove the following : (1) For a fixed , let be a graph whose vertices are triples and is an edge if . Then does not contain any clique or independent set of size more than . (2) Suppose is a set of points in the plane, not all on one line. Then pairs of points from define at least distinct lines.
I hope you liked this post of mine. My next post will likely be on another interesting puzzle, maybe from one of the CACM journals. Until then, stay tuned. Ciao!