Sunday, February 01, 2015

A very cool property of binomial coefficients

Last night I was reading a post in this other blog, by Ben Vitale. His post is about some special types of binomial coefficients.

In case you don’t remember, given two non-negative integers m and r, their binomial coefficient  C(m,r) (also known as “m chose r”) counts the number of subsets of size r out of a set of size m, and it is calculated by the formula:

C(m,r) = m!/(r!•(m-r)!)

In particular, when r=2, we get

C(m,2) = m!/(2!•(m-2)!) = m(m-1)/2

This is an expression for counting the number of all possible unordered pairs formed by two elements of a set of size m.
Somewhere near the end of his post, Ben presents the following formula:

C(kn,2) = k•C(n,2) + (1/2)•(k-1)k•n2

On seeing this formula, I noticed the second term on the right-hand side,

(1/2)•(k-1)k•n2

can be rewritten using the binomial coefficient C(k,2), producing the expression

C(kn,2) = k•C(n,2) + C(k,2)•n2

This formula holds true for any two positive integers n and k, each greater than 1.
In particular, by using the trick of swapping n with k in that expression, we get the following one:

C(nk,2) = n•C(k,2) + C(n,2)•k2

Now, multiplication being commutative, we know kn = nk.

Therefore, C(kn,2) = C(nk,2)

And we can connect their two equivalent expressions, making this formula:

 k•C(n,2) + (n2)•C(k,2) = (k2)•C(n,2) + n•C(k,2)

I don’t know about you but I believe this is just amazing!
Let’s illustrate this property with a couple examples:

a) First, we choose two numbers, let’s say n=5 and k=7

b) Then we calculate their squares: 52 = 25, and 72 = 49

c) Now we calculate their binomial coefficients for 2:

C(5,2) = 5•4/2 = 20/2 = 10
C(7,2) = 7•6/2 = 42/2 = 21

d) Now we plug the numbers into the formula, and verify it:

7•C(5,2) + 25•C(7,2) = 49•C(5,2) + 5•C(7,2)

(7)(10) + (25)(21) = (49)(10) + (5)(21)

70 + 525 = 490 + 105

595 = 595

Let’s check some other numbers, for example n=8 and k=14

Their squares are 82 = 64, and 142 = 196

Their binomial coefficients with 2 are:

C(8,2) = 8•7/2 = 28
C(14,2) = 14•13/2 = 91

and we verify:

14•C(8,2) + 64•C(14,2) = 196•C(8,2) + 8•C(14,2)

(14)(28) + (64)(91) = (196)(28) + (8)(91)

392 + 5824 = 5488 + 728

6216 = 6216

The reason I like this property so much is because both expressions

k•C(n,2) + (n2)•C(k,2)

and

(k2)•C(n,2) + n•C(k,2)

are linear combinations of the same two binomial coefficients. These linear combinations have different coefficients:

k and n2 in one case, and k2 and n, in the other.

In principle, right off the bat, I would not expect them to turn out equal but they are, every single time! What is more, the only change in the coefficients is that you move the square (the exponent 2) from k to n, and viceversa.
I find all this to be pretty cool. I wanted to share it with you, and many thanks to Ben Vitale for his blog post.

No comments: