Showing posts with label mathematics. Show all posts
Showing posts with label mathematics. Show all posts

Thursday, March 1, 2012

Number of k-combinations for all k

This is an equations that comes up quite commonly in algorithm analysis:

here is an intuitive understanding for this.

Assume we have 10 items.
And we need to find sum of all possible combinations of these
i.e. 0C10 + 1C10 + 2C10 .....

What we are doing is basically we have 10 positions and in that we have 10 elements (since its a combination order does not matter). And in each position we have a choice for the item to be included or Not-included. So its a binary choice for each position and since we have 10 positions its 2x2 10 times i.e. 2^10.

So for n positions we have 2^n possible ways we can select these items.


If you still want a further rephrasing of the same information you can read this : http://www.themathpage.com/aprecalc/permutations-combinations-2.htm#sum

Enjoy!

Sunday, August 21, 2011

Prove intuitively that X * Y == Y * X

I needed an intuitive way to show this to my nephew (why is 6* 7 same as 7 * 6). Its really simple.

By definition of multiplication (Y * X) is read as "Y Xs are" which literally means X items stacked Y number of times. i.e. :


But notice that if we view this data horizontally it is Y items stacked X times i.e. X * Y!

therefore X * Y == Y * X

Enjoy!