Re: Math Question: How many combinations of size x in set y.

2008-04-24 Thread Marlon Moyer
>yep, I missed that part. > >On Apr 16, 2008, at 10:58 AM, Ian Skinner wrote: > >> While digging around for some ruby articles, I came across this function: def subn(n, list) return [[]] if n == 0 return [] if list.empty? remainder = list[1..-1] subn(n-1, remainder).collect {|it|

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread G Money
Math rocksand so does this list. On Wed, Apr 16, 2008 at 11:07 AM, Ian Skinner <[EMAIL PROTECTED]> wrote: > James Smith wrote: > >> I don't know if CF has a factorial function, but one would be very > easy to > >> write. > >> > > > > function Factorial(integer){ > > Var TheFactorial=1; >

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread Ian Skinner
James Smith wrote: >> I don't know if CF has a factorial function, but one would be very easy to >> write. >> > > function Factorial(integer){ > Var TheFactorial=1; > while (integer GT 0) { > TheFactorial = TheFactorial*integer; > integer = integer-1; > } > Return TheFactori

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread zaph0d . b33bl3br0x
yep, I missed that part. On Apr 16, 2008, at 10:58 AM, Ian Skinner wrote: > [EMAIL PROTECTED] wrote: >> actually, set y: 1,2,3,4,5 would have 32 different combinations >> >> null, 1, 1 2, 1 3, 1 4, 1 5, 2, 2 2, 2 3, 2 4, 2 5, 3, 3 3, 3 4, 3 5, >> 4, 4 4, 4 5, 5, 5 5, 1 2 2, 1 2 3, 1 2 4, 1 2 5, e

RE: Math Question: How many combinations of size x in set y.

2008-04-16 Thread Erika L. Walker
And here is where we realize how seriously geeky this list actually is ... ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;251500

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread Ian Skinner
G Money wrote: > To find the number of combinations of quantity quantity R, in N number of > items: > > N! / R!(N-R)! > > Keep in mind that in a combination, order does not matter. Make sure that is > what you want, instead of a permutation, where order is considered. Yes, combination is exactly w

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread morgan l
He wants to limit the combination length; in the first example, include only combinations of exactly 3 digits. On Wed, Apr 16, 2008 at 10:51 AM, <[EMAIL PROTECTED]> wrote: > actually, set y: 1,2,3,4,5 would have 32 different combinations > > null, 1, 1 2, 1 3, 1 4, 1 5, 2, 2 2, 2 3, 2 4, 2 5, 3,

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread Ian Skinner
[EMAIL PROTECTED] wrote: > actually, set y: 1,2,3,4,5 would have 32 different combinations > > null, 1, 1 2, 1 3, 1 4, 1 5, 2, 2 2, 2 3, 2 4, 2 5, 3, 3 3, 3 4, 3 5, > 4, 4 4, 4 5, 5, 5 5, 1 2 2, 1 2 3, 1 2 4, 1 2 5, etc, 1 2 3 4 5 > > The formula would be 2^(number of items in set) Well that

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread James Smith
> I don't know if CF has a factorial function, but one would be very easy to > write. function Factorial(integer){ Var TheFactorial=1; while (integer GT 0) { TheFactorial = TheFactorial*integer; integer = integer-1; } Return TheFactorial; } -- Jay ~

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread zaph0d . b33bl3br0x
actually, set y: 1,2,3,4,5 would have 32 different combinations null, 1, 1 2, 1 3, 1 4, 1 5, 2, 2 2, 2 3, 2 4, 2 5, 3, 3 3, 3 4, 3 5, 4, 4 4, 4 5, 5, 5 5, 1 2 2, 1 2 3, 1 2 4, 1 2 5, etc, 1 2 3 4 5 The formula would be 2^(number of items in set) On Apr 16, 2008, at 10:32 AM, Ian Skinner w

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread James Smith
> What is the formula to calculate the number of combinations of size x > [no repeats] that exist in a set of size y? Combinations are closely related to permutations. http://www.mathwords.com/c/combination_formula.htm http://www.easycalculation.com/statistics/learn-permutation-combination.php

Re: Math Question: How many combinations of size x in set y.

2008-04-16 Thread G Money
To find the number of combinations of quantity quantity R, in N number of items: N! / R!(N-R)! Keep in mind that in a combination, order does not matter. Make sure that is what you want, instead of a permutation, where order is considered. I don't know if CF has a factorial function, but one wou