In this post we’ll look in some detail a very common and important technique in combinatorics, **double counting**. Let’s start with an easy example involving binomial coefficient

Example 1Prove that .

There is an obvious way to prove this by algebraic manipulations using the fact that . But we are more intersted in a general idea which not only proves this particular identity but also shows us how to come up with such identities. So, here’s one such proof:

Consider a community of people from which you have to select a committee of members with a designated leader. In how many ways can this be done? One way to do this is to choose the members first in ways and then choose a leader from them in ways. This gives a total of ways. Other way of doing this would be to first choose the leader, in ways and then from the remaining people choose to complete the committe. This gives a total of ways. Thus, we can see that .

This illustrates the typical “procedure” of double counting in proving identities. You look for an object which when counted in one way gives the left hand side and when counted in another way gives the right hand side. I would like to write it as this:

*Let , be finite sets and a subset of . Whenever we say is incident to . If denotes the number of elements that are incident to and denotes the number of elements that are incident to , then .*

Here’s a famous example from graph theory.

Example 2Let be a finite simple graph with vertex set and edge set . The degree of a vertex , denoted as , is the number of edges incident to . Then we have

For the proof consider , where is the set of pairs such that is an end-vertex of . Counting in two ways gives us on one hand , since every vertex contributes to the count, and on the other hand , since every edge has two ends.

Next let’s consider an interesting identity in number theory:

Example 3For any natural number , we have , where is the divisor function and is the floor function.

To prove this, let and .

This identity can be used to prove a surprising result that even though is a wildly jumping function its average is quite well behaved. In fact,

Proof of this follows easily from the identity and the properties of harmonic numbers.

In example 1, we had a nice combinatorial view of the number , namely, it is the number of ways to choose elements from a set of elements. But it might not be that easy in identities involving some other numbers. For example, consider this:

Example 4Let denote the Fibonacci number. Then

To give a double counting proof of this identity we need a combinatorial view of the Fibonacci numbers. That can be done as follows:

Let denote the number of ways in which you can tile a rectangular board with squares and domnioes. Clearly as you can put only a square and as you can put two squares or a single domino. Thinking recursively we see that a tiling of rectangular board will either begin with a square or a domino giving us for all .

So, it is not difficult to see that for all (letting ). Now, we would prove an equivalent identity involving ,

The right hand side is the number of ways to tile rectangular board by squares and dominoes minus one particular tiling.

Let’s try this: is the number of tilings with at least one domino.

Can we count it in some other way?

Think about what is the position of the last domino in a tiling. Since after we have put the last domino, it’s all squares! With the last domino at we have tilings where ranges from to . Hence, we get a total of tilings with at least one domino.

I’ll list some more examples that one can try using these ideas:

Example 5

Prove that .

Example 6Let be a set of persons such that:

- Any person is acquainted with exactly other persons in .
- Any two persons that are acquainted have exactly common acquaintances in .
- Any two persons that are not acquainted have exactly common acquaintances in .
Then show that, .

In graph theoretic terms this will be stated as, “Given a -regular graph with the property that any two adjacent vertices have exactly common neighbors and any two non adjacent vertices have exactly common neighbors, show that .”

Such graphs are known as strongly regular graphs.

Example 7Show that for all ,

Hint: How many tilings have exactly dominoes?

Example 8Theorem 3 on this post.

** Further reading and references **

Nice

Example 5: I have n red balls and I have to select a non-empty set of balls and color one of them blue. I can either choose r red balls and then choose one out of those r to color blue (LHS). Or I can first choose the ball to color blue (out of n) and then choose a possibly empty set out of the other n-1 (none of which I color).

Example 7: I want a list of numbers consisting of only 1s and 2s which sum to n. The first element can be 1 or 2 and then we recurse (RHS). Or I can have a list of n 1s (n C 0) or a list of (n-1) 1s, one of which I choose to swap with 2 ((n – 1) C 1) or a list of (n-2) 1s, two of which I choose to swap with 2 ((n – 2) C 2) and so on … (LHS).

Example 5: Saying that you have “n red balls” generally gives the impression that those are identical. You can also look at this way: “From a group of n people select a team and pick a team leader”. Since there is always a leader, the team size will be at least one.

Example 7: That’s a really nice way of looking at it! 🙂

Another way to solve 7:

Start from the left hand side. Try to get combinatorial view of the number C(n-i,i). It is the number of ways to choose i numbers from {1,2,3,…,n-1} such that no two of them are consecutive. You can prove it by noticing it’s similarity with the number C(n+r-1,r-1), i.e., the number of non-negative integer solutions to x_1 + x_2 + … x_r = n.

Therefore, the left hand side counts the number of ways to choose a subset of {1,2,…,n-1} avoiding any consecutive numbers. Let us denote this number by f(n). Then f(2) = 2, f(3) = 3. Thinking recursively you can get that f(n) = f(n-1) + f(n-2) (*) for all n>3. Hence, f(n) = F(n+1).

[(*) count separetly the subsets which contain 1 and those which don’t]

Yeah, in 5 I basically wanted to say I’ll select r items and then one out of those r items again. Couldn’t phrase it well.

Example 6: So I ask everyone I know to get one rupee from people they know and I don’t. This is (LHS =) = the number of people I know \times (number of people they know who aren’t me and aren’t people I know) = k * (k – \lam – 1).

(RHS) Also, everyone in the room except (the people I know and me ) = (n – k – 1) will have to pay 1 rupee to exactly \mu people.

Correct. I think that is how I’ll explain it to kids in that pre RMO workshop. Thanks!

Another way to put it, fix a vertex in G and count the number of vertices at distance exactly 2 from it.

I initially tried that approach, but then ran into this:

There are k ({n1, n2 .. nk}) nodes one hop away from me. Each of those k nodes have have (k – (\lam \ + 1)) nodes one hop away from them which are one+ hop away from me. But two nodes, ni and nj might have some common nodes one hop away which are one+ hop away from me. k * (k – \lam – 1) counts these more than once.

Yes, my bad. And obviously it should over count since we know that anything that is not your neighbor is at distance 2 from you in such graphs. So that gives (n-k-1) people at distance 2 from you.

What we are counting here is this: fix a vertex u, count the number of ordered pairs (x,y) such that u-x-y is a length 2 path and u,y are not adjacent. Put in another way, count the number of paths of length 2 starting from u.

Pingback: Conteo doble | ¿Quieres problemas?

Combinatorics appears frequently in statistical mechanics in physics. Thanks for this!