For questions about the functionality related to permutations in Mathematica.

learn more… | top users | synonyms

6
votes
2answers
374 views

Find all permutations with a condition

How can I find all the permutations of {a, b, c} where a + b + c = n? For instance: if ...
8
votes
3answers
323 views

Reduce the output from tuples by including symmetry?

I need all the possible 3x3 binary tensors, but I'd like to have this account for symmetries. I've started by using the Tuples command. Tuples[{1, 0}, {3, 3}] ...
9
votes
2answers
563 views

How to represent a list as a cycle

I want to select distinct cycles (represented by List). The cycle {a, b, c, d} must be the same as {b, c, d, a} or ...
9
votes
2answers
269 views

Combining nested lists that meet certain criteria for a permutation

I have the following list representing a permutation on 26 characters: ...
9
votes
0answers
258 views

Using Compile to speed up Function with PermutationProduct

I have the following fairly simple routine dot involving PermutationProduct that I wish to speed up using ...
1
vote
1answer
246 views

How can I permute a multiset?

I have a multiset {1, 3, 3, 1, 2} and would like to randomly permute the classes like so: {2, 1, 1, 2, 3} or {3, 2, 2, 3, 1}, what is the simplest and most efficient way to do this? In reality the ...
8
votes
1answer
444 views

Mathematica function/package for shuffle permutations

Does anyone knows a way to compute a list of all (p,q)-shuffles in mathematica? For a definition of the shuffle permutations see for example http://ncatlab.org/nlab/show/shuffle I'm dreaming of a ...
2
votes
1answer
517 views

Adding rules to permutations

How can I calculate only those permutations of Range[n], that satisfy certain rules? I don't want to filter the result after calculating all the permutations but ...
10
votes
4answers
1k views

How to remove repeated permutations?

I want to get the Permutations on the elements of a list. Then I'm doing this: ...
10
votes
1answer
1k views

How to apply a permutation to a symmetric square matrix?

Given a symmetric square matrix, how can I apply a permutation to the rows and columns (i.e. the same permutation to both the rows and the columns) such a way that the new structure of the matrix ...
10
votes
3answers
253 views

Efficient way to turn a subset into a permutation

For an input vector $\{a_1,a_2,\ldots,a_n,b_{1},b_2,\ldots,b_{m}\}$ and a list of ordered positions $\{k_1,k_2,\ldots, k_n\}$, such that $1\leqslant k_1 < k_2 < \ldots < k_n \leqslant ...