Summing nCr


By William Johnson (P2617) on Tuesday, August 15, 2000 - 04:20 am :

It seems that 2n = The summation between 0 and n of nCr.

Why, and can this be extrapolated to anything else?


By The Editor :

This is equivalent to saying that the (n+1)th row of Pascal's triangle adds up to 2n .


By Brad Rodgers (P1930) on Tuesday, August 15, 2000 - 11:15 pm :

Sorry to have to ask, but what does the question mean (summation between 0 and n of nCr)?

Thanks,

Brad


By Sean Hartnoll (Sah40) on Tuesday, August 15, 2000 - 11:38 pm :

Brad -

summation between 0 and n of nCr
= nC0 + nC1 + nC2 + ... + nC(n-1)+ nCn

Where in each term nCr is the number of ways of choosing r elements from a set of n, and is given by

nCr = (n!)/((n-r)! r!)

Where n! is the factorial function:

n! = n (n-1) (n-2) ... 1.

Hope this helps, (perhaps you can work out why nCr is the number of ways of choosing r elements)

Sean


By Dan Goodman (Dfmg2) on Tuesday, August 15, 2000 - 01:51 pm :
I think the best way to think of this is in terms of power sets and subsets. If N={1,2,3,,n}, how many subsets of N are there? One way of answering this is to say, how many subsets of size k are there, and it's the number of ways of picking k elements from n, i.e. nCk. So the total number of subsets is the sum from k=0 to n of nCk.

There is another way of answering the question though, which is to use indicator functions. If U is a subset of N, the indicator function IU :N{0,1}(x) (where x is in N) takes the value 1 if x is in U or 0 if x isn't in U. Clearly, each subset has a unique indicator function IU and each indicator function has a unique subset U, so there are the same number of indicator functions and subsets. Now we just have to count the number of indicator functions there are. The domain of the indicator functions is 1, 2, 3, ..., n and it can be either 1 or 0 each time, so there are 2×2×2××2= 2n different indicator functions. Therefore the number of subsets of N is 2n = sum from r=0 to n of nCr. Tada!

I don't remember any similar results, although I'm pretty sure there are some.



By Arvan Pritchard (T708) on Tuesday, August 15, 2000 - 02:05 pm :

Another way to look at it is to use the expansion of (x+y)n - the coefficient of xk yn-k is n Ck [because you have to pick the x from k of the factors] then set x=y=1.


By Michael Doré (P904) on Tuesday, August 15, 2000 - 03:27 pm :

Alternatively we can do it by induction. We use the result:

C(n,r) = C(n-1,r) + C(n-1,r-1)

where C(n,r) = n choose r. (This result is why Pascal's triangle works.)

Now suppose the result holds for n = k:

C(k,0) + C(k,1) + ... + C(k,k) = 2^k

Multiply by 2:

2C(k,0) + 2C(k,1) + ... + 2C(k,k) = 2^(k+1)

C(k,0) + (C(k,0)+C(k,1)) + (C(k,1)+C(k,2)) + ... (C(k,k-1)+C(k,k)) + C(k,k) = 2^(k+1)

So:

C(k,0) + C(k+1,1) + C(k+1,2) + C(k+1,3) + ... + C(k+1,k) + C(k,k) = 2^(k+1)

But C(k,0) = C(k+1,0) = C(k,k) = C(k+1,k+1) = 1 so:

C(k+1,0) + C(k+1,1) + C(k+1,2) + ... + C(k+1,k+1) = 2^(k+1)

So if the proposition holds for n = k it also holds for n = k+1. And it obviously holds for n = 1 so that completes the induction.

But I do prefer Dan or Arvan's way of doing it (which are really totally analogous to each other) as it gives you some idea of why it works too.

Yours,

Michael


By Neil Morrison (P1462) on Tuesday, August 15, 2000 - 06:37 pm :

I think there is some other relation between the sums of nCx where x is an integer:

Don't quote me on this, but I seem to remember that the sum of all the odd 'x's = the sum of all even 'x', or something similar.


By Michael Doré (P904) on Wednesday, August 16, 2000 - 12:17 am :

Neil,

Well

(1-x)n = C(n,0) - C(n,1)x + C(n,2)x2 + ... + (-1)n C(n,n)xn

So setting x = 1:

0 = C(n,0) - C(n,1) + C(n,2) - ...

and

C(n,0) + C(n,2) + ... = C(n,1) + C(n,3) + ...

Therefore:

C(n,0) + C(n,2) + ... = 2n-1

And I guess we can distill the multiples of 3 (i.e. find C(n,0) + C(n,3) + ...) using complex numbers.

Let w=cos(2π/3)+isin(2π/3)
Now:

(1+x)n = C(n,0) + C(n,1)x + C(n,2)x2 + C(n,3)x3 + ... + C(n,n)xn
(1+xw)n = C(n,0) + wC(n,1)x + w2 C(n,2)x2 + C(n,3)x3 + ... + wn C(n,n)xn
(1+xw2 )n = C(n,0) + w2 C(n,1)x + w C(n,2)x2 + C(n,3)x3 + ... + w2n C(n,n)xn

Add and set x = 1:

2n + (1+w)n + (1+w2 )n = 3[C(n,0) + C(n,3) + C(n,6) + ...]

But 1 + w = -w2 , 1+w2 = -w so:

2n + (-w2 )n + (-w)n = 3[C(n,0) + C(n,3) + ...]

We can take the (-1)n outside the brackets, write w2 = w-1 and hence obtain:

C(n,0)+C(n,3)+=1/3( 2n +2(-1 )n cos(2nπ/3)]
Now to fish out C(n,0) + C(n,4) + ... we consider the following:

(1+x)n = C(n,0) + C(n,1)x + C(n,2)x2 + ... + C(n,n)xn
(1+xi)n = C(n,0) + iC(n,1)x -C(n,2)x2 + ... + in C(n,n)xn
(1-x)n = C(n,0) -C(n,1)x + C(n,2)x2 - ... + (-1)n C(n,n)xn
(1-xi)n = C(n,0) -iC(n,1)x -C(n,2)x2 - ... + (-i)n C(n,n)xn

Set x = 1 and add:

2n + (1+i)n + (1-i)n = 4[C(n,0) + C(n,4) + ...]

So:

2n-2 + 2n/2-1 cos(πn/4)=C(n,0)+C(n,4)+
And you could go on and fish out the multiples of 4,5 etc.

Michael


By Neil Morrison (P1462) on Wednesday, August 16, 2000 - 07:46 pm :

Yes, that's where I found the result (I had glanced over it before, but couldn't remember anything about it.)