Thread: Combin
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Combin

... took around 30 mins to run on my sys: Pentium 1.86
and as for the OP's sample question <g ..
If I had the numbers 3, 12, 17, 24, 32, 36
then that is combination ???? of 3838380


Answer: It's combination# 1,405,869 (as derived in the full sample
version)


....The numbers {3, 12, 17, 24, 32, 36} out of 40 ???

Hi. As a side note, in the study of combinations, the op is asking for the
"Rank."
Because we are dealing with KSubsets, the op is asking for the Rank of a
particular KSubset. The function name is usually called "RankKSubset."
The solution code is called recursively using Combin. I get the same
solution as you in 0 seconds.
There are different ways to set it up...

Debug.Print RankKSubset(40, 3, 12, 17, 24, 32, 36)
1,405,869

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Max" wrote in message
...
Here's the links to 2 sample books ..

A "full" version sample construct of the play is available at:
http://www.savefile.com/files/8377418
Combinations Generation & Lookup Output Sequence
Contains: Myrna's sub, Don's UDF, the *full* 3.8+ million combinations
output (Pick 6 out of 1 - 40) in Sheet2 and a lookup sheet with the
formulas
to derive the sequence number of any combos within the 3.8+ million total
combinations.
[ It's a 29 MB zip d/l decompressing to 144 MB, file set to Manual calc
mode ]

Alternatively, a much smaller-sized abridged version is available at:
http://www.savefile.com/files/7287459
Combos Gen n Lookup Output Sequence_Abridged_Ver
[ 1.1 MB zip decompressing to 6.2 MB, file set to Manual calc mode ]
Contents are the same as the full version (link above) except with an
abridged output (Pick 6 out of 1 - 40) in Sheet2:
First 2 cols only (65536 x 2 = 131,072 combos) instead of the full 58+
cols

Note: Save the file to your harddisk first, then open the file from there.
To facilitate testing, data input, etc the calc mode in the sample is
intentionally set to manual mode. Just press F9 to recalc / update as
required.

and as for the OP's sample question <g ..
If I had the numbers 3, 12, 17, 24, 32, 36
then that is combination ???? of 3838380

Answer: It's combination# 1,405,869 (as derived in the full sample
version)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---