In a group of k people, some are acquainted with each other and some are not. There are two rooms for dinner. Every person chooses to stay in that room, in which he has an even number of acquaintances. Prove that the number of different ways that people can be divided in these rooms is always a power of 2.

I've tried to switch it in a graph problem, considering every person as a point and connecting each two points with an edge if they are acquainted. Then we know that the number of odd- degree points is even. But I don't know how to proceed. Any help would be appreciated. Thanks in advance.


This is an answer for a question from this comment.

Do you perhaps know any other combinatorial problem which could be solved with an abstract or linear algebra?

I know several applications of an abstract or linear algebra in combinatorics.

1) David Ellis, “Algebraic Methods in Combinatorics”. The paper starts as follows:

In the last fifty years, algebraic methods have been used with striking success in combinatorics. This course looks at some of the most important of these methods, and some of the most beautiful results obtained using them. We will also explore connections with combinatorial geometry, probability theory and theoretical computer science.

2) I guess a book “Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra” by Jiřì Matoušek also contains related miniatures.

3) There is a paper “Combinatorial Nullstellensatz” by Noga Alon. Its abstract says:

We present a general algebraic technique and discuss some of its numerous applications in Combinatorial Number Theory, in Graph Theory and in Combinatorics. These applications include results in additive number theory and in the study of graph coloring problems. Many of these are known results, to which we present united proofs, and some results are new.

Googing for this paper, I also found a few related papers:

– Evan Chen, “Combinatorial Nullstellensatz”.

– Andrew Drucker, “Notes on the Combinatorial Nullstellensatz”.

– Brad R. Jones, “Combinatorial Nullstellensatz”.

– Zoltán Lóránt Nagy, “Applications of the Combinatorial Nullstellensatz”, Ph.D. thesis.

– Pete L. Clark, “The Combinatorial Nullstellensätze Revisited”.

4) Abstract and linear algebra are used for construction of Steiner systems and more general block designs.

5) Now concerning the papers of people working in this direction, which I know personally (because they are from Ukraine). There is a (small?) book “Methods of Linear Algebra in Combinatorics” by I. V. Protasov and O. M. Khromulyak. Unfortunately, it is in Ukraininan and I don’t have it. I have only an unnamed (and, probably, overlapping with it) Protasov’s book of sketches in combinatorics, contaning a 17-pages section “Linear Algebra in Combinatorics” with problems and theorems. In patrticular, it contains Fisher-Bose(?) theorem, Chaudhuri(?)–Wilson theorems, Kahn and Kalai solution of Borsuk’s problem (based on a theorem by Frankl and Wilson), and Bollobás’(?) theorem. Unfortunately, the book is also in Ukrainian and I don’t have a permission to share it (it was sent by Ihor Protasov to Taras Banakh, who sent it to me). Since the first link for further reading at this Wikipedia page is broken, I say that Oleg Pikhurko’s course notes “Algebraic Methods in Combinatorics” are here.

6) At last, recently I proved an algebraic lemma (see here, it order to show that some integer linear programming problem has an optimal solution with a relatively simply form. This result was used in order to provide an algorithm to solve a combinatorial optimization problem (see a paper “Computing Optimal Tangles Faster” by Oksana Firman, Philipp Kindermann, Alexander Wolff, Johannes Zink and me). The problem input data complexity is estimated by natural numbers $n$ and $l$, and in the considered case $l$ is extremely large. The proposed algorithm is so complicated that it is still unpublished, but I expect its computation complexity to be about $\exp(O(n^7\log n)\log l)$. One can say that this is a very slow algorithm, but I stated with an algorithm of complexity like $\exp(\exp(\exp O(n\log n)))\log l$.


Let $G$ be the graph with vertices $v_1,\ldots,v_k$, representing the people and with edges whenever two people are acquainted. Let $F$ be the field with 2 elements.

Let $V$ be the $k$-dimensional vectorspace over $F$. We consider the elements of $V$ to represent the possible subsets of people, i.e. $(x_1,\ldots,x_n)$ represents the subset $A$ where $v_i\in A$ if and only if $x_i=1$.

Let $W$ be another $k$-dimensional vectorspace over $F$. Its elements are going to be interpreted as the parities of the degrees of the vertices in their own room (i.e. partition).

Example: for $k=3$ the element $(0,1,0)$ of $W$ is interpreted as: $v_1$ and $v_3$ have an even number of acquaintances in the same room, $v_2$ has an odd number of acquaintances in the same room.

Note that it is not at all guaranteed that every element of $W$ corresponds to an existing configuration.

For each $i=1,\ldots,k$, we define a mapping $s_i:W\to W$ as follows: $s_i(a_1,\ldots,a_k)=(b_1,\ldots,b_k)$ where

  • $b_j=1-a_j$ if $v_i$ and $v_j$ are neighbours,
  • $b_i=1-a_i$ if the degree (total number of acquaintances) of $v_i$ is odd,
  • $b_i=a_i$ if the degree of $v_i$ is even, and
  • $b_j=a_j$ otherwise.

This mapping corresponds exactly to the parity changes that occur when you move $v_i$ to the other room (verify!).

Composition of the $s_i$ is commutative (verify!), so it is easy to see that the collection of all $F$-linear combinations of the $s_i$ is a vector space over $F$, where composition has the role of vector space addition (verify!). Call this vector space $T$.

Define the mapping $g:V\to T$ by assigning to $(x_1,\ldots,x_k)$ the composition of those $s_i$ for which $x_i$ is nonzero.

Example: for $k=3$ the element $(0,1,1)$ would map to $s_2\circ s_3$.

Then $g$ is linear (verify!) and its kernel represents subsets of $\{v_1,\ldots,v_k\}$ that cause no parity changes when they are all moved to the other room simultaneously.

Since the kernel of a linear map is a vector space itself, its cardinality is a power of 2, say $2^n$.

Now we have shown that for every possible(!) parity distribution, there are exactly $2^n$ configurations realizing this distribution.

This reduces the problem to showing that there is at least one configuration where all parities are 0 and this problem is solved here (thanks Alex).