is among - problem

Geoff Canyon gcanyon at
Sat Nov 22 11:04:05 EST 2003

(Anyone not interested in math hit delete right now)

I should have pointed out the formula for this. When choosing y objects 
from x possible objects, the number of combinations xCy is


Where x! means x * (x-1) * (x-2) * ... * 2 * 1

In this case that translates to



The nice thing about this formula is that whichever of the divisors is 
larger simple cancels out that portion of the dividend. So:


which is


becomes simply


3*2 cancels the 6, and you have 7*5 or 35

If you _do_ care about what order the numbers come in, that's 
permutations, and the formula is similar but simpler:

xPr = x!/(x-y)!

So if you wanted all the ways you could arrange 3 numbers from 7 that 
would be




which is 7*6*5, or 210


Geoff Canyon
gcanyon at

On Nov 22, 2003, at 12:19 AM, Geoff Canyon wrote:

> To verify that there are 35 solutions, consider that this problem 
> translates to: choose three numbers from the set "1,2,3,4,5,6,7" To 
> solve that, find 7C3, which is (7*6*5)/(3*2*1) That's 210/6, or 35

More information about the Use-livecode mailing list