Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How can one generate all possible permutations of r elements out of n where r by space_monk (Chaplain)

on Feb 26, 2013 at 13:44 UTC ( #1020692=note: print w/replies, xml ) Need Help??


in reply to How can one generate all possible permutations of r elements out of n where r<n?

A very fast look on CPAN reveals Math::Combinatorics

Despite the low version number, it looks as though it does what you want, and if it doesn't the source code is probably a good starting point to modify to do it.

IIRC a lot of advice round here advises Googling and checking CPAN, because it's probably been asked before :-).

A Monk aims to give answers to those who have none, and to learn from those who know more.
  • Comment on Re: How can one generate all possible permutations of r elements out of n where r<n?

Replies are listed 'Best First'.
Re^2: How can one generate all possible permutations of r elements out of n where r<n?
by supriyoch_2008 (Scribe) on Feb 27, 2013 at 09:14 UTC

    Hi space_monk,

    Thanks for the suggestions. I have used Math::Combinatorics to solve the problem of combinations of elements.

    With kind regards.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020692]
help
Chatterbox?
[Corion]: marto: You mean "Sane Dots Dramatic Reading of ITIL" ? ;)
[marto]: Sane Dots, chapter 13: ITIL never work :P
[marto]: sorry, bad pun of it'll :P
[Corion]: :-D
[Corion]: I think that ITIL is mostly to prevent people from doing harm to a system that basically runs unattended :)
[Corion]: Maybe you could reduce ITIL to a computer network, a man and a dog. The network runs the computations. The man is there to feed the dog. The dog is there to prevent the man from accessing the computers.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2017-01-24 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.