MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Simple linear algebra methods are a surprisingly powerful tool to prove combinatorial results. Some examples of combinatorial theorems with linear algebra proofs are the (weak) perfect graph theorem, the Frankl-Wilson theorem, and Fisher's inequality.

Are there other good examples?

share|cite|improve this question
@Francois- thanks for fixing the link. – Tony Huynh Mar 3 '10 at 20:50
@Tony: No problem. URL encoding gets tricky. – François G. Dorais Mar 3 '10 at 20:56
You could probably find plenty by searching MathSciNet for papers with a combinatorics MSC code in the journal "Linear Algebra and its Applications". – Douglas S. Stones Mar 3 '10 at 22:53
@Douglas - Thanks for the tip. Unfortunately, I am MathSciNetless for the next little while... – Tony Huynh Mar 4 '10 at 2:25

17 Answers 17

up vote 26 down vote accepted

Some other examples are the Erdos-Moser conjecture (see R. Proctor, Solution of two difficult problems with linear algebra, Amer. Math. Monthly 89 (1992), 721-734), a few results at, and Lovasz's famous result on the Shannon capacity of a 5-cycle and other graphs (IEEE Trans. Inform. Theory 25 (1979), 1-7). For a preliminary manuscript of Babai and Frankl on this subject, see

share|cite|improve this answer
Right, I thought immediately of the lovely manuscript by Babai and Frankl. Too bad it is not more easily available: I was lucky enough to take a combinatorics class from Babai in 1998 and thereby acquire a copy. I still have it! (Do you know why they have apparently lost interest in publishing it?) – Pete L. Clark Mar 4 '10 at 0:12
I don't know why Babai and Frankl have lost interest in publishing it, but the preliminary manuscript is still readily available from the link above. – Richard Stanley Mar 4 '10 at 0:49
I know someone tried to contact the UChicago department several times about getting that manuscript without luck, so here is a scanned copy: – Steven Sam Mar 4 '10 at 17:05
I've received a few emails about the link being dead, so here is a new one: – Steven Sam Jan 29 '12 at 5:11

The AMS has a new book out, Jiri Matousek, Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra. Info at

"This volume contains a collection of clever mathematical applications of linear algebra, mainly in combinatorics, geometry, and algorithms."

share|cite|improve this answer
Thanks Gerry. The book looks good, I'll probably pick it up. I really enjoyed Using the Borsuk-Ulam Theorem by the same author. – Tony Huynh Mar 10 '10 at 21:28

Hoffman and Singleton proved that a regular graph with girth 5 and diameter 2 has to have degree 2, 3, 7, or 57. If I recall correctly, the proof used spectral properties of the adjacency matrix to produce some non-polynomial equation for which these were the integer solutions.

There are unique examples of the first three cases: degree 2 is a pentagon, degree 3 is the Petersen graph, and degree 7 is the Hoffman-Singleton graph. The existence of the degree 57 graph is still open (as far as I know).

share|cite|improve this answer

Here is a link to a Tricki article that has some further examples.

share|cite|improve this answer
This article is very nice, for the trick and also the exposition. Thanks!. A curiosity, who is its author? Sorry, but the author isn't listed at the site. Maybe you? :-) – Anonymous Mar 4 '10 at 22:14
Actually yes ... It's possible to see who Tricki articles are by if you look at their revision history. – gowers Mar 5 '10 at 11:39

The Lindstrom-Gessel-Viennot Lemma uses the reflection principle on $S_n$ to say that the number of nonintersecting families of lattice paths in the plane equals the determinant of a matrix so that the $i,j$-th entry is the number of paths from the $i$th source to the $j$th sink.

This was not a linear algebra proof. However, this determinant can be used to enumerate plane partitions inside an $a\times b \times c~$ box, to $q$-enumerate plane partitions by weight, and to count domino tilings of an Aztec diamond. The resulting determinants can be manipulated and evaluated in ways which are natural in linear algebra, but not as clear on the objects, such as factoring the matrices. These enumerations can be viewed as applications of simple results in linear algebra.


Lattice paths are defined and the sources and sinks are restricted so that any nonintersecting family must be an even permutation from source indices to sink indices, usually the identity.

Others independently discovered this result, e.g., Karlin and McGregor.

The same idea applies to Brownian motion.

share|cite|improve this answer

It's not quite what you have asked for, but very close:

Some facts - and proofs! - in combinatorics can be interpreted as linear algebra over the "field with one element". In this very nicely written article Henry Cohn gives a concrete meaning to this and shows how to make a proof from linear algebra into a proof about a combinatorical statement by rephrasing it into axiomatic projective geometry.

