Is there a quick way to generate combinations

B

biomahui

Is there a quick way to generate combinations?
For instance, if I have four elements(1,2,3,4), I can have a
comnination of (1,2,3), or (2,3,4),(1,3,4),(1,2,4).
but if I have 300 elements to generate combinations with 20 elements;
how can I get it with a concise scripts in perl.
Thanks in advance.
 
A

Arne Ruhnau

Is there a quick way to generate combinations?
For instance, if I have four elements(1,2,3,4), I can have a
comnination of (1,2,3), or (2,3,4),(1,3,4),(1,2,4).
but if I have 300 elements to generate combinations with 20 elements;

Maybe Math::Combinatorics from CPAN can help you. Here is how I found it:

http://search.cpan.org -> Search for 'Combinations'

Would that have been too hard for you to do?

Arne Ruhnau
 
B

biomahui

Thank you Arne Ruhnau.
Sorry. I plan to delete the post for my carelessness. but it doesn't
appear for a long time.
I will be very careful next time. I never go to cpan before.
 
K

kevindotcar

Arne said:
Maybe Math::Combinatorics from CPAN can help you. Here is how I found it:

http://search.cpan.org -> Search for 'Combinations'

[---]

More specifically (well, more generically), Google
"Perl and math and combinations"

and you'll hit it along with some other possible solutions.


kDot
 
C

charley

The number of possible combinations for 300 choose 20 is larger than
any disk will record.

The number is 7.500433759 E30

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top