Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0

Request #16874 Permutations with repetition
Submitted: 2009-12-05 08:19 UTC
From: ifeghali Assigned:
Status: Open Package: Math_Combinatorics (version 1.0.0)
PHP Version: 5.3.0 OS: NA
Roadmaps: (Not assigned)    
Subscription  


 [2009-12-05 08:19 UTC] ifeghali (Igor Feghali)
Description: ------------ It would be great to generate permutations with repetitions as well. For example: Given a set = [A, B, C] It's permutation, two by two is: P{2} = [A,B] [A,C] [B,A] [B,C] [C,A] [C,B] I propose a switch (function argument) that would make the output: PR{2} = [A,A] [A,B] [A,C] [B,A] [B,B] [B,C] [C,A] [C,B] [C,C] That would me able to specify a higher subset size. For the above example, currently the highest subset size possible is 3. With repetitions that number can be any positive integer. For example, it makes sense to have: PR{5} = [A,A,A,A,A] [A,A,A,A,B] ...

Comments

 [2009-12-05 08:20 UTC] ifeghali (Igor Feghali)
Typo: "That would allow me to specify a higher subset size as well"