Showing posts with label commutative. Show all posts
Showing posts with label commutative. Show all posts

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.

Saturday, February 28, 2009

A Number Divided By Another Number

One more instance of Math not being English

Lately I had a few students who had some trouble with fractions. Part of the problem was a very specific type of confusion at the time of setting up a division calculation. When asked “How much is 5 divided by 12?” for example, they would sometimes correctly calculate the result but most other times they would set up the division as 12 divided by 5. One of them asked me a few times if the result would be the same. When I tried to explain that division is not commutative, using some visual representations of fractions, he was not totally convinced. So I just pulled the calculator, I asked him to give me a couple numbers, and I did both divisions (let’s say, 17/4 and 4/17) with the calculator, showing him the results. We repeated the “experiment” with two other examples, and then he was convinced that division is not commutative. However, such discovery created some anxiety in him because he doubted he would choose the right order of calculation in any given problem. Actually, it took multiple repetitions on my part for him to finally learn how to set up the right calculation when a word problem involves the phrase “divided by.” At first he wanted to transliterate the written phrase (“105 divided by 15” for example) word by word, and number by number, in the exact same order into the division calculation by writing, from left to right, the 105 first, outside the division symbol, then the division symbol (the one that looks like a rotated “L”), and finally the 15, inside the division symbol. I would tell him that the order of the numbers in the phrase “105 divided by 15” is backwards to the order of the same numbers in the actual calculation but this only seemed to surprise him, and confuse him. Once more, I resorted to the calculator. I said: “O.K. just do the division.” When he asked: “In what order?” I said: “Do them both.” Once he had calculated both results by long-hand, I gave him the calculator, and I said, “Now do them both with the calculator.” As he punched the calculator keys, I directed his attention to what sequence in the calculator was giving him the same result as he had calculated long-hand. I said “Do you see when you enter into the calculator: ‘105, division symbol, 15, enter’ that gives you the same result as when you did ’15, division symbol, 105’ by long-hand?” When he saw this evidence he still said “It is confusing.” Then I said: “Yes, I know, but that is just the way it is, so you are going to have to remember it that way. In the calculator division the numbers go in the same order as they are in the phrase ‘105 divided by 15,’ whereas in the long-hand division, to get the same result, the numbers have to go backwards.” It took some repetition over a few tutoring sessions but he finally got it consistently right.