(by the way: Lior's answer is an instance of linear algebra over field with one element)

share|cite|improve this answer
See also this blog post by Peter Cameron:… – Felix Goldberg Mar 23 '14 at 14:16

There is nice linear-algebra proof of the following result in discreet geometry:

Any $n$ lines in general position cut from the plane at least $n-2$ triangles.

See А. Я. Белов Об одной задаче комбинаторной геометрии (thanks to Arseny and Garry). You will find there more examples of such problems.

share|cite|improve this answer
Alexey Kanel-Belov – Arseniy Akopyan Mar 4 '10 at 3:29
Perhaps the paper in question is A problem in combinatorial geometry, Uspekhi Mat Nauk 47 (1992), no. 3 (285), 151-152, translation in Russian Math Surveys 47 (1992), no. 3, 167-168, MR 93h:52016. Maybe it's also in A Kanel'-Belov and A Kovaldzhi, Taking on triangles: in search of answers between the lines, Quantum 11 (2001), no. 4, 10-16. – Gerry Myerson Mar 4 '10 at 4:02

The proof that every $n\times n$ semi-magic square can be written as an integer linear combination of $n^2-2n+2$ permutation matrices.

share|cite|improve this answer

Here is an example I learned about this month: The edges of the complete graph cannot be partitioned into fewer than $n-1$ complete bipartite graphs. Apparently the only known proofs involve linear algebra.

share|cite|improve this answer
I should add that Richard Brualdi, from whom I learned this, will be writing a book over the course of the next year largely on the connections between linear algebra and graph theory. – Tracy Hall Jul 27 '10 at 13:27
Recently Sundar Vishwanathan gave a combinatorial proof: – Konrad Swanepoel Sep 7 '10 at 13:57
Nice proof in ! (Typo: $\sum_{i=1}^n$ should be $\sum_{i=1}^{n-2}$ in the last formula of the proof; also, $k > n^n$ can just as well be replaced by $k > n^{n-1}$.) Can something similar be done with this problem: ? – darij grinberg Mar 27 '12 at 23:05

The polynomial method in combinatorial incidence geometry relies crucially on linear algebra to locate a non-trivial polynomial of controlled degree that vanishes at a specified set of points. A good example of the method in action is Dvir's proof of the finite field Kakeya conjecture, see e.g. .

share|cite|improve this answer
This is also in Matousek's book mentioned by Gerry Myerson. – Richard Stanley Mar 28 '12 at 0:26

These references may be more shallow than you desired, but they are both fun and lucid.

1) Noga Alon's Tools From Higher Algebra contains many things (or at least references to those things) that only require linear algebra at heart, such as Rayleigh's Principle.

2) A Course in Combinatorics by van Lint and Wilson is laced with gems in self-contained sections, such that each page is an adventure. You'll find Lots of techniques here that only require linear algebra, including the awkward-looking "interlacing property" of eigenvalues that have popped up way too much for me to ignore by now.

My favorite is actually the aforementioned Babai/Frankl manuscript, which is still very readable and useful. In theory you can still get it; in practice more difficult. First time I tried to order it I didn't get a reply at all.


share|cite|improve this answer
Thanks. The book by van Lint and Wilson is indeed one of my favorites. You're quite right that it's hard to ignore (no matter how hard I try) interlacing eigenvalues. – Tony Huynh Mar 10 '10 at 16:17

This is a crosspost from Why linear algebra is fun!(or ?), suggested by Kevin O'Bryant. I think it's relevant here. Everything below is verbatim from the earlier post.

My favorite application of linear algebra, as introduced to me by Fan Chung, is Oddtown (which I learned about from a manuscript of Lovasz, but may not be due to him).

The $n$ residents of Oddtown love to form clubs; call the family of these $\mathcal{F}$. If $F_1$ and $F_2$ are in $\mathcal{F}$, then $|F_1|$ must be odd (this is Oddtown!) and $|F_1 \cap F_2|$ must be even unless $F_1 = F_2$ ($\scriptsize{go\;Oddtown?}$). The question is, how many clubs may these $n$ people form?

The answer (taken from Tibor Szabó's lecture notes) is this:

Let $\mathcal{F} = \{F_1,\ldots,F_m\} \subseteq 2^{[n]}$ be a set of clubs in Oddtown. Let $\mathbf{v}_i \in \{0,1\}^n$ be the characteristic vector of $F_i$; the $j$th coordinate is 1 iff $j \in F_i$.

Note that $\mathbf{v}_i^T \mathbf{v}_j = |F_i \cap F_j|$.

Now, $\mathbf{v}_1,\ldots,\mathbf{v}_m$ is independent over $\mathbb{F}^n_2$: if $\lambda_1\mathbf{v}_1 + \cdots + \lambda_m\mathbf{v}_m = 0$, then for each $i$ we have $$0 \;=\; (\lambda_1\mathbf{v}_1 + \cdots + \lambda_m\mathbf{v}_m)^T\mathbf{v}_i \;=\; \lambda_1\mathbf{v}_1^T\mathbf{v}_i + \cdots + \lambda_i\mathbf{v}_i^T\mathbf{v}_i + \ldots + \lambda_m\mathbf{v}_m^T\mathbf{v}_i \;=\; \lambda_i $$

Since $\mathbf{v}_1,\ldots,\mathbf{v}_m$ are linearly independent vectors over $\mathbb{F}^n_2$, $m \leq n$, and Oddtown can have at most $n$ clubs.

share|cite|improve this answer

The following is a good illustration:

Let $P$ be a finite set ("points"), and let $L\subset 2^P$ ("lines") be such that distinct lines intersect in at most one point and any two distinct points are contained in a line. Let $V$ be the real vector space with basis $P$, $W$ the vector space with basis $L$. There are natural linear maps $T\colon V\to W$ and $S\colon W\to V$ mapping every point to the sum of the lines containing it, and every line to the sum of the points in it. Then $ST = J+D-I$ where $J$ is the all-ones matrix (through every two distinct points there is a unique line), $I$ the identity matrix and $D$ is diagonal with entries counting the lines through each point.

Assume that not all points are collinear. Then all the diagonal entries of $D-I$ are at least one; it is then easy to verify that the determinant of $ST$ is positive, and conclude that $|L| \geq |P|$.

share|cite|improve this answer
This is the same result as the Fisher's inequality. – Anurag Jan 12 '15 at 13:32

Linear algebra is also useful for proving lower bounds in extremal "bootstrap percolation" type problems. For example, Alon and Kalai used linear algebra (actually, exterior algebra) to (independently) answer the following question, first considered by Bollobás:

What is the minimum number of edges in a graph $G$ on $n$ vertices such that the non-edges of $G$ can be added, one edge at a time, so that every edge completes a $k$-clique when it is added?

Some more recent applications of linear algebra in bootstrap percolation can be found in a paper of Balogh, Bollobás, Morris and Riordan. Specifically, they use linear algebra to prove Lemma 3, which is the main tool of the paper.

I can personally tell you that this lemma can be quite useful. It is used in two (joint) papers of mine: see here and here. In particular, in the second paper, we use this linear algebraic lemma to prove a conjecture of Balogh and Bollobás on $r$-neighbour bootstrap percolation in the hypercube.

share|cite|improve this answer

Variants of the EKR Theorem offer a wide class of examples. This page has a nice list going, by the way.

A friend of mine once made the outrageous claim -- but hear me out -- that most "linear algebra proofs" in combinatorics are not truly using linear algebra. I think he was getting at such arguments' use of a preferential basis (think positive or $\{0,1\}$-matrices) when linear algebra should, in its purest sense, be basis-independent. In the standard proof of Fisher's inequality, you set up and compute a determinant, get that some matrix has full rank, and then conclude the inequality. But there are no linear transformations (debateable). He conceded that, for instance, Perron-Frobenius belongs inside "matrix analysis", but not "linear algebra"!

I argued a little, but then eventually kind of saw his point. I guess I now really appreciate the obvious (but fortunate) fact that inner products count something!

share|cite|improve this answer

Here are some examples where the dimension of a vector space of polynomials is used to solve a combinatorial problem.

Theorem 1 There are at most $n(n+1)/2$ equiangular lines in $\mathbb{R}^n$.

Proof. [Koornwinder] Let $L_1, \dots, L_m$ be $m$ lines passing through origin in $\mathbb{R}^n$ with angle $arccos(\alpha)$ between every pair of them. Pick unit vectors $u_1, \dots, u_m$ on each line. Then we have $\langle u_i, u_j \rangle ^2 = \alpha^2 \delta_{i, j}$. Define polynomials $P_1, \dots, P_m$ with $P_i(x) = \langle u_i, x \rangle^2 - \alpha^2 \langle x, x \rangle$. Then we have $P_i(u_j) = (1-\alpha^2)\delta_{i, j}$, and therefore, these $m$ polynomials are linearly independent. The space of $n$-variable homogenous polynomials with degree at most $2$ has dimension ${n + 1\choose 2}$, and therefore $m \leq n(n+1)/2$.

Theorem 2 [Larman, Rogers, Seidel] A two-distance set in $\mathbb R^n$ has cardinality at most $(n+4)(n+1)/2$.

Proof. Let $u_1, \dots, u_m$ be $m$ points in $R^n$ and $a$, $b$ be the two non-zero real number such that $\|u_i - u_j\| \in \{a, b\}$. Define $P_i(x) = (\|u_i - x\|^2 - a^2)(\|u_i - x\|^2 - b^2)$. Then, $P_i(u_j) = a^2b^2\delta_{i, j}$. Therefore, the polynomials $P_i$'s are linearly independent. Moreover, these polynomials lie in the vector space spanned by polynomials of the type $$\left(\sum_{i = 1}^nx_i^2\right)^2, \left(\sum_{i = 1}^n x_i^2\right)x_j, x_ix_j, x_i, 1.$$ The number of such polynomials is $1 + n + n(n+1)/2 + n + 1 = (n+4)(n+1)/2$, which gives us the bound.

For more such examples see "Linear Algebra Methods in Combinatorics" by Babai and Frankl, linked in Stanley's answer.

share|cite|improve this answer
Similar techniques are used in this paper by Babai, Snevily and Wilson to prove several results on codes and sets: – Anurag Nov 25 '15 at 17:33

There is also a book in Russian, Линейно-алгебраический метод в комбинаторике by Raygorodsky, that deals with this.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.