Thursday, December 17, 2009

What is the method for calculating how many sets of numbers can be found within a fixed number.?

Example: 100 numbers will have 99 sets of two, then 98 sets of two, and 97 sets of two all the way down to the last set. Is there a formula to calculate all sets?What is the method for calculating how many sets of numbers can be found within a fixed number.?
If I understand your question, there are two ways to calculate how many 'sets' of numbers can be found within a fixed number.





If order is important, we call that a PERMUTATION





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





If order is not important, it is called a COMBINATION





n C r = n!/[(n - r) !(r !)]





These concepts are covered when you study combinatorial mathematics, and other subjects.





QEDWhat is the method for calculating how many sets of numbers can be found within a fixed number.?
The number of selections of size k from a set S of size n is called the binomial coefficient or ';choose function';.


C(n,k) = n! / [k! (n - k)!]


where n is the number of objects from which you can choose and k is the number to be chosen, and n! denotes the factorial.


n! = 1 x 2 x 3 x 4 .... x (n - 1) x n


It is called binomial coefficient because it helps us to calculate things like (a + b)^n in this way:


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





Formula C(n,k) = n! / [k! (n - k)!] is compact and cool, but it's not very practical when n and k are large numbers


To illustrate this, 100! is approximately equal 9.33x10^157 . Somehow, my PC still can deal with such a huge numbers, but my pocket calculator returns error, since it can only count to 10^100.


So it's often easier to use this formula


C(n,k) = (n - 0)/(k - 0) x (n - 1)/(k - 1) x (n - 2)/(k - 2) x .... x [n - (k - 1)] / [k - (k - 1)]


For example, C(6,3) = 6/3 x 5/2 x 4/1 = 2 x 2.5 x 4 = 20





I'm not going to give complete and mathematically correct proof for this, since it would take couple of written pages, but I'll give you some hints. First some terminology.


Set of n numbers can be ordered in n! ways, and we say that it has n! permutations.


For example, set {1,2,3} has n! = 1 x 2 x 3 = 6 permutations, and those are (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2) and (3,2,1)


They represent permuted but identical set.


In the same way, selection of k = 2 elements like {1,2} chosen from this set has k! = 2! = 2 permutation and those are (1,2) and (2,1)


They represent permuted but identical selection of 2 elements from set of 3 elements.





Let there is a set of n elements. For each possible permutation the set can be divided in two groups where one group contains the first k elements and the other group is made of remaining n 鈭?k elements.


Since there are k! permutations of the first group, and every of these permutations can be paired with (n-k)! permutations of the second group, there are in total k! (n-k)! ways for one selection of k numbers to be repeated inside n! permutations of the main set.


So the number of unique selections of k numbers from set of n numbers is n! / [k! (n - k)!]





Also we may ask: What is the number of all possible selections from a set S of size n ?


I'll just tell it's 2^n - 1, if the smallest size of selection is 1 element, or 2^n, if we allow that selection have 0 elements (that can be interpreted as there is one way not to choose any element from a set of n).

No comments:

Post a Comment