Talk:Permutations with some identical elements: Difference between revisions
Content added Content deleted
m (→task wording: used a true ellipsis.) |
m (→task wording: used a subscript instead of normal digits.) |
||
Line 20: | Line 20: | ||
would it be better with: |
would it be better with: |
||
Given an input of the form <big>[ |
Given an input of the form <big>[a<sub>1</sub>, a<sub>2</sub>, ···, a<sub>k</sub>]</big> where <big>a<sub>k</sub></big> denotes how many duplicates of element <big>k</big> you should have, |
||
each <big>a<sub>k</sub> > 0</big> and the sum of all <big>a<sub>k</sub></big> is <big>'''n'''</big>. |
each <big>a<sub>k</sub> > 0</big> and the sum of all <big>a<sub>k</sub></big> is <big>'''n'''</big>. |
||
Revision as of 16:08, 27 July 2019
Duplicate of Permutations with repetitions
Seems to me this exact operation is covered by the existing (for 6 years!) Permutations_with_repetitions task. --Thundergnat (talk) 19:32, 25 July 2019 (UTC)
- I don't think so.He wants to create the permutation of different elements in which each element has its own constant multiplicity in this permutation. His example: [2,1] ( element 1 two times und element 2 1 time ) should give results (1,1,2), (1,2,1) and (2,1,1)
I don't think the permutations_with_repetitions task is about permutations at all, but rather generating all possible sequences (words) of a certain length from an alphabet, where each symbol may be repeated an infinite amount of times as needed.
This task is instead about creating all sequences of a finite set of elements where some elements are indistinguishable from each other.
- Yes, you're right; it is different. I've added a Go solution --PureFox (talk) 21:27, 25 July 2019 (UTC)
task wording
Where it says:
Given an input of the form [a1, a2, ..., ak] where ai denotes how many duplicates of element i you should have, each ai > 0 and the sum of all ai is n.
would it be better with:
Given an input of the form [a1, a2, ···, ak] where ak denotes how many duplicates of element k you should have, each ak > 0 and the sum of all ak is n.
(I've added whitespace and used a bigger font to make the subscripts easier to read.) -- Gerard Schildberger (talk) 03:51, 27 July 2019 (UTC)