generating combinations (math problem, permuatations related)


2004-07-14 05:07:12 AM
delphi161
Hi,
After you read this title you are thinking permutations. As did i :) The
problem here is
that i also need the combination of the same number.
for example:
i want all combinations of the value's (13,16,19,22) with for example 2
slots available in
the output.
should yield:
(normal permutations)
13,16
13,19
13,22
16,19
16,22
19,22
but i also need:
13,13
16,16
19,19
22,22
example source would be greatly appreciated.
--
Best Regards,
Peter.