Quick Math Combination Question

Associate
Joined
19 Jun 2010
Posts
1,695
Location
Southampton City Centre
Just here at work and stupidly us developers can't find the easiest way to figure out how many combinations of the numbers 1-7 there are, regardless of order.

So 1,2,3 is the same as 3,2,1.

Any quick solutions out there?

My google-fu is weak.
 
It's "maths".

And i think there's an algorithm for this, i vaguely remember it from GCSE. But i can't remember what it's called. I'll have a look for you...

You need to capitalise your I's, also sentences shouldn't start with and or but.

Appreciate it. :)
 
Think of it as this.

I have 7 products on my website. I want to create a link for every possible combination that people could buy those.

Hence why order doesn't matter. If I bought products 3, 5 and 7. It's the same as me buying 5, 7 and 3.

So the above is only 1 link. How many links to cover all products?
 
Okay, 127 must be the right answer, if order doesn't matter.

If you only want one number, then you have 7C1 (ie: 7) to choose from.

If you want two numbers, you have 7C2=21 to choose from.

If you want three numbers, you have 7C3=35 to choose from.

7C4=35
7C5=21
7C6=7
7C7=1

1+7+21+35+35+21+7 = 127

[This assumes that order does not matter. Ie - if you pick number 5 and 2, that's the same as 2 and 5]


Awesome, cheers :)
 
Back
Top Bottom