# Math Help - [SOLVED] unique combination formula

1. ## [SOLVED] unique combination formula

Can anyone help!!!!.

I am trying to work out a formula for calculating unique combinations of items in a store e.g. 4 bottles of wine - select any 3 for £10.

This throws up a problem as for example if we name them 1,2,3 , the unique combinations are :

111 , 112 , 113 , 114 , 221 , 222 , 223 , 224 , 331 , 332 , 333 , 334

441 , 442 , 443 , 444 , 123 , 234 , 124 , 134

I need to ignore duplicates as 112 = 121 = 211 , 234 = 324 = 432 etc.

I would like to increase the number of items from 4 to say 10 and work out all combinations with a formula rather then by hand.

This is probably a breeze for you maths folks but it has had me scratching my head for a while !!!!

Thanks,

Barry.

2. I believe you are trying to use Permutations and Combinations!!

Say you have 4 distinct wine bottles(A,B,C and D) and you want to select 3
AAA isnt an option since there are only 4 bottles
However ABC is the same as BAC,CBA .......

So from 4 bottles number of ways of selecting 3 is given by 4C3 and solved as

(4x3x2)/(1x2x3) which is basically 4 ways.

There's a whole lot more!!

3. the answer you are looking for is not a simple combination, but a form of triangular number. after thinking about the problem myself for a time, i came up with this formula; i think that it is correct.
$\200dpi \sum_{i=0}^{n}\left(\sum_{k=1}^{r-i}k\right)(n-k)$
[IMG]file:///C:/DOCUME%7E1/IBM/LOCALS%7E1/Temp/moz-screenshot-2.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/IBM/LOCALS%7E1/Temp/moz-screenshot-3.jpg[/IMG]

4. Look like the combination of r from n with repeated, and the formula should be like this ((n+r-1) over r)
which is same as (n+r-1)!/r!(n-r)!
where n is number of thing to choose from, choose r from n.
In your case, n is 4 and r is 3
So the number of combination will be:
((4+3-1) over 3) = (4+3-1)! / (3!)(4-1)!= 6!/(3!)(3!)
= (6x5x4x3x2x1)/(3x2x1)(3x2x1)=20